/*
 * The registry, a department's page and the home page.
 *
 * After the mock-up Lex approved on 2026-09-17 -
 * architect/design/mockups/catalog-home-r1.html (catalogue, department,
 * home) - and architect/tasks/03-catalog-home.md. The same skin as the test
 * page: slips of paper, tape, sticky notes, a note in blue pen. The header, the
 * trail, the footer and the paper kit they share (the tape, the notes, the
 * dashed frame, the blue button) are in css/base.css.
 *
 * Loaded on those three kinds of page only; see quizstandard_enqueue_assets().
 */

/* ---------- a page's head: note, heading, introduction, count ---------- */

.quizstandard-cat-head {
    margin: 12px 0 0;
}

.quizstandard-cat-title {
    margin: 14px 0 0;
    font-family: var(--font-ui);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.01em;
    text-wrap: balance;
}

/* A department's introduction, when Lex has written one. */
.quizstandard-cat-lead {
    margin: 8px 0 0;
    font-family: var(--font-read);
    font-size: 15px;
    line-height: 1.5;
    color: #3D3A34;
}

.quizstandard-cat-lead p {
    margin: 0 0 8px;
}

.quizstandard-cat-lead p:last-child {
    margin-bottom: 0;
}

.quizstandard-cat-count {
    margin: 12px 0 0;
}

/* ---------- the ribbon of departments on the registry ---------- */

/*
 * One row of slips that scrolls sideways, running out to the edges of the
 * screen - hence the negative margins, which are exactly the column's padding
 * and so never make the page itself wider.
 */
.quizstandard-ribbon {
    display: flex;
    gap: 8px;
    margin: 0 -18px;
    padding: 14px 18px 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.quizstandard-ribbon::-webkit-scrollbar {
    display: none;
}

.quizstandard-ribbon a {
    flex: 0 0 auto;
    padding: 9px 12px;
    background: var(--slip);
    box-shadow: 0 3px 8px -5px rgba(0, 0, 0, .5);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
    transform: rotate(-1deg);
}

.quizstandard-ribbon a:nth-child(even) {
    transform: rotate(1deg);
}

.quizstandard-ribbon a.is-on {
    background: var(--butter);
}

/* ---------- the certificate card ---------- */

.quizstandard-cards {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 18px 0 0;
}

/*
 * A white slip, a little crooked - one way, then the other - with a strip of
 * tape across its top edge, pink on one card and mint on the next.
 */
.quizstandard-card {
    position: relative;
    display: block;
    padding: 8px 8px 14px;
    background: var(--slip);
    box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5);
    color: inherit;
    text-decoration: none;
    transform: rotate(.5deg);
}

.quizstandard-card:nth-child(even) {
    transform: rotate(-.5deg);
}

.quizstandard-card .quizstandard-tape {
    left: 50%;
    top: -9px;
    width: 66px;
    height: 18px;
    transform: translateX(-50%) rotate(-2deg);
}

.quizstandard-card:nth-child(even) .quizstandard-tape {
    background: var(--mint);
    transform: translateX(-50%) rotate(2deg);
}

.quizstandard-card-figure {
    position: relative;
    aspect-ratio: 1200 / 630;
    background: var(--sheet);
}

.quizstandard-card-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The department's sticky note, on the cover's top left corner. */
.quizstandard-card-dept {
    position: absolute;
    left: 12px;
    top: 12px;
    max-width: calc(100% - 24px);
    padding: 5px 8px;
    background: var(--butter);
    box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.2;
    color: var(--ink);
    transform: rotate(-2deg);
}

.quizstandard-card-title {
    margin: 12px 6px 0;
    font-family: var(--font-ui);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.01em;
}

.quizstandard-card-meta {
    display: flex;
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 8px;
    margin: 10px 6px 0;
}

.quizstandard-card-meta .quizstandard-dashed {
    padding: 7px 9px;
    font-size: 11px;
}

/* How many have been issued: a solid frame on pale blue. */
.quizstandard-dashed.is-solid {
    border-style: solid;
    background: var(--slip-4);
}

/* ---------- the way on, and an empty page ---------- */

.quizstandard-pager {
    margin: 24px 0 0;
    text-align: center;
}

.quizstandard-pager-next {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.4;
    color: var(--blue);
    text-decoration: underline dashed;
    text-underline-offset: 4px;
}

