/* ==========================================================================
   ESPACIO 9 — Design System
   Warm "paper & ink" light theme. Mindloop DNA (liquid-glass, serif-italic
   accents, scroll-reveal) inverted into a natural, airy, artistic palette.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400;1,6..72,500&display=swap');

:root {
  /* Paper (backgrounds) */
  --paper:      #F4EEE3;   /* base warm cream */
  --paper-2:    #EAE1D1;   /* deeper alternating band */
  --paper-3:    #FBF7F0;   /* lightest — cards, glass */

  /* Ink (foreground) */
  --ink:        #211D16;   /* warm near-black */
  --ink-2:      #4C453A;   /* body text */
  --ink-3:      #8C8475;   /* muted / captions */
  --ink-4:      #B7AE9E;   /* faint */

  /* Lines */
  --line:       rgba(33, 29, 22, 0.13);
  --line-soft:  rgba(33, 29, 22, 0.07);

  /* Natural accent — verde Espacio 9 (#84BE44) */
  --clay:       #84BE44;
  --clay-2:     #97CB5E;
  --clay-soft:  #C6E0A0;
  --clay-wash:  #E9F2D9;

  /* Secondary nature accent — muted sage (rare) */
  --sage:       #6E7659;
  --sage-wash:  #E4E6DA;

  /* Brand logo palette — used for calendar / festivo categories & accents */
  --brand-green:  #9BC45F;
  --brand-cyan:   #6EC1D4;
  --brand-yellow: #EABE57;
  --brand-orange: #DC6646;

  /* Type */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  --shadow-soft: 0 1px 2px rgba(33,29,22,0.05), 0 8px 28px -12px rgba(33,29,22,0.16);
  --shadow-lift: 0 2px 4px rgba(33,29,22,0.06), 0 22px 50px -22px rgba(33,29,22,0.28);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* offset anchored sections below the fixed navbar */
section[id], div[id^="little"], div[id^="infantil"], div[id^="primaria"], div[id^="eso"] {
  scroll-margin-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--clay); color: #fff; }

/* --- Serif accent helper --- */
.serif {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
}

/* --- Liquid glass, light edition --- */
.liquid-glass {
  background: rgba(255, 255, 255, 0.42);
  background-blend-mode: luminosity;
  backdrop-filter: blur(10px) saturate(1.25);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  border: none;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.75),
    0 1px 2px rgba(33, 29, 22, 0.05),
    0 12px 30px -16px rgba(33, 29, 22, 0.22);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.3px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.45) 22%,
    rgba(255,255,255,0.05) 45%, rgba(255,255,255,0.05) 55%,
    rgba(33,29,22,0.06) 80%, rgba(33,29,22,0.12) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* green "clay" glass — CTA buttons with the liquid-glass sheen */
.liquid-glass--clay {
  background: rgba(132, 190, 68, 0.80);
  backdrop-filter: blur(10px) saturate(1.35);
  -webkit-backdrop-filter: blur(10px) saturate(1.35);
  color: #fff;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(33, 29, 22, 0.06),
    0 12px 30px -16px rgba(70, 97, 31, 0.55);
}
.liquid-glass--clay::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.40) 22%,
    rgba(255,255,255,0.05) 45%, rgba(255,255,255,0.05) 55%,
    rgba(33,29,22,0.10) 80%, rgba(33,29,22,0.20) 100%);
}
.liquid-glass--clay:hover { background: rgba(151, 203, 94, 0.86); }

/* danger glass — botones destructivos */
.liquid-glass--danger {
  background: rgba(200, 97, 26, 0.72);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  color: #fff;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    0 1px 2px rgba(33, 29, 22, 0.06),
    0 12px 30px -16px rgba(200, 97, 26, 0.52);
}
.liquid-glass--danger::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.42) 22%,
    rgba(255,255,255,0.04) 45%, rgba(255,255,255,0.04) 55%,
    rgba(33,29,22,0.12) 80%, rgba(33,29,22,0.24) 100%);
}
.liquid-glass--danger:hover { background: rgba(218, 110, 32, 0.82); }
.liquid-glass--dark {
  background: rgba(255, 255, 255, 0.10);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    0 10px 30px -16px rgba(0,0,0,0.4);
}
.liquid-glass--dark::before {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.18) 22%,
    rgba(255,255,255,0) 45%, rgba(255,255,255,0) 55%,
    rgba(255,255,255,0.18) 80%, rgba(255,255,255,0.55) 100%);
}

