/* Fundación Restaurar Social — identidad tomada del escudo bordado: hilo amarillo sobre negro.
   Tipografía: Barlow Condensed (eco de las letras del escudo) + Atkinson Hyperlegible
   (pensada para lectura fácil, el público incluye adultos mayores y personas con baja visión). */
:root {
  --ink: #121110;
  --ink-2: #1d1b18;
  --ink-soft: #3a3631;
  --thread: #f2df1f;        /* amarillo del bordado */
  --thread-deep: #c9b400;
  --paper: #f7f2e6;
  --paper-2: #efe7d3;
  --text: #24211d;
  --muted: #5d574e;
  --line: #ddd3bd;
  --wa: #1f9d55;
  --radius: 14px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font: 400 1.0625rem/1.65 var(--body); color: var(--text); background: #fffdf8; -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 800; line-height: 1.02; text-transform: uppercase; letter-spacing: 0.01em; margin: 0 0 0.6em; }
h2 { font-size: clamp(2.4rem, 6vw, 4rem); }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--thread-deep); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--thread); color: var(--ink); padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px; font: 700 1.15rem/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; border: 2px solid transparent; cursor: pointer; transition: transform .15s, background .15s, color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-thread { background: var(--thread); color: var(--ink); }
.btn-thread:hover { background: #fff07a; }
.btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { border-color: var(--thread); color: var(--thread); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--thread); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(18,17,16,.94); backdrop-filter: blur(8px); color: #fff; border-bottom: 1px solid rgba(242,223,31,.18); }
.header-row { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 56px; height: auto; }
.brand-text { display: flex; flex-direction: column; font-family: var(--display); text-transform: uppercase; line-height: 1; }
.brand-text small { font-size: .8rem; letter-spacing: .2em; color: var(--thread); font-weight: 600; }
.brand-text strong { font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; }
.main-nav { display: flex; gap: 2px; margin-left: auto; }
.main-nav a { font: 600 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em; text-decoration: none; padding: 10px 9px; border-radius: 8px; color: rgba(255,255,255,.85); white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="true"] { color: var(--thread); }
.header-donate { min-height: 42px; padding: 0 20px; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; padding: 8px; margin-left: auto; cursor: pointer; }
.mobile-panel { display: none; }

@media (max-width: 1100px) {
  .main-nav { display: none; }
  .header-donate { margin-left: auto; }
  .menu-toggle { display: block; margin-left: 0; }
  .mobile-panel { position: fixed; inset: var(--header-h) 0 0; z-index: 49; background: var(--ink); padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .25s, visibility .25s; }
  .mobile-panel.open { transform: none; visibility: visible; }
  .m-link { color: #fff; text-decoration: none; font: 700 1.7rem/1 var(--display); text-transform: uppercase; padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .mobile-panel .btn { margin-top: 18px; }
}
@media (max-width: 420px) { .brand-text strong { font-size: 1.1rem; } .header-donate { padding: 0 14px; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: center; background: var(--ink); color: #fff; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
/* Video de YouTube de fondo: cubre todo el hero (16:9 recortado), sin clics. */
.hero-video { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 1s; }
.hero-video iframe { position: absolute; top: 50%; left: 50%; width: max(100%, 177.78vh); height: max(100%, 56.25vw); min-height: 100%; transform: translate(-50%, -50%) scale(1.15); border: 0; }
.hero-media.has-video .hero-video { opacity: 1; }
.hero-media.has-video::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,17,16,.9) 0%, rgba(18,17,16,.6) 55%, rgba(18,17,16,.35) 100%); }
.hero-media.has-video .stitch-art { opacity: 0; transition: opacity 1s; }
/* Sin video: el escudo se "borda" solo, puntada a puntada. */
.stitch-art { position: absolute; right: max(-60px, calc((100vw - 1180px) / 2 - 40px)); top: 50%; transform: translateY(-50%); height: 88%; width: auto; opacity: .95; }
.stitch-art .thread path { fill: none; stroke: var(--thread); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 9 5; }
.stitch-art mask path { fill: none; stroke: #fff; stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: bordar 3.2s cubic-bezier(.6,.1,.3,1) .3s forwards; }
.stitch-art mask .d2 { animation-delay: 2.4s; animation-duration: 2.2s; }
.stitch-art mask .d3 { animation-delay: 3.6s; animation-duration: 1.8s; }
@keyframes bordar { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .stitch-art mask path { stroke-dashoffset: 0; } }

.hero-copy { position: relative; padding-block: 72px; }
.hero h1 { font-size: clamp(3.2rem, 9vw, 7rem); max-width: 11ch; line-height: .92; margin-bottom: .35em; }
.thread-text { color: var(--thread); display: block; }
.hero .lead { font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 34rem; color: rgba(255,255,255,.88); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-facts { font-size: .95rem; color: rgba(255,255,255,.65); border-top: 1px dashed rgba(242,223,31,.4); padding-top: 14px; max-width: 34rem; }
@media (max-width: 760px) {
  .stitch-art { height: 60%; top: auto; bottom: -4%; transform: none; right: -70px; opacity: .2; }
  .hero { min-height: auto; }
}

/* ---------- Secciones ---------- */
.section { padding-block: clamp(64px, 9vw, 112px); }
.section-paper { background: var(--paper); }
.section-ink { background: var(--ink); color: #fff; }
.section-intro { font-size: 1.15rem; color: var(--muted); max-width: 44rem; margin-bottom: 40px; }
.section-ink .section-intro { color: rgba(255,255,255,.75); }
.statement { font-size: clamp(1.3rem, 2.4vw, 1.6rem); line-height: 1.4; font-weight: 700; }

.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.mv { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }
.mv > div { border-top: 3px solid var(--ink); padding-top: 14px; }
@media (max-width: 560px) { .mv { grid-template-columns: 1fr; } }

.shield { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 28px; outline: 2px dashed rgba(242,223,31,.5); outline-offset: -10px; }
.shield img { width: 70%; margin: 0 auto 20px; }
.shield h3 { color: var(--thread); font-size: 1.4rem; }
.shield dl { margin: 0; display: grid; gap: 12px; }
.shield dt { font: 700 1.15rem/1 var(--display); text-transform: uppercase; color: var(--thread); }
.shield dd { margin: 4px 0 0; color: rgba(255,255,255,.85); }

/* Qué hacemos */
.work-grid, .join-grid, .contact-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.work-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .work-grid { grid-template-columns: 1fr; } }
.work { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; background: #fff; }
.work svg { width: 52px; height: 52px; margin-bottom: 14px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 5 3.5; }
.work h3 { font-size: 1.45rem; }
.work p { color: var(--muted); margin: 0; }

/* Histórico */
/* Histórico horizontal: línea punteada arriba, una tarjeta por hito, desliza de lado (más antiguo a la izquierda). */
.timeline-wrap { position: relative; }
.timeline { list-style: none; margin: 0; padding: 34px 2px 18px; display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; position: relative; }
.timeline li { position: relative; flex: 0 0 min(300px, 78vw); scroll-snap-align: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px; }
.timeline li::before { content: ''; position: absolute; top: -34px; left: -10px; right: -10px; border-top: 3px dashed var(--ink); transform: translateY(8px); }
.timeline li:first-child::before { left: 24px; }
.timeline li:last-child::before { right: calc(100% - 30px); }
.timeline li::after { content: ''; position: absolute; top: -34px; left: 20px; width: 17px; height: 17px; border-radius: 50%; background: var(--thread); border: 3px solid var(--ink); }
.timeline time { font: 700 1rem/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.timeline h3 { margin: 8px 0 6px; font-size: 1.45rem; }
.timeline-nav { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 8px; }
.timeline-nav button { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.timeline-nav button:hover { background: var(--ink); color: var(--thread); }
/* Solo en la vista previa del editor de productivos.co: atajos para editar videos, eventos e hitos. */
.editar-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 16px; padding: 10px 16px; border-radius: 999px; border: 2px dashed #2563eb; background: #eff6ff; color: #1d4ed8; font: 700 0.95rem/1 var(--body); cursor: pointer; }
.hero .editar-chip { position: absolute; top: 18px; right: 18px; z-index: 2; margin: 0; }
.timeline p { margin: 0; }
.timeline .tag { display: inline-block; font-size: .8rem; font-weight: 700; background: var(--ink); color: var(--thread); padding: 2px 8px; border-radius: 6px; margin-left: 8px; vertical-align: middle; }
.gallery { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 40px 0 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.gallery figcaption { font-size: .92rem; color: var(--muted); margin-top: 6px; }

/* Únete */
.join-grid { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .join-grid { grid-template-columns: 1fr; } }
.join { padding: 28px; border-radius: var(--radius); background: var(--paper); border-left: 6px solid var(--thread); display: flex; flex-direction: column; }
.join p { color: var(--muted); flex: 1; }
.link-wa, .link-map { display: inline-flex; align-items: center; gap: 8px; font: 700 1.1rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em; color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--thread-deep); }
.link-wa::after, .link-map::after { content: '→'; }

/* Eventos */
.events { display: grid; gap: 16px; }
.event { display: grid; grid-template-columns: 110px 1fr auto; gap: 24px; align-items: center; background: var(--ink-2); border: 1px solid rgba(242,223,31,.2); border-radius: var(--radius); padding: 22px; }
.event-date { text-align: center; border: 2px dashed var(--thread); border-radius: 12px; padding: 10px 6px; font-family: var(--display); text-transform: uppercase; line-height: 1; }
.event-date b { display: block; font-size: 2.8rem; color: var(--thread); }
.event-date span { font-size: 1.05rem; font-weight: 700; letter-spacing: .1em; }
.event h3 { margin-bottom: 6px; }
.event-meta { color: rgba(255,255,255,.7); margin-bottom: 6px; }
.event-need { color: var(--thread); font-weight: 700; margin: 6px 0 0; }
.event p { margin: 0; }
.event-actions { display: flex; flex-direction: column; gap: 10px; }
.event-actions .btn { min-height: 42px; font-size: 1rem; padding: 0 18px; white-space: nowrap; }
@media (max-width: 760px) { .event { grid-template-columns: 80px 1fr; } .event-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } .event-date b { font-size: 2.2rem; } }
.events-empty { max-width: 40rem; }
.events-empty p:not(.statement) { color: rgba(255,255,255,.75); }

/* Ayudas: dos puertas */
.doors { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .doors { grid-template-columns: 1fr; } }
.door { border-radius: 20px; padding: clamp(24px, 4vw, 40px); }
.door > h3 { font-size: clamp(2rem, 4vw, 2.6rem); }
.door-give { background: #fff; border: 2px solid var(--ink); }
.door-need { background: var(--ink); color: #fff; }
.door-need > h3 { color: var(--thread); }
.donate { padding-bottom: 28px; margin-bottom: 28px; border-bottom: 2px dashed var(--line); }
.donate p, .in-kind p { color: var(--muted); }
.amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 14px; }
.amount { min-height: 52px; border-radius: 12px; border: 2px solid var(--ink); background: #fff; font: 700 1.25rem/1 var(--display); cursor: pointer; color: var(--ink); }
.amount[aria-pressed="true"] { background: var(--ink); color: var(--thread); }
.other { display: block; font-weight: 700; margin-bottom: 16px; }
.other input { display: block; width: 100%; margin-top: 6px; min-height: 50px; padding: 0 14px; border: 2px solid var(--line); border-radius: 12px; font: inherit; }
.other input:focus { border-color: var(--ink); outline: none; }
.form-error { color: #b42318; font-weight: 700; }
.needs { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.needs li { background: var(--paper-2); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .98rem; }
.steps { padding-left: 1.3em; margin: 0 0 24px; display: grid; gap: 10px; color: rgba(255,255,255,.88); }
.steps strong { color: #fff; }
.note { font-size: .95rem; color: rgba(255,255,255,.65); margin: 16px 0 0; }
.note.emergency { color: #fff; border-left: 3px solid var(--thread); padding-left: 12px; }

/* Contacto */
.contact-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); }
.contact h3 { font-size: 1.3rem; }
.contact p { font-size: 1.1rem; word-break: break-word; }
.contact p a { text-decoration: none; font-weight: 700; }
.transparency { margin-top: 32px; padding: 24px 28px; background: var(--paper); border-radius: var(--radius); border: 2px dashed var(--ink-soft); }
.transparency h3 { font-size: 1.3rem; }
.transparency p { margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,.8); padding-top: 64px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.site-footer h4 { color: var(--thread); font-size: 1.1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--thread); }
.footer-legal { margin-top: 16px; font-size: .95rem; line-height: 1.7; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 40px; padding: 18px 0; font-size: .9rem; }
.footer-bottom p { margin: 0; }
.footer__credit { text-align: center; font-size: .85rem; padding: 0 0 22px; margin: 0 auto; color: rgba(255,255,255,.6); }
.socials { display: flex; gap: 10px; margin-top: 14px; }
.socials a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); }
.socials svg { width: 20px; height: 20px; }

/* WhatsApp flotante */
.wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 58px; height: 58px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.wa-float svg { width: 30px; height: 30px; }

/* ---------- Páginas internas (legales, gracias, 404) ---------- */
.page-head { background: var(--ink); color: #fff; padding: 64px 0 48px; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); margin: 0; }
.legal-updated { color: rgba(255,255,255,.65); margin: 12px 0 0; }
.legal { max-width: 780px; padding-block: 48px 80px; }
.legal h2 { font-size: 1.7rem; margin-top: 1.6em; }
.legal li { margin-bottom: .4em; }
.result { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 80px; }
.result h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
.result .lead { max-width: 34rem; margin-inline: auto; color: var(--muted); font-size: 1.15rem; }
.icon-big { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: 50%; background: var(--ink); color: var(--thread); display: grid; place-items: center; }
.icon-big svg { width: 38px; height: 38px; }
.result .btn-outline { margin-left: 8px; }

.pendiente { background: #fff3a0; color: #5a4a00; padding: 0 4px; border-radius: 4px; }
