/* =========================================================================
   Misión Acción México — Styles
   Theme is driven by CSS custom properties. To rebrand, change the values
   in :root (colors, fonts) and everything updates.
   ========================================================================= */

:root {
  /* Palette (warm, hopeful, trustworthy) */
  --sand:        #faf6ef;
  --cream:       #fffdf9;
  --ink:         #1f2a29;
  --muted:       #566462;
  --primary:     #0f5f57;   /* deep teal */
  --primary-dk:  #0a4741;
  --primary-lt:  #e4f0ed;
  --accent:      #e07a3b;   /* warm terracotta */
  --accent-dk:   #c26026;
  --line:        #e9e0d4;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --maxw: 1120px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px -18px rgba(15, 42, 40, 0.35);
  --shadow-sm: 0 4px 18px -10px rgba(15, 42, 40, 0.28);
  --header-h: 72px;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--sand);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; font-weight: 600; margin: 0; letter-spacing: -0.01em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 760px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; box-shadow: var(--shadow-sm); }

.btn-accent { background: var(--accent-dk); color: #fff; }
.btn-accent:hover { background: #a84f1e; color: #fff; box-shadow: var(--shadow-sm); }

.btn-ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }
.btn-ghost.dark { color: #fff; border-color: rgba(255,255,255,0.6); }
.btn-ghost.dark:hover { background: #fff; color: var(--primary-dk); }

.btn-donate {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  font-size: 0.95rem;
}
.btn-donate:hover { background: var(--accent-dk); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 239, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -20px rgba(15,42,40,0.5); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-mark { border-radius: 8px; }
.brand-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-mx { color: var(--accent-dk); }

.nav { display: flex; align-items: center; gap: clamp(14px, 1.7vw, 26px); }
.nav a { color: var(--ink); font-weight: 500; font-size: 0.92rem; opacity: 0.85; white-space: nowrap; }
.nav a:hover { opacity: 1; text-decoration: none; color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 12px; }

/* Language switch */
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--cream);
}
.lang-btn {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-btn.is-active { background: var(--primary); color: #fff; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; width: 20px; margin: 0 auto; background: var(--ink); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 520px at 78% -10%, rgba(224, 122, 59, 0.16), transparent 60%),
    radial-gradient(900px 520px at 8% 12%, rgba(15, 95, 87, 0.14), transparent 58%),
    linear-gradient(180deg, var(--cream), var(--sand));
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(24px, 5vw, 56px);
  padding: clamp(48px, 7vw, 96px) 24px;
}
.hero-text { max-width: 640px; }
.hero-media img,
.about-media img,
.mission-media img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 44px rgba(15, 42, 40, 0.16));
}
.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dk);
  margin: 0 0 18px;
}
.hero-title {
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  font-weight: 600;
  max-width: 16ch;
  margin-bottom: 26px;
}
.hero-verse {
  margin: 0 0 34px;
  padding-left: 20px;
  border-left: 3px solid var(--accent);
  max-width: 60ch;
}
.hero-verse p { font-family: var(--font-display); font-style: italic; font-size: clamp(1.05rem, 2.1vw, 1.28rem); color: var(--primary-dk); margin: 0 0 8px; }
.hero-verse cite { font-style: normal; font-weight: 600; color: var(--muted); font-size: 0.92rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-eyebrow {
  font-weight: 600; font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dk); margin: 0 0 12px;
}
.section-eyebrow.light { color: #ffd9bf; }
.section-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 18px; }
.lead { font-size: clamp(1.05rem, 1.7vw, 1.2rem); color: var(--muted); margin: 0; }
.lead.center { text-align: center; }

.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.section-head .section-eyebrow { display: block; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: clamp(28px, 5vw, 64px); align-items: center; }

/* ---------- Mission ---------- */
.section-mission { background: var(--cream); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mission-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.mission-pillars { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.mission-pillars li {
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  color: var(--primary-dk);
  font-family: var(--font-display);
  font-size: 1.02rem;
}

/* ---------- Cards (What we do) ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--primary-lt); color: var(--primary);
  margin-bottom: 18px;
}
.card-icon svg { width: 26px; height: 26px; }
.card-title { font-size: 1.28rem; margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); }

/* ---------- Get involved ---------- */
.section-involved { background: var(--primary); color: #fff; }
.section-involved .section-title { color: #fff; }
.section-involved .lead { color: rgba(255,255,255,0.85); }
.involved-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.involved-copy .btn { margin-top: 26px; }
.involved-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.involved-list li {
  position: relative;
  padding: 14px 16px 14px 42px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.involved-list li::before {
  content: "";
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: 999px;
  background: var(--accent);
}

/* ---------- Partners ---------- */
/* Flex + center so any number of logos stays balanced (2 today, more later). */
.partner-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-bottom: 26px; }
.partner-logo {
  flex: 0 1 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 108px;
  padding: 20px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.partner-logo img {
  height: 46px;          /* uniform logo height across partners */
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.partner-logo:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: transparent; text-decoration: none; }
.partners-note { text-align: center; color: var(--muted); margin: 0; }

/* ---------- Contact ---------- */
.section-contact { background: var(--cream); border-top: 1px solid var(--line); }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.contact-details { display: grid; gap: 22px; }
.contact-item { display: grid; gap: 4px; }
.contact-label { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--accent-dk); }
.contact-item a { font-size: 1.1rem; font-weight: 500; }
.contact-item address { font-style: normal; color: var(--ink); line-height: 1.55; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-dk); color: rgba(255,255,255,0.82); padding: 48px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 26px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { border-radius: 8px; }
.footer-name { font-family: var(--font-display); font-weight: 600; color: #fff; margin: 0; font-size: 1.1rem; }
.footer-tagline { margin: 2px 0 0; font-size: 0.92rem; }
.footer-meta { text-align: right; }
.footer-verse { font-family: var(--font-display); font-style: italic; margin: 0 0 6px; color: rgba(255,255,255,0.7); font-size: 0.92rem; }
.footer-rights { margin: 0; font-size: 0.85rem; color: rgba(255,255,255,0.55); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Focus visibility ---------- */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .hero-inner, .about-grid, .mission-grid, .involved-inner, .contact-inner { grid-template-columns: 1fr; }
  /* Keep the illustration from dominating when stacked */
  .hero-media, .about-media, .mission-media { max-width: 440px; margin: 0 auto; }
  .hero-text { max-width: none; }
}

@media (max-width: 980px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .nav a { padding: 14px 24px; font-size: 1.05rem; opacity: 1; border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }
  .site-header.nav-open .nav { opacity: 1; transform: none; pointer-events: auto; }

  .nav-toggle { display: flex; }
  .site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 760px) {
  .brand-mx { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-meta { text-align: center; }
  .footer-brand { flex-direction: column; text-align: center; }
}

@media (max-width: 500px) {
  .cards, .involved-list { grid-template-columns: 1fr; }
  .btn-donate { display: none; } /* keep header light on small phones; donate CTA still in hero + contact */
}
