/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ---- PFDA brand palette ------------------------------------------
       From "PFDA Brand Template.pdf" (branding and supporting docs/). These five are
       the brand; everything below them is derived from them. */
    --brand-navy: #1B2A4A;       /* headlines, buttons, cards, formal backgrounds */
    --brand-blue: #2E7FE0;       /* accents and icons. Buttons are navy by choice. */
    --brand-warm-white: #FBF9F5; /* the main background */
    --brand-soft-gray: #8A8F98;  /* dividers and structure */
    --brand-gold: #C9A227;       /* sparingly: rules, badges, highlights */

    /* What the page actually uses. */
    --primary-color: var(--brand-navy);
    --primary-dark: #111C33;     /* navy hover */
    --secondary-color: var(--brand-gold);
    --accent-color: var(--brand-blue);
    --text-dark: var(--brand-navy);
    /* Soft Gray itself is only 3.1:1 on the warm white -- too faint to read as text.
       This is the same gray taken darker until it clears 4.5:1 (5.6:1). */
    --text-light: #5F6570;
    --bg-light: var(--brand-warm-white);
    --bg-white: #ffffff;
    /* Alternate sections: a shade deeper than the page, like the rows in the
       brand's printed pieces. */
    --bg-warm: #F4F0E8;
    --border-color: #E5E0D6;
    --success-color: #10b981;
    --shadow-sm: 0 1px 2px 0 rgba(27, 42, 74, 0.06);
    --shadow-md: 0 4px 12px -2px rgba(27, 42, 74, 0.10);
    --shadow-lg: 0 12px 24px -6px rgba(27, 42, 74, 0.16);

    /* Gold fails as text on light backgrounds (2.3:1), so it is used for lines and
       fills there, never words. On navy it is fine (5.9:1). */

    /* Brand typography: Playfair Display for major headings, Montserrat for body.
       Loaded from Google Fonts in each page's <head>. */
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* ---- Hero background carousel -------------------------------------
       The two numbers that decide how the photographs read behind the hero.
       Adjust these; nothing else needs touching.

       --hero-carousel-opacity  how far the photographs come through.
                                0 = invisible, 1 = full strength.
                                Around 0.2-0.35 keeps the headline comfortable.
       --hero-scrim-opacity     the wash laid over the photographs to protect
                                the text. Raise it if a bright image makes the
                                headline hard to read; lower it to let more
                                photograph through.
       They pull against each other: a higher carousel opacity usually wants a
       higher scrim to match. ------------------------------------------- */
    --hero-carousel-opacity: 0.28;
    --hero-scrim-opacity: 0.55;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Form controls do not inherit the page font on their own. */
button,
input,
select,
textarea {
    font-family: inherit;
}

h1,
h2,
h3 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-dark);
}

html {
    scroll-behavior: smooth;
    /* The nav is sticky, so without this an anchor jump lands with the section's
       heading tucked underneath it. Covers plain links like the hero's
       "Become a Member" and any page opened with a #hash already in the URL. */
    scroll-padding-top: 5rem;
}

/* Navigation */
#mainNav {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* The thin gold line the brand runs under every navy title band. */
    border-bottom: 3px solid var(--brand-gold);
}

.nav-container {
    /* Wider than the 1200px page content so the logo sits out toward the left edge and
       the brand name (wider in Playfair) leaves the links enough room. */
    max-width: 1440px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--primary-color);
    flex-shrink: 0;
    white-space: nowrap;
}

/* The official badge, drawn small beside the name. */
.nav-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    flex: 1;
    /* Centred with auto margins on the end items (below), NOT justify-content: center.
       A centred row that overflows spills off BOTH ends, and the left spill cannot be
       scrolled to -- that is what was cutting off Home. Auto margins centre when there
       is room and collapse to a plain left-aligned, scrollable row when there is not. */
    justify-content: flex-start;
    /* Keep every item on one line. If the row runs out of room it scrolls
       sideways rather than wrapping "Support Us" onto two lines. */
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-links li {
    flex: 0 0 auto;
}

.nav-links li:first-child {
    margin-left: auto;
}

.nav-links li:last-child {
    margin-right: auto;
}

