/* =========================================================================
   Aid Via Action — Squarespace-faithful design system
   Palette: cream #F4F6EA + pure black #000. No accent color; color comes
   only from photography. Fonts: Newsreader (headings 400) + PT Serif (body).
   ========================================================================= */

/* ----------------------------------------------------------------- TOKENS */
:root {
    --paper:   #F4F6EA;   /* cream page background */
    --ink:     #000000;   /* all text, headings, links, buttons */
    --white:   #ffffff;
    --line:    #000000;   /* borders are black */
    --error:   #8a1c13;   /* muted brick red, only for form errors */

    --serif-display: 'Newsreader', Georgia, 'Times New Roman', serif;
    --serif-body:    'PT Serif', Georgia, 'Times New Roman', serif;

    --maxw: 1080px;
    --maxw-wide: 1240px;
    --gutter: 24px;

    /* vertical rhythm — airy, editorial */
    --section-y: 96px;
}

/* ----------------------------------------------------------------- RESET */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--serif-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; border-radius: 0; }

/* ------------------------------------------------------------ TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--serif-display);
    font-weight: 400;
    color: var(--ink);
    margin: 0 0 0.4em;
    line-height: 1.06;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(38px, 6vw, 68px); }
h2 { font-size: clamp(30px, 4.4vw, 47px); }
h3 { font-size: clamp(22px, 2.4vw, 30px); }
h4 { font-size: 20px; letter-spacing: -0.01em; }

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 700; }
em, i { font-style: italic; }

.lead {
    font-size: 19px;
    line-height: 1.6;
}

.muted { color: var(--ink); opacity: 0.72; }
.small { font-size: 14px; }
.center { text-align: center; }

/* -------------------------------------------------------------- LAYOUT */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}
.container.wide { max-width: var(--maxw-wide); }
.container.narrow { max-width: 760px; }

.section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.section--tight { padding-top: 56px; padding-bottom: 56px; }

.section-head { margin-bottom: 48px; }
.section-head h2 { margin-bottom: 16px; }
.section-head p { font-size: 18px; max-width: 620px; }
.section-head.center { text-align: center; }
.section-head.center p { margin-left: auto; margin-right: auto; }

.page-title { margin-bottom: 24px; }

/* --------------------------------------------------------------- BUTTONS */
/* Square, black fill, white text. Content buttons carry a 4px WHITE border
   which reads as a cream "ring" on the page. Header CTA uses a black border. */
.btn {
    display: inline-block;
    font-family: var(--serif-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.2;
    text-align: center;
    text-transform: none;
    letter-spacing: 0;
    background: var(--ink);
    color: var(--white);
    border: 4px solid var(--white);
    border-radius: 0;
    padding: 15px 30px;
    cursor: pointer;
    transition: opacity .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { opacity: .82; text-decoration: none; color: var(--white); }

/* Header Donate CTA — black border, no cream ring. */
.btn--cta {
    border-color: var(--ink);
    padding: 12px 26px;
}

.btn--sm { padding: 10px 18px; font-size: 14px; }
.btn--block { display: block; width: 100%; }

/* Plain text/arrow link */
.btn-text {
    display: inline-block;
    font-family: var(--serif-body);
    font-size: 17px;
    color: var(--ink);
    border-bottom: 1px solid var(--ink);
    padding-bottom: 2px;
}
.btn-text:hover { text-decoration: none; opacity: .7; }

/* =========================================================================
   HEADER — logo left, primary nav (wraps to two rows) centered, three CTAs
   (Symposium / AvaGH Journal / Donate) at the right. Not sticky (normal flow).
   Widths tuned so the 8-item nav naturally wraps after "Donors" at ~1440px,
   matching the real Squarespace header.
   ========================================================================= */
.site-header {
    background: var(--paper);
    padding: 22px 0;
    position: relative;
    z-index: 50;
}
/* Header spans a wider column than body content so the wrapped nav + 3 CTAs
   sit comfortably (real site uses the full 1440 grid). */
.site-header .header-inner { max-width: 1400px; }
.header-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    position: relative;
}
.brand-logo { display: block; flex: 0 0 auto; }
.brand-logo img { width: 200px; max-width: 40vw; height: auto; }

/* Nav takes the middle; fixed basis forces a clean two-row wrap like the real
   site (row 1: Home…Donors, row 2: Sponsors…AVA Events). */
.primary-nav { flex: 1 1 420px; }
.primary-nav ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    width: 420px;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    row-gap: 8px;
    column-gap: 28px;
}
.primary-nav a {
    font-family: var(--serif-body);
    font-size: 16px;
    color: var(--ink);
    padding: 2px 0;
    white-space: nowrap;
}
.primary-nav a:hover,
.primary-nav a.active { text-decoration: underline; }

