/* Awards portfolio - www.wood.org.nz/awards
   A gallery-catalogue look: stone wall, white mats, serif numerals, museum placards. */

.awards-page {
    --aw-wall: #eeebe5;
    --aw-mat: #ffffff;
    --aw-ink: #2a2723;
    --aw-muted: #7d766c;
    --aw-rule: #d6d0c6;
    --aw-accent: #8a4b2a;      /* rimu */
    --aw-serif: "Fraunces", Georgia, "Times New Roman", serif;

    background: var(--aw-wall);
    color: var(--aw-ink);
}

.awards-page footer { background-color: transparent !important; border-top: 1px solid var(--aw-rule); }

.aw-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--aw-muted);
    margin: 0 0 .75rem;
}

/* ---------- layout ---------- */

.aw-layout {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 3rem;
    max-width: 1280px;
    margin: 0 auto;
    padding: 3.5rem 2rem 4rem;
}

/* ---------- year index ---------- */

.aw-rail {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.aw-years {
    list-style: none;
    margin: 0;
    padding: 0;
}

.aw-year {
    position: relative;
    display: block;
    padding: .2rem 0 .2rem 1.75rem;
    font-family: var(--aw-serif);
    font-size: 1.15rem;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--aw-muted);
    text-decoration: none;
    transition: color .15s;
}

.aw-year::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 1px;
    background: var(--aw-ink);
    transition: width .2s;
}

.aw-year:hover { color: var(--aw-ink); }
.aw-year:hover::before { width: .6rem; }

.aw-year.is-current {
    color: var(--aw-ink);
    font-weight: 600;
}
.aw-year.is-current::before { width: 1.25rem; }

.aw-year:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 2px; }

/* ---------- header ---------- */

.aw-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    padding-bottom: 2.5rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--aw-rule);
}

.aw-header.has-poster { grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); }

.aw-title { margin: 0; line-height: .9; }

.aw-title-year {
    display: block;
    font-family: var(--aw-serif);
    font-optical-sizing: auto;
    font-weight: 300;
    font-size: clamp(4.5rem, 11vw, 9rem);
    letter-spacing: -.03em;
    font-variant-numeric: lining-nums;
}

.aw-title-name {
    display: block;
    margin-top: .75rem;
    font-family: var(--aw-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1.2;
}

.aw-intro {
    max-width: 38rem;
    margin: 1.5rem 0 0;
    font-size: 1.05rem;
    line-height: 1.65;
    white-space: pre-line;
}

.aw-count {
    margin: 1.25rem 0 0;
    font-size: .85rem;
    color: var(--aw-muted);
}

.aw-poster { margin: 0; padding-top: 1.6rem; }

.aw-poster-button {
    display: block;
    width: 100%;
    padding: .6rem;
    border: 0;
    background: var(--aw-mat);
    cursor: zoom-in;
}
.aw-poster-button img { display: block; width: 100%; height: auto; }

.aw-poster figcaption {
    margin-top: .5rem;
    font-size: .75rem;
    color: var(--aw-muted);
}

/* ---------- grid of pieces ---------- */

.aw-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3.5rem 2.25rem;
    counter-reset: piece;
}

.aw-piece { counter-increment: piece; scroll-margin-top: 2rem; }

.aw-mat {
    display: block;
    width: 100%;
    padding: 1.25rem;
    border: 0;
    background: var(--aw-mat);
    cursor: zoom-in;
    outline: 1px solid transparent;
    transition: outline-color .2s;
}

.aw-mat img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    transition: transform .4s ease;
}

.aw-mat:hover { outline-color: var(--aw-rule); }
.aw-mat:hover img { transform: scale(1.025); }
.aw-mat:focus-visible { outline: 2px solid var(--aw-accent); outline-offset: 3px; }

.aw-placard {
    position: relative;
    padding: 1rem 0 0 2.25rem;
}

.aw-placard::before {
    content: counter(piece, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 1.05rem;
    font-size: .75rem;
    font-variant-numeric: tabular-nums;
    color: var(--aw-muted);
}

.aw-award {
    margin: 0 0 .25rem;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--aw-accent);
}

.aw-maker {
    margin: 0;
    font-family: var(--aw-serif);
    font-size: 1.2rem;
    line-height: 1.3;
}

.aw-detail {
    margin: .2rem 0 0;
    font-size: .875rem;
    color: var(--aw-muted);
}

.aw-views {
    margin: .35rem 0 0;
    font-size: .75rem;
    letter-spacing: .04em;
    color: var(--aw-muted);
}

.aw-none { color: var(--aw-muted); font-style: italic; }

/* ---------- previous / next year ---------- */

.aw-pager {
    display: flex;
    justify-content: space-between;
    margin-top: 4.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--aw-rule);
}

