/*
Theme Name: Archivo de la Serranía
Description: Biblioteca digital y catálogo patrimonial de la Serranía de Ronda.
Version: 1.0.0
Requires PHP: 8.3
*/

:root {
    color-scheme: light;
    --ink: #172a27;
    --green: #164b42;
    --dark: #102a26;
    --muted: #52635d;
    --paper: #fbfaf6;
    --line: #dbe0d7;
    --gold: #e7bc75;
    --serif: Georgia,"Times New Roman",serif;
    --sans: system-ui,-apple-system,"Segoe UI",sans-serif;
}

*,*::before,*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.6 var(--sans);
}

a {
    color: inherit;
    text-underline-offset: .2em;
}

img,video {
    max-width: 100%;
    height: auto;
}

h1,h2,h3,p,figure {
    margin: 0;
}

h1,h2,h3 {
    font-family: var(--serif);
    font-weight: 500;
    line-height: 1.04;
}

:focus-visible {
    outline: 3px solid #b07020;
    outline-offset: 4px;
}

.wrap {
    width: min(1280px,calc(100% - 104px));
    margin-inline: auto;
}

.skip {
    position: absolute;
    inset: 8px auto auto 8px;
    z-index: 20;
    background: #fff;
    padding: 10px;
    transform: translateY(-150%);
}

.skip:focus {
    transform: none;
}

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.head-inner,.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-block: 19px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    background: var(--green);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font: 26px var(--serif);
}

.brand-name {
    display: block;
    font: 600 19px/1.15 var(--serif);
}

.brand-place {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(12px,2.1vw,30px);
}

.nav a {
    text-decoration: none;
    font-size: 15px;
    font-weight: 650;
}

.nav a:hover,.nav a[aria-current] {
    color: var(--green);
    text-decoration: underline;
}

.nav .nav-archive {
    border: 1px solid #9fae9f;
    border-radius: 6px;
    padding: 8px 13px;
}

.hero {
    background: var(--dark);
    color: var(--paper);
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.12fr .88fr;
    min-height: 503px;
}

.hero-copy {
    align-self: center;
    position: relative;
    z-index: 1;
    padding: 52px 26px 56px 0;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--green);
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.eyebrow::before {
    content: "";
    width: 26px;
    height: 1px;
    background: currentColor;
}

.hero .eyebrow {
    color: var(--gold);
}

.hero h1 {
    max-width: 730px;
    margin: 17px 0 20px;
    font-size: clamp(54px,7vw,100px);
    letter-spacing: -.061em;
    line-height: .96;
}

.hero h1 em {
    color: var(--gold);
    font-weight: 400;
}

.hero-copy>p:not(.eyebrow) {
    max-width: 440px;
    color: #d9e3db;
    font-size: 18px;
    margin-bottom: 26px;
}

.hero-visual {
    position: relative;
    min-width: 0;
    background: #283a33;
    isolation: isolate;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    position: absolute;
    object-fit: cover;
    object-position: 50% 42%;
    filter: sepia(.46) saturate(.62) brightness(.77) contrast(1.11);
}

.hero-visual::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,var(--dark),transparent 25%),linear-gradient(0deg,#102a26d9,transparent 29%);
    pointer-events: none;
}

.hero-visual figcaption {
    position: absolute;
    z-index: 1;
    right: 17px;
    bottom: 15px;
    text-align: right;
    font-size: 13px;
    color: #fff4d7;
}

.search {
    display: flex;
    gap: 8px;
    width: min(100%,560px);
}

.search label,.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.search input {
    min-width: 0;
    flex: 1;
    background: #fff;
    border: 1px solid #aeb9af;
    border-radius: 6px;
    color: var(--ink);
    min-height: 51px;
    padding: 10px 15px;
    font: inherit;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 47px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 18px;
    font: 700 15px var(--sans);
    text-decoration: none;
    background: var(--green);
    color: #fff;
    cursor: pointer;
}

.button:hover {
    background: #216657;
}

.hero .button {
    background: var(--gold);
    color: var(--dark);
}

.hero .button:hover {
    background: #f4cd8e;
}

