:root {
    --dark: #0e352b;
    --dark-2: #08251f;
    --green: #286b4d;
    --green-2: #3d8b64;
    --cream: #f8f2e7;
    --paper: #fffdf8;
    --orange: #ff6b2c;
    --gold: #f6a21a;
    --text: #1c2d28;
    --muted: #64766f;
    --line: #e7dece;
    --shadow: 0 22px 50px rgba(14, 53, 43, 0.12);
    --radius: 18px;
    --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    line-height: 1.65;
    color: var(--text);
    background: radial-gradient(circle at 0 0, rgba(61,139,100,.22), transparent 32rem), linear-gradient(180deg, #eff8f3 0, var(--cream) 34rem, #fff 100%);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: linear-gradient(120deg, transparent 0 42%, rgba(255,107,44,.06) 42% 44%, transparent 44%), linear-gradient(60deg, transparent 0 55%, rgba(40,107,77,.07) 55% 57%, transparent 57%);
    background-size: 240px 240px;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { color: var(--muted); }
ul { padding-left: 1.2rem; color: var(--muted); }
li + li { margin-top: .45rem; }
strong { color: var(--dark); }

.skip-link {
    position: absolute;
    left: 1rem;
    top: -5rem;
    z-index: 50;
    padding: .8rem 1rem;
    border-radius: 999px;
    background: var(--orange);
    color: #fff;
    font-weight: 800;
    transition: top .2s ease;
}
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header {
    width: min(var(--max), calc(100% - 32px));
    margin: 24px auto 0;
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
    background: rgba(255,253,248,.96);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
}
.topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .55rem 1.4rem;
    background: var(--dark-2);
    color: #f7efe1;
    font-size: .82rem;
}
.topline p, .topline a { color: #f7efe1; text-decoration: none; }
.nav-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    color: var(--dark);
    text-decoration: none;
    line-height: 1;
}
.brand strong { display: block; font-size: clamp(1.25rem, 3vw, 1.8rem); letter-spacing: -.03em; }
.brand small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 50% 50% 50% 12%;
    background: linear-gradient(135deg, var(--orange), var(--gold));
    transform: rotate(-10deg);
}
.brand-mark svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: #fff; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.primary-nav a {
    color: var(--dark);
    text-decoration: none;
    font-size: .94rem;
    font-weight: 800;
    padding: .62rem .8rem;
    border-radius: .6rem;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--orange); background: #fff3e6; }