.quizstandard-empty {
    margin: 18px 0 0;
    padding: 14px 16px;
    background: var(--slip);
    box-shadow: var(--lift);
    font-family: var(--font-read);
    font-size: 14px;
    line-height: 1.5;
    color: #3D3A34;
    transform: rotate(-.4deg);
}

/* ---------- blocks: departments, newest, most issued ---------- */

.quizstandard-block {
    margin: 28px 0 0;
}

/* A heading with its link on the right: "Newest certificates - See all". */
.quizstandard-block-h {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.quizstandard-block-h a {
    flex: none;
    letter-spacing: 0;
    text-transform: none;
    color: var(--blue);
    text-decoration: underline dashed;
    text-underline-offset: 4px;
}

.quizstandard-block .quizstandard-cards {
    margin-top: 0;
}

/* The departments: slips two to a row, the name and a count. */
.quizstandard-dept-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.quizstandard-dept-grid a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--slip);
    box-shadow: 0 3px 8px -5px rgba(0, 0, 0, .5);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.3;
    color: var(--ink);
    text-decoration: none;
    transform: rotate(-.8deg);
}

.quizstandard-dept-grid a:nth-child(3n+2) {
    transform: rotate(.6deg);
}

.quizstandard-dept-grid a:nth-child(3n) {
    transform: rotate(-.3deg);
}

.quizstandard-dept-grid span {
    min-width: 0;
}

.quizstandard-dept-grid small {
    flex: none;
    font-size: 11px;
    color: var(--ink-faint);
}

/* ---------- the home page's thesis ---------- */

.quizstandard-hero {
    position: relative;
    margin: 16px 0 0;
}

/* The issued stamp, set down on the corner of the thesis. */
.quizstandard-hero-stamp {
    position: absolute;
    right: -6px;
    top: -4px;
    width: auto;
    height: 44px;
    max-width: 45%;
    object-fit: contain;
    opacity: .85;
    transform: rotate(8deg);
    pointer-events: none;
}

.quizstandard-hero-title {
    margin: 12px 0 0;
    font-family: var(--font-ui);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.quizstandard-hero-note {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 10px 0 0;
    font-family: var(--font-hand);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--blue);
    transform: rotate(-2deg);
}

.quizstandard-hero-lead {
    margin: 12px 0 0;
    font-family: var(--font-read);
    font-size: 15.5px;
    line-height: 1.5;
    color: #3D3A34;
}

.quizstandard-hero-lead p {
    margin: 0 0 10px;
}

.quizstandard-hero-lead p:last-child {
    margin-bottom: 0;
}

.quizstandard-hero-btn {
    margin: 18px 0 0;
}

/* ---------- the most issued, on a taped note ---------- */

.quizstandard-toplist {
    position: relative;
    padding: 6px 14px;
    background: var(--slip);
    box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .4);
    transform: rotate(-.4deg);
}

.quizstandard-toplist .quizstandard-tape {
    left: 50%;
    top: -9px;
    width: 60px;
    height: 18px;
    background: var(--butter);
    transform: translateX(-50%) rotate(-2deg);
}

.quizstandard-toplist ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: quizstandard-top;
}

.quizstandard-toplist li {
    counter-increment: quizstandard-top;
}

.quizstandard-toplist a {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px dashed #D5DAEE;
    color: inherit;
    text-decoration: none;
}

.quizstandard-toplist li:last-child a {
    border-bottom: 0;
}

/* The place, written in by hand. */
.quizstandard-toplist a::before {
    content: counter(quizstandard-top) ".";
    font-family: var(--font-hand);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--blue);
}

.quizstandard-toplist-title {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

.quizstandard-toplist small {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-faint);
    white-space: nowrap;
}

/* ---------- pointer, motion ---------- */

@media (hover: hover) and (pointer: fine) {
    .quizstandard-card:hover .quizstandard-card-title,
    .quizstandard-dept-grid a:hover span,
    .quizstandard-toplist a:hover .quizstandard-toplist-title {
        color: var(--blue);
    }

    .quizstandard-ribbon a:hover:not(.is-on) {
        background: var(--slip-4);
    }

    .quizstandard-blue-btn:hover:not(:active) {
        background: color-mix(in srgb, var(--blue) 88%, var(--ink));
    }
}