.section {
    padding-block: 58px;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.section-head h2,.callout h2 {
    font-size: clamp(35px,4vw,55px);
    letter-spacing: -.045em;
}

.section-head p {
    margin-top: 7px;
    color: var(--muted);
}

.more {
    color: var(--green);
    font-weight: 750;
    white-space: nowrap;
}

.collections {
    display: grid;
    grid-template-columns: repeat(6,1fr);
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.collections a {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px 13px 15px;
    text-decoration: none;
    transition: background .16s,border-color .16s;
}

.collections a:hover,.collections a:focus-visible {
    background: #eef3eb;
    border-color: #78998b;
}

.collection-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: #e6eee6;
    color: var(--green);
    font: 22px var(--serif);
}

.collections strong {
    font: 600 19px/1.12 var(--serif);
}

.collections small {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.35;
}

.section-alt {
    background: #edf1e9;
}

.cards {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 18px;
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    overflow: hidden;
}

.card-media {
    width: 100%;
    aspect-ratio: 1.95;
    display: grid;
    place-items: center;
    background: #e5ebe2;
    color: #426e61;
    font: 62px var(--serif);
}

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

.card-body {
    padding: 18px 19px 22px;
}

.card h3 {
    margin-top: 7px;
    font-size: 25px;
    line-height: 1.13;
}

.card h3 a {
    text-decoration: none;
}

.card h3 a:hover {
    text-decoration: underline;
}

.card .note {
    margin-top: 8px;
}

.label {
    color: var(--green);
    font-size: 14px;
    font-weight: 750;
}

.note {
    color: var(--muted);
}

.callout {
    max-width: 730px;
}

.callout p {
    margin-block: 14px 20px;
}

.catalog-head {
    background: #e8eee5;
    padding-block: 42px;
}

.catalog-head h1,.resource h1,.plain h1 {
    font-size: clamp(42px,6.6vw,78px);
    letter-spacing: -.05em;
    margin-block: 8px 14px;
}

.catalog-head .search {
    margin-top: 22px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.filters a {
    display: block;
    padding: 7px 12px;
    border: 1px solid #b7c6ba;
    border-radius: 30px;
    text-decoration: none;
    background: #fff;
}

.filters a[aria-current],.filters a:hover {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.results {
    margin-bottom: 20px;
}

.pagination {
    margin-top: 28px;
}

.page-numbers {
    display: inline-block;
    margin: 0 8px 6px 0;
    padding: 4px 8px;
}

.page-numbers.current {
    background: var(--green);
    color: #fff;
    border-radius: 4px;
}

.back {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--green);
}

.resource-grid {
    display: grid;
    grid-template-columns: minmax(0,1.7fr) minmax(240px,1fr);
    gap: 32px;
    margin-top: 25px;
}

.resource-media {
    display: block;
    max-height: 650px;
    object-fit: contain;
    object-position: left;
}

.resource audio {
    width: min(100%,580px);
}

.metadata {
    margin: 0;
    padding: 19px;
    background: #ebf0e9;
    border-radius: 7px;
    overflow-wrap: anywhere;
}

.metadata dt {
    font-weight: 750;
    margin-top: 12px;
}

.metadata dt:first-child {
    margin-top: 0;
}

.metadata dd {
    margin: 0;
}

.rich>*+* {
    margin-top: 1em;
}

.resource .button {
    margin-top: 18px;
}

.site-footer {
    background: var(--dark);
    color: var(--paper);
}

.site-footer a:hover {
    color: var(--gold);
}

.footer-inner {
    flex-wrap: wrap;
    min-height: 100px;
}

.footer-inner .brand-place {
    color: #c3d1c5;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

@media(max-width:1020px) {
    .collections {
        grid-template-columns: repeat(3,1fr);
    }
}

@media(max-width:760px) {
    .wrap {
        width: calc(100% - 36px);
    }
    .head-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .hero-inner {
        grid-template-columns: 1fr;
    }
    .hero-copy {
        padding: 38px 0 30px;
    }
    .hero h1 {
        font-size: clamp(46px,11vw,74px);
    }
    .hero-visual {
        min-height: 260px;
    }
    .hero-visual::after {
        background: linear-gradient(180deg,var(--dark),transparent 25%),linear-gradient(0deg,#102a26c0,transparent 36%);
    }
    .section {
        padding-block: 37px;
    }
    .section-head {
        align-items: start;
        flex-direction: column;
        gap: 9px;
    }
    .cards {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

@media(max-width:440px) {
    .collections {
        grid-template-columns: repeat(2,1fr);
    }
    .cards {
        grid-template-columns: 1fr;
    }
    .hero-visual {
        min-height: 205px;
    }
    .search input {
        padding-inline: 9px;
    }
    .search .button {
        padding-inline: 12px;
    }
    .nav {
        column-gap: 13px;
    }
    .nav a {
        font-size: 14px;
    }
}
