/* =========================================================
   COADMAVEZA
   Idea: la mesa del martes. Fachada encalada (blanco), verde
   mangle y amarillo mango del logo. Una sola familia tipográfica,
   Lexend, diseñada para facilitar la lectura.
   ========================================================= */
:root {
  --cal: #ffffff;        /* fondo: pared encalada */
  --mangle: #0f4a37;     /* verde del logo, títulos y sección de la mesa */
  --mangle-deep: #0a3828;
  --tinta: #24332c;      /* texto */
  --mango: #ffc531;      /* acción y sección de donar */
  --hoja: #d6e7dc;       /* verde claro: mesa, bordes suaves */
  --tint: #f2f7f3;       /* secciones alternas, apenas verde */
  --muted: #4f625a;

  --font: "Lexend", system-ui, sans-serif;

  /* Escala tipográfica (18 / 24 / 32-48 / 44-88) */
  --t-small: 1rem;       /* 16px */
  --t-body: 1.125rem;    /* 18px */
  --t-h3: 1.5rem;        /* 24px */
  --t-h2: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  --t-h1: clamp(2.75rem, 1rem + 6.2vw, 5.5rem);

  --wrap: 1200px;
  --gutter: 24px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--tinta);
  background: var(--cal);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--mangle); text-underline-offset: .18em; text-decoration-thickness: 2px; }
