

/* Brand and Interface Variables */
:root {
    --uw-brown: #492f24;
    --uw-gold: #ffc425;
    --charcoal: #39302a;
    --charcoal-light: #25221e;
    --warm-background: #f1efe8;
    --warm-border: #d7d2c5;
    --white: #ffffff;
    --text: #25282a;
    --text-muted: #656a6d;
    --gold-light: #fff1bd;
    --gold-dark: #5d4900;
    --focus: #006db6;
    --shadow-small: 0 2px 8px rgba(23, 25, 27, 0.08);
    --shadow-large: 0 18px 50px rgba(23, 25, 27, 0.28);
    --content-width: 1280px;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--warm-background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

/* Accessibility Helpers */
.skip-link {
    position: absolute;
    top: -100px;
    left: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    background: var(--uw-gold);
    color: var(--charcoal);
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    white-space: nowrap;
    border: 0;
    clip: rect(0, 0, 0, 0);
}

/* Site Header */
.site-header {
    position: relative;
    z-index: 10;
    background: var(--charcoal);
    color: var(--white);
    border-top: 5px solid var(--uw-gold);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 3rem, var(--content-width));
    height: 112px;
    margin: 0 auto;
    gap: 2rem;
}

.brand,
.brand-logo {
    height: 100%;
}

/* Header Logo */
.brand {
    display: flex;
    align-items: center;
    max-height: 112px;
    color: var(--white);
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: min(600px, 68vw);
    object-fit: contain;
    object-position: left center;
}

/* Footer Logo */
.footer-logo {
    display: block;
    width: auto;
    max-width: min(520px, 100%);
    height: 92px;
    object-fit: contain;
    object-position: left center;
}

.brand-copy strong {
    font-size: 1.05rem;
    line-height: 1.25;
}

.brand-copy span {
    margin-top: 0.2rem;
    color: #c8c9c6;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.site-nav a {
    color: #e3e3df;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.site-nav a:hover {
    color: var(--uw-gold);
}

