/* ============================================================
   Hay Un Nuevo Amanecer — sistema de diseño "amanecer"
   La página recorre un ciclo de luz: noche (hero) → violeta →
   terracota → oro (donaciones/ubicación) → noche (cierre, footer).
   El color de acción (botones, CTA) se mantiene constante en
   terracota en toda la página; el degradado es solo para
   títulos y las líneas "horizonte" que abren cada sección.
   ============================================================ */

:root {
  --night:      #1B2340;
  --night-deep: #12172C;
  --twilight:   #5B3B6E;
  --ember:      #A8441A;
  --ember-dark: #7E3212;
  --gold:       #E0A030;
  --paper:      #FFFFFF;
  --paper-warm: #FBF3E7;
  --ink:        #201B2E;
  --ink-muted:  #5B5468;
  --line:       #EAE3DA;
  --max: 1120px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 760px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.brand img { height: 40px; display: block; }
.main-nav { display: flex; flex-wrap: wrap; gap: 22px; }
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 10px 2px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.main-nav a:hover { color: var(--ember); border-color: var(--ember); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  width: 44px;
  height: 44px;
  padding: 0;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--ink);
  transition: transform 200ms ease, opacity 200ms ease;
}
.nav-toggle span { top: 21px; }
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  min-height: 68vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--night);
}
.hero-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: hero-drift 24s ease-in-out infinite alternate;
}
@keyframes hero-drift {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(27,35,64,0.85) 0%, rgba(27,35,64,0.45) 45%, rgba(224,160,48,0.35) 100%);
}
.hero-overlay {
  position: relative;
  text-align: center;
  color: #fff;
  padding: 40px 24px;
}
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 14px;
}
.hero-overlay h1 {
  font-size: clamp(2.2rem, 6vw, 3.7rem);
  font-optical-sizing: auto;
  margin: 0 0 16px;
}
.hero-times { font-size: 1.15rem; margin: 0; color: #F4EFE6; }

/* ---------------- Horizon rule (per-section signature) ---------------- */
.section { position: relative; padding: 70px 0; }
.section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
#en-vivo::before      { background: linear-gradient(90deg, var(--night), var(--twilight)); }
#actividades::before  { background: linear-gradient(90deg, var(--twilight), var(--ember)); }
#formacion::before    { background: linear-gradient(90deg, var(--ember), var(--gold)); }
#donaciones::before   { background: var(--gold); }
#ubicacion::before    { background: linear-gradient(90deg, var(--gold), var(--ember)); }
#proteccion-datos::before { background: linear-gradient(90deg, var(--ember), var(--night)); }

.section.alt { background: var(--paper-warm); }

.section h2 {
  font-size: 1.9rem;
  margin-bottom: 26px;
}
#en-vivo h2       { color: var(--twilight); }
#actividades h2   { color: var(--ember); }
#formacion h2     { color: var(--ember-dark); }
#donaciones h2    { color: #96631A; }
#ubicacion h2     { color: var(--ember-dark); }

.section h3 { color: var(--ink); font-size: 1.15rem; }

/* ---------------- En Vivo ---------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.video-embed { position: relative; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: var(--night); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.social-links { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; }
.social-links a {
  color: var(--twilight);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding: 4px 0;
  transition: border-color 150ms ease;
}
.social-links a:hover { border-color: var(--twilight); }

.legado { margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); }
.legado h3 {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

/* ---------------- Actividades ---------------- */
.activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 20px;
}
.activity-grid img {
  width: 100%; height: auto; aspect-ratio: 16/9;
  object-fit: contain; background: var(--night-deep);
  border-radius: 12px; display: block;
}

/* ---------------- Formación ---------------- */
.verse {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-muted);
  max-width: 720px;
  margin: 0 0 40px;
}
.verse span { display: block; margin-top: 10px; font-style: normal; font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ember); }

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 28px;
  text-align: center;
  counter-reset: step;
}
.steps-grid figure { margin: 0; position: relative; }
.steps-grid img {
  width: 116px; height: 116px; object-fit: cover; border-radius: 50%;
  margin: 0 auto 14px; display: block;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 4px var(--paper);
}
.steps-grid figcaption { font-weight: 600; font-size: 0.92rem; color: var(--ink); }

.doc-link { margin-top: 40px; }
.doc-link a {
  font-weight: 700;
  color: var(--ember);
  text-decoration: none;
  border-bottom: 2px solid var(--ember);
  padding-bottom: 2px;
}
.doc-link a:hover { color: var(--ember-dark); border-color: var(--ember-dark); }