.primary-nav a[href="donate.html"] { color: #fff; background: var(--orange); box-shadow: 0 10px 20px rgba(255,107,44,.22); }
.primary-nav a[href="donate.html"]:hover, .primary-nav a[href="donate.html"][aria-current="page"] { background: #e9571b; color: #fff; }
.nav-toggle {
    display: none;
    width: 2.8rem;
    height: 2.8rem;
    border: 1px solid var(--line);
    border-radius: .7rem;
    background: #fff;
    color: var(--dark);
}
.nav-toggle svg { width: 1.5rem; margin: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

main {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 70px;
}
.section-pad {
    margin-bottom: 34px;
    padding: clamp(24px, 5vw, 48px);
    border: 1px solid rgba(232,223,208,.84);
    border-radius: var(--radius);
    background: rgba(255,253,248,.95);
    box-shadow: 0 14px 34px rgba(14,53,43,.08);
}
.section-heading { max-width: 740px; margin-bottom: 1.6rem; }
.section-heading.center { margin-inline: auto; text-align: center; }
.eyebrow {
    display: block;
    margin-bottom: .75rem;
    color: var(--gold);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
h1, h2, h3 { color: var(--dark); line-height: 1.12; }
h1 { font-size: clamp(2.15rem, 6vw, 4.7rem); letter-spacing: -.05em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.65rem); letter-spacing: -.035em; margin-bottom: 1rem; }
h3 { font-size: 1.15rem; margin-bottom: .55rem; }
.button, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: .55rem;
    padding: .8rem 1.15rem;
    background: var(--orange);
    color: #fff;
    font: inherit;
    font-size: .88rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 22px rgba(255,107,44,.24);
    transition: transform .2s ease, background .2s ease;
}
.button:hover, button[type="submit"]:hover { background: #e9571b; transform: translateY(-2px); }
.button.secondary { background: var(--dark); box-shadow: none; }

.hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(280px, 1.08fr);
    align-items: stretch;
    min-height: 460px;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: var(--dark);
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(14,53,43,.98) 0%, rgba(14,53,43,.82) 42%, rgba(14,53,43,.08) 78%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; align-self: center; padding: clamp(32px, 7vw, 72px); }
.hero h1 { max-width: 640px; color: #fff; }
.hero p { max-width: 560px; color: #d7e2dc; margin: 1rem 0 1.6rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-media, .hero-media picture, .hero-media img { height: 100%; min-height: 360px; }
.hero-media img { width: 100%; object-fit: cover; }

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .78fr);
    gap: clamp(22px, 5vw, 54px);
    align-items: center;
    background: linear-gradient(135deg, rgba(14,53,43,.97), rgba(40,107,77,.92));
    overflow: hidden;
}
.page-hero h1, .page-hero p { color: #fff; }
.page-hero p { max-width: 660px; color: #dce8e2; margin-top: 1rem; }
.page-hero-image img, .page-hero-image { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 1rem; }

.impact-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-top: -34px;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--cream);
    overflow: hidden;
}
.impact-strip article {
    padding: 1.2rem;
    min-height: 116px;
    border-right: 1px solid var(--line);
}
.impact-strip article:last-child { border-right: 0; }
.impact-strip h2 { font-size: 1.05rem; margin: .6rem 0 .2rem; }
.impact-strip p { font-size: .92rem; }
.mini-icon { display: inline-grid; place-items: center; width: 2.55rem; height: 2.55rem; border-radius: 50%; color: var(--orange); background: #fff6e8; }
.mini-icon svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.intro-grid, .two-col, .contact-grid, .form-section, .learning-corner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
    gap: clamp(24px, 5vw, 54px);
    align-items: center;
}
.intro-grid picture img, .image-stack img { width: 100%; border-radius: 1rem; object-fit: cover; aspect-ratio: 4 / 3; }
.image-stack { position: relative; }
.floating-card {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    max-width: 190px;
    padding: 1rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: var(--shadow);
}
.floating-card strong { display: block; color: var(--orange); font-size: 2rem; line-height: 1; }
.floating-card span { color: var(--muted); font-weight: 800; }
.check-list { list-style: none; padding: 0; margin: 1.2rem 0; }
.check-list li { position: relative; padding-left: 1.7rem; }
.check-list li::before { content: ""; position: absolute; left: 0; top: .4rem; width: .9rem; height: .9rem; border-radius: 50%; background: linear-gradient(135deg, var(--orange), var(--gold)); }

.stats-grid, .steps-grid, .value-grid, .card-grid.three, .projects-container, .gallery-grid, .donation-options {
    display: grid;
    gap: 1.25rem;
}
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.steps-grid, .card-grid.three, .projects-container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.value-grid, .contact-grid, .donation-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
article, .mission-card, .stat-card, .steps-grid article, .timeline article, .donation-options button, .contact-grid article, .gallery-item {
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 12px 24px rgba(14,53,43,.08);
}
.stat-card, .steps-grid article, .value-grid article, .mission-card, .contact-grid article, .timeline article { padding: 1.25rem; }
.stat-card { position: relative; overflow: hidden; }
.stat-card::before, .steps-grid article::before, .timeline article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--orange), var(--gold)); }
.stat-card strong { display: block; margin-bottom: .5rem; color: var(--orange); font-size: clamp(2rem, 5vw, 3rem); line-height: 1; }
.stat-card span { display: block; color: var(--muted); font-weight: 800; }
.steps-grid article { position: relative; overflow: hidden; }
.steps-grid span { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-bottom: 1rem; border-radius: 50%; background: #fff3e6; color: var(--orange); font-weight: 900; }
.feature-card, .project-card { overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.feature-card:hover, .project-card:hover, .gallery-item:hover { transform: translateY(-6px); box-shadow: 0 18px 34px rgba(14,53,43,.14); }
.feature-card picture img, .project-card picture img { width: 100%; height: 220px; object-fit: cover; }
.feature-card > div, .project-card > div { padding: 1.2rem; }
.feature-card a { display: inline-block; margin-top: .8rem; color: var(--orange); font-weight: 900; text-decoration: none; }
.cta-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding: 1.7rem;
    border-radius: 1rem;
    background: linear-gradient(rgba(14,53,43,.84), rgba(14,53,43,.9)), url("../images/webp/2026_06_28_19_15_IMG_1023.webp") center/cover;
}
.cta-card h3 { color: #fff; font-size: 1.7rem; }
.cta-card p { color: #e8f0ec; margin: .5rem 0 1.1rem; }
.learning-corner { align-items: start; background: linear-gradient(135deg, #fffdf8, #eff8f3); }
.tip-list { display: grid; gap: 1rem; }
.tip-list article { padding: 1.2rem; }
.process { background: rgba(255,253,248,.95); }
.split-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: center;
    background: linear-gradient(135deg, rgba(14,53,43,.96), rgba(40,107,77,.9)), url("../images/webp/2026_06_28_19_11_IMG_1017.webp") center/cover;
}
.split-cta h2, .split-cta p { color: #fff; }
.split-cta p { color: #dce8e2; max-width: 760px; }
.mission-card h3 + p { margin-bottom: 1rem; }
.timeline { display: grid; gap: 1rem; }
.timeline article { position: relative; padding-left: 1.6rem; overflow: hidden; }
.tag { display: inline-flex; margin-bottom: .7rem; padding: .25rem .55rem; border-radius: 999px; background: #fff3e6; color: var(--orange); font-size: .75rem; font-weight: 900; }
dl { margin-top: 1rem; display: grid; gap: .6rem; }
dl div { display: grid; grid-template-columns: 78px 1fr; gap: .7rem; }
dt { color: var(--dark); font-weight: 900; }
dd { color: var(--muted); }
.filter-bar { display: flex; gap: .65rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.filter-btn, .donation-options button {
    cursor: pointer;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--dark);
    font: inherit;
}
.filter-btn { padding: .65rem 1rem; border-radius: 999px; font-weight: 900; }
.filter-btn.active, .filter-btn:hover, .donation-options button.selected { border-color: var(--orange); color: #fff; background: var(--orange); }
.gallery-item { position: relative; overflow: hidden; color: #fff; text-decoration: none; }
.gallery-item img { width: 100%; height: 230px; object-fit: cover; transition: transform .35s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item span { position: absolute; inset: auto .8rem .8rem; padding: .45rem .65rem; border-radius: 999px; background: rgba(8,37,31,.82); font-weight: 900; font-size: .85rem; }
.donation-options button { text-align: left; padding: 1.2rem; border-radius: 1rem; box-shadow: 0 12px 24px rgba(14,53,43,.08); transition: transform .2s ease, background .2s ease, color .2s ease; }
.donation-options button:hover { transform: translateY(-4px); }
.donation-options strong { display: block; font-size: 1.4rem; color: inherit; }
.donation-options span { color: inherit; opacity: .8; }
.form-section { align-items: start; }
.smart-form { display: grid; gap: .75rem; }
label { color: var(--dark); font-weight: 900; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: .65rem;
    padding: .85rem 1rem;
    background: #fff;
    color: var(--text);
    font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(255,107,44,.2); border-color: var(--orange); }
.smart-form.has-error input:invalid, .smart-form.has-error textarea:invalid { border-color: #c73516; }
.form-note { min-height: 1.5rem; font-weight: 800; color: var(--green); }
.faq { max-width: 900px; margin-inline: auto; }
details { border: 1px solid var(--line); border-radius: 1rem; background: #fff; padding: 1rem 1.2rem; }
details + details { margin-top: .8rem; }
summary { cursor: pointer; color: var(--dark); font-weight: 900; }
details p { margin-top: .7rem; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    border: 0;
    border-radius: 999px;
    padding: .75rem 1rem;
    background: var(--dark);
    color: #fff;
    font-weight: 900;
    box-shadow: var(--shadow);
    transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px); }

.site-footer {
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto 28px;
    display: grid;
    grid-template-columns: 1.4fr .8fr .8fr;
    gap: 1.8rem;
    padding: clamp(24px, 5vw, 44px);
    border-radius: var(--radius);
    background: var(--dark-2);
    color: #fff;
}
.site-footer p, .site-footer a, .site-footer small { color: #d7e2dc; }
.site-footer a { display: block; text-decoration: none; margin-top: .4rem; }
.site-footer h2 { color: #fff; font-size: 1rem; margin-bottom: .7rem; }
.footer-brand { margin-bottom: 1rem; }
.footer-brand strong { color: #fff; }
.copyright { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 1rem; color: #d7e2dc; }

@media (max-width: 980px) {
    .nav-toggle { display: grid; }
    .primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        background: rgba(255,253,248,.98);
        border-top: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
    .primary-nav.is-open { display: flex; }
    .primary-nav a { width: 100%; }
    .hero, .page-hero, .intro-grid, .two-col, .form-section, .learning-corner, .split-cta { grid-template-columns: 1fr; }
    .hero::after { background: linear-gradient(180deg, rgba(14,53,43,.98) 0%, rgba(14,53,43,.74) 52%, rgba(14,53,43,.18) 100%); }
    .hero-media { order: -1; max-height: 420px; }
    .impact-strip, .stats-grid, .steps-grid, .card-grid.three, .projects-container, .gallery-grid, .value-grid, .contact-grid, .donation-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-cta { align-items: start; }
    .site-footer { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .topline { flex-direction: column; gap: .25rem; }
    .nav-shell { padding: .9rem 1rem; }
    main, .site-header, .site-footer { width: min(100% - 20px, var(--max)); }
    main { padding-top: 20px; }
    .section-pad { padding: 1.25rem; margin-bottom: 20px; }
    .impact-strip, .stats-grid, .steps-grid, .card-grid.three, .projects-container, .gallery-grid, .value-grid, .contact-grid, .donation-options { grid-template-columns: 1fr; }
    .hero-content { padding: 1.5rem; }
    .hero-media, .hero-media picture, .hero-media img { min-height: 280px; }
    .floating-card { position: static; margin-top: 1rem; }
    dl div { grid-template-columns: 1fr; gap: .1rem; }
    .site-footer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
    .reveal { opacity: 1; transform: none; }
}


/* Team and complete project image archive */
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
.team-card { overflow: hidden; }
.team-card > div:last-child { padding: 1.2rem; }
.team-card strong { display: block; margin: .4rem 0 .65rem; color: var(--orange); }
.team-avatar { display: grid; place-items: center; min-height: 180px; background: linear-gradient(135deg, var(--dark), var(--green)); color: #fff; font-size: 2.3rem; font-weight: 900; letter-spacing: .08em; }
.team-photo { width: 100%; height: 240px; display: block; object-fit: cover; background: linear-gradient(135deg, #eef7f2, #fff4e7); }
.project-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.project-photo-item { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 1rem; background: #fff; box-shadow: 0 12px 24px rgba(14,53,43,.08); }
.project-photo-item img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .3s ease; }
.project-photo-item:hover img { transform: scale(1.04); }
.project-photo-item figcaption { padding: .85rem 1rem 1rem; color: var(--dark); font-weight: 800; }
@media (max-width: 980px) { .team-grid, .project-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .team-grid, .project-photo-grid { grid-template-columns: 1fr; } }

/* Mobile navigation reliability fix */
@media (max-width: 980px) {
    .site-header {
        overflow: visible;
    }

    .nav-shell {
        position: relative;
    }

    .nav-toggle {
        position: relative;
        z-index: 32;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .primary-nav {
        top: calc(100% + 1px);
        z-index: 30;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    body.nav-open {
        overflow: hidden;
    }
}

/* Form submission feedback */
.form-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}
.form-note {
    display: none;
    margin: .9rem 0 0;
    padding: .9rem 1rem;
    border-radius: .8rem;
    font-weight: 750;
    line-height: 1.55;
}
.form-note:not(:empty) { display: block; }
.form-note.is-success {
    color: #0e4a37;
    background: #e8f6ee;
    border: 1px solid #a9d9bd;
}
.form-note.is-error {
    color: #7d221b;
    background: #fff0ed;
    border: 1px solid #efb4aa;
}
.smart-form button[disabled] {
    cursor: wait;
    opacity: .72;
}


/* Deployment-safe mobile menu and team image corrections */
.team-card { border-radius: 1rem; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 24px rgba(14,53,43,.08); }
.team-card .team-photo {
    width: 100% !important;
    height: 280px !important;
    max-height: 280px !important;
    aspect-ratio: 4 / 3;
    display: block !important;
    object-fit: cover !important;
    object-position: center 22%;
}
.team-card:nth-child(2) .team-photo { object-position: center 38%; }
.team-card:nth-child(3) .team-photo { object-position: center 35%; }
.team-card:nth-child(4) .team-photo { object-position: center 20%; }

@media (max-width: 980px) {
    .site-header { overflow: visible !important; isolation: isolate; }
    .nav-shell { position: relative !important; }
    .primary-nav {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 9999 !important;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: .3rem !important;
        padding: .85rem !important;
        background: #fffdf8 !important;
        border: 1px solid var(--line) !important;
        border-top: 0 !important;
        border-radius: 0 0 1rem 1rem !important;
        box-shadow: 0 18px 36px rgba(14,53,43,.18) !important;
        max-height: calc(100dvh - 150px) !important;
        overflow-y: auto !important;
    }
    .primary-nav.is-open { display: flex !important; }
    .primary-nav a { display: block !important; width: 100% !important; }
    .nav-toggle { display: grid !important; position: relative !important; z-index: 10000 !important; }
}
@media (max-width: 640px) {
    .team-card .team-photo { height: 300px !important; max-height: 300px !important; aspect-ratio: auto; }
}


/* Hosting corrections: footer contact alignment and gallery viewer */
.site-footer .footer-contact-line {
    display: flex;
    align-items: baseline;
    gap: .35rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.site-footer .footer-contact-line span { flex: 0 0 auto; }
.site-footer .footer-contact-line a {
    display: inline !important;
    margin: 0 !important;
    color: inherit;
    text-decoration: none;
    overflow-wrap: normal;
    word-break: normal;
}
.gallery-item img {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: cover;
    background: #eef3f0;
}
.gallery-lightbox[hidden] { display: none !important; }
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(3, 20, 16, .92);
}
.gallery-lightbox img {
    display: block;
    max-width: min(1100px, 94vw);
    max-height: 82dvh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.38);
}
.gallery-lightbox-caption { color: #fff; margin: .75rem 0 0; text-align: center; font-weight: 700; }
.gallery-lightbox-close {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #0b3d31;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
body.lightbox-open { overflow: hidden; }
@media (max-width: 420px) {
    .site-footer .footer-contact-line { font-size: .92rem; gap: .25rem; }
    .gallery-item img { height: 240px; }
}

/* Mobile project archive visibility fix
   Mobile Safari can delay or skip IntersectionObserver callbacks for large,
   lazy-loaded sections. Do not hide content behind reveal animation on phones. */
@media (max-width: 980px) {
    .reveal,
    .reveal.is-visible {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
    }

    #project-photo-archive {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    #project-photo-archive .project-photo-grid {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }

    #project-photo-archive .project-photo-item {
        display: block !important;
        min-width: 0 !important;
    }

    #project-photo-archive .project-photo-item img {
        display: block !important;
        width: 100% !important;
        height: 210px !important;
        object-fit: cover !important;
    }
}

@media (max-width: 640px) {
    #project-photo-archive .project-photo-grid {
        grid-template-columns: 1fr !important;
    }

    #project-photo-archive .project-photo-item img {
        height: 240px !important;
    }
}
