/* =====================================================
   BASE.CSS — Tokens, tipografía, layout, botones,
   secciones, footer, hero unificado (.portada)
   ===================================================== */

/* ── 1. Tokens globales ─────────────────────────────── */
:root {
  /* Paleta base cálida */
  --bg-page: #f8f4ee;
  --bg-page-2: #f3ece2;
  --bg-page-3: #ede2d4;

  --text-primary: #4c3a2f;
  --text-secondary: #7a6557;
  --text-muted: #9a8576;

  /* Beiges / marrones */
  --warm-100: #fcfaf7;
  --warm-200: #f5eee4;
  --warm-300: #eadfce;
  --warm-400: #d9c6ad;
  --warm-500: #b68f66;
  --warm-600: #9a7450;
  --warm-700: #7e5e43;
  --warm-800: #5f4738;
  --warm-900: #453327;

  --accent: #a77c52;
  --accent-light: #c9a47f;
  --accent-dark: #8c6542;

  /* Superficies */
  --surface-light: #fffdf9;
  --surface-cream: #f7f1e8;
  --surface-warm: #efe4d6;
  --surface-glass: rgba(255, 252, 247, 0.78);

  /* Bordes */
  --border-subtle: rgba(120, 92, 69, 0.12);
  --border-light: rgba(120, 92, 69, 0.08);
  --border-strong: rgba(120, 92, 69, 0.18);

  /* Sombras */
  --shadow-sm: 0 2px 10px rgba(88, 65, 48, 0.06);
  --shadow-md: 0 10px 30px rgba(88, 65, 48, 0.10);
  --shadow-lg: 0 18px 48px rgba(88, 65, 48, 0.12);
  --shadow-xl: 0 26px 72px rgba(88, 65, 48, 0.16);
  --shadow-accent: 0 12px 36px rgba(167, 124, 82, 0.18);

  /* Layout */
  --max-width: 1200px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  /* Transiciones */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Tokens portada */
  --portada-dorado:       #b8924a;
  --portada-dorado-osc:   #8f6e32;
  --portada-marron:       #4c3220;
  --portada-marron-suave: #9b7250;
  --portada-texto-suave:  #7a5c3e;
  --portada-linea:        rgba(139, 100, 58, 0.16);
  --portada-linea-dorada: rgba(184, 146, 74, 0.28);
  --portada-sombra:       0 12px 36px rgba(78, 52, 30, 0.10);
}

/* ── 2. Reset ───────────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(201, 164, 127, 0.20), transparent 28%),
    radial-gradient(circle at right center, rgba(167, 124, 82, 0.10), transparent 30%),
    linear-gradient(180deg, var(--warm-100) 0%, var(--bg-page) 55%, var(--bg-page-2) 100%);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ── 3. Tipografía display ──────────────────────────── */
h1, h2, h3,
.portada__titulo,
.section-header h2,
.soft-panel__title,
.footer__brand,
.writing-card__quote {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

/* ── 4. Layout base ─────────────────────────────────── */
.container {
  width: min(var(--max-width), calc(100% - 64px));
  margin-inline: auto;
}

/* ── 5. Skip link ───────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 20px;
  background: var(--surface-light);
  color: var(--warm-900);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.skip-link:focus {
  left: 20px;
}

/* ── 6. Botones ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fffdf9;
  box-shadow: var(--shadow-accent);
  isolation: isolate;
}

.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle 90px at var(--mx, 50%) var(--my, 50%),
    rgba(255, 244, 210, 0.50) 0%,
    rgba(255, 224, 160, 0.22) 40%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: inherit;
}

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(167, 124, 82, 0.28);
}

.btn--primary:hover::before {
  opacity: 1;
}

.btn--primary span {
  position: relative;
  z-index: 1;
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.58);
  color: var(--warm-900);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.80);
  border-color: var(--border-strong);
  transform: translateY(-3px);
}

.btn--small {
  padding: 10px 22px;
  font-size: 13px;
}

/* ── 7. Secciones ───────────────────────────────────── */
.section {
  padding: 120px 0;
  background: linear-gradient(180deg, var(--surface-light) 0%, var(--surface-cream) 100%);
  color: var(--text-primary);
  position: relative;
}

.section:nth-of-type(even) {
  background: linear-gradient(180deg, #f9f4ed 0%, #efe5d8 100%);
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light), transparent);
}

.section--soft {
  background: linear-gradient(180deg, var(--warm-200) 0%, var(--warm-300) 100%);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 60px;
}

.section-header h2 {
  font-size: clamp(40px, 4.6vw, 62px);
  margin-bottom: 16px;
  color: var(--warm-900);
  position: relative;
  display: inline-block;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 18px;
  margin-top: 24px;
}

