/* ========================================
   WORD OF THE DAY (home page, under the CTA)
   Filled from vocab.json by script.js
   ======================================== */

.word-of-day {
    /* small or short screens: centred below the hero */
    box-sizing: border-box;
    position: relative;
    width: min(26rem, calc(100% - 5rem));
    margin: 4.5rem auto 1rem;   /* top room for the "Learn a new word" note */
    /* same light panel as the cards on the other pages */
    padding: 1.1rem 1.35rem;
    background: #f5ece6;
    border: 1px solid rgba(64, 59, 53, 0.24);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(64, 59, 53, 0.06), 0 10px 28px -12px rgba(64, 59, 53, 0.22);
    color: var(--text-color);
    /* hidden behind the loading screen, like the rest of the page */
    opacity: 0;
    transition: opacity 0.6s ease;
}

body.loaded .word-of-day,
html.returning .word-of-day {
    opacity: 1;
}

/* Desktop: tucked into the bottom-left corner of the window, out of the hero's way */
@media (min-width: 971px) and (min-height: 770px) {
    .word-of-day {
        position: fixed;
        left: 2rem;
        bottom: 2rem;
        z-index: 5;
        /* stops short of the centred footer line on narrower windows */
        width: min(26rem, calc(50vw - 150px - 3rem));
        margin: 0;
    }
}

/* "Learn a new word" note above the card: a line runs right from it,
   then turns down as an arrow into the card */
.wod-note {
    --note-size: 15px;   /* odd, so the 1px line centres on a whole pixel */
    position: absolute;
    left: 1.35rem;
    bottom: calc(100% + 6px);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: var(--note-size);
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: var(--text-color);
    opacity: 0.7;
}

.wod-note-arrow {
    position: relative;
    box-sizing: border-box;
    width: 40px;
    height: 24px;
    margin-top: calc((var(--note-size) - 1px) / 2);
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
}

/* arrowhead, pointing down */
.wod-note-arrow::after {
    content: '';
    position: absolute;
    box-sizing: border-box;
    /* 9px chevron mask, turned to point down; tip on the line's end */
    right: -5px;
    bottom: -2px;
    width: 9px;
    height: 9px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpath d='M2.5 .5l4 4-4 4' fill='none' stroke='%23000'/%3E%3C/svg%3E") center / 9px 9px no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9'%3E%3Cpath d='M2.5 .5l4 4-4 4' fill='none' stroke='%23000'/%3E%3C/svg%3E") center / 9px 9px no-repeat;
    transform: rotate(90deg);
}

.wod-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.wod-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.55;
}

.wod-shuffle {
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-color);
    font-size: 0.85rem;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.wod-shuffle:hover,
.wod-shuffle:focus-visible {
    opacity: 1;
}

.wod-shuffle.spin {
    transform: rotate(180deg);
}

.wod-entry {
    margin: 0;
    line-height: 1.55;
    transition: opacity 0.2s ease;
}

.word-of-day.swapping .wod-entry {
    opacity: 0;
}

.wod-word {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.wod-word:hover {
    border-bottom-color: currentColor;
}

.wod-pos {
    margin-left: 0.35rem;
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.6;
}

.wod-definition {
    display: block;
    font-size: 0.98rem;
    opacity: 0.8;
}

/* Shorter desktop windows: a more compact corner card so it stays clear of the hero panel */
@media (min-width: 971px) and (min-height: 770px) and (max-height: 949px) {
    .word-of-day {
        left: 1.25rem;
        bottom: 1.25rem;
        width: min(20.5rem, calc(50vw - 150px - 2.25rem));
        padding: 0.7rem 0.9rem;
    }

    .wod-top {
        margin-bottom: 0.25rem;
    }

    .wod-label {
        font-size: 0.66rem;
    }

    .wod-word {
        font-size: 1.08rem;
    }

    .wod-pos {
        font-size: 0.8rem;
    }

    .wod-entry {
        line-height: 1.4;
    }

    .wod-definition {
        font-size: 0.85rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .wod-note {
        --note-size: 13px;
        left: 0.9rem;
    }

    .wod-note-arrow {
        width: 32px;
        height: 18px;
    }
}