.nav-link {
    display: block;
    padding: 0.4rem 0.5rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.auth-buttons .btn {
    white-space: nowrap;
}

#userGreeting {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Buttons */
.btn {
    padding: 0.4rem 1rem;
    /* Transparent on solid buttons, navy on outlined ones, so both are the same size. */
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Navy outline. Gold was the old fill here, but white on gold is unreadable (2.4:1). */
.btn-secondary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1.125rem;
}

.btn-small {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg-white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: var(--text-light);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.demo-accounts {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.demo-accounts code {
    background-color: var(--bg-white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section-alt {
    background-color: var(--bg-warm);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1.25rem;
}

/* A short gold rule under each section heading, as in the brand's printed pieces. */
.section-title::after {
    content: '';
    display: block;
    width: 64px;
    height: 3px;
    margin: 0.75rem auto 0;
    background-color: var(--brand-gold);
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 3rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--brand-warm-white) 0%, #E6EAF2 100%);
    padding: 6rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    /* Anchors the absolutely positioned photo layer below, and clips it to the hero. */
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* The photo layer. Sits under everything in the hero; the gradient above shows through
   wherever a photograph is faded or absent. */
.hero-carousel {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: var(--hero-carousel-opacity);
    pointer-events: none;
}

/* No images listed yet -> no layer at all, so the hero keeps its plain gradient instead
   of showing an empty frame behind the headline. carousel.js adds this class. */
.hero-carousel.is-empty {
    display: none;
}

/* Laid over the photographs, under the text. This is what keeps the headline readable
   when a bright photograph comes round. */
.hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--brand-warm-white) 0%, #E6EAF2 100%);
    opacity: var(--hero-scrim-opacity);
}

.hero-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* logo_lrg.png is a large source file, scaled down here rather than resized on disk, so
   the full-resolution original stays available for print and for retina screens. */
.hero-logo {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    /* A soft lift so the mark reads against whichever photograph is behind it. */
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.18));
}

.placeholder-image {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8rem;
    box-shadow: var(--shadow-lg);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.about-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.about-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Committees Section */
.committees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.committee-card {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.committee-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.committee-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.committee-lead {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.committee-members {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Resources Section */
.resources-intro {
    text-align: center;
    margin-bottom: 2rem;
}

.file-browser {
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.file-browser-header {
    background-color: var(--bg-light);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.current-path {
    color: var(--text-dark);
}

.file-list {
    padding: 1rem;
}

.file-item {
    /* Rows are <button>s (folders) and <a>s (files), so strip what each brings with it. */
    width: 100%;
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    text-decoration: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
    cursor: pointer;
    align-items: center;
}

.file-item:hover,
.file-item:focus-visible {
    background-color: var(--bg-light);
}

.file-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

/* Folder icons drawn by resources.js: gold back, lighter gold front, navy symbol. Navy
   on the light gold reads at better than 5:1, so the symbol stays legible. */
.folder-icon svg {
    display: block;
    width: 40px;
    height: 32px;
}

.folder-icon .folder-back {
    fill: var(--brand-gold);
}

.folder-icon .folder-front {
    fill: #E6CB72;
}

.folder-icon .folder-symbol {
    color: var(--brand-navy);
}

.file-item.folder:hover .folder-front {
    fill: #EDD68C;
}

.file-back .file-name {
    color: var(--text-light);
}

.file-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    vertical-align: middle;
}

.file-empty {
    padding: 1rem;
    color: var(--text-light);
}

.file-item.folder {
    font-weight: 600;
}

.file-icon {
    font-size: 1.5rem;
    /* As wide as a folder icon, so file names line up with folder names. */
    width: 40px;
    text-align: center;
}

.file-name {
    color: var(--text-dark);
    overflow-wrap: anywhere;
}

.file-meta {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Fundraising Section */
.membership-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.tier-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
}

.tier-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.tier-card.featured {
    border-color: var(--primary-color);
    border-width: 2px;
    border-top-width: 4px;
    transform: scale(1.05);
}

.tier-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Gold for the one "premium" moment on the page. Navy text, not white: 5.9:1 vs 2.4:1. */
.tier-card.featured .tier-badge {
    background-color: var(--brand-gold);
    color: var(--primary-color);
}

.tier-price {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.tier-price span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
}

.tier-benefits {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
}

.tier-benefits li {
    padding: 0.5rem 0;
    color: var(--text-light);
}

.donation-section {
    background-color: var(--bg-white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    text-align: center;
    margin-top: 3rem;
    box-shadow: var(--shadow-sm);
}

.donation-section h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.donation-amounts {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.amount-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    background-color: var(--bg-white);
    color: var(--primary-color);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.amount-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Directory Section */
.directory-search {
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    display: block;
    margin: 0 auto;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.directory-map-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.directory-map-link:hover {
    text-decoration: underline;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.member-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    /* A column so the Contact button can sink to the bottom. Names, hospitals and job
       titles all wrap to different depths, and without this the buttons sit at a
       different height on every card in a row. */
    display: flex;
    flex-direction: column;
}

.member-card .contact-member-btn {
    margin-top: auto;
    align-self: center;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.member-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.member-card h4,
.member-name {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

/* Post-nominal letters sit with the name but read as an annotation to it, not part of
   it — lighter and non-bold so the person's name still carries the line. */
.member-postnominals {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.9em;
}

/* The office held on the board. */
.member-office {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.9rem;
}

/* Where they actually work. Separated from the board office above by a hairline, because
   the two are different kinds of fact and the spec puts a blank line between them. */
.member-affiliation {
    border-top: 1px solid var(--border-color);
    padding-top: 0.9rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.member-hospital {
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 600;
}

.member-place {
    color: var(--text-light);
    font-size: 0.8125rem;
}

.member-jobtitle {
    color: var(--text-light);
    font-size: 0.8125rem;
    line-height: 1.45;
}

/* Kept: the map detail panel and any record predating the boardTitle split still use it. */
.member-role {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.member-info {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.member-info .muted-info {
    font-style: italic;
}

.member-map-link {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    /* Underlined because the accent is no longer a colour that reads as "link". */
    text-decoration: underline;
    text-underline-offset: 3px;
}

.member-map-link:hover {
    text-decoration: underline;
}

.directory-status {
    text-align: center;
    color: var(--text-light);
    margin-top: 2rem;
}

.directory-heading {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-top: 2.5rem;
}

/* Join Section */
.join-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.join-benefits {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.join-benefits h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.benefits-list {
    list-style: none;
}

.benefits-list li {
    padding: 0.75rem 0;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.benefits-list li:last-child {
    border-bottom: none;
}

.join-form-container {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.form-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.form-placeholder p {
    margin-bottom: 2rem;
    color: var(--text-light);
}

.form-note {
    margin-top: 1rem;
    color: var(--text-light);
}

/* Footer */
footer {
    background-color: var(--brand-navy);
    border-top: 4px solid var(--brand-gold);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-links {
        order: 3;
        /* flex: 1 from the base rule beats width: 100%, so the row never actually
           broke — it just got squeezed. Force it onto its own line. */
        flex: 0 0 100%;
        justify-content: flex-start;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .cta-buttons {
        justify-content: center;
    }
    
    .join-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.5rem 1rem;
    }
    
    .org-name {
        font-size: 0.9rem;
    }
    
    .nav-logo {
        width: 36px;
        height: 36px;
    }
    
    .hero {
        padding: 4rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .placeholder-image {
        width: 200px;
        height: 200px;
        font-size: 5rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .membership-tiers {
        grid-template-columns: 1fr;
    }
    
    .tier-card.featured {
        transform: none;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ==========================================================================
   Hero background carousel
   Slides are stacked and cross-faded rather than slid sideways: as a
   background there is nothing to swipe, and a fade cannot leave the track
   offset mid-transition if an image loads slowly.
   Strength is set by --hero-carousel-opacity / --hero-scrim-opacity in :root.
   ========================================================================== */

.carousel-track {
    position: absolute;
    inset: 0;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
    /* Clips any per-image `scale` zoom to the slide rather than letting it spill. */
    overflow: hidden;
}

.carousel-slide.is-active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* object-position and transform are set per image from CAROUSEL_IMAGES in
       carousel.js — framing belongs to the photograph, not to the stylesheet. The
       default here is what an entry with no `focus` gets. */
    object-position: center 50%;
}

/* Captions are suppressed in the hero — the headline is the message there, and a caption
   competing with it reads as clutter. Kept styled in case the carousel is ever used as a
   standalone block again. */
.carousel-caption {
    display: none;
}

/* Small and low-contrast: these are a background control, not a call to action. Bottom
   right so they clear the headline and the buttons. */
.carousel-dots {
    position: absolute;
    right: 2rem;
    bottom: 1.5rem;
    z-index: 2;
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.carousel-dot.is-current {
    background-color: var(--primary-color);
    transform: scale(1.3);
}

.carousel-dot:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* ==========================================================================
   What Is a Facility Dog?
   ========================================================================== */

.lead-paragraph {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-dark);
    max-width: 65ch;
    margin: 0 auto 1.75rem;
    text-align: center;
}

.section-intro {
    color: var(--text-light);
    max-width: 65ch;
    margin: 0 auto 1.5rem;
    text-align: center;
}

.distinction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.distinction-card {
    background-color: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    /* A single accent edge rather than a full border — these are facets of one
       definition, not four separate things. */
    border-left: 3px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Small labels, not major headings -- the brand keeps Playfair for those. */
.distinction-card h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.distinction-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.55;
}

.facility-detail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 820px;
    margin: 0 auto;
}

.detail-panel {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.detail-panel summary {
    padding: 1.1rem 1.35rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.detail-panel summary::-webkit-details-marker {
    display: none;
}

/* The heading has to live inside <summary> to be the clickable label, so it is reset to
   read as a row rather than as a page heading. */
.detail-panel summary h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-dark);
    margin: 0;
}

.detail-panel summary::after {
    content: '+';
    font-size: 1.4rem;
    line-height: 1;
    color: var(--primary-color);
    flex-shrink: 0;
}

.detail-panel[open] summary::after {
    content: '\2212';
}

.detail-panel summary:hover {
    background-color: var(--bg-light);
}

.detail-panel summary:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: -3px;
}

.detail-body {
    padding: 0 1.35rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.detail-body p {
    color: var(--text-light);
    line-height: 1.65;
    max-width: 68ch;
}

.emphasis-note {
    background-color: var(--bg-light);
    border-left: 3px solid var(--secondary-color);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    color: var(--text-dark) !important;
    font-weight: 500;
}

.marked-list {
    margin: 0;
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 68ch;
}

/* The professions are labels, not prose — set as chips so they scan in one pass. */
.chip-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.chip-list li {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-dark);
}

@media (prefers-reduced-motion: reduce) {
    .carousel-slide,
    .carousel-dot {
        transition: none;
    }
}
