/* ===================================================================
   Spotswood Capital — Educational Library Styles
   Matches the existing site palette and typography exactly.
   Palette: bg #fbf8f3, text #20272d, navy #28465e, gold #8c5f2f/#b88a43
   Fonts: Georgia serif for headings, Arial sans for UI/body text
   =================================================================== */

:root {
    color: #20272d;
    background: #fbf8f3;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: #20272d;
    background: #fbf8f3;
}

body, input, select, textarea, button { font: inherit; }

a { color: inherit; }

/* ---- Header (matches main site) ---- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px clamp(18px, 5vw, 68px);
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid rgba(32, 39, 45, 0.1);
    box-shadow: 0 8px 30px rgba(38, 42, 45, 0.06);
}

.brand {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #8c5f2f;
    text-decoration: none;
    white-space: nowrap;
}

.site-header nav {
    display: flex;
    gap: 8px;
    font-family: Arial, Helvetica, sans-serif;
}

.site-header nav a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    color: #28465e;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
    background: #eef3f4;
}

/* ---- Section bands ---- */
.band {
    padding: clamp(36px, 6vw, 64px) clamp(20px, 6vw, 82px);
    background: #f8f5ef;
}

.band.white { background: #fff; }

.content {
    width: min(1120px, 100%);
    margin: 0 auto;
}

/* ---- Typography ---- */
.eyebrow, .section-label {
    margin: 0 0 8px;
    color: #8c5f2f;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1 {
    margin: 8px 0 16px;
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: 0;
    color: #20272d;
}

h2 {
    margin: 10px 0 14px;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 700;
    line-height: 1.12;
    color: #20272d;
}

h3 {
    margin: 24px 0 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #20272d;
}

p, li, label, input, select, textarea, button, .small-note {
    font-family: Arial, Helvetica, sans-serif;
}

p, li { line-height: 1.65; }

.lead {
    font-size: 1.15rem;
    color: #4b555c;
    max-width: 680px;
    line-height: 1.6;
}

/* ---- Search form ---- */
.search-form {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    border: 1px solid rgba(32, 39, 45, 0.18);
    border-radius: 6px;
    padding: 12px 16px;
    color: #20272d;
    background: #fbfbfa;
    font-family: Arial, Helvetica, sans-serif;
}

.search-form input[type="text"]:focus {
    outline: 2px solid #28465e;
    outline-offset: -1px;
}

/* ---- Buttons ---- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
}

.button.primary {
    color: #fff;
    background: #28465e;
}

.button.primary:hover { background: #1e3a4f; }

.button.secondary {
    color: #28465e;
    background: #fff;
    border-color: rgba(40, 70, 94, 0.28);
}

/* ---- Topic navigation ---- */
.topic-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.topic-nav a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    background: #fbf8f3;
    border: 1px solid rgba(40, 70, 94, 0.14);
    color: #28465e;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    transition: background 160ms ease, border-color 160ms ease;
}

.topic-nav a:hover { background: #eef3f4; }

.topic-nav a.active {
    background: #28465e;
    color: #fff;
    border-color: #28465e;
}

/* ---- Article cards ---- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.article-card {
    padding: 24px;
    border: 1px solid rgba(40, 70, 94, 0.16);
    border-left: 5px solid #b88a43;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(40, 70, 94, 0.14);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(40, 70, 94, 0.18);
}

.article-category {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    background: rgba(40, 70, 94, 0.08);
    color: #28465e;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: Arial, Helvetica, sans-serif;
}

.article-card h2 {
    margin: 4px 0 10px;
    font-size: 1.25rem;
    line-height: 1.2;
}

.article-card h2 a {
    text-decoration: none;
    color: #20272d;
}

.article-card h2 a:hover { color: #28465e; }

.article-summary {
    color: #4b555c;
    font-size: 0.95rem;
    line-height: 1.55;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(140, 95, 47, 0.08);
    color: #8c5f2f;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
}

.read-more {
    display: inline-block;
    margin-top: 14px;
    color: #28465e;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
}

.read-more:hover { text-decoration: underline; }

/* ---- Empty state ---- */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #63707a;
}

/* ---- Individual article ---- */
.article-content {
    max-width: 760px;
}

.article-meta {
    color: #63707a;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.article-lede {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #4b555c;
    margin-bottom: 28px;
}

.article-body {
    line-height: 1.7;
}

