/* ==========================================================================
   El Naranjal — hoja de estilos
   Mobile-first. Sin dependencias externas salvo tipografías (Google Fonts).
   ========================================================================== */

:root {
  /* Paleta */
  --ivory: #F7F4EC;
  --ivory-deep: #EFE8D8;
  --tan: #E7DCC4;
  --brown: #6B4E2E;
  --forest: #23301F;
  --forest-soft: #3A5A40;
  --terracotta: #C97B4A;
  --terracotta-dark: #B56A3B;
  --gold: #D9A441;
  --ink: #23301F;
  --ink-soft: #4A5344;
  --white: #FFFCF7;

  /* Tipografía */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Escala fluida */
  --fs-h1: clamp(2.2rem, 4.5vw + 1rem, 3.8rem);
  --fs-h2: clamp(1.7rem, 2.5vw + 1rem, 2.4rem);
  --fs-h3: clamp(1.15rem, 1vw + 1rem, 1.4rem);
  --fs-lead: clamp(1.05rem, 0.6vw + 1rem, 1.2rem);
  --fs-body: 1rem;

  --radius: 20px;
  --radius-sm: 12px;
  --container: 1200px;
  --gutter: 24px;

  --shadow-sm: 0 2px 10px rgba(35, 48, 31, 0.08);
  --shadow-md: 0 12px 32px rgba(35, 48, 31, 0.14);
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--ivory);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 0 0 0.6em; font-weight: 600; }
p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; }

/* Accesibilidad: foco visible siempre */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--forest);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
  margin: 0 0 12px;
}
.eyebrow.center { justify-content: center; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--terracotta); flex: none; }

/* ---- Botones ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--forest); color: var(--white); }
.btn-primary:hover { background: #1a2416; }
.btn-accent { background: var(--terracotta); color: var(--white); }
.btn-accent:hover { background: var(--terracotta-dark); }
.btn-outline { background: transparent; color: var(--forest); border-color: var(--forest); }
.btn-outline:hover { background: var(--forest); color: var(--white); }
.btn-outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.6); }
.btn-outline-light:hover { background: var(--white); color: var(--forest); }
.btn-ghost { background: transparent; color: var(--ink); text-decoration: underline; padding-inline: 4px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.cta-row-center { justify-content: center; }

/* ==========================================================================
   Header / navegación
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  border-bottom: 1px solid rgba(35, 48, 31, 0.08);
}
/* El desenfoque va en un pseudo-elemento: backdrop-filter en el propio header
   lo convertiría en el contenedor del menú móvil (position: fixed) y lo encogería. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
  gap: 16px;
}
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1.2; }
.brand-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); }
.brand-sub { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

.nav-toggle {
  position: relative;
  z-index: 2; /* por encima del panel abierto para poder cerrarlo */
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid rgba(35,48,31,0.2);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle-bar { width: 20px; height: 2px; background: var(--ink); margin-inline: auto; transition: transform 0.2s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.primary-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, 86vw);
  background: var(--white);
  box-shadow: var(--shadow-md);
  padding: 96px 28px 28px;
  transform: translateX(100%);
  visibility: hidden; /* fuera de pantalla no debe recibir foco con Tab */
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
  overflow-y: auto;
}
.primary-nav.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.primary-nav ul { display: flex; flex-direction: column; gap: 4px; margin-bottom: 28px; }
.primary-nav a { display: block; padding: 12px 4px; font-weight: 500; text-decoration: none; border-bottom: 1px solid rgba(35,48,31,0.08); }
.nav-ctas { display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 1040px) {
  .nav-toggle { display: none; }
  .primary-nav {
    position: static;
    width: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    transform: none;
    visibility: visible;
    display: flex;
    align-items: center;
    gap: 20px;
    overflow: visible;
  }
  .primary-nav ul { flex-direction: row; gap: 16px; margin-bottom: 0; }
  .primary-nav a { padding: 4px 0; border-bottom: none; font-size: 0.95rem; white-space: nowrap; }
  .nav-ctas { flex-direction: row; gap: 8px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { background: var(--ivory); }
.hero-grid {
  display: grid;
  gap: 40px;
  padding-block: 48px 56px;
  align-items: center;
}
.hero-copy h1 { font-size: var(--fs-h1); margin-bottom: 0.4em; }
.hero-copy .lead { font-size: var(--fs-lead); max-width: 46ch; margin-bottom: 1.6em; }
.hero-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-md); aspect-ratio: 9 / 10; object-fit: cover; }

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr 1fr; padding-block: 64px 80px; }
}

