/* 
  v4/styles.css
  Design Principles: Warm beige background, EB Garamond + Nunito Sans, large border radii, soft glassmorphism panels.
*/

:root {
    /* Colors - Warm & Natural */
    --bg-color: #F8F6F0;
    /* Soft off-white/beige */
    --surface-color: #FFFFFF;
    --surface-color-glass: rgba(255, 255, 255, 0.7);
    --text-dark: #1C1B1A;
    --text-muted: #5A5855;

    --primary-accent: #A85F12;
    /* Deeper ochre for stronger contrast */
    --primary-accent-hover: #8E4F0F;
    --primary-accent-ink: #7A430A;
    --secondary-accent: #3A4E48;
    /* Deep earthy green for grounding */

    /* Typography */
    --font-serif: 'EB Garamond', serif;
    --font-sans: 'Nunito Sans', sans-serif;
    --gh-font-heading: var(--font-serif);
    --gh-font-body: var(--font-sans);

    /* Radii - Soft geometry */
    --radius-sm: 8px;
    --radius-md: 20px;
    --radius-lg: 32px;
    --radius-xl: 48px;
    --radius-pill: 9999px;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --header-height: 96px;
    --announcement-bar-height: 0px;
    --hero-panel-max: 920px;
    --content-max: 900px;
    --content-wide: 1040px;

    /* Transitions */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-neutral {
    --bg-color: #f7f7f5;
    --surface-color: #ffffff;
    --surface-color-glass: rgba(255, 255, 255, 0.78);
    --text-dark: #1f2326;
    --text-muted: #5f666d;
}

.title-sans h1,
.title-sans h2,
.title-sans h3,
.title-sans h4 {
    --gh-font-heading: var(--font-sans);
    font-weight: 700;
}

.title-serif h1,
.title-serif h2,
.title-serif h3,
.title-serif h4 {
    --gh-font-heading: var(--font-serif);
}

.body-humanist {
    --gh-font-body: var(--font-sans);
}

.body-modern {
    --gh-font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--gh-font-body);
    background-color: var(--bg-color);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
}

.site-main {
    min-height: calc(100vh - var(--header-height));
    padding-top: calc(var(--header-height) + var(--announcement-bar-height));
}

.home-template .site-main {
    padding-top: var(--announcement-bar-height);
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Typography elements */
h1,
h2,
h3,
h4 {
    font-family: var(--gh-font-heading);
    font-weight: 400;
    line-height: 1.1;
    color: var(--text-dark);
}

em {
    font-style: italic;
}

/* ==========================================================================
   Components 
   ========================================================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-pill);
    transition: var(--transition-smooth);
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 1rem;
}

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

.btn--primary:hover {
    background-color: var(--primary-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(226, 160, 63, 0.2);
}

.btn--dark {
    background-color: var(--text-dark);
    color: #fff;
}

.btn--dark:hover {
    background-color: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn--outline {
    background-color: transparent;
    border-color: rgba(28, 27, 26, 0.1);
    color: var(--text-dark);
}

.btn--outline:hover {
    border-color: var(--text-dark);
}

.btn--outline-dark {
    border-color: var(--text-dark);
}

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

.btn--full {
    width: 100%;
}

/* Pills / Tags */
.pill-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    background-color: rgba(28, 27, 26, 0.05);
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-right: 0.5rem;
}

.pill-tag--secondary {
    background-color: rgba(226, 160, 63, 0.15);
    color: #a67022;
}

