/* ==========================================================================
   Alder Creek Centennial — an Omeka S theme for the Alder Creek
   Centennial Oral History Project.

   Palette: beet-leaf green, harvest gold, cream paper, barn rust —
   drawn from the collection itself: beet fields, sunflowers at the
   Okamura stand, the grange hall, and the centennial quilt.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    --green: #1d4e33;
    --gold: #d9a53a;
    --rust: #a8502a;
    --ink: #2b2418;
    --paper: #faf6ec;
    --cream: #f4eddc;
    --surface: #fffdf6;
    --muted: #6f6a5d;
    --border: #ddd6c7;

    --green-dark: color-mix(in srgb, var(--green) 82%, black);
    --green-soft: color-mix(in srgb, var(--green) 10%, var(--paper));
    --gold-soft: color-mix(in srgb, var(--gold) 22%, var(--paper));
    --gold-deep: color-mix(in srgb, var(--gold) 72%, var(--ink));

    --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
    --sans: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;

    --content-width: 72rem;
    --shadow: 0 1px 2px rgba(43, 36, 24, 0.08), 0 6px 18px -8px rgba(43, 36, 24, 0.18);
    --shadow-lift: 0 2px 4px rgba(43, 36, 24, 0.1), 0 14px 30px -10px rgba(43, 36, 24, 0.25);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif);
    color: var(--green);
    line-height: 1.2;
    margin: 1.5em 0 0.5em;
}

h1:first-child, h2:first-child, h3:first-child {
    margin-top: 0;
}

a {
    color: var(--green);
    text-decoration-color: color-mix(in srgb, var(--gold) 65%, transparent);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--gold-deep);
}

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 4px solid var(--gold);
    font-family: var(--serif);
    font-style: italic;
    color: color-mix(in srgb, var(--ink) 85%, var(--green));
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

th {
    font-family: var(--serif);
    color: var(--green);
}

button,
.button,
input[type="submit"] {
    font-family: var(--sans);
    cursor: pointer;
}

select,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
textarea {
    font-family: var(--sans);
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.45rem 0.65rem;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--gold);
    outline: 2px solid color-mix(in srgb, var(--gold) 45%, transparent);
    outline-offset: 0;
}

#skipnav {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--gold);
    color: var(--ink);
    padding: 0.5rem 1rem;
    z-index: 100;
    border-radius: 0 0 6px 0;
}

#skipnav:focus {
    left: 0;
}

/* --------------------------------------------------------------------------
   3. Quilt strip — for the centennial quilt: one block for each year
   -------------------------------------------------------------------------- */
.quilt-strip {
    height: 12px;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(255, 253, 246, 0.18) 0 6px,
            transparent 6px 12px
        ),
        repeating-linear-gradient(
            90deg,
            var(--gold) 0 26px,
            var(--rust) 26px 52px,
            var(--cream) 52px 78px,
            var(--green) 78px 104px
        );
}

/* --------------------------------------------------------------------------
   4. Masthead
   -------------------------------------------------------------------------- */
#masthead {
    background-color: var(--green);
    background-image: linear-gradient(
        color-mix(in srgb, var(--green) 92%, white),
        var(--green)
    );
    color: var(--paper);
}

.masthead-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2.25rem 1.5rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}

.masthead-kicker {
    margin: 0 0 0.35rem;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}

.site-title {
    margin: 0;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.site-title a {
    color: var(--paper);
    text-decoration: none;
}

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

.site-title img {
    max-height: 6rem;
    width: auto;
    display: block;
}

.masthead-tagline {
    margin: 0.4rem 0 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.1rem;
    color: color-mix(in srgb, var(--paper) 80%, var(--green));
}

/* Header search */
#search {
    flex: 0 1 20rem;
    min-width: 14rem;
}

#search-form {
    display: flex;
    border-bottom: 2px solid color-mix(in srgb, var(--paper) 45%, transparent);
}

#search-form:focus-within {
    border-bottom-color: var(--gold);
}

#search-form input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--paper);
    padding: 0.4rem 0.25rem;
}

#search-form input[type="text"]::placeholder {
    color: color-mix(in srgb, var(--paper) 65%, transparent);
}

#search-form input[type="text"]:focus {
    outline: none;
}

#search-form button {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 1.1rem;
    padding: 0.25rem 0.4rem;
}

#search-form button:hover {
    color: var(--paper);
}

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
#top-nav {
    background: var(--green-dark);
    position: relative;
}

#top-nav ul {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

#top-nav ul ul {
    /* Sub-menus: simple dropdown */
    position: absolute;
    display: none;
    flex-direction: column;
    background: var(--green-dark);
    padding: 0.5rem 0;
    min-width: 14rem;
    box-shadow: var(--shadow-lift);
    border-radius: 0 0 8px 8px;
    z-index: 20;
}

#top-nav li {
    position: relative;
}

#top-nav li:hover > ul,
#top-nav li:focus-within > ul {
    display: flex;
}

#top-nav a {
    display: block;
    padding: 0.7rem 0.9rem;
    color: var(--paper);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
}

#top-nav a:hover {
    color: var(--gold);
}