/* Search Hero */
.search-hero {
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(90deg, rgba(23, 25, 27, 0.94) 0%, rgba(23, 25, 27, 0.78) 55%, rgba(23, 25, 27, 0.48) 100%), url("images/ser_exterior.jpg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--white);
}

.search-hero::after {
    display: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: min(100% - 3rem, var(--content-width));
    margin: 0 auto;
    padding: 4.5rem 0;
}

.eyebrow {
    margin-bottom: 0.6rem;
    color: var(--uw-gold);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.search-hero h1 {
    max-width: 48rem;
    margin-bottom: 0.75rem;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.hero-description {
    max-width: 45rem;
    margin-bottom: 1.75rem;
    color: #c9ccce;
    font-size: 1rem;
}

.hero-help {
    max-width: 45rem;
    margin-top: 2rem;
    margin-bottom: 1.75rem;
    color: #c9ccce;
    font-size: 0.75rem;
}

.help-description {
    padding-top: 2rem;
    color: #c9ccce;
    font-size: 1rem;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    max-width: 54rem;
    overflow: hidden;
    background: var(--white);
    border-radius: 0.45rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.search-form input {
    width: 100%;
    min-width: 0;
    padding: 1.1rem 1.25rem;
    color: var(--text);
    background: var(--white);
    border: 0;
}

.search-form input::placeholder {
    color: #72777a;
}

.search-form button {
    min-width: 8rem;
    padding: 1rem 1.5rem;
    background: var(--uw-gold);
    color: var(--charcoal);
    border: 0;
    font-weight: 700;
}

.search-form button:hover {
    background: #ffd052;
}

/* Database Layout */
.database-layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    width: min(100% - 3rem, var(--content-width));
    margin: 0 auto;
    padding: 2.5rem 0 4rem;
    gap: 2rem;
}

/* Filters */
.filters {
    align-self: start;
}

.filters-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.filters-heading-row h2 {
    margin-bottom: 0;
    font-size: 1rem;
}

.text-button {
    padding: 0;
    background: transparent;
    color: var(--uw-brown);
    border: 0;
    font-size: 0.78rem;
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 1.25rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem 2.25rem 0.75rem 0.8rem;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--warm-border);
    border-radius: 0.3rem;
}

/* Results Toolbar */
.results-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.results-toolbar h2 {
    margin-bottom: 0.15rem;
    font-size: 1.3rem;
}

.results-toolbar p {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sort-control label {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.sort-control select {
    padding: 0.6rem 2rem 0.6rem 0.7rem;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--warm-border);
    border-radius: 0.3rem;
}

/* Publication Cards */
.publication-card {
    margin-bottom: 0.9rem;
    padding: 1.5rem 1.6rem;
    background: var(--white);
    border-left: 4px solid var(--uw-gold);
    box-shadow: var(--shadow-small);
}

.publication-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.publication-meta span:not(:last-child)::after {
    margin-left: 0.75rem;
    color: #b3aea1;
    content: "•";
}

.publication-meta .publication-series {
    display: inline-flex;
    padding: 0.25rem 0.45rem;
    background: var(--gold-light);
    color: var(--gold-dark);
    border-radius: 0.2rem;
    font-weight: 700;
}

.publication-meta .publication-series::after {
    display: none;
}

.publication-center {
    margin-bottom: 0.35rem;
    color: var(--uw-brown);
    font-size: 0.78rem;
    font-weight: 700;
}

.publication-card h3 {
    margin-bottom: 0.65rem;
    color: var(--charcoal);
    font-size: 1.2rem;
    line-height: 1.3;
}

.publication-authors {
    margin-bottom: 0.65rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.bibliographic-reference {
    margin-bottom: 0;
    color: #5d6265;
    font-size: 0.8rem;
    line-height: 1.55;
}

.publication-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #e6e2d8;
}

.publication-number {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.details-button {
    padding: 0.65rem 0.85rem;
    background: var(--charcoal-light);
    color: var(--white);
    border: 0;
    border-radius: 0.25rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.details-button:hover {
    background: var(--uw-brown);
}

/* No Results */
.no-results {
    padding: 3rem 1.5rem;
    background: var(--white);
    text-align: center;
    box-shadow: var(--shadow-small);
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
}

.no-results button {
    padding: 0.7rem 1rem;
    background: var(--uw-gold);
    color: var(--charcoal);
    border: 0;
    border-radius: 0.25rem;
    font-weight: 700;
}

/* Publication Dialog */
#publication-dialog {
    width: min(100% - 2rem, 46rem);
    max-height: calc(100vh - 2rem);
    padding: 0;
    overflow: auto;
    background: var(--white);
    color: var(--text);
    border: 0;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-large);
}

#publication-dialog::backdrop {
    background: rgba(13, 15, 16, 0.75);
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--charcoal);
    color: var(--white);
    border-top: 5px solid var(--uw-gold);
}

.dialog-header h2 {
    margin-bottom: 0;
    font-size: 1.45rem;
}

.dialog-publication-number {
    margin-bottom: 0.35rem;
    color: var(--uw-gold);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dialog-close {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
}

.dialog-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.dialog-content {
    padding: 1.5rem;
}

.dialog-content section {
    margin-bottom: 1.5rem;
}

.dialog-content section:last-child {
    margin-bottom: 0;
}

.dialog-content h3 {
    margin-bottom: 0.5rem;
    color: var(--uw-brown);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dialog-content p {
    margin-bottom: 0;
}

.format-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.format-links a {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 0.9rem;
    background: var(--uw-gold);
    color: var(--charcoal);
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.format-links a:hover {
    background: #ffd052;
}

/* Publication Permalink */
.permalink-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.permalink-button {
    padding: 0.7rem 0.9rem;
    background: var(--charcoal-light);
    color: var(--white);
    border: 0;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.permalink-button:hover {
    background: var(--uw-brown);
}

.permalink-status {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Site Footer */
.site-footer {
    background: var(--uw-brown);
    color: var(--white);
}

.footer-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: min(100% - 3rem, var(--content-width));
    margin: 0 auto;
    padding: 2rem 0;
    gap: 2rem;
}

.footer-inner p {
    margin: 0.2rem 0 0;
    color: #e0d9d5;
    font-size: 0.8rem;
}

/* Tablet Layout */
@media (max-width: 850px) {
    .site-nav {
        display: none;
    }

    .database-layout {
        grid-template-columns: 1fr;
    }

    .filters {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .filters-heading-row {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .filter-group {
        margin-bottom: 0;
    }
}

/* Mobile Layout */
@media (max-width: 600px) {
    .header-inner,
    .hero-inner,
    .database-layout,
    .footer-inner {
        width: min(100% - 2rem, var(--content-width));
    }

    .header-inner {
        width: min(100% - 2rem, var(--content-width));
        height: 88px;
    }

    .brand-mark {
        width: 46px;
        height: 46px;
        font-size: 0.9rem;
    }

    .brand-copy strong {
        font-size: 0.9rem;
    }

    .brand-copy span {
        font-size: 0.62rem;
    }

    .brand {
        max-height: 78px;
    }

    .brand-logo {
        max-width: 78vw;
    }

    .footer-logo {
        max-width: 100%;
        height: 74px;
    }

    .hero-inner {
        padding: 3rem 0;
    }

    .search-form {
        grid-template-columns: 1fr;
        overflow: visible;
        background: transparent;
        box-shadow: none;
        
    }

    .search-form input {
        border-radius: 0.4rem;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .search-form button {
        width: 100%;
        margin-top: 0.65rem;
        border-radius: 0.4rem;
    }

    .database-layout {
        padding-top: 1.5rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .results-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sort-control {
        justify-content: space-between;
    }

    .sort-control select {
        flex: 1;
    }

    .publication-card {
        padding: 1.2rem;
    }

    .publication-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .details-button {
        width: 100%;
    }

    .footer-inner {
        flex-direction: column;
    }
}