/* Three CTAs sit in a row at the right end of the header */
.header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-cta { flex: 0 0 auto; white-space: nowrap; }

/* Hamburger — hidden on desktop */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    padding: 6px;
}

/* Full-screen cream overlay menu (mobile) */
.mobile-nav {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--paper);
    z-index: 100;
    padding: 80px 24px 40px;
    text-align: center;
    overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav-close {
    position: absolute;
    top: 22px;
    right: 24px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
}
.mobile-nav ul {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
}
.mobile-nav li { margin: 0; }
.mobile-nav ul a {
    display: block;
    font-family: var(--serif-display);
    font-size: 28px;
    letter-spacing: -0.02em;
    padding: 14px 0;
    color: var(--ink);
}
.mobile-nav-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.mobile-nav-actions .btn { min-width: 200px; }

/* =========================================================================
   HOME — HERO (full-bleed photo)
   ========================================================================= */
/* Full-bleed cropped hero band. Real site is ~765px tall at 1440px wide
   (≈53% of width), a fixed-height crop — NOT the photo's natural ratio. */
.home-hero {
    width: 100%;
    height: 53.1vw;
    max-height: 765px;
    min-height: 420px;
    overflow: hidden;
}
.home-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* --------------------------------- Intro: text + flag image, two columns */
.intro-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 56px;
    align-items: start;
}
.intro-grid h1 { margin-bottom: 28px; }
.intro-grid p { font-size: 17px; line-height: 1.62; }
.intro-figure img { width: 100%; }

.intro-ethics {
    margin-top: 40px;
    max-width: 820px;
    font-size: 17px;
    line-height: 1.62;
}

/* --------------------------------- What We Do band */
.whatwedo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
}
.whatwedo-copy h2 { margin-bottom: 22px; }
.whatwedo-copy p { font-size: 17px; line-height: 1.62; }

/* =========================================================================
   BLACK-OUTLINED LINK BOXES (Introduction / Operations / Research …)
   ========================================================================= */
.link-boxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 40px;
}
.link-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--ink);
    border-radius: 0;
    padding: 20px 24px;
    font-family: var(--serif-body);
    font-size: 18px;
    color: var(--ink);
    background: transparent;
    transition: background .18s ease, color .18s ease;
}
.link-box::after { content: '\203A'; font-size: 22px; line-height: 1; }
.link-box:hover {
    background: var(--ink);
    color: var(--white);
    text-decoration: none;
}

/* =========================================================================
   PHOTO GALLERY GRID
   ========================================================================= */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
.photo-grid--feature {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 620px;
    margin: 0 auto 28px;
}

/* =========================================================================
   NEWSLETTER SIGNUP BLOCK
   ========================================================================= */
.newsletter {
    text-align: center;
    padding-top: 72px;
    padding-bottom: 72px;
}
.newsletter h2 { margin-bottom: 14px; }
.newsletter p { font-size: 17px; margin-bottom: 26px; }
.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 520px;
    margin: 0 auto;
    flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
    flex: 1 1 260px;
    min-width: 200px;
    font-family: var(--serif-body);
    font-size: 16px;
    padding: 14px 16px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--white);
    color: var(--ink);
}
.newsletter-form input[type="email"]:focus {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}

/* =========================================================================
   GENERIC CARD GRIDS (team, sponsors, blogs, events) — Phase 2 uses these
   ========================================================================= */
.card-grid {
    display: grid;
    gap: 44px 32px;
}
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }

.team-card { text-align: center; }
.team-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    margin-bottom: 18px;
}
.team-card h3 { font-size: 24px; margin-bottom: 4px; }
.team-card .role { font-size: 15px; margin-bottom: 16px; }

.sponsor-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    border: 1px solid var(--ink);
    min-height: 180px;
}
.sponsor-card img { max-height: 130px; width: auto; }

