/* ==========================================================================
   Stirling City Historical Society
   Self-contained stylesheet — no CSS framework.
   Palette drawn from the museum grounds: evergreen roofs and redwoods,
   brass/amber highlights, warm paper rather than clinical white.
   ========================================================================== */

:root {
    --ink:          #2a2521;
    --ink-muted:    #6b6259;
    --paper:        #faf6f0;
    --paper-sunk:   #f2ece3;
    --rule:         #e2d9cc;

    --evergreen:      #2f4f3e;
    --evergreen-dark: #243d30;
    --evergreen-deep: #1a2d23;
    --brass:          #c08a2e;
    --brass-dark:     #a4741f;

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

    --container: 1140px;
    --measure: 68ch;
    --radius: 6px;
    --shadow: 0 2px 10px rgba(42, 37, 33, 0.10);
    --shadow-lift: 0 10px 28px rgba(42, 37, 33, 0.16);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--evergreen); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--evergreen-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.2rem; }

p, ul, ol { margin: 0 0 1.15rem; }

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

/* Visible focus ring for keyboard users */
:focus-visible {
    outline: 3px solid var(--brass);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.site-main {
    flex: 1;
    padding-block: 2rem 3rem;
}

/* Centred reading column for articles and list pages */
.prose-column {
    max-width: var(--measure);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--evergreen-deep);
    color: #fff;
    padding: 0.75rem 1.25rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.7rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease,
                border-color 0.2s ease, transform 0.2s ease;
}

.btn-primary {
    background: var(--evergreen);
    border-color: var(--evergreen);
    color: #fff;
}

.btn-primary:hover {
    background: var(--evergreen-dark);
    border-color: var(--evergreen-dark);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border-color: var(--evergreen);
    color: var(--evergreen);
}

.btn-outline:hover {
    background: var(--evergreen);
    color: #fff;
    transform: translateY(-1px);
}

.btn-sm { font-size: 0.85rem; padding: 0.45rem 1.1rem; }
.btn-lg { font-size: 1.05rem; padding: 0.85rem 2rem; }

.btn i { margin-right: 0.5rem; }

/* --------------------------------------------------------------------------
   Site header / navigation
   -------------------------------------------------------------------------- */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    position: relative;
    z-index: 20;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.9rem;
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--evergreen-dark);
    text-decoration: none;
    line-height: 1.2;
}

.nav-brand:hover { color: var(--evergreen); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0.45rem 0.6rem;
    cursor: pointer;
    color: var(--ink);
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    margin: 4px 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: block;
    padding: 0.35rem 0.8rem;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
    color: var(--evergreen);
    border-bottom-color: var(--brass);
}

/* --------------------------------------------------------------------------
   Hero (homepage)
   Uses museum2021.jpg (1624x974) rather than museumheader.jpg, which is a
   1249x204 banner crop of the same photo and blurs badly when scaled to fill.
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    background:
        linear-gradient(rgba(22, 30, 26, 0.45), rgba(22, 30, 26, 0.68)),
        url('/images/museum2021.jpg');
    background-size: cover;
    background-position: center 68%;
    min-height: 72vh;
    display: flex;
    align-items: center;
    color: #fff;
    text-align: center;
}

.hero-content {
    width: 100%;
    padding-block: 4rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5.5vw, 4rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.25rem;
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.hero-subtitle {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    max-width: 42ch;
    margin: 0 auto 2.5rem;
    font-weight: 300;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.hero-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    max-width: 860px;
    margin-inline: auto;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* Uniform padding on every cell so icons align across the row,
   whether or not the cell is a link. */
.hero-info-item {
    display: block;
    padding: 0.5rem;
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
}

a.hero-info-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

a.hero-info-item {
    transition: background 0.25s ease, transform 0.25s ease;
}

.hero-info-item i {
    color: var(--brass);
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
    display: block;
}