h1, h2, h3 { color: var(--mangle); margin: 0; font-weight: 800; }
h1 { font-size: var(--t-h1); line-height: 1; letter-spacing: -.045em; }
h2 { font-size: var(--t-h2); line-height: 1.1; letter-spacing: -.035em; margin-bottom: .6em; max-width: 22ch; }
h3 { font-size: var(--t-h3); line-height: 1.2; letter-spacing: -.01em; margin-bottom: .35em; }
strong { font-weight: 700; }
.small { font-size: var(--t-small); color: var(--muted); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--mangle); color: #fff; padding: 10px 16px; border-radius: 6px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--mangle); outline-offset: 3px; }
.mesa :focus-visible, .site-footer :focus-visible { outline-color: var(--mango); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 1.0625rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  padding: 15px 24px; border-radius: 6px; border: 2px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
.btn-gold { background: var(--mango); color: var(--mangle-deep); }
.btn-gold:hover { background: #ffd35f; }
.btn-green { background: var(--mangle); color: #fff; }
.btn-green:hover { background: var(--mangle-deep); }
.btn-line { color: var(--mangle); border-color: var(--mangle); background: transparent; }
.btn-line:hover { background: var(--mangle); color: #fff; }
.btn-block { width: 100%; }
/* Alias que usa gracias.html */
.btn-primary { background: var(--mangle); color: #fff; }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--cal); border-bottom: 2px solid var(--hoja); }
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--mangle); font-weight: 800; font-size: 1.25rem; letter-spacing: .01em; }
.brand-logo { width: 44px; height: 44px; object-fit: contain; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a:not(.btn) { color: var(--tinta); text-decoration: none; font-size: 1.0625rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:not(.btn):hover { border-bottom-color: var(--mango); }
.nav-donate { padding: 11px 20px; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 26px; height: 3px; border-radius: 2px; background: var(--mangle); margin: 5px 0; transition: transform .2s, opacity .2s; }

/* ---------- Portada ---------- */
.hero { padding: 64px 0 0; }
.hero-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; margin-bottom: 48px; }
.hero h1 { max-width: 11ch; }
.lead { color: var(--tinta); font-size: 1.25rem; line-height: 1.5; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero { padding-bottom: 56px; }
.hero-photo img { width: 100%; aspect-ratio: 2.2 / 1; object-fit: cover; object-position: center 78%; border-radius: 4px; background: var(--hoja); }
.hero-photo figcaption { padding-top: 16px; font-size: 1.125rem; color: var(--tinta); max-width: 70ch; }
.hero-photo figcaption strong { color: var(--mangle); box-shadow: inset 0 -.38em 0 var(--mango); }

/* ---------- La mesa del martes ---------- */
.mesa { background: var(--mangle); color: #fff; padding: 96px 0 104px; }
.mesa h2 { color: #fff; max-width: none; }
.table-viz {
  --seat: clamp(12px, 2.2vw, 30px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: calc(var(--seat) * .5);
  margin: 40px 0 48px;
}
.table-end { display: flex; flex-direction: column; gap: calc(var(--seat) * .45); }
.table-mid { display: grid; gap: calc(var(--seat) * .45); }
.seat-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: calc(var(--seat) * .3); justify-items: center; }
.seat { width: var(--seat); height: var(--seat); border-radius: 50%; background: #fff; }
.seat-vol { background: var(--mango); }
.table-top {
  background: var(--hoja); color: var(--mangle); border-radius: 8px;
  min-height: calc(var(--seat) * 3.2); display: grid; place-items: center; text-align: center;
  padding: 12px 16px; font-weight: 700; font-size: clamp(.875rem, .7rem + .6vw, 1.125rem);
}
/* El único movimiento automático de la página: los puestos se ocupan una vez */
.table-viz.animate .seat { transform: scale(0); }
.table-viz.animate.seated .seat { transform: scale(1); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); transition-delay: calc(var(--i) * 28ms); }

.mesa-text { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: start; }
.mesa-text p { color: rgba(255, 255, 255, .9); font-size: 1.25rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.legend li { display: flex; align-items: center; gap: 14px; font-size: 1.125rem; }
.legend strong { font-size: 1.5rem; color: #fff; }
.dot { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; }
.dot-adult { background: #fff; }
.dot-vol { background: var(--mango); }
.facts { list-style: none; margin: 56px 0 0; padding: 28px 0 0; border-top: 2px solid rgba(255, 255, 255, .18); display: flex; flex-wrap: wrap; gap: 16px 56px; color: rgba(255, 255, 255, .85); }
.facts strong { color: var(--mango); font-size: 1.5rem; margin-right: 6px; }

/* ---------- Bloques generales ---------- */
.block { padding: 112px 0; }
.block-tint { background: var(--tint); }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.block-head h2 { margin-bottom: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.h-small { font-size: var(--t-h3); letter-spacing: -.01em; }

/* Nosotros */
.story { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: center; }
.story-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--hoja); }
.mv { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 80px; padding-top: 40px; border-top: 2px solid var(--hoja); }
.mv p { color: var(--muted); }
.values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin: 48px 0 0; }
.values dt { font-weight: 700; color: var(--mangle); font-size: 1.125rem; }
.values dd { margin: 4px 0 0; color: var(--muted); font-size: var(--t-small); }

/* Qué hacemos */
.programs { margin-top: 16px; }
.program { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; padding: 32px 0; border-top: 2px solid var(--hoja); }
.program:last-child { border-bottom: 2px solid var(--hoja); }
.program h3 { margin: 0; }
.program p { margin: 0; }
.audience { margin-top: 40px; font-size: 1.25rem; max-width: 56ch; }

/* ---------- Donar ---------- */
.donate { background: var(--mango); color: var(--mangle-deep); padding: 112px 0 96px; }
.donate h2, .donate h3 { color: var(--mangle-deep); }
.donate a:not(.btn) { color: var(--mangle-deep); font-weight: 700; }
.donate .small { color: var(--mangle-deep); }
.donate-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 64px; align-items: start; }
.donate-copy > p { font-size: 1.25rem; }
.tiers { list-style: none; padding: 0; margin: 36px 0 24px; border-top: 2px solid rgba(10, 56, 40, .25); }
.tier { display: grid; grid-template-columns: 9.5rem 1fr; gap: 20px; align-items: baseline; padding: 18px 0; border-bottom: 2px solid rgba(10, 56, 40, .25); font-size: 1.125rem; }
.tier-amount { font-weight: 800; font-size: 1.75rem; letter-spacing: -.02em; }
.tier-featured .tier-amount { color: var(--mangle); text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: .2em; }
.bank-panel { background: var(--cal); color: var(--tinta); border-radius: 10px; padding: 32px; }
.bank-panel h3 { margin-bottom: 16px; }
.bank-panel .small { color: var(--muted); margin: 14px 0 0; }
.bank { margin: 0 0 24px; }
.bank div { display: grid; grid-template-columns: 6rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 2px solid var(--tint); align-items: center; }
.bank dt { color: var(--muted); font-size: var(--t-small); }
.bank dd { margin: 0; font-weight: 700; }
.bank-number dd { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
#account-number { font-size: 1.5rem; font-weight: 800; color: var(--mangle); letter-spacing: .03em; }
.copy-btn { font: 700 .9375rem var(--font); background: var(--tint); color: var(--mangle); border: 2px solid var(--hoja); border-radius: 6px; padding: 6px 14px; cursor: pointer; }
.copy-btn:hover { border-color: var(--mangle); }
.copy-btn.copied { background: var(--mangle); color: #fff; border-color: var(--mangle); }
.other-ways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; margin-top: 80px; }
.other-ways p { font-size: 1.0625rem; }

/* ---------- Actividades ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.filter { font: 400 1.0625rem var(--font); color: var(--tinta); background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 0; cursor: pointer; }
.filter:hover { border-bottom-color: var(--hoja); }
.filter[aria-pressed="true"] { font-weight: 700; color: var(--mangle); border-bottom-color: var(--mango); }

.act-feature {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
}
.act-feature, .act-row { text-decoration: none; }
.act-feature .act-img { aspect-ratio: 3 / 2; border-radius: 4px; }
.act-feature h3 { font-size: clamp(1.75rem, 1.2rem + 1.4vw, 2.25rem); letter-spacing: -.02em; }
.act-feature:hover h3, .act-row:hover h3 { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--mango); text-underline-offset: .15em; }
.act-img { overflow: hidden; background: var(--hoja); }
.act-img img { width: 100%; height: 100%; object-fit: cover; }
.act-img-empty { display: grid; place-items: center; color: var(--mangle); font-weight: 700; background: var(--hoja); }
.act-date { display: block; color: var(--muted); font-size: var(--t-small); margin-bottom: 6px; }
.act-cat { font-weight: 700; color: var(--mangle); }
.act-summary { color: var(--muted); margin: 8px 0 0; }
.act-link { display: inline-block; margin-top: 16px; font-weight: 700; color: var(--mangle); border-bottom: 3px solid var(--mango); }

.act-list { list-style: none; margin: 56px 0 0; padding: 0; }
.act-row {
  display: grid; grid-template-columns: 13rem minmax(0, 1fr) 7.5rem; gap: 32px; align-items: center;
  width: 100%; padding: 24px 0; border: 0; border-top: 2px solid var(--hoja); background: none;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.act-list li:last-child .act-row { border-bottom: 2px solid var(--hoja); }
.act-row h3 { font-size: 1.375rem; margin: 0; }
.act-row .act-summary { font-size: 1.0625rem; margin-top: 4px; }
.act-row .act-img { aspect-ratio: 4 / 3; border-radius: 4px; font-size: .875rem; }
#load-more { margin-top: 32px; }
.empty { color: var(--muted); padding: 24px 0; }

/* ---------- Galería ---------- */
.gallery { columns: 3 260px; column-gap: 12px; }
.gallery-item { break-inside: avoid; margin: 0 0 12px; cursor: zoom-in; position: relative; border-radius: 4px; overflow: hidden; background: var(--hoja); }
.gallery-item img { width: 100%; height: auto; }
.gallery-item figcaption { padding: 8px 2px 4px; font-size: var(--t-small); color: var(--muted); background: var(--tint); }

/* ---------- Aliados ---------- */
.allies-block { padding: 72px 0; }
.allies { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 40px; font-size: 1.25rem; font-weight: 700; color: var(--muted); }
.allies a { color: inherit; text-decoration: none; }
.allies img { max-height: 52px; width: auto; }

/* ---------- Información legal ---------- */
.legal { margin: 0; }
.legal div { display: grid; grid-template-columns: 11rem 1fr; gap: 16px; padding: 14px 0; border-bottom: 2px solid var(--hoja); }
.legal div:first-child { border-top: 2px solid var(--hoja); }
.legal dt { color: var(--muted); }
.legal dd { margin: 0; font-weight: 700; }
.docs { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.docs a { font-weight: 700; }
.docs-empty { color: var(--muted); font-size: 1.0625rem; }

/* ---------- Contacto ---------- */
.contact-list { margin: 8px 0 24px; display: grid; gap: 18px; }
.contact-list dt { font-size: var(--t-small); color: var(--muted); }
.contact-list dd { margin: 2px 0 0; font-size: 1.25rem; font-weight: 700; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.socials { display: flex; gap: 20px; font-weight: 700; }
.map { margin-top: 24px; aspect-ratio: 16 / 10; border-radius: 4px; overflow: hidden; background: var(--tint); }
.map iframe { width: 100%; height: 100%; border: 0; }
.contact-form { display: grid; gap: 18px; background: var(--tint); padding: 36px; border-radius: 10px; }
.contact-form label { display: grid; gap: 6px; font-weight: 700; color: var(--mangle); }
.contact-form input, .contact-form select, .contact-form textarea {
  font: 400 1.125rem var(--font); color: var(--tinta); background: var(--cal);
  border: 2px solid var(--hoja); border-radius: 6px; padding: 12px 14px; width: 100%;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: none; border-color: var(--mangle); }
.contact-form .small { margin: 0; }

/* ---------- Pie ---------- */
.site-footer { background: var(--mangle-deep); color: rgba(255, 255, 255, .8); padding: 64px 0 28px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; flex-wrap: wrap; padding-bottom: 40px; border-bottom: 2px solid rgba(255, 255, 255, .12); }
.footer-name { color: #fff; font-weight: 800; font-size: 1.5rem; margin-bottom: 8px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; font-size: var(--t-small); }
.footer-bottom a { color: rgba(255, 255, 255, .7); }

/* ---------- WhatsApp ---------- */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 60px; height: 60px; border-radius: 50%; background: #25d366; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(10, 56, 40, .3); }
.wa-float svg { width: 32px; height: 32px; fill: #fff; }

/* ---------- Diálogos ---------- */
dialog { border: 0; padding: 0; color: var(--tinta); }
dialog::backdrop { background: rgba(10, 56, 40, .8); }
.dialog-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cal); color: var(--mangle); font-size: 1.75rem; line-height: 1; cursor: pointer; }
.modal { width: min(860px, calc(100% - 32px)); max-height: calc(100vh - 48px); border-radius: 10px; background: var(--cal); }
.modal-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.modal-content { padding: 28px 40px 40px; }
.modal-content h2 { margin: 4px 0 16px; max-width: none; }
.modal-text { white-space: pre-line; }
.modal-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 24px; }
.modal-gallery button { padding: 0; border: 0; border-radius: 4px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; background: var(--hoja); }
.modal-gallery img { width: 100%; height: 100%; object-fit: cover; }
.modal-cta { margin-top: 32px; padding: 20px 24px; border-radius: 8px; background: var(--mango); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.modal-cta p { margin: 0; font-weight: 700; color: var(--mangle-deep); }

.lightbox { background: transparent; width: 100vw; height: 100vh; max-width: none; max-height: none; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(6, 30, 22, .94); }
.lightbox figure { max-width: 92vw; text-align: center; }
.lightbox img { max-width: 92vw; max-height: 80vh; margin: 0 auto; border-radius: 4px; }
.lightbox figcaption { color: rgba(255, 255, 255, .85); margin-top: 12px; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; font-size: 2rem; cursor: pointer; }
.lb-nav:hover { background: rgba(255, 255, 255, .3); }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .table-viz.animate .seat { transform: none; }
  * { transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cal); padding: 8px var(--gutter) 24px; border-bottom: 2px solid var(--hoja);
    visibility: hidden; opacity: 0; transition: opacity .15s, visibility .15s;
  }
  .main-nav.open { visibility: visible; opacity: 1; }
  .main-nav a:not(.btn) { padding: 16px 0; border-bottom: 2px solid var(--tint); font-size: 1.1875rem; }
  .nav-donate { margin-top: 16px; padding: 15px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .hero { padding-top: 40px; }
  .hero-top, .mesa-text, .story, .two-col, .donate-grid, .act-feature { grid-template-columns: 1fr; gap: 32px; }
  .hero-top { margin-bottom: 32px; }
  .hero-photo img { aspect-ratio: 16 / 10; object-position: center 90%; }
  .mv { grid-template-columns: 1fr; gap: 32px; margin-top: 56px; }
  .values { grid-template-columns: 1fr 1fr; }
  .program { grid-template-columns: 1fr; gap: 8px; }
  .other-ways { grid-template-columns: 1fr; gap: 32px; margin-top: 56px; }
  .block { padding: 80px 0; }
  .mesa, .donate { padding: 72px 0; }
}
@media (max-width: 620px) {
  :root { --gutter: 16px; }
  .brand span { font-size: 1.125rem; }
  .actions .btn { width: 100%; }
  /* En el celular la mesa se gira: larga hacia abajo, cabeceras arriba y abajo */
  .table-viz { --seat: 18px; grid-template-columns: 1fr; justify-items: center; gap: 10px; margin: 28px 0 40px; }
  .table-end { flex-direction: row; gap: 8px; }
  .table-mid { grid-template-columns: auto 104px auto; gap: 10px; }
  .seat-row { grid-template-columns: 1fr; grid-template-rows: repeat(var(--n), 1fr); gap: 6px; }
  .table-top { min-height: 0; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 1rem; padding: 16px 8px; }
  .values { grid-template-columns: 1fr; gap: 20px; }
  .tier { grid-template-columns: 1fr; gap: 2px; }
  .act-row { grid-template-columns: 1fr 5.5rem; gap: 16px; }
  .act-row .act-date-col { grid-column: 1 / -1; }
  .legal div { grid-template-columns: 1fr; gap: 2px; }
  .bank-panel, .contact-form { padding: 24px 20px; }
  .modal-content { padding: 22px 20px 28px; }
  .facts { gap: 12px; }
}