/* Simple bulleted lists in editorial style */
.rule-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 720px;
}
.rule-list li {
    padding: 14px 0 14px 26px;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    position: relative;
    font-size: 17px;
}
.rule-list li::before {
    content: '\2014';
    position: absolute;
    left: 0;
}

/* Donors — centered "|"-separated rosters */
.donor-year { text-align: center; margin-bottom: 56px; }
.donor-year h2 { margin-bottom: 18px; }
.donor-year p { font-size: 18px; line-height: 1.9; max-width: 820px; margin: 0 auto; }

/* =========================================================================
   FORMS (contact) — cream, black outlines
   ========================================================================= */
.form-group-label {
    display: block;
    font-family: var(--serif-body);
    font-size: 15px;
    margin-bottom: 8px;
}
.form-field { margin-bottom: 22px; }
.form-field label {
    display: block;
    font-family: var(--serif-body);
    font-size: 15px;
    margin-bottom: 8px;
}
.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    font-family: var(--serif-body);
    font-size: 16px;
    padding: 13px 15px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--white);
    color: var(--ink);
}
.form-field input:focus,
.form-field textarea:focus {
    outline: 2px solid var(--ink);
    outline-offset: -2px;
}
.form-field textarea { min-height: 160px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.errorlist {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    color: var(--error);
    font-size: 14px;
}

/* Messages / alerts */
.alert {
    border: 1px solid var(--ink);
    border-radius: 0;
    padding: 14px 18px;
    margin: 24px 0;
    font-size: 16px;
}
.alert-success { background: rgba(0,0,0,0.04); }
.alert-error { border-color: var(--error); color: var(--error); }

/* Donate widget (stub) */
.amount-chips { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.amount-chip {
    border: 1px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-family: var(--serif-body);
    font-size: 17px;
    padding: 14px 26px;
    cursor: pointer;
}
.amount-chip:hover, .amount-chip.active { background: var(--ink); color: var(--white); }

/* =========================================================================
   FOOTER — cream, nav columns + email + 501c3 + Donate + socials
   ========================================================================= */
.site-footer {
    background: var(--paper);
    border-top: 1px solid rgba(0,0,0,0.15);
    padding: 64px 0 48px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 40px;
    align-items: start;
}
.footer-col h4 {
    font-family: var(--serif-display);
    font-size: 20px;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-family: var(--serif-body); font-size: 16px; }
.footer-col a:hover { text-decoration: underline; }

.footer-action { text-align: right; }
.footer-action .btn { margin-bottom: 18px; }

.footer-social {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
}
.footer-social a {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
}
.footer-social a:hover { background: var(--ink); }
.footer-social a:hover svg { fill: var(--white); }
.footer-social svg { width: 18px; height: 18px; fill: var(--ink); }

.footer-legal {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(0,0,0,0.15);
    text-align: center;
    font-size: 14px;
}

/* Fade-in on scroll (subtle, matches Squarespace default) */
@media (prefers-reduced-motion: no-preference) {
    .fade-in { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
    .fade-in.is-visible { opacity: 1; transform: none; }
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 980px) {
    :root { --section-y: 72px; }
    .intro-grid { grid-template-columns: 1fr; gap: 36px; }
    .intro-figure { max-width: 420px; }
    .whatwedo-grid { grid-template-columns: 1fr; gap: 32px; }
    .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-action { grid-column: 1 / -1; text-align: left; }
    .footer-social { justify-content: flex-start; }
}

@media (max-width: 767px) {
    /* Collapse header to logo + hamburger, hide desktop nav + right CTAs */
    .site-header { padding: 16px 0; }
    .header-inner { flex-direction: row; justify-content: space-between; align-items: center; }
    .brand-logo img { width: 150px; }
    .primary-nav, .header-actions { display: none; }
    .nav-toggle { display: block; }

    /* Mobile hero is a tall full-bleed crop (~560px), matching home-mobile.png */
    .home-hero { height: 560px; max-height: none; min-height: 0; }

    .link-boxes { grid-template-columns: 1fr; gap: 14px; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .card-grid--3, .card-grid--4 { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .donor-year p { font-size: 16px; }
}

@media (max-width: 440px) {
    .photo-grid { grid-template-columns: 1fr; }
}