.article-body h2 {
    margin-top: 36px;
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.article-body h3 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.article-body p {
    color: #3a4248;
    margin: 12px 0;
}

.article-body ul, .article-body ol {
    color: #3a4248;
    padding-left: 24px;
    margin: 12px 0;
}

.article-body li { margin: 6px 0; }

.article-body blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    border-left: 4px solid #b88a43;
    background: #f8f5ef;
    border-radius: 0 6px 6px 0;
}

.article-body blockquote p {
    color: #4b555c;
    margin: 0;
}

.article-body hr {
    border: none;
    border-top: 1px solid rgba(32, 39, 45, 0.12);
    margin: 28px 0;
}

.article-body strong { font-weight: 700; }

.article-body a {
    color: #28465e;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---- Sources ---- */
.sources {
    margin-top: 36px;
    padding: 20px;
    border: 1px solid rgba(32, 39, 45, 0.1);
    border-radius: 8px;
    background: #fbfbfa;
}

.sources h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #28465e;
}

.sources ul {
    padding-left: 20px;
    margin: 0;
    color: #4b555c;
    font-size: 0.92rem;
}

.sources li { margin: 6px 0; }

.sources a {
    color: #28465e;
    text-decoration: none;
}

.sources a:hover { text-decoration: underline; }

/* ---- Disclaimer box ---- */
.disclaimer-box {
    margin-top: 32px;
    padding: 20px 24px;
    border-left: 4px solid #b88a43;
    background: #f8f5ef;
    border-radius: 0 8px 8px 0;
}

.disclaimer-box h3 {
    margin: 0 0 8px;
    font-size: 0.92rem;
    color: #8c5f2f;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.disclaimer-box p {
    margin: 0;
    color: #4b555c;
    font-size: 0.88rem;
    line-height: 1.6;
}

.article-disclaimer { margin-top: 36px; }

/* ---- Back link ---- */
.back-link {
    margin-top: 32px;
}

.back-link a {
    color: #28465e;
    text-decoration: none;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
}

.back-link a:hover { text-decoration: underline; }

/* ---- Footer (matches main site) ---- */
.footer {
    color: #f8f4ec;
    background: #20272d;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 0.9fr;
    gap: 28px;
    padding: 42px clamp(20px, 6vw, 82px);
}

.footer h2, .footer h3 { color: #fff; }

.footer h2 { margin: 0 0 18px; }

.footer h3 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: #f4d49b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer h3::after {
    content: "";
    width: 34px;
    height: 2px;
    background: #b88a43;
}

.footer p, .footer li { color: rgba(248, 244, 236, 0.78); }

.footer-disclosure {
    display: grid;
    gap: 10px;
    padding: 0 clamp(20px, 6vw, 82px) 28px;
}

.footer-disclosure p {
    max-width: 1180px;
    margin: 0;
    color: rgba(248, 244, 236, 0.68);
    font-size: 0.78rem;
    line-height: 1.55;
}

.footer a {
    color: rgba(248, 244, 236, 0.92);
    text-decoration: none;
}

.footer a:hover, .footer a:focus {
    color: #f4d49b;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer ul {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.footer-main section:nth-child(n + 2) p {
    margin-top: 0;
    color: rgba(248, 244, 236, 0.7);
    font-size: 0.92rem;
}

.footer-main section:nth-child(n + 2) li { font-size: 0.96rem; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px clamp(20px, 6vw, 82px);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ---- Responsive ---- */
@media (max-width: 920px) {
    .site-header {
        position: relative;
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .site-header nav a {
        flex: 1 1 auto;
        justify-content: center;
    }

    .article-grid, .footer-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    html, body { overflow-x: hidden; }

    .site-header {
        width: 100%;
        padding: 12px 16px;
    }

    .site-header nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .site-header nav a {
        min-width: 0;
        padding: 0 4px;
        font-size: 0.74rem;
        line-height: 1.15;
        text-align: center;
        white-space: normal;
    }

    h1 { font-size: clamp(1.7rem, 7vw, 2rem); }

    .search-form, .footer-bottom {
        flex-direction: column;
    }

    .search-form input[type="text"] { width: 100%; }

    .button, .search-form a { width: 100%; }
}

/* ===================================================================
   Featured carousel — Fidelity-style image carousel on the library
   landing page. Decorative nature images; text overlaid on a gradient.
   =================================================================== */
.carousel-band {
    padding: clamp(28px, 4vw, 44px) clamp(20px, 6vw, 82px);
}

.carousel {
    position: relative;
}

.carousel-viewport {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(32, 39, 45, 0.22);
}

.carousel-track {
    display: flex;
    transition: transform 520ms cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.carousel-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 100%;
    margin: 0;           /* reset <figure> default 40px margins */
    height: clamp(280px, 40vw, 420px);
    overflow: hidden;
}

.slide-media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.slide-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* gradient scrim for legibility */
.carousel-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        100deg,
        rgba(20, 26, 30, 0.82) 0%,
        rgba(20, 26, 30, 0.55) 38%,
        rgba(20, 26, 30, 0.12) 70%,
        rgba(20, 26, 30, 0.02) 100%
    );
    pointer-events: none;
}

