/* Rate Songs on /album/ (2026-10-21): the call to action under the P O U R
   blocks and the modal it opens (components/rate-songs-cta.njk,
   rate-songs.njk, assets/js/ee-rate-songs.js). Loaded by base.njk wherever
   `class="ee-rate` appears.

   The call to action keeps the Equalizer type of the P O U R blocks above
   it (components/ee-album.css). The modal looks like the song page
   (2026-10-21): the same gray band, criterion label, name, genre, controls
   and yellow bar ("AI Album" in ee-blog-index.css), in Lato. */

/* ---- Call to action -------------------------------------------------------- */

/* As wide as the P O U R blocks above it, in Midnight. */
.ee-rate-cta,
.entry-content .ee-rate-cta {
    --rate-width: min(1200px, 100vw - 40px);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 32px;
    box-sizing: border-box;
    width: var(--rate-width);
    max-width: none;
    margin: -24px 0 56px calc((100% - var(--rate-width)) / 2);
    padding: 28px 32px;
    border-radius: 12px;
    background: #1A1033;
    color: #fff;
    font-family: 'Atkinson Hyperlegible', 'Lato', sans-serif;
}

.ee-rate-cta[hidden] {
    display: none;
}

.ee-rate-cta h2,
.entry-content .ee-rate-cta h2 {
    margin: 0 0 4px;
    font-family: 'Space Grotesk', 'Lato', sans-serif;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #fff;
}

.ee-rate-cta p,
.entry-content .ee-rate-cta p {
    max-width: 52ch;
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    color: #fff;
}

.entry-content .ee-rate-cta .ee-rate-cta-status:empty {
    display: none;
}

.entry-content .ee-rate-cta .ee-rate-cta-status {
    flex-basis: 100%;
    font-weight: 700;
}

/* ---- The modal --------------------------------------------------------------- */

.ee-rate {
    box-sizing: border-box;
    width: min(720px, 100vw - 32px);
    max-width: none;
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #000;
    font-family: 'Lato', sans-serif;
    overflow: auto;
    overscroll-behavior: contain;
}

.ee-rate::backdrop {
    background: rgba(10, 8, 26, 0.82);
}

.ee-rate-inner {
    display: flex;
    flex-direction: column;
}

/* The song page's gray band: the criterion, name, genre and controls on
   the left, Close on the right, and the yellow bar under them. */
.ee-rate-band {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px 16px;
    background: var(--bg-light-gray);
    color: var(--ee-black);
}

.ee-rate-head {
    flex: 1;
    min-width: 0;
}

.ee-rate-head::after {
    content: "";
    display: block;
    width: 64px;
    height: 6px;
    margin-top: 14px;
    border-radius: 3px;
    background: var(--btn-yellow);
    box-shadow: 0 0 0 1px var(--ee-blue);
}

/* "1.4.3 CONTRAST (MINIMUM)", as on the song page, linked to WCAG 2.2. */
.ee-rate-sc {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ee-rate .ee-rate-criterion,
.ee-rate .ee-rate-criterion:visited {
    color: var(--ee-dark-gray);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.ee-rate .ee-rate-criterion:hover {
    color: var(--ee-black);
    text-decoration-thickness: 3px;
}

.ee-rate .ee-rate-criterion:focus-visible {
    outline: 3px solid var(--ee-blue);
    outline-offset: 3px;
    text-decoration: none;
}

.ee-rate-close {
    order: 2;
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 14px;
    border: 2px solid currentColor;
    border-radius: 8px;
    background: inherit; /* the band's color, so its contrast is plain to see */
    color: inherit;
    font: 700 18px/1 'Lato', sans-serif;
    cursor: pointer;
}

.ee-rate-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: square;
}

.ee-rate-close:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ee-rate-close:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.ee-rate-body {
    padding: 18px 24px 22px;
}

.ee-rate-title {
    margin: 0;
    font-family: 'Lato', sans-serif;
    font-size: clamp(26px, 3.4vw, 34px);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.012em;
    color: var(--ee-black);
}

.ee-rate-genre {
    margin: 6px 0 0;
    font-size: 18px;
    line-height: 1.4;
    color: var(--ee-dark-gray);
}

/* The poster, then the player in its place, at 16:9. hqdefault.jpg is 4:3
   with black bars, so it is cropped to the picture. */
.ee-rate-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #1A1033;
}

.ee-rate-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.ee-rate-poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ee-rate-poster[hidden] {
    display: none;
}

/* Over the poster and the video: a click plays or pauses. */
.ee-rate-toggle {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

/* Play/Pause, Restart, and how far into the section it is. */
.ee-rate-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin-top: 12px;
}

.ee-rate-ctl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ee-rate-ctl svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Play/Pause keeps one width, so Restart does not shift as it changes. */
.ee-rate-playbtn {
    min-width: 7.5em;
}

.ee-rate-controls[data-state="playing"] .ee-rate-icon-play,
.ee-rate-controls[data-state="paused"] .ee-rate-icon-pause {
    display: none;
}

.ee-rate-time {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    color: #333;
}

.ee-rate-part {
    margin-top: 16px;
}

.ee-rate .ee-rate-part-name {
    margin: 0;
    font-family: 'Lato', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #000;
}

.ee-rate .ee-rate-lyrics {
    margin: 10px 0 0;
    font-size: 18px;
    line-height: 1.6;
    color: #000;
}

/* The song pages' thumbs, set inside the modal. */
.ee-rate .ee-album-feedback {
    max-width: none;
    margin: 18px 0 0;
    padding: 16px 0 0;
    border-top: 2px solid #14183A;
}

.ee-rate .ee-album-feedback h3 {
    margin: 0 0 14px;
    font-family: 'Lato', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

/* Next song, at the right end of the thumbs' row; it wraps under them on a
   narrow screen. */
.ee-rate .ee-rate-next {
    margin-left: auto;
}

/* Go to the song page, right under the lyrics it shows in full. */
.ee-rate .ee-rate-page-line {
    margin: 12px 0 0;
}

.ee-rate-page {
    font-size: 18px;
    font-weight: 700;
    color: var(--ee-blue);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* A wide screen: the player on the left, the section's lyrics on the
   right, so the whole dialog fits the
   window. The video also shrinks with a short window. */
@media (min-width: 860px) {
    .ee-rate {
        width: min(980px, 100vw - 48px);
    }

    .ee-rate-main {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        gap: 28px;
        align-items: start;
    }

    /* Height left for the video once the rest is counted, as 16:9 width. */
    .ee-rate-media {
        width: clamp(240px, (100vh - 570px) * 16 / 9, 100%);
    }

    .ee-rate-part {
        margin-top: 0;
    }

    .ee-rate .ee-rate-lyrics {
        font-size: 17px;
        line-height: 1.55;
    }
}

@media (max-width: 560px) {
    .ee-rate-band,
    .ee-rate-body {
        padding-inline: 20px;
    }

    /* Close above the criterion. */
    .ee-rate-band {
        flex-direction: column;
    }

    .ee-rate-close {
        order: -1;
        align-self: flex-end;
    }

    .ee-rate-cta,
    .entry-content .ee-rate-cta {
        padding: 24px 20px;
    }
}

@media (forced-colors: active) {
    .ee-rate {
        border: 2px solid CanvasText;
    }
}