/* ---------------- Donaciones ---------------- */
.button {
  display: inline-block;
  background: var(--ember);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 8px;
  margin-top: 8px;
  transition: background 150ms ease, transform 150ms ease;
}
.button:hover { background: var(--ember-dark); }
.button:active { transform: translateY(1px); }

#donaciones p:not(.donation-card figcaption) { max-width: 640px; }
.donation-card {
  margin: 0 0 28px;
  max-width: 960px;
}
.donation-card img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  border: 1px solid var(--line);
}
.donation-card figcaption {
  margin-top: 14px;
  font-size: 1.05rem;
  color: var(--ink-muted);
  max-width: 640px;
}
.donation-card figcaption strong { color: var(--ink); }
.donation-card figcaption a { color: var(--ember); font-weight: 600; }

/* ---------------- Ubicación ---------------- */
.map-embed { border-radius: 12px; overflow: hidden; margin-top: 22px; border: 1px solid var(--line); }
.map-embed iframe { width: 100%; height: 360px; border: 0; display: block; }

/* ---------------- Legal + Footer (night bookend) ---------------- */
#proteccion-datos {
  background: var(--night);
  color: #E7E4EF;
}
#proteccion-datos h2 { color: var(--gold); }
#proteccion-datos h3 { color: #C9C3DC; margin-top: 30px; }
#proteccion-datos p, #proteccion-datos li { color: #CFC9DD; }
#proteccion-datos ul { padding-left: 20px; }
#proteccion-datos a { color: var(--gold); }

.site-footer { background: var(--night-deep); color: #DAD5E6; padding: 48px 0 34px; }
.site-footer h3 {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 12px;
}
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.copyright { opacity: 0.7; font-size: 0.85rem; }

/* ---------------- Declaración de Fe (subpágina) ---------------- */
.doc-hero {
  background: linear-gradient(180deg, var(--night) 0%, var(--twilight) 100%);
  padding: 64px 0 48px;
  color: #fff;
  text-align: center;
}
.doc-hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); color: #fff; margin: 8px 0 18px; }
.doc-intro { color: #E4DEEF; font-size: 1.05rem; max-width: 560px; margin: 0 auto; }

.doc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
  max-width: 980px;
}

.doc-toc {
  position: sticky;
  top: 90px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
}
.doc-toc-label {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.doc-toc ol {
  margin: 0;
  padding-left: 20px;
}
.doc-toc li { margin-bottom: 10px; }
.doc-toc a {
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: color 150ms ease;
}
.doc-toc a:hover { color: var(--ember); }
.doc-toc a.is-active { color: var(--ember); }

.doc-article section { margin-bottom: 48px; scroll-margin-top: 90px; }
.doc-article h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.35rem;
  color: var(--ink);
  margin-bottom: 14px;
}
.doc-num {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--twilight);
}
.doc-article section:nth-of-type(1) .doc-num { background: var(--night); }
.doc-article section:nth-of-type(2) .doc-num { background: var(--twilight); }
.doc-article section:nth-of-type(3) .doc-num { background: #7A4A72; }
.doc-article section:nth-of-type(4) .doc-num { background: #93495A; }
.doc-article section:nth-of-type(5) .doc-num { background: var(--ember); }
.doc-article section:nth-of-type(6) .doc-num { background: var(--ember-dark); }
.doc-article section:nth-of-type(7) .doc-num { background: #96631A; }
.doc-article section:nth-of-type(8) .doc-num { background: #B08423; }
.doc-article section:nth-of-type(9) .doc-num { background: var(--gold); color: var(--ink); }

.doc-article p { margin: 0 0 14px; color: var(--ink); }

.doc-version { color: var(--ink-muted); font-size: 0.85rem; border-top: 1px solid var(--line); padding-top: 20px; }

@media (max-width: 900px) {
  .doc-layout { grid-template-columns: 1fr; gap: 32px; }
  .doc-toc { position: static; }
  .doc-toc ol { columns: 2; gap: 24px; }
  .doc-toc li { break-inside: avoid; }
}
@media (max-width: 640px) {
  .doc-toc ol { columns: 1; }
}

/* ---------------- WhatsApp float ---------------- */
.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.28);
  z-index: 30;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: transform 150ms ease;
}
.whatsapp-float:hover { transform: translateY(-2px); }

/* ---------------- Mobile ---------------- */
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    padding: 6px 24px 22px;
    border-bottom: 1px solid var(--line);
    gap: 4px;
  }
  .main-nav a { padding: 12px 0; }
  .main-nav.open { display: flex; }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

  .section { padding: 52px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-photo { animation: none; }
}