.slide-caption {
    position: absolute;
    z-index: 2;
    left: 0;
    bottom: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    max-width: min(560px, 62%);
    padding: clamp(28px, 5vw, 56px);
    color: #fff;
}

.slide-cat {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(184, 138, 67, 0.9);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.slide-title {
    margin: 0;
    font-size: clamp(1.5rem, 3.2vw, 2.4rem);
    font-weight: 700;
    line-height: 1.12;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

.slide-title a {
    color: #fff;
    text-decoration: none;
}

.slide-title a:hover { text-decoration: underline; text-underline-offset: 3px; }

.slide-summary {
    margin: 0;
    max-width: 460px;
    color: rgba(255, 255, 255, 0.88);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.98rem;
    line-height: 1.55;
}

.slide-cta {
    align-self: flex-start;
    margin-top: 6px;
    padding: 9px 18px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease;
}

.slide-cta:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: #fff;
}

/* arrows */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #28465e;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    transition: background 160ms ease, transform 160ms ease;
}

.carousel-arrow:hover { background: #fff; }
.carousel-arrow.prev { left: clamp(10px, 3vw, 22px); }
.carousel-arrow.next { right: clamp(10px, 3vw, 22px); }
.carousel-arrow.prev:hover { transform: translateY(-50%) scale(1.06); }
.carousel-arrow.next:hover { transform: translateY(-50%) scale(1.06); }

/* dots */
.carousel-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.carousel-dots .dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.carousel-dots .dot:hover { background: rgba(255, 255, 255, 0.8); }

.carousel-dots .dot.active {
    background: #fff;
    transform: scale(1.25);
}

.carousel:focus-visible {
    outline: 3px solid #b88a43;
    outline-offset: 4px;
    border-radius: 12px;
}

/* ===================================================================
   Article hero — full-width banner image with overlaid title.
   Magazine-style composition for individual article pages.
   =================================================================== */
.article-hero-band {
    padding: 0 clamp(20px, 6vw, 82px);
    background: #f8f5ef;
}

.article-hero {
    position: relative;
    margin: 0 auto;
    width: min(1120px, 100%);
    height: clamp(240px, 34vw, 360px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 18px 44px rgba(32, 39, 45, 0.2);
}

.article-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(20, 26, 30, 0.82) 0%,
        rgba(20, 26, 30, 0.4) 45%,
        rgba(20, 26, 30, 0.05) 100%
    );
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: clamp(26px, 5vw, 52px);
    color: #fff;
}

.hero-cat {
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 4px;
    background: rgba(184, 138, 67, 0.92);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0;
    max-width: 760px;
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

/* When an article has a hero image, pull the body band up slightly */
.article-hero-band + .band {
    padding-top: clamp(28px, 4vw, 44px);
}

/* ===================================================================
   Article card thumbnails — image across the top of each grid card.
   =================================================================== */
.article-card {
    padding: 0;            /* thumb is full-bleed; body has its own pad */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-thumb {
    display: block;
    width: 100%;
    height: 168px;
    overflow: hidden;
    background: #e9e4da;
    border-bottom: 3px solid #b88a43;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 420ms ease;
}

.article-card:hover .card-thumb img {
    transform: scale(1.05);
}

.card-body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Cards without a thumbnail keep a top pad so they don't look broken */
.article-card:not(:has(.card-thumb)) .card-body {
    padding-top: 24px;
}

/* ---- Carousel responsive ---- */
@media (max-width: 720px) {
    .carousel-slide { height: clamp(240px, 56vw, 320px); }
    .slide-caption { max-width: 80%; padding: clamp(20px, 6vw, 30px); }
    .slide-summary { display: none; }
    .carousel-arrow { width: 38px; height: 38px; font-size: 1.3rem; }
    .article-hero { height: clamp(200px, 42vw, 280px); border-radius: 10px; }
    .card-thumb { height: 140px; }
}