/* ================================================================
   WORCESTER COUNTY MDGENWEB
   Sitewide stylesheet

   Visual direction:
   - 1930s-1940s linen-postcard character
   - Ocean blues + sepia + warm medium browns
   - Restrained coral and golden-yellow accents
   - Coastal, historic, friendly -- not beach-resort kitsch

   Keep this file organized by the numbered sections below.
   ================================================================ */

/* ----------------------------------------------------------------
   1. COLOR PALETTE AND GLOBAL SETTINGS
   ---------------------------------------------------------------- */
:root {
    --ocean-deep: #274f5a;
    --ocean: #3f7180;
    --ocean-light: #7ea7ac;
    --sea-glass: #b9ceca;

    --sepia-dark: #6c5038;
    --brown: #8a6647;
    --brown-light: #b08b66;
    --sand: #d8c7a8;

    --parchment: #f3ead7;
    --paper: #fbf7ec;
    --paper-warm: #f7efdf;

    --ink: #332d27;
    --ink-soft: #5b5147;

    --coral: #c65d46;
    --gold: #d2a246;
    --blue-pop: #2f718f;

    --line: rgba(108, 80, 56, 0.28);
    --shadow: 0 10px 28px rgba(64, 48, 35, 0.16);

    --page-width: 1180px;
    --radius: 15px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(rgba(255,255,255,0.18), rgba(255,255,255,0.18)),
        repeating-linear-gradient(
            0deg,
            #e8ddc8 0,
            #e8ddc8 2px,
            #eadfcb 2px,
            #eadfcb 4px
        );
    font-family: Lexend, "Trebuchet MS", Aptos, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.65;
}