/* ── 8. Footer ──────────────────────────────────────── */
.footer {
  background:
    radial-gradient(circle at top center, rgba(201, 164, 127, 0.10), transparent 30%),
    linear-gradient(180deg, var(--warm-900) 0%, #3b2b21 100%);
  color: rgba(255, 248, 240, 0.78);
  padding: 80px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 164, 127, 0.38), transparent);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer__brand {
  font-size: 30px;
  color: #fffaf4;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__brand::before {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--accent-light);
  border-radius: 50%;
}

.footer__text {
  color: rgba(255, 248, 240, 0.66);
  font-size: 15px;
  line-height: 1.8;
  max-width: 300px;
}

.footer__title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 24px;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__links a {
  color: rgba(255, 248, 240, 0.78);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer__links a:hover {
  color: #ffffff;
  transform: translateX(4px);
}

.footer__links a::before {
  content: '→';
  opacity: 0;
  transition: all 0.3s ease;
  color: var(--accent-light);
}

.footer__links a:hover::before {
  opacity: 1;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 248, 240, 0.52);
}

/* ── 9. WhatsApp flotante ───────────────────────────── */
.wa-float {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 30px rgba(37, 211, 102, 0.3);
  z-index: 9999;
  transition: all 0.4s var(--ease-spring);
  text-decoration: none;
}

.wa-float:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 15px 40px rgba(37, 211, 102, 0.4);
}

.wa-float svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* ── 10. Hero unificado (.portada) ──────────────────── */
.portada {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100dvh - 72px);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #f2ead8 0%, #ede3cf 100%);
}

.portada__deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.deco-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--portada-linea-dorada);
  opacity: 0.5;
}
.deco-ring--1 { width: 400px; height: 400px; top: -100px; left: -100px; }
.deco-ring--2 { width: 260px; height: 260px; top: 60%;   left: 5%;    opacity: 0.3; }
.deco-ring--3 { width: 180px; height: 180px; bottom: 5%; left: 48%;   opacity: 0.25; }

.portada__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
  padding-bottom: 80px;
  padding-right: 56px;
  padding-left: max(1.2rem, calc((100vw - 1100px) / 2));
}

.portada__eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--portada-dorado);
  margin-bottom: 20px;
}

.portada__titulo {
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  line-height: 1.05;
  color: var(--portada-marron);
  margin-bottom: 12px;
}

.portada__titulo-accent {
  font-style: italic;
  color: var(--portada-dorado);
}

.portada__subtitulo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-style: italic;
  color: var(--portada-marron-suave);
  margin-bottom: 36px;
}

.portada__ficha {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--portada-linea);
  border-radius: 28px;
  padding: 20px 24px;
  box-shadow: var(--portada-sombra);
  margin-bottom: 36px;
  backdrop-filter: blur(8px);
}

.ficha-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.ficha-item__icon {
  width: 18px;
  height: 18px;
  color: var(--portada-dorado);
  margin-bottom: 6px;
}

.ficha-item strong {
  font-size: 0.95rem;
  color: var(--portada-marron);
  font-weight: 700;
}

.ficha-item span {
  font-size: 0.85rem;
  color: var(--portada-texto-suave);
}

.ficha-sep {
  width: 1px;
  background: var(--portada-linea);
  margin: 0 20px;
  align-self: stretch;
}

.portada__acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.btn-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--portada-dorado-osc);
  text-decoration: none;
  transition: letter-spacing 0.2s;
}
.btn-link:hover { letter-spacing: 0.04em; }

.portada__img {
  position: relative;
  overflow: hidden;
}

.portada__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portada__img-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,240,200,0.12) 0%, transparent 50%, rgba(0,0,0,0.08) 100%);
  pointer-events: none;
}

/* ── 11. Variantes de portada ───────────────────────── */
.portada--home { }

.portada--actividades { }

.portada--escritos {
  grid-template-columns: 1fr;
}

.portada--escritos .portada__body {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

/* ── 12. Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .portada {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .portada__img {
    aspect-ratio: 4/3;
    order: -1;
  }
  .portada__body {
    padding: 60px 1.2rem 60px;
  }
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .footer__text {
    max-width: 100%;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  .wa-float {
    right: 20px;
    bottom: 20px;
  }
}

@media (max-width: 600px) {
  .portada__titulo {
    font-size: clamp(2.4rem, 9vw, 3.5rem);
  }
  .portada__ficha {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }
  .ficha-sep {
    width: 100%;
    height: 1px;
    margin: 0;
  }
}

@media (max-width: 480px) {
  .btn {
    width: 100%;
  }

  .section {
    padding: 80px 0;
  }

  .container {
    width: min(var(--max-width), calc(100% - 32px));
  }
}