.stats-bar { background: var(--white); border-top: 1px solid var(--tan); border-bottom: 1px solid var(--tan); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  padding-block: 24px;
  text-align: center;
}
@media (min-width: 700px) { .stats-grid { text-align: left; } }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--forest); }
.stat-label { font-size: 0.82rem; color: var(--ink-soft); }

/* ==========================================================================
   Secciones genéricas
   ========================================================================== */
.section { padding-block: 64px; }
.section-muted { background: var(--ivory-deep); }
.section-dark { background: var(--forest); color: var(--white); padding-block: 72px; }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: #DCE3D3; }

.section-head { max-width: 62ch; margin: 0 auto 40px; text-align: center; }
.section-lead { font-size: var(--fs-lead); }
.section h2 { font-size: var(--fs-h2); }

.split-grid { display: grid; gap: 40px; align-items: center; }
.split-media img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow-sm); aspect-ratio: 7 / 8; object-fit: cover; }
.split-copy h2 { font-size: var(--fs-h2); }
.split-copy p { max-width: 58ch; }
.signature { margin-top: 1.4em; font-weight: 600; color: var(--ink); }
.signature span { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; }

@media (min-width: 900px) {
  .split-grid { grid-template-columns: 5fr 7fr; }
  .split-grid-reverse { grid-template-columns: 7fr 5fr; }
  .split-grid-reverse .split-media { order: 2; }
}

/* ---- Grids de tarjetas ---- */
.card-grid { display: grid; gap: 24px; }
.card-grid-3 { grid-template-columns: 1fr; }
.card-grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .card-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.feature-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.feature-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.feature-card h3, .feature-card p { padding-inline: 20px; }
.feature-card h3 { margin-top: 18px; font-size: var(--fs-h3); }
.feature-card p { padding-bottom: 20px; font-size: 0.95rem; margin-bottom: 0; }

.amenity-card {
  background: var(--white);
  border: 1px solid var(--tan);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.amenity-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--tan);
  color: var(--brown);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.amenity-icon svg { width: 22px; height: 22px; }
.amenity-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.amenity-card p { font-size: 0.92rem; margin-bottom: 0; }

/* ---- Impacto / rescates ---- */
.impact-grid { display: grid; gap: 32px; align-items: center; padding-bottom: 56px; }
.impact-copy h2 { font-size: var(--fs-h2); max-width: 20ch; }
.impact-copy p { max-width: 60ch; }
.impact-question { font-weight: 600; margin-bottom: 12px; }
.impact-cta { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) {
  .impact-grid { grid-template-columns: 7fr 5fr; }
  .impact-cta { align-items: flex-end; }
  .impact-cta .btn { width: 100%; max-width: 320px; }
}

.rescates-subtitle { font-size: var(--fs-h2); margin-bottom: 8px; }
.rescates-lead { max-width: 60ch; margin-bottom: 32px; }