/* Glass Panels */
.glass-panel {
    background: var(--surface-color-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Layouts / Sections
   ========================================================================== */

.section-shell {
    padding-top: clamp(7rem, 10vw, 9rem);
    padding-bottom: var(--space-xl);
}

.section-shell--centered {
    text-align: center;
}

.section-shell--full {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-header--narrow,
.archive-header {
    max-width: 640px;
    margin: 0 auto var(--space-lg);
}

.page-shell {
    padding-top: clamp(8rem, 11vw, 10rem);
    padding-bottom: var(--space-xl);
    max-width: var(--content-max);
    margin: 0 auto;
}

.post-template .page-shell,
.page-template .page-shell {
    padding-top: clamp(8.5rem, 12vw, 10.75rem);
}

.entry-header {
    margin-bottom: var(--space-lg);
}

.entry-header--centered {
    text-align: center;
}

.entry-title {
    font-size: clamp(2.4rem, 5vw, 4.1rem);
    line-height: 1.05;
    margin-bottom: 1.1rem;
}

.entry-meta {
    margin-top: 1.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.entry-meta__sep {
    opacity: 0.6;
}

.entry-meta__tag {
    font-weight: 700;
}

.post-single__header .hero__subtitle {
    margin-top: 0.25rem;
    margin-bottom: 0.3rem;
    max-width: 64ch;
    margin-inline: auto;
}

.post-single__header .entry-meta {
    margin-top: 1.15rem;
}

.entry-feature {
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-lg);
}

.entry-feature--wide {
    max-width: var(--content-wide);
    margin-left: auto;
    margin-right: auto;
}

.entry-feature__img {
    width: 100%;
    height: auto;
    display: block;
}

.entry-feature__caption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.entry-content--narrow {
    max-width: var(--content-max);
    margin: 0 auto;
}

.pagination-wrap {
    margin-top: 3rem;
}

.story-highlight {
    position: relative;
    z-index: 10;
}

.section-actions {
    text-align: center;
    margin-top: 3rem;
}

.empty-state {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.06);
    text-align: center;
}

.empty-state h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.meta-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.author-avatar {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-pill);
    margin: 0 auto 1.5rem;
    object-fit: cover;
}

.author-bio,
.tag-description {
    margin-top: 1rem;
}

.error-panel {
    padding: 4rem;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.error-code {
    font-size: clamp(4rem, 8vw, 6rem);
    color: var(--primary-accent);
    margin-bottom: 1rem;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-serif);
}

.error-message {
    margin-bottom: 2.5rem;
}

.style-guide__header {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.style-guide__section {
    margin-bottom: var(--space-lg);
}

.style-guide__checklist {
    padding: 2rem;
}

.style-guide__tokens {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.style-guide__token {
    border-radius: var(--radius-md);
    padding: 1rem;
    min-height: 120px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.style-guide__token strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.style-guide__token span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.style-guide__token--bg {
    background: var(--bg-color);
}

.style-guide__token--surface {
    background: var(--surface-color);
}

.style-guide__token--accent {
    background: #f4d9ad;
    color: #2e2210;
}

.style-guide__token--secondary {
    background: #5d706a;
    color: #fff;
}

.style-guide__token--secondary span {
    color: rgba(255, 255, 255, 0.88);
}

.style-guide__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.style-guide__form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.style-guide__form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.style-guide__form-grid input,
.style-guide__form-grid select,
.style-guide__form-grid textarea {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    font: inherit;
    background: rgba(255, 255, 255, 0.88);
}

.style-guide__form-grid textarea {
    min-height: 140px;
    resize: vertical;
}

.style-guide__form-grid .style-guide__span-full {
    grid-column: 1 / -1;
}

/* Header */
.gh-announcement-bar {
    font-family: var(--font-sans) !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 140 !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

#announcement-bar-root {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 140;
    pointer-events: none;
}

#announcement-bar-root .gh-announcement-bar {
    pointer-events: auto;
}

body.has-announcement-bar .header {
    top: var(--announcement-bar-height);
}

.header {
    position: fixed;
    top: var(--announcement-bar-height);
    left: 0;
    width: 100%;
    z-index: 120;
    transition: all var(--transition-smooth);
    /* Changed to smooth */
    background-color: rgba(255, 255, 255, 0.94);
    /* fully solid bright white to guarantee contrast */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    /* slight darker border */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--header-height);
    padding: 1rem var(--space-md);
    transition: all var(--transition-smooth);
}

.header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.header.scrolled .header__inner {
    min-height: 84px;
    padding: 0.75rem var(--space-md);
}

.header__logo-img {
    height: 56px;
    width: auto;
    max-width: min(240px, 56vw);
    object-fit: contain;
    display: block;
}

.header__logo-default {
    display: inline-flex;
    align-items: center;
}

.header__logo-img--fallback {
    height: 62px;
}

.header__nav {
    display: flex;
    gap: var(--space-lg);
}

.nav__list,
.nav .nav {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.brand {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.brand--large {
    font-size: 2.5rem;
}

.nav__link,
.nav .nav a {
    font-size: 1rem;
    font-weight: 700;
    /* Bolder text for contrast */
    color: var(--text-dark);
    /* Always dark */
    transition: var(--transition-smooth);
    opacity: 0.75;
}

.nav__link:hover,
.nav__link.active,
.nav .nav a:hover,
.nav .nav-current a {
    color: var(--primary-accent);
    opacity: 1;
}

.header__actions {
    display: flex;
    gap: 1rem;
}

.nav-mobile-actions {
    display: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    background-color: var(--text-dark);
    border-radius: 999px;
    display: block;
    height: 2px;
    transition: var(--transition-smooth);
    width: 24px;
}

.hamburger {
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: "";
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 64vh;
    /* Made shorter per feedback */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: var(--space-xl);
    padding-bottom: var(--space-lg);
    overflow: hidden;
}

.hero__image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    overflow: hidden;
    z-index: -1;
    background-color: var(--primary-accent);
    /* Fallback color */
}

.hero__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Ensure no inline space below image */
}

/* Ensure overlay stays on top of image but behind content */
.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(18, 22, 20, 0.34) 0%, rgba(248, 246, 240, 0.86) 70%, rgba(248, 246, 240, 0.98) 100%);
    pointer-events: none;
}