/* --- Pricing spotlight cards (cursor-following clay ring over liquid glass) --- */
.spotlight-card {
  position: relative;
  --spot-x: -9999px;
  --spot-y: -9999px;
  transition: transform .4s cubic-bezier(0.22,1,0.36,1);
}
.spotlight-card:hover { transform: translateY(-4px); }
.spotlight-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity .4s ease;
  background: radial-gradient(300px circle at var(--spot-x) var(--spot-y),
    rgba(132,190,68,0.9), rgba(132,190,68,0.25) 40%, transparent 64%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
.spotlight-card:hover .spotlight-ring { opacity: 1; }
/* featured card keeps a faint static clay halo even at rest */
.spotlight-card--featured .spotlight-ring {
  opacity: .4;
  background: radial-gradient(360px circle at var(--spot-x) var(--spot-y),
    rgba(132,190,68,0.95), rgba(132,190,68,0.4) 46%, rgba(132,190,68,0.18) 100%);
}
.spotlight-card--featured:hover .spotlight-ring { opacity: 1; }

/* --- Calendar month grid: 2 → 3 → 4 columns (3×4 on desktop) --- */
.cal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 680px) { .cal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .cal-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

/* --- Primary nav visibility (CSS-driven so all 8 sections fit before
   collapsing to the full-screen overlay menu) --- */
.primary-nav { display: none; }
.nav-burger { display: flex; }
@media (min-width: 1100px) {
  .primary-nav { display: flex; }
  .nav-burger { display: none; }
}

/* --- Hairline divider --- */
.hair {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--line) 30%, var(--line) 70%,
    transparent 100%);
}

/* --- Image-slot tuning to match the paper aesthetic --- */
image-slot {
  --slot-bg: var(--paper-3);
  --slot-border: var(--line);
  --slot-fg: var(--ink-3);
  background: var(--paper-3);
}

/* Lift the hovered mounted photo (and its Replace/Remove controls) above
   the overlapping siblings so the buttons are always reachable. */
.mounted-photo { transition: filter .2s ease; }
.mounted-photo:hover { z-index: 40 !important; }

/* --- Number "9" texture marks --- */
.mark-9 {
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 0.8;
  color: var(--clay);
}

/* --- Underline-grow link --- */
.link-grow {
  position: relative;
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
}
.link-grow::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
.link-grow:hover::after { transform: scaleX(1); }

/* --- Marquee --- */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes e9FadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 38s linear infinite;
}

/* --- Instagram two-row marquee (top → right, bottom → left) --- */
@keyframes ig-left  { from { transform: translateX(0); }       to { transform: translateX(-50%); } }
@keyframes ig-right { from { transform: translateX(-50%); }    to { transform: translateX(0); } }
.ig-strip { position: relative; }
.ig-rows { display: flex; flex-direction: column; gap: 16px; }
.ig-mask { overflow: hidden; }
.ig-track {
  display: inline-flex;
  gap: 16px;
  will-change: transform;
}
.ig-track--right { animation: ig-right 70s linear infinite; }
.ig-track--left  { animation: ig-left  70s linear infinite; }
.ig-mask:hover .ig-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ig-track { animation: none; } }
.ig-tile {
  position: relative;
  flex: 0 0 auto;
  width: clamp(150px, 17vw, 216px);
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  background: var(--paper-3);
  transition: transform .3s ease, box-shadow .3s ease;
}
.ig-tile:hover { transform: translateY(-4px) scale(1.012); box-shadow: var(--shadow-lift); }
.ig-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-tile .ig-hover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to top, rgba(33,29,22,0.42), rgba(33,29,22,0.04) 60%);
  color: #fff; opacity: 0; transition: opacity .3s ease;
}
.ig-tile:hover .ig-hover { opacity: 1; }
/* fade edges so tiles slide in/out gracefully */
.ig-mask::before, .ig-mask::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 9%; z-index: 2; pointer-events: none;
}

/* --- Subtle grain overlay --- */
.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* hide scrollbars on horizontal rails */
.no-bar::-webkit-scrollbar { display: none; }
.no-bar { scrollbar-width: none; }

/* --- Reviews carousel (Google) --- */
@keyframes rev-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.rev-mask { overflow: hidden; position: relative; }
.rev-track {
  display: flex;
  gap: 20px;
  width: max-content;
  will-change: transform;
  animation: rev-scroll 75s linear infinite;
}
.rev-track:hover { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .rev-track { animation: none; } }
.rev-card {
  flex: 0 0 auto;
  width: clamp(290px, 31vw, 366px);
  display: flex;
  flex-direction: column;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 26px 24px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
  transition: transform .3s ease, box-shadow .3s ease;
}
.rev-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.rev-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--clay); color: #fff;
  font-weight: 600; font-size: 19px; flex-shrink: 0;
  font-family: var(--font-sans);
}
.rev-card blockquote {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rev-mask::before, .rev-mask::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 7%; z-index: 2; pointer-events: none;
}
.rev-mask::before { left: 0;  background: linear-gradient(90deg, #211D16, transparent); }
.rev-mask::after  { right: 0; background: linear-gradient(270deg, #211D16, transparent); }