#top-nav .active > a {
    border-bottom-color: var(--gold);
    color: var(--gold);
}

#top-nav ul ul a {
    border-bottom: none;
    padding: 0.45rem 1.1rem;
}

#mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    flex-direction: column;
    gap: 5px;
}

#mobile-nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--paper);
    border-radius: 2px;
}

/* --------------------------------------------------------------------------
   6. Banner
   -------------------------------------------------------------------------- */
.banner {
    display: flex;
    overflow: hidden;
    justify-content: center;
}

.banner img {
    width: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   7. Content shell
   -------------------------------------------------------------------------- */
#content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

#content > h2:first-of-type,
#content .page-title,
h2 .title {
    font-family: var(--serif);
}

#content > h2:first-child,
#content > h2:first-of-type {
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    margin-bottom: 1.25rem;
}

/* Gold rule under the page title */
#content > h2:first-of-type::after {
    content: "";
    display: block;
    width: 4.5rem;
    height: 4px;
    margin-top: 0.6rem;
    background: linear-gradient(90deg, var(--gold) 0 60%, var(--rust) 60%);
    border-radius: 2px;
}

.breadcrumbs {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.sub-menu ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sub-menu a {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.92rem;
}

.sub-menu .active > a {
    background: var(--green);
    border-color: var(--green);
    color: var(--paper);
}

/* --------------------------------------------------------------------------
   8. Browse controls, pagination, search filters
   -------------------------------------------------------------------------- */
.browse-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.browse-controls .advanced-search {
    margin-left: auto;
    font-size: 0.95rem;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.pagination input[type="text"] {
    width: 3.5rem;
    text-align: center;
    padding: 0.3rem;
}

.pagination a {
    text-decoration: none;
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
}

.pagination a:hover {
    background: var(--gold-soft);
}

.sorting {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.search-filters {
    margin: 0.5rem 0 1rem;
}

.search-filters .filter {
    display: inline-block;
    background: var(--gold-soft);
    border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
    border-radius: 999px;
    padding: 0.2rem 0.8rem;
    margin: 0 0.4rem 0.4rem 0;
    font-size: 0.9rem;
}

.search-filters .filter-label {
    font-weight: 600;
    margin-right: 0.35rem;
}

/* --------------------------------------------------------------------------
   9. Interview cards (item browse)
   -------------------------------------------------------------------------- */
.resource-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 1.5rem;
}

.resource-list .resource {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    padding-bottom: 1.1rem;
}

.resource-list .resource:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
}

/* Pieced-quilt corner on every card */
.resource-list .resource::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(
        90deg,
        var(--green) 0 25%,
        var(--gold) 25% 50%,
        var(--rust) 50% 75%,
        var(--cream) 75%
    );
    z-index: 2;
}

.resource-list .resource-link {
    text-decoration: none;
    display: block;
}

.resource-list .resource img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    filter: sepia(0.12) saturate(0.95);
}

.resource-list .resource-name {
    display: block;
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--green);
    padding: 1rem 1.1rem 0.25rem;
}

.resource-list .resource-link:hover .resource-name {
    color: var(--gold-deep);
}

.interview-meta {
    padding: 0 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.75rem;
}

.interview-meta .interview-narrator + .interview-date::before {
    content: "·";
    margin-right: 0.6rem;
    color: var(--gold);
}

.resource-list .description {
    padding: 0.5rem 1.1rem 0;
    font-size: 0.95rem;
    color: color-mix(in srgb, var(--ink) 80%, var(--muted));
}

/* Body truncation modes (body classes set by the layout) */
.body-truncate-fade .resource-list .description,
.body-truncate-ellipsis .resource-list .description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    position: relative;
}

.body-truncate-fade .resource-list .description::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1.6em;
    background: linear-gradient(transparent, var(--surface));
}

.interview-subjects {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0 1.1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.subject-chip,
.oa-topic-chip {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    background: var(--gold-soft);
    border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--border));
    border-radius: 4px;
    padding: 0.12rem 0.55rem;
    text-decoration: none;
}

a.oa-topic-chip:hover {
    background: var(--gold);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   10. Resource show pages (interviews)
   -------------------------------------------------------------------------- */
.resource.show #content > h3 {
    /* the "Item" resource-type label */
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rust);
    margin: -0.75rem 0 1.5rem;
}

/* Metadata as a ledger: label column, dotted rules */
.property {
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: 0.35rem 1.5rem;
    margin: 0;
    padding: 0.65rem 0;
    border-bottom: 1px dotted var(--border);
}

.property dt,
.property h4 {
    grid-column: 1;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0.15rem 0 0;
}

.property dd {
    grid-column: 2;
    margin: 0;
}

.property .value {
    margin-bottom: 0.25rem;
}

.property .value:last-child {
    margin-bottom: 0;
}

.collapsed-values .value:nth-child(n+9) {
    display: none;
}

.show-more-values {
    background: none;
    border: none;
    color: var(--green);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.25rem 0;
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: 3px;
}

/* Media list & linked resources */
.media-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0;
    list-style: none;
}