a {
    color: #245f79;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover,
a:focus {
    color: #9d4434;
}

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

h1,
h2,
h3,
h4 {
    color: var(--sepia-dark);
    line-height: 1.18;
    margin-top: 0;
}

p:first-child {
    margin-top: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    background: #fff;
    color: #000;
    padding: 0.6rem 0.9rem;
}

.skip-link:focus {
    left: 0.75rem;
    top: 0.75rem;
}

/* ----------------------------------------------------------------
   2. SITE HEADER AND PRIMARY NAVIGATION
   ---------------------------------------------------------------- */
.site-header {
    background: var(--ocean-deep);
    color: #fff;
    border-bottom: 5px solid var(--gold);
}

.header-inner {
    width: min(var(--page-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 11px 0 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-name {
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.site-tagline {
    color: #dbe9e8;
    font-size: 0.83rem;
    text-align: right;
}

.primary-nav {
    background: #7b5c41;
    box-shadow: inset 0 -1px rgba(255,255,255,0.16);
}

.nav-inner {
    width: min(var(--page-width), calc(100% - 24px));
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
}

.primary-nav a {
    color: #fff8e9;
    text-decoration: none;
    font-weight: 700;
    font-size: clamp(0.82rem, 1.05vw, 0.94rem);
    padding: 0.72rem clamp(0.42rem, 0.72vw, 0.78rem);
    white-space: nowrap;
    border-left: 1px dashed rgba(255,255,255,0.28);
}

.primary-nav a:last-child {
    border-right: 1px dashed rgba(255,255,255,0.28);
}

.primary-nav a:hover,
.primary-nav a:focus,
.primary-nav a[aria-current="page"] {
    background: var(--coral);
    color: #fff;
}

/* ----------------------------------------------------------------
   3. PAGE SHELL
   ---------------------------------------------------------------- */
.page-shell {
    width: min(var(--page-width), calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 42px;
}

.postcard-banner {
    background: #f2dfb5;
    border: 7px solid #f7edcf;
    outline: 1px solid rgba(111, 78, 46, 0.32);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.postcard-banner img {
    display: block;
    width: 100%;
}

.home-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.65fr);
    gap: 22px;
    margin-top: 24px;
    align-items: stretch;
}

.intro-copy,
.postmark-panel,
.content-panel,
.feature-card,
.link-card,
.search-card,
.callout {
    background: rgba(251, 247, 236, 0.95);
    border: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(72, 52, 35, 0.08);
}

.intro-copy {
    padding: 26px 28px;
    border-top: 5px solid var(--ocean);
}

.intro-copy h1 {
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    margin-bottom: 0.6rem;
}

.eyebrow {
    margin: 0 0 0.35rem;
    color: var(--coral);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.lead {
    color: var(--ink-soft);
    font-size: 1.08rem;
}

.postmark-panel {
    position: relative;
    padding: 24px;
    overflow: hidden;
    background:
        linear-gradient(rgba(251,247,236,0.93), rgba(251,247,236,0.93)),
        repeating-linear-gradient(90deg, transparent 0 22px, rgba(39,79,90,0.1) 22px 23px);
}

.postmark-panel::before {
    content: "WORCESTER\A MARYLAND\A 1742";
    white-space: pre;
    display: grid;
    place-items: center;
    width: 150px;
    height: 150px;
    margin: 0 auto 16px 8px;
    border: 4px double var(--coral);
    border-radius: 50%;
    color: var(--coral);
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: 0.08em;
    text-align: center;
    transform: rotate(-7deg);
    opacity: 0.86;
}

/* Wavy cancellation bars complete the vintage postmark motif. */
.postmark-panel::after {
    content: "";
    position: absolute;
    top: 72px;
    left: 142px;
    width: 155px;
    height: 72px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='155' height='72' viewBox='0 0 155 72'%3E%3Cg fill='none' stroke='%23c65d46' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M0 8 C14 0 28 16 42 8 S70 0 84 8 S112 16 126 8 S146 2 155 7'/%3E%3Cpath d='M0 25 C14 17 28 33 42 25 S70 17 84 25 S112 33 126 25 S146 19 155 24'/%3E%3Cpath d='M0 42 C14 34 28 50 42 42 S70 34 84 42 S112 50 126 42 S146 36 155 41'/%3E%3Cpath d='M0 59 C14 51 28 67 42 59 S70 51 84 59 S112 67 126 59 S146 53 155 58'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transform: rotate(-7deg);
    opacity: 0.72;
    pointer-events: none;
}

.postmark-panel h2 {
    font-size: 1.05rem;
    text-align: center;
    margin-bottom: 0.55rem;
}

.postmark-panel p {
    font-size: 0.92rem;
    text-align: center;
    color: var(--ink-soft);
}

/* ----------------------------------------------------------------
   4. RESEARCH ROUTE / HOMEPAGE FEATURE NAVIGATION
   ---------------------------------------------------------------- */
.section-block {
    margin-top: 34px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-heading::after {
    content: "";
    height: 2px;
    flex: 1;
    background: linear-gradient(to right, var(--brown-light), transparent);
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.route-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.route-card {
    position: relative;
    display: block;
    min-height: 155px;
    padding: 22px 20px 20px;
    color: var(--ink);
    text-decoration: none;
    background: var(--paper);
    border: 1px solid var(--line);
    border-top: 7px solid var(--ocean);
    box-shadow: 0 4px 14px rgba(64,48,35,0.09);
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.route-card:nth-child(2n) {
    border-top-color: var(--brown-light);
}

.route-card:nth-child(3n) {
    border-top-color: var(--coral);
}

.route-card:hover,
.route-card:focus {
    color: var(--ink);
    transform: translateY(-3px);
    box-shadow: 0 9px 22px rgba(64,48,35,0.14);
}

.route-number {
    display: inline-block;
    color: var(--coral);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.route-card h3 {
    margin: 0.25rem 0 0.4rem;
    font-size: 1.2rem;
}

.route-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.91rem;
}

/* ----------------------------------------------------------------
   5. FEATURE STORIES AND CONTENT CARDS
   ---------------------------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 0;
    overflow: hidden;
}

.feature-card-body {
    padding: 22px 24px 24px;
}

.feature-label {
    color: var(--blue-pop);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.feature-card h3 {
    margin: 0.3rem 0 0.55rem;
}

.feature-card p:last-child {
    margin-bottom: 0;
}

.map-figure {
    margin: 0;
    background: #dbc49f;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.map-figure img {
    display: block;
    width: 100%;
    max-height: 330px;
    object-fit: cover;
}

/* ----------------------------------------------------------------
   6. LINK COLLECTIONS
   ---------------------------------------------------------------- */
.link-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.link-card {
    padding: 20px 21px;
}

.link-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 2px dotted var(--sand);
}

.clean-list {
    margin: 0;
    padding-left: 1.15rem;
}

.clean-list li {
    margin: 0.42rem 0;
}

.small-note {
    color: var(--ink-soft);
    font-size: 0.86rem;
}

/* ----------------------------------------------------------------
   7. SEARCH AND SPECIAL CALLOUTS
   ---------------------------------------------------------------- */
.search-card {
    padding: 22px 24px;
    border-top: 5px solid var(--gold);
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-form label {
    font-weight: 700;
}

.search-form input[type="text"] {
    flex: 1 1 280px;
    min-width: 0;
    border: 1px solid #a58c70;
    border-radius: 7px;
    padding: 0.68rem 0.75rem;
    font: inherit;
    background: #fffdf8;
}

.button {
    display: inline-block;
    border: 0;
    border-radius: 7px;
    padding: 0.68rem 1rem;
    background: var(--ocean-deep);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.button:hover,
.button:focus {
    background: var(--coral);
    color: #fff;
}

.callout {
    padding: 20px 22px;
    border-left: 6px solid var(--coral);
}

.callout strong {
    color: var(--sepia-dark);
}

/* ----------------------------------------------------------------
   8. INTERIOR PAGE LAYOUT
   ---------------------------------------------------------------- */
.interior-hero {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 25px;
    align-items: center;
    margin-bottom: 24px;
    padding: 22px;
    background: rgba(251,247,236,0.95);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.interior-logo {
    padding: 7px;
    background: #f3dfb7;
    border: 1px solid rgba(108,80,56,0.38);
    transform: rotate(-1.2deg);
}

.interior-logo img {
    display: block;
}

.interior-title h1 {
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    margin: 0.15rem 0 0.5rem;
}

.breadcrumbs {
    color: var(--ink-soft);
    font-size: 0.82rem;
}

.content-panel {
    padding: clamp(22px, 4vw, 38px);
}

.content-panel h2 {
    margin-top: 1.9rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px dotted var(--sand);
}

.content-panel h2:first-child {
    margin-top: 0;
}

.float-map {
    float: right;
    width: min(42%, 390px);
    margin: 0 0 1.2rem 1.4rem;
    padding: 7px;
    background: #edd8ad;
    border: 1px solid var(--line);
    box-shadow: 0 5px 14px rgba(64,48,35,0.14);
}

/* ----------------------------------------------------------------
   9. FOOTER
   ---------------------------------------------------------------- */
.site-footer {
    margin-top: 42px;
    background: #294d55;
    color: #eaf2ef;
}

.footer-mdgenweb {
    padding: 1.05rem 1rem 0.95rem;
    background: var(--parchment);
    text-align: center;
}

.footer-mdgenweb a {
    display: inline-block;
    line-height: 0;
}

.footer-mdgenweb img {
    display: block;
    width: 150px;
    max-width: 55vw;
    height: auto;
    margin: 0 auto;
}

.footer-inner {
    width: min(var(--page-width), calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 26px;
    text-align: center;
    border-top: 5px solid var(--gold);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1.15rem;
    margin-bottom: 1rem;
}

.footer-nav a,
.footer-nav a:visited {
    color: #fff0bf;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(255, 240, 191, 0.72);
    text-underline-offset: 2px;
}

.footer-meta {
    max-width: 920px;
    margin: 0 auto;
}

.footer-meta p {
    margin: 0.3rem 0;
    font-size: 0.88rem;
}

.footer-small {
    color: #cbdcda;
}

.site-footer a,
.site-footer a:visited {
    color: #ffe3a3;
    text-decoration-thickness: 1.5px;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #ffffff;
    text-decoration-color: currentColor;
}

/* ----------------------------------------------------------------
   10. RESPONSIVE ADJUSTMENTS
   ---------------------------------------------------------------- */
@media (max-width: 880px) {
    .home-intro,
    .interior-hero,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .route-grid,
    .link-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .interior-logo {
        width: 180px;
        margin: 0 auto;
    }

    .interior-title {
        text-align: center;
    }
}

@media (max-width: 620px) {
    .nav-inner {
        flex-wrap: wrap;
    }

    body {
        font-size: 15.5px;
    }

    .header-inner {
        display: block;
        text-align: center;
    }

    .site-tagline {
        margin-top: 0.25rem;
        text-align: center;
    }

    .primary-nav a {
        flex: 1 1 50%;
        text-align: center;
        border-bottom: 1px dashed rgba(255,255,255,0.2);
    }

    .route-grid,
    .feature-grid,
    .link-columns {
        grid-template-columns: 1fr;
    }

    .float-map {
        float: none;
        width: 100%;
        margin: 0 0 1.2rem;
    }

    .page-shell {
        width: min(100% - 18px, var(--page-width));
    }

    .intro-copy,
    .content-panel {
        padding: 21px 19px;
    }
}


/* ----------------------------------------------------------------
   11. CONTENT COLLECTIONS, TABLES, TIMELINES AND READERS
   ---------------------------------------------------------------- */
.page-note {
    margin: 1.1rem 0;
    padding: 0.85rem 1rem;
    border-left: 5px solid var(--gold);
    background: #fff8e8;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0 0 1.4rem;
    padding: 0;
    list-style: none;
}

.quick-links a {
    display: inline-block;
    padding: 0.42rem 0.68rem;
    background: #e6f0ef;
    border: 1px solid rgba(39,79,90,0.22);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.record-grid,
.resource-grid,
.book-grid,
.atlas-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 1.2rem 0;
}

.record-card,
.resource-card,
.book-card {
    padding: 18px;
    background: var(--paper-warm);
    border: 1px solid var(--line);
    border-top: 4px solid var(--ocean);
    border-radius: 10px;
}

.record-card:nth-child(3n+2),
.resource-card:nth-child(3n+2),
.book-card:nth-child(3n+2) {
    border-top-color: var(--coral);
}

.record-card:nth-child(3n),
.resource-card:nth-child(3n),
.book-card:nth-child(3n) {
    border-top-color: var(--gold);
}

.record-card h2,
.record-card h3,
.resource-card h2,
.resource-card h3,
.book-card h2,
.book-card h3 {
    margin-bottom: 0.45rem;
}

.resource-card address {
    font-style: normal;
    white-space: normal;
}

.timeline {
    margin: 1.3rem 0;
    border-left: 3px solid var(--sand);
}

.timeline-entry {
    position: relative;
    display: grid;
    grid-template-columns: minmax(100px, 150px) 1fr;
    gap: 16px;
    padding: 0.15rem 0 1.15rem 20px;
}

.timeline-entry::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.35rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--coral);
    border: 2px solid var(--paper);
}

.timeline-date {
    color: var(--sepia-dark);
    font-weight: 900;
}

.timeline-text p { margin: 0; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 0.55rem 0.65rem;
    border: 1px solid rgba(108,80,56,0.24);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: #dce9e7;
    color: var(--ocean-deep);
}

.data-table tr:nth-child(even) td { background: rgba(243,234,215,0.45); }

.definition-list dt {
    margin-top: 0.7rem;
    color: var(--sepia-dark);
    font-weight: 800;
}

.definition-list dd {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 3px solid var(--sand);
}

.media-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 1rem 0 2rem;
    overflow: hidden;
    background: #1d2d30;
    border: 7px solid #ead6ae;
    outline: 1px solid var(--line);
    box-shadow: 0 6px 16px rgba(64,48,35,0.12);
}

.media-embed iframe,
.book-reader iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.book-reader {
    height: min(78vh, 760px);
    min-height: 520px;
    margin: 1rem 0;
    border: 7px solid #ead6ae;
    outline: 1px solid var(--line);
    background: #ddd;
}

.article-image {
    float: right;
    width: min(45%, 430px);
    margin: 0 0 1.1rem 1.4rem;
    padding: 7px;
    background: #ead6ae;
    border: 1px solid var(--line);
    box-shadow: 0 5px 14px rgba(64,48,35,0.14);
}

.transcription {
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: normal;
    padding: 18px;
    background: #fffdf7;
    border: 1px solid var(--line);
    border-left: 5px solid var(--ocean);
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.89rem;
    line-height: 1.5;
}

.atlas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.atlas-card {
    display: block;
    padding: 8px;
    background: #ead6ae;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    text-decoration: none;
}

.atlas-card:hover,
.atlas-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(64,48,35,0.13);
}

.atlas-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #fff;
}

.atlas-card span {
    display: block;
    padding: 0.55rem 0.4rem 0.35rem;
    font-weight: 800;
    text-align: center;
}

.atlas-viewer img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 6px 18px rgba(64,48,35,0.15);
}

.atlas-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 1rem 0;
}

.small-print {
    color: var(--ink-soft);
    font-size: 0.82rem;
}

@media (max-width: 780px) {
    .record-grid,
    .resource-grid,
    .book-grid,
    .atlas-grid {
        grid-template-columns: 1fr;
    }

    .timeline-entry {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .article-image {
        float: none;
        width: 100%;
        margin: 0 0 1.2rem;
    }
}