.animal-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius); overflow: hidden; }
.animal-card img,
.animal-card video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.animal-card video { object-position: 50% 48%; background: var(--forest); }
.animal-card-body { padding: 18px 20px 22px; }
.animal-card-body h4 { font-family: var(--font-display); color: var(--white); font-size: 1.1rem; margin-bottom: 6px; }
.animal-card-body p { color: #DCE3D3; font-size: 0.92rem; margin-bottom: 0; }

/* ---- Galería ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.gallery-grid img { width: 100%; border-radius: var(--radius-sm); aspect-ratio: 1 / 1; object-fit: cover; }
@media (min-width: 900px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---- Ubicación ---- */
.location-facts { display: flex; flex-direction: column; gap: 8px; margin-top: 1.2em; }
.location-facts li { color: var(--ink-soft); }
.location-facts strong { color: var(--ink); }

/* ---- FAQ (acordeón accesible) ---- */
.faq-grid { display: grid; gap: 16px; max-width: 900px; margin: 0 auto; }
@media (min-width: 720px) { .faq-grid { grid-template-columns: repeat(2, 1fr); } }
.faq-item { background: var(--ivory-deep); border-radius: var(--radius-sm); overflow: hidden; }
.faq-q { margin: 0; }
.faq-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 20px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-trigger::after {
  content: "+";
  font-size: 1.4rem;
  line-height: 1;
  color: var(--terracotta);
  flex: none;
  transition: transform 0.2s ease;
}
.faq-trigger[aria-expanded="true"]::after { transform: rotate(45deg); }
.faq-a { padding: 0 20px 20px; }
.faq-a p { margin-bottom: 0; font-size: 0.95rem; }

/* ---- CTA final ---- */
.final-cta { position: relative; padding-block: 96px; overflow: hidden; color: var(--white); }
.final-cta-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.final-cta::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,25,17,0.55) 0%, rgba(20,25,17,0.85) 100%);
  z-index: 1;
}
.final-cta-content { position: relative; z-index: 2; text-align: center; max-width: 760px; }
.final-cta h2 { color: var(--white); font-size: var(--fs-h2); }
.final-cta p { color: #E9E5D6; font-size: var(--fs-lead); margin-bottom: 2em; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--forest); color: #C9D1C1; padding-top: 56px; }
.footer-grid { display: grid; gap: 32px; padding-bottom: 40px; }
.footer-title { color: var(--white); margin-bottom: 10px; }
.footer-brand p { max-width: 40ch; color: #A9B4A0; }
.footer-col h3 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: #C9D1C1; text-decoration: none; }
.footer-col a:hover { color: var(--white); text-decoration: underline; }
address { font-style: normal; color: #A9B4A0; line-height: 1.7; }
address a { color: #C9D1C1; }
.footer-social { display: flex; gap: 16px; margin-top: 14px; }
.footer-legal { border-top: 1px solid rgba(255,255,255,0.12); padding-block: 20px; font-size: 0.82rem; color: #8C9784; }

@media (min-width: 900px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---- Donaciones (Bre-B) ---- */
.donate-card {
  display: grid; gap: 32px; align-items: center;
  max-width: 880px; margin: 0 auto; padding: 32px 24px;
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-md);
}
.donate-label { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terracotta-dark); margin-bottom: 4px; }
.donate-key { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw + 0.8rem, 2.2rem); font-weight: 700; color: var(--forest); overflow-wrap: anywhere; margin-bottom: 16px; }
.donate-status { min-height: 1.4em; margin: 8px 0 0; font-size: 0.9rem; color: var(--forest-soft); }
.donate-steps { margin: 16px 0 0; padding-left: 1.2em; color: var(--ink-soft); font-size: 0.95rem; }
.donate-steps li + li { margin-top: 6px; }
.donate-qr { margin: 0; text-align: center; }
.donate-qr img { width: 100%; max-width: 260px; height: auto; margin-inline: auto; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--tan); padding: 8px; }
.donate-qr figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--ink-soft); }
@media (min-width: 760px) {
  .donate-card { grid-template-columns: 1.3fr 1fr; padding: 40px; gap: 48px; }
}

/* ---- Mapa embebido (Google Maps) ---- */
.map-embed { min-height: 320px; }
.map-embed iframe { display: block; width: 100%; height: 100%; min-height: 320px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
@media (min-width: 900px) { .map-embed, .map-embed iframe { min-height: 420px; } }

/* ---- Radiografía desplegable en la tarjeta de un animal ---- */
.xray { margin-top: 14px; }
.xray summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.xray summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
.xray img { display: block; width: 100%; max-height: 420px; margin-top: 12px; object-fit: contain; background: #000; border-radius: var(--radius-sm); }

/* Botones del menú: los estilos de enlace del nav no deben quitarles su relleno */
.primary-nav .nav-ctas .btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 22px; font-size: 0.95rem; font-weight: 600; border-bottom: 2px solid transparent; }

/* ---- Selector de idioma (ES/EN) ---- */
.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(35, 48, 31, 0.25);
  border-radius: 999px;
  overflow: hidden;
  align-self: flex-start;
}
.lang-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  cursor: pointer;
}
.lang-btn[aria-pressed="true"] { background: var(--forest); color: var(--white); }
.lang-btn:not([aria-pressed="true"]):hover { color: var(--ink); }
@media (min-width: 900px) {
  .lang-switch { align-self: center; }
  .lang-btn { padding: 6px 11px; font-size: 0.78rem; }
}
