/* =========================================================
   PAPER INDEX

   Grouped listing of papers by exam session, with filters
   for qualification and year. Shared by past papers and
   predicted papers — see the note in paper-viewer.css about
   the two class names.

   See /inc/paper-index.php
       /templates/paper-index.php
       /assets/js/paper-index.js
   ========================================================= */

.mwd-paper-index {
    /*
       Four values drive every colour on this component. The year row and the
       Question Paper / Mark Scheme buttons deliberately share --mwd-ink-muted
       so they can never drift apart.
    */
    --mwd-ink: #497281;
    --mwd-accent: #01bcef;
    --mwd-accent-soft: #e7f6fb;

    --mwd-font: Outfit, Helvetica, Arial, Lucida, sans-serif;

    width: 100%;
}


/* =========================================================
   FILTERS
   ========================================================= */

.mwd-paper-filters {
    margin-bottom: 40px;
}


/* ---- Qualification: segmented control ---- */

.mwd-paper-quals {
    display: flex;
    justify-content: center;

    max-width: 100%;
    margin: 0 auto 26px;

    border-radius: 12px;
    overflow: hidden;
}

.mwd-paper-quals:last-child {
    margin-bottom: 0;
}

.mwd-paper-quals:last-child {
    margin-bottom: 0;
}


.mwd-paper-qual {
    flex: 1 1 0;
    min-width: 0;
    max-width: 240px;

    margin: 0;
    padding: 14px 30px;

    border: 0;
    border-radius: 0;

    background: var(--mwd-accent-soft);
    color: var(--mwd-ink);

    font-family: var(--mwd-font);
    font-size: 20px;
    font-weight: 600;
    line-height: 34px;
    text-align: center;

    cursor: pointer;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}




.mwd-paper-qual.is-active,
.mwd-paper-qual.is-active:hover {
    background: var(--mwd-accent);
    color: #fff;
}


/* ---- Year: plain text row ---- */

.mwd-paper-years {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 10px 26px;
}


.mwd-paper-year {
    margin: 0;
    padding: 2px 0;

    border: 0;
    border-radius: 0;

    background: none;
    color: var(--mwd-ink-muted);

    font-family: var(--mwd-font);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;

    text-decoration: none;

    cursor: pointer;

    transition: color 0.15s ease;
}


.mwd-paper-year:hover {
    color: var(--mwd-ink);
}


.mwd-paper-year.is-active {
    color: var(--mwd-ink);

    text-decoration: underline;
}


/* =========================================================
   EXAM SESSION
   ========================================================= */

.mwd-paper-session {
    margin-bottom: 48px;
}


.mwd-paper-session:last-child {
    margin-bottom: 0;
}


/* Sessions hidden by the filters. */
.mwd-paper-session[hidden] {
    display: none;
}


.mwd-paper-session-heading {
    margin-bottom: 14px;
}


.mwd-paper-session-title {
    margin: 0;

    font-size: 28px;
    line-height: 1.2;
    font-weight: 700;
}


.mwd-paper-session-title span {
    font-weight: 400;
}


/* =========================================================
   PAPER LIST
   ========================================================= */

.mwd-paper-list {
    display: flex;
    flex-direction: column;

    border-top: 1px solid rgba(0, 0, 0, 0.12);
}


/* =========================================================
   INDIVIDUAL PAPER
   ========================================================= */

.mwd-paper-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 24px;

    padding: 18px 0;

    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}


.mwd-paper-title {
    flex: 1 1 auto;

    margin: 0;
    padding: 0;

    font-size: 17px;
    line-height: 1.4;
    font-weight: 600;
}


.mwd-paper-title a {
    color: inherit;
    text-decoration: none;
}


.mwd-paper-title a:hover {
    text-decoration: underline;
}


/* =========================================================
   RESOURCE LINKS
   ========================================================= */

.mwd-paper-links {
    display: flex;
    align-items: center;

    gap: 8px;

    flex: 0 0 auto;
}


.mwd-paper-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 9px 13px;

    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 4px;

    background: transparent;
    color: var(--mwd-ink-muted);

    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;

    text-decoration: none;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}


.mwd-paper-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--mwd-ink-muted);

    text-decoration: none;
}


.mwd-paper-link:active {
    transform: scale(0.98);
}


/* =========================================================
   YOUTUBE
   ========================================================= */

.mwd-paper-link--youtube {
    white-space: nowrap;
}


.mwd-paper-youtube-icon {
    display: block;

    width: 19px;
    height: 19px;

    flex: 0 0 auto;

    color: #ff0033;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.mwd-paper-empty {
    margin: 0;
    padding: 32px 0;

    color: var(--mwd-ink-muted);

    font-size: 16px;
    text-align: center;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .mwd-paper-filters {
        margin-bottom: 32px;
    }


    /* Stacked, still one rounded shape. */
    .mwd-paper-quals {
        flex-direction: column;

        max-width: 320px;
        margin-bottom: 22px;
    }


    .mwd-paper-qual {
        max-width: none;

        font-size: 18px;
        line-height: 28px;
    }


    .mwd-paper-years {
        gap: 10px 20px;
    }


    .mwd-paper-session {
        margin-bottom: 36px;
    }


    .mwd-paper-session-title {
        font-size: 24px;
    }


    .mwd-paper-item {
        align-items: flex-start;
        flex-direction: column;

        gap: 12px;

        padding: 18px 0;
    }


    .mwd-paper-links {
        width: 100%;

        flex-wrap: wrap;
    }


    .mwd-paper-link {
        flex: 1 1 auto;
    }

}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .mwd-paper-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }


    .mwd-paper-link--youtube {
        grid-column: 1 / -1;
    }

}


/* =========================================================
   QUALIFICATION CONTROL — CORNERS

   The radius lives on the first and last button rather than
   the container. The container is full width with centred
   items, so a radius on it rounds empty space either side.
   ========================================================= */

.mwd-paper-quals {
    border-radius: 0;
    overflow: visible;
}


.mwd-paper-qual:first-child {
    border-radius: 12px 0 0 12px;
}


.mwd-paper-qual:last-child {
    border-radius: 0 12px 12px 0;
}


/* Only one option: the control is hidden, but be safe anyway. */
.mwd-paper-qual:first-child:last-child {
    border-radius: 12px;
}


@media (max-width: 767px) {

    .mwd-paper-qual:first-child {
        border-radius: 12px 12px 0 0;
    }

    .mwd-paper-qual:last-child {
        border-radius: 0 0 12px 12px;
    }

}