.hero__content {
    text-align: center;
    max-width: var(--hero-panel-max);
    width: min(100%, var(--hero-panel-max));
    position: relative;
    z-index: 1;
    padding: clamp(1.65rem, 3.2vw, 2.9rem) clamp(1.45rem, 3.3vw, 2.65rem) clamp(1.7rem, 2.8vw, 2.4rem);
    border-radius: 28px;
    background: rgba(248, 246, 240, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.56);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.hero__title {
    font-size: clamp(2.25rem, 5.4vw, 4.8rem);
    margin-bottom: 1.2rem;
    letter-spacing: -0.03em;
    line-height: 1.02;
}

.hero__title-top {
    color: var(--text-dark);
}

.hero__title-bottom {
    color: var(--primary-accent-ink);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

.hero__subtitle {
    font-size: clamp(1.1rem, 1.9vw, 1.45rem);
    color: #242321;
    font-weight: 600;
    max-width: 34ch;
    margin: 0 auto 2rem;
}

/* Story/Quote Block (Replacing templatey stats) */
.story-block {
    margin-top: -2.35rem;
    /* Slight overlap */
    position: relative;
    z-index: 10;
    max-width: var(--hero-panel-max);
    width: min(100%, var(--hero-panel-max));
    padding: clamp(1.7rem, 3.25vw, 2.75rem) clamp(1.5rem, 4vw, 3.35rem);
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.story-block__quote {
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 1.65vw, 1.75rem);
    line-height: 1.42;
    color: var(--text-dark);
    margin-bottom: 1.1rem;
    font-style: italic;
    max-width: 36ch;
    margin-left: auto;
    margin-right: auto;
}

.story-block__author {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Section Shared */
.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-lg);
}

.section-title {
    font-size: clamp(2.2rem, 3.8vw, 3.2rem);
    margin-bottom: 1rem;
}

.section-desc {
    font-size: 1.125rem;
    color: var(--text-muted);
}

.services {
    padding: var(--space-xl) 0;
}

.home-template .services {
    padding: clamp(3.25rem, 5.6vw, 4.75rem) 0;
}

.home-template .section-header {
    margin-bottom: clamp(1.75rem, 3.6vw, 2.75rem);
}

.home-template .section-actions {
    margin-top: 2rem;
}

/* Cards System */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.card {
    display: block;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.06);
}

.card__image {
    aspect-ratio: 3/2;
    overflow: hidden;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.card:hover .card__image img {
    transform: scale(1.03);
}

.card__content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card__title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.card__text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card__link {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-accent);
}

.card__link .arrow {
    transition: var(--transition-smooth);
}

.card:hover .arrow {
    transform: translateX(4px);
}

#stories .card {
    flex-direction: column-reverse;
}

#stories .card__content {
    padding: 1.3rem 1.35rem 1.1rem;
}

/* Feature Mission (Split Layout) */
.feature-mission {
    padding: var(--space-xl) 0;
    background-color: var(--surface-color);
}

.home-template .feature-mission {
    padding: clamp(3.75rem, 6.25vw, 5.25rem) 0;
}

.feature-mission__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
}

.feature-mission__text h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1.5rem;
}

.feature-mission__text p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 500px;
}

.image-stack {
    position: relative;
}

.img-main {
    border-radius: var(--radius-xl);
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
}

/* Donate Section */
.donate-section {
    padding: var(--space-xl) 0;
}

.home-template .donate-section {
    padding: clamp(3.25rem, 5.8vw, 4.75rem) 0;
}

.donate-section--standalone {
    padding-top: var(--space-lg);
}

.donate-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem;
    background: linear-gradient(135deg, #F9F2E6 0%, #F5ECDD 100%);
    border: none;
}