.aw-pager-link { color: var(--aw-ink); text-decoration: none; }
.aw-pager-link .aw-label { display: block; margin-bottom: .2rem; }
.aw-pager-newer { text-align: right; }
.aw-pager-year { font-family: var(--aw-serif); font-size: 1.6rem; }
.aw-pager-link:hover .aw-pager-year { color: var(--aw-accent); }

/* ---------- empty state ---------- */

.aw-empty { max-width: 40rem; margin: 0 auto; padding: 6rem 2rem; }
.aw-empty-title { font-family: var(--aw-serif); font-weight: 300; font-size: 2.5rem; }

/* ---------- viewer ---------- */

.aw-viewer {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #1c1a17;
    color: #f2eee8;
    overflow: hidden;
}
.aw-viewer[open] { display: flex; flex-direction: column; }
.aw-viewer::backdrop { background: #1c1a17; }

.aw-viewer-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 2rem 1rem;
}

.aw-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
    padding: clamp(.5rem, 1.5vw, 1.25rem);
    transition: opacity .15s;
}
.aw-viewer-img.is-loading { opacity: .25; }

.aw-viewer-thumbs {
    display: flex;
    justify-content: center;
    gap: .5rem;
    padding: 0 2rem;
}
.aw-viewer-thumbs[hidden] { display: none; }

.aw-viewer-thumb {
    width: 4rem;
    height: 3rem;
    padding: 0;
    border: 1px solid #4a453f;
    background: #fff;
    opacity: .55;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}
.aw-viewer-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.aw-viewer-thumb:hover { opacity: .85; }
.aw-viewer-thumb.is-current { opacity: 1; border-color: #f2eee8; }
.aw-viewer-thumb:focus-visible { outline: 2px solid #d29a72; outline-offset: 2px; }

.aw-viewer-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    padding: 1rem 2rem 1.5rem;
}

.aw-viewer-caption { min-height: 3.5rem; }
.aw-viewer .aw-award { color: #d29a72; }
.aw-viewer .aw-detail { color: #a8a096; }
.aw-viewer p:empty { display: none; }

.aw-viewer-controls { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

.aw-viewer-count {
    margin-right: .75rem;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
    color: #a8a096;
}

.aw-viewer-btn {
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 .9rem;
    border: 1px solid #4a453f;
    background: transparent;
    color: inherit;
    font-size: 1.1rem;
}
.aw-viewer-btn:hover { border-color: #f2eee8; }
.aw-viewer-btn:focus-visible { outline: 2px solid #d29a72; outline-offset: 2px; }
.aw-viewer-close { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.aw-viewer.is-single [data-action="prev"],
.aw-viewer.is-single [data-action="next"],
.aw-viewer.is-single .aw-viewer-count { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 1199.98px) {
    .aw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991.98px) {
    .aw-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 0 0 3rem;
    }

    /* Year index becomes a sticky horizontal strip */
    .aw-rail {
        top: 0;
        z-index: 10;
        background: var(--aw-wall);
        border-bottom: 1px solid var(--aw-rule);
    }
    .aw-rail-label { display: none; }
    .aw-years {
        display: flex;
        gap: 1.5rem;
        overflow-x: auto;
        padding: .9rem 1.25rem;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }
    .aw-years::-webkit-scrollbar { display: none; }
    .aw-years li { scroll-snap-align: center; }
    .aw-year { padding: .1rem 0 .35rem; }
    .aw-year::before { top: auto; bottom: 0; left: 50%; transform: translateX(-50%); }
    .aw-year:hover::before { width: 0; }
    .aw-year.is-current::before { width: 100%; }

    .aw-content { padding: 2.5rem 1.25rem 0; }
}

@media (max-width: 767.98px) {
    .aw-header.has-poster { grid-template-columns: minmax(0, 1fr); }
    .aw-poster { max-width: 220px; }
    .aw-viewer-stage { padding: 1rem .75rem .5rem; }
    .aw-viewer-thumbs {
    display: flex;
    justify-content: center;
    gap: .5rem;
    padding: 0 2rem;
}
.aw-viewer-thumbs[hidden] { display: none; }

.aw-viewer-thumb {
    width: 4rem;
    height: 3rem;
    padding: 0;
    border: 1px solid #4a453f;
    background: #fff;
    opacity: .55;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}
.aw-viewer-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.aw-viewer-thumb:hover { opacity: .85; }
.aw-viewer-thumb.is-current { opacity: 1; border-color: #f2eee8; }
.aw-viewer-thumb:focus-visible { outline: 2px solid #d29a72; outline-offset: 2px; }

.aw-viewer-bar { flex-direction: column; align-items: stretch; padding: .75rem 1rem 1rem; }
    .aw-viewer-controls { justify-content: flex-end; }
}

@media (max-width: 575.98px) {
    .aw-grid { grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .aw-mat img, .aw-year::before, .aw-viewer-img { transition: none; }
    .aw-mat:hover img { transform: none; }
}