.media-list img {
    border-radius: 8px;
    border: 1px solid var(--border);
}

#linked-resources caption,
.linked-resources h3 {
    text-align: left;
}

/* --------------------------------------------------------------------------
   11. OralArchivist player — heritage palette
   -------------------------------------------------------------------------- */
/* Doubled class beats the module's own defaults, which load after this file */
.oral-archivist-player.oral-archivist-player {
    --oa-accent: var(--green);
    --oa-muted: var(--muted);
    --oa-border: var(--border);
    --oa-surface: var(--cream);
    --oa-highlight-bg: var(--gold-soft);
    --oa-bar-bg: var(--green);
    --oa-bar-fg: #ffffff;
    --oa-play-bg: var(--gold);
    --oa-play-fg: var(--green);
    --oa-wave-played: var(--gold);
    --oa-wave-rest: rgba(255, 255, 255, 0.35);
    --oa-radius: 10px;
    font-family: var(--sans);
}

.oral-archivist-player .oa-heading,
.oral-archivist-player .oa-col-heading {
    font-family: var(--serif);
    color: var(--green);
}

/* --------------------------------------------------------------------------
   12. OralArchivist segment browse / topics ("Explore the interviews")
   -------------------------------------------------------------------------- */
.oa-segments-page .oa-segments-intro {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-style: italic;
    color: color-mix(in srgb, var(--ink) 75%, var(--muted));
    max-width: 46rem;
}

.oa-segment-search {
    margin: 1.5rem 0;
}

.oa-segment-search input[type="text"],
.oa-segment-search input[type="search"] {
    min-width: 18rem;
}

.oa-segment-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
    gap: 1.25rem;
    padding: 0;
    list-style: none;
}

.oa-segment-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--gold);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}

.oa-segment-card:hover {
    box-shadow: var(--shadow-lift);
}

.oa-segment-title {
    font-family: var(--serif);
    font-size: 1.15rem;
    margin: 0 0 0.3rem;
}

.oa-segment-time {
    font-variant-numeric: tabular-nums;
    color: var(--rust);
    font-weight: 600;
    font-size: 0.88rem;
}

.oa-segment-source {
    color: var(--muted);
    font-size: 0.9rem;
}

.oa-segment-snippet {
    font-size: 0.95rem;
}

.oa-segment-snippet mark,
mark {
    background: var(--gold-soft);
    color: inherit;
    padding: 0 0.15em;
    border-radius: 3px;
}

.oa-topic-index {
    columns: 3 14rem;
    column-gap: 2rem;
}

.oa-topic-count {
    color: var(--muted);
    font-size: 0.85rem;
}

.oa-breadcrumb {
    font-size: 0.9rem;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   13. Page blocks: pull quotes, archival notes, homepage
   -------------------------------------------------------------------------- */
.pull-quote {
    margin: 2.5rem auto;
    max-width: 38rem;
    text-align: center;
    position: relative;
    padding-top: 2.25rem;
}

.pull-quote::before {
    content: "\201C";
    position: absolute;
    top: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--serif);
    font-size: 5rem;
    line-height: 1;
    color: var(--gold);
}

.pull-quote blockquote {
    border: none;
    padding: 0;
    margin: 0;
    font-family: var(--serif);
    font-size: 1.45rem;
    line-height: 1.45;
    font-style: italic;
    color: var(--green);
}

.pull-quote blockquote p {
    margin: 0 0 0.5rem;
}

/* Attribution: use a plain paragraph ending with an em-dash line */
.pull-quote blockquote p:last-child:not(:only-child) {
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 1rem;
}

.transcript-note {
    background: var(--cream);
    border: 1px dashed color-mix(in srgb, var(--rust) 45%, var(--border));
    border-radius: 8px;
    padding: 1.25rem 1.5rem 1rem;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.transcript-note::before {
    content: "Archival note";
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rust);
    margin-bottom: 0.5rem;
}

/* Homepage */
.home-template #content {
    padding-top: 1.5rem;
}

.home-template #content > h2:first-of-type {
    position: absolute;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.blocks .block {
    margin-bottom: 2.5rem;
}

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
#colophon {
    background: var(--green);
    color: color-mix(in srgb, var(--paper) 85%, var(--green));
    margin-top: 2rem;
}

.footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2.25rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

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

.footer-credit {
    margin: 0;
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--paper) 55%, var(--green));
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */
@media screen and (max-width: 800px) {
    .masthead-inner {
        flex-direction: column;
        align-items: stretch;
        padding-top: 1.5rem;
    }

    #search {
        flex-basis: auto;
    }

    #mobile-nav-toggle {
        display: flex;
    }

    #top-nav > ul {
        display: none;
        flex-direction: column;
        padding-bottom: 0.75rem;
    }

    #top-nav.open > ul {
        display: flex;
    }

    #top-nav ul ul {
        position: static;
        display: flex;
        box-shadow: none;
        padding-left: 1.25rem;
    }

    #top-nav a {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    #top-nav .active > a {
        border-left-color: var(--gold);
    }

    .property {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .browse-controls .advanced-search {
        margin-left: 0;
    }
}