.donate-card__text h2 {
    font-size: clamp(1.9rem, 4.1vw, 3rem);
    margin-bottom: 1rem;
}

.donate-card__text p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.donate-card--standalone {
    padding: 3rem;
}

.preset-amounts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.amount-btn {
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.amount-btn:hover,
.amount-btn.active {
    background: var(--text-dark);
    color: #fff;
    border-color: var(--text-dark);
}

.tax-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

/* Newsletter Section */
.newsletter-section {
    padding-bottom: var(--space-xl);
}

.home-template .newsletter-section {
    padding-bottom: clamp(3.25rem, 5.8vw, 4.75rem);
}

.newsletter-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem;
    background: var(--surface-color);
}

.newsletter-box--standalone {
    margin-top: 1.5rem;
}

.newsletter-box__info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

.newsletter-form--stacked {
    max-width: 520px;
    flex-wrap: wrap;
}

.newsletter-form--stacked .input-light {
    min-width: 240px;
}

.newsletter-form--stacked .success-message,
.newsletter-form--stacked .error-message {
    width: 100%;
}

.newsletter-form .success-message,
.newsletter-form .error-message {
    display: none;
    font-size: 0.85rem;
}

.newsletter-form.success .success-message {
    color: #2c6f52;
    display: block;
}

.newsletter-form.error .error-message {
    color: #8b2f2f;
    display: block;
}

.input-light {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #F8F6F0;
    font-family: var(--font-sans);
    outline: none;
}

.input-light:focus {
    border-color: var(--text-dark);
}

/* Footer */
.footer {
    background-color: var(--text-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-xl) 0 var(--space-md);
}

.footer .brand {
    color: #fff;
}

.footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer__brand p {
    margin-top: 1rem;
    max-width: 36ch;
}

.footer__logo-link {
    display: inline-flex;
    align-items: center;
}

.footer__logo-img {
    height: 64px;
    width: auto;
    max-width: 260px;
    object-fit: contain;
}

.footer__logo-img--fallback {
    height: 68px;
}