.hero-info-item h2 {
    font-family: var(--font-body);
    font-weight: 700;
    color: #fff;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
}

.hero-info-item small {
    display: block;
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.88;
}

/* Masthead on interior pages */
.header-image-container {
    height: 220px;
    overflow: hidden;
}

.header-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 60%;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    font-size: 0.9rem;
    color: var(--ink-muted);
}

.breadcrumb li + li::before {
    content: "/";
    margin-right: 0.5rem;
    color: var(--rule);
}

.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--evergreen); text-decoration: underline; }
.breadcrumb .is-current { color: var(--ink); }

/* --------------------------------------------------------------------------
   Article content
   -------------------------------------------------------------------------- */
.page-meta {
    color: var(--ink-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.post-list article {
    padding-block: 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.post-list article:last-child { border-bottom: none; }

.post-list h2 { margin-bottom: 0.3rem; }
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { text-decoration: underline; }

.prose img { border-radius: var(--radius); margin-block: 1.5rem; }

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin-block: 1.5rem;
    font-size: 0.95rem;
}

.prose th, .prose td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

.prose th { font-weight: 700; background: var(--paper-sunk); }

.prose blockquote {
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.25rem;
    border-left: 3px solid var(--brass);
    color: var(--ink-muted);
    font-style: italic;
}

/* Tables in legacy pages can be wider than the column */
.prose .table-scroll { overflow-x: auto; }

.contact-email { margin-block: 1.75rem; }

/* --------------------------------------------------------------------------
   Thumbnail gallery for figure shortcodes
   -------------------------------------------------------------------------- */
.figure-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.figure-gallery figure {
    margin: 0;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.figure-gallery figure a {
    display: block;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.figure-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
    transition: transform 0.3s ease;
}

.figure-gallery figure:hover img { transform: scale(1.05); }

/* --------------------------------------------------------------------------
   Homepage news cards
   -------------------------------------------------------------------------- */
.news-section { padding-block: 3rem; }

.section-title {
    text-align: center;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    position: relative;
}

/* Brass rule under section headings */
.section-title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 56px;
    height: 3px;
    background: var(--brass);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift);
}

.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    background: var(--paper-sunk);
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    margin: 0;
    transition: transform 0.35s ease;
}

.news-card:hover .card-img-wrapper img { transform: scale(1.05); }

.card-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--evergreen) 0%, var(--evergreen-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--brass);
}

.card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.35rem;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--evergreen); }

.card-date {
    font-size: 0.85rem;
    color: var(--ink-muted);
    margin-bottom: 0.75rem;
}

.card-text {
    font-size: 0.95rem;
    color: var(--ink-muted);
    flex: 1;
    margin-bottom: 1.15rem;
}

.card-actions { margin-top: auto; }

.news-more { text-align: center; margin-top: 2.5rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--evergreen-deep);
    color: rgba(255, 255, 255, 0.82);
    padding-block: 3rem 2rem;
    margin-top: auto;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
}

.site-footer h2 {
    font-family: var(--font-display);
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 1rem;
}

.site-footer a { color: rgba(255, 255, 255, 0.82); text-decoration: none; }
.site-footer a:hover { color: var(--brass); text-decoration: underline; }

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li { margin-bottom: 0.35rem; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.65);
}

.footer-bottom p { margin: 0; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .nav-toggle { display: block; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--rule);
        box-shadow: var(--shadow);
        padding: 0.5rem 1.25rem 1rem;
    }

    .nav-links.is-open { display: flex; }

    .nav-links a {
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--rule);
    }

    .nav-links li:last-child a { border-bottom: none; }

    .hero-section { min-height: 58vh; }

    .hero-info { grid-template-columns: 1fr; padding: 1.25rem; }

    .header-image-container { height: 150px; }

    .news-section { padding-block: 2rem; }

    .card-img-wrapper, .card-img-placeholder { height: 160px; }

    .footer-bottom { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