.footer__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.footer__col h4 {
    color: #fff;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer__col ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer__col .nav__list,
.footer__col .nav {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.footer__col .nav__link,
.footer__col .nav a {
    color: rgba(255, 255, 255, 0.8);
    opacity: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.footer__col a {
    transition: var(--transition-smooth);
}

.footer__col a:hover,
.footer__col .nav-current a,
.footer__col .nav__link.active {
    color: #fff;
    transform: translateX(2px);
    display: inline-block;
}

.footer__bottom {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    font-size: 0.85rem;
}

/* Simple Reveal Animation */
.fade-up {
    opacity: 1;
    transform: none;
}

.has-js .fade-up {
    opacity: 1;
    transform: translateY(14px);
    transition: transform 0.55s ease-out;
}

.has-js .fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    .impact__grid {
        gap: 1rem;
    }
}

@media (max-width: 900px) {
    :root {
        --header-height: 80px;
    }

    .header__actions {
        display: none;
    }

    .nav-toggle {
        display: block;
        z-index: 120;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--surface-color);
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        padding: 1rem var(--space-md) 1.25rem;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    }

    .nav.is-open {
        display: block;
    }

    .nav .nav {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 0.25rem;
    }

    .nav .nav a {
        display: block;
        padding: 0.4rem 0;
        opacity: 1;
    }

    .nav-mobile-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .nav-mobile-actions .btn {
        width: 100%;
        padding: 0.65rem 0.75rem;
    }

    .header__logo-img {
        height: 48px;
        max-width: min(200px, 54vw);
    }

    .header__logo-img--fallback {
        height: 52px;
    }

    .impact__grid {
        grid-template-columns: 1fr;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-mission__inner {
        grid-template-columns: 1fr;
    }

    .donate-card {
        grid-template-columns: 1fr;
        padding: 2rem;
    }

    .newsletter-box {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .footer__inner {
        grid-template-columns: 1fr;
    }

    .footer__logo-img {
        height: 56px;
    }

    .footer__logo-img--fallback {
        height: 60px;
    }

    .footer__links {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .style-guide__form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-shell {
        padding-top: 6rem;
    }

    .entry-title {
        font-size: clamp(2rem, 8.5vw, 3rem);
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .footer__links {
        grid-template-columns: 1fr;
    }

    .preset-amounts {
        grid-template-columns: repeat(2, 1fr);
    }

    .style-guide__tokens {
        grid-template-columns: 1fr;
    }

    .entry-meta {
        gap: 0.35rem;
    }

    .error-panel {
        padding: 2.25rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .has-js .fade-up {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Ghost Post/Page Content Overrides
   ========================================================================== */
.post-single__content,
.page-single__content {
    max-width: var(--content-max);
    margin: 0 auto;
}

.post-single__content h2,
.page-single__content h2 {
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
}

.post-single__content h3,
.page-single__content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.post-single__content p,
.page-single__content p {
    margin-bottom: 1.5rem;
}

.post-single__content img,
.page-single__content img,
.entry-content img {
    max-width: 100%;
    height: auto !important;
}

.post-single__content ul,
.page-single__content ul {
    list-style: disc;
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.post-single__content ol,
.page-single__content ol {
    list-style: decimal;
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.entry-content ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.entry-content ol {
    list-style: decimal;
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-single__content blockquote,
.page-single__content blockquote {
    border-left: 4px solid var(--primary-accent);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.post-single__content table,
.page-single__content table,
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0 2rem;
    font-size: 0.98rem;
}

.post-single__content th,
.post-single__content td,
.page-single__content th,
.page-single__content td,
.entry-content th,
.entry-content td {
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 0.75rem 0.9rem;
    text-align: left;
}

.post-single__content pre,
.page-single__content pre,
.entry-content pre {
    background: #151617;
    color: #f5f5f5;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.25rem 0 2rem;
}

.post-single__content details,
.page-single__content details,
.entry-content details {
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin: 1rem 0 2rem;
    background: rgba(255, 255, 255, 0.5);
}

.post-single__content summary,
.page-single__content summary,
.entry-content summary {
    cursor: pointer;
    font-weight: 700;
}

.kg-image-card img {
    width: 100%;
    max-width: 100%;
    height: auto !important;
    object-fit: contain;
    border-radius: var(--radius-md);
    margin: 2rem auto;
}

/* --------------------------------------------------------------------------
   Ghost Koenig Styles (kg-* classes)
   -------------------------------------------------------------------------- */
.kg-width-wide {
    max-width: 1040px;
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 1040px;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 12px;
}

.kg-embed-card iframe {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius-md);
}

.kg-embed-card iframe[src*="openstreetmap"] {
    aspect-ratio: 16 / 10;
}

/* Support raw iframe embeds from Ghost HTML cards (no kg-embed wrapper). */
.entry-content > iframe,
.page-single__content > iframe,
.post-single__content > iframe {
    display: block;
    width: 100% !important;
    max-width: 100%;
    min-height: 320px;
    height: auto;
    border: 0;
    border-radius: var(--radius-md);
    background: #fff;
    margin: 1rem auto 2rem;
}

/* Common pasted pattern for form embeds; 100% height collapses without an explicit viewport height. */
.entry-content > iframe[height="100%"],
.page-single__content > iframe[height="100%"],
.post-single__content > iframe[height="100%"] {
    height: clamp(580px, 78vh, 980px);
}

.kg-callout-card {
    border-left: 4px solid var(--primary-accent);
    background: rgba(226, 160, 63, 0.1);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin: 1rem 0 2rem;
}

.kg-button-card {
    margin: 1rem 0 2rem;
    text-align: center;
}

.kg-button-card .kg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    padding: 0.75rem 1.4rem;
    font-weight: 700;
    background: var(--secondary-accent);
    color: #fff;
}

.kg-toggle-card {
    margin: 1rem 0 2rem;
}

.kg-file-card {
    margin: 1rem 0 2rem;
}

.kg-file-card-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    border-radius: 14px;
    padding: 0.9rem 1rem;
}

.kg-file-card-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(58, 78, 72, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.kg-file-card-title {
    font-weight: 700;
}

.kg-file-card-caption {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.kg-video-card video {
    width: 100%;
    border-radius: var(--radius-md);
    background: #0f0f0f;
}

.kg-bookmark-card {
    width: 100%;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: var(--text-dark);
}

.kg-bookmark-content {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex: 1;
}

.kg-bookmark-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.kg-bookmark-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.4;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.kg-bookmark-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-pill);
}

.kg-bookmark-author {
    color: var(--text-muted);
}

.kg-bookmark-publisher {
    font-weight: 500;
}

.kg-bookmark-thumbnail {
    flex: 1;
    min-width: 30%;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.kg-width-full img,
.kg-width-wide img {
    width: 100%;
    height: auto;
}
