/* Madrasa — shared styles for the landing page and lesson units */
:root {
  --night: #16303f;
  --night-2: #1f4256;
  --ink: #1b2430;
  --muted: #5b6573;
  --cream: #fbf6ec;
  --sand: #f1e6d1;
  --card: #ffffff;
  --line: #e4d9c4;
  --amber: #f2a93b;
  --amber-ink: #8a5300;
  --clay: #c8643b;
  --leaf: #2f8f6b;
  --danger: #b4372f;
  --whatsapp: #1f9d55;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 48, 63, 0.06), 0 8px 24px rgba(22, 48, 63, 0.08);
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 84px; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 650; }
h3 { font-size: 1.25rem; font-weight: 650; }
p { margin: 0 0 1em; }

/* Language switching: every translatable string exists as a [data-l] pair. */
html[data-lang="es"] [data-l="en"],
html[data-lang="en"] [data-l="es"] { display: none !important; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 0.75rem;
}
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: 600 1rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.btn-wa { background: var(--whatsapp); color: #fff; }
.btn-wa:hover { background: #188547; }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 246, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; }
.brand svg { width: 40px; height: 40px; }
.nav { display: flex; gap: 1.4rem; margin-left: auto; font-size: 0.95rem; font-weight: 500; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.lang-toggle {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--card);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  font: 700 0.8rem/1 var(--font-body);
  letter-spacing: 0.05em;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.lang-toggle button[aria-pressed="true"] { background: var(--night); color: #fff; }
.header-cta { padding: 0.6rem 1rem; font-size: 0.9rem; }
@media (max-width: 860px) {
  .nav { display: none; }
  .lang-toggle { margin-left: auto; }
}
@media (max-width: 480px) {
  .header-cta span { display: none; }
  .header-cta { padding: 0.6rem; }
}

/* Hero */
.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(242, 169, 59, 0.18), transparent 45%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  color: #fff;
  overflow: hidden;
}
.hero .wrap { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 3rem; align-items: center; padding: clamp(56px, 9vw, 110px) 0; }
.hero .eyebrow { color: var(--amber); }
.hero .lead { color: rgba(255, 255, 255, 0.82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.hero-owl { justify-self: center; width: min(320px, 70vw); filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35)); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; margin-top: 2rem; padding: 0; list-style: none; font-size: 0.95rem; color: rgba(255, 255, 255, 0.78); }
.hero-facts li::before { content: "✓ "; color: var(--amber); font-weight: 700; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-owl { order: -1; width: 150px; justify-self: start; }
}

/* Cards & grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
@media (max-width: 860px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
}
.card p:last-child { margin-bottom: 0; }
.icon-badge {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--sand);
  color: var(--night);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}
.step-num {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 0.5rem;
}

/* Philosophy band */
.band { background: var(--sand); }
.not-list { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 0.6rem; }
.not-list li { display: flex; gap: 0.7rem; align-items: flex-start; }
.not-list .x { color: var(--danger); font-weight: 800; }
.not-list .ok { color: var(--leaf); font-weight: 800; }

/* Sample unit */
.unit-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
@media (max-width: 860px) { .unit-preview { grid-template-columns: 1fr; } }
.mini-flash {
  background: var(--night);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: var(--shadow);
  position: relative;
}
.mini-flash .word { font-family: var(--font-head); font-size: 2rem; }
.mini-flash .hint { color: var(--amber); font-size: 0.9rem; margin-top: 0.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.chips li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.9rem; }

/* Pricing */
.price-head { display: flex; align-items: baseline; justify-content: center; gap: 0.4rem; margin: 0.5rem 0 2.5rem; }
.price-head strong { font-family: var(--font-head); font-size: 3rem; }
.price-head span { color: var(--muted); }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); justify-content: center; gap: 1.5rem; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--amber); }
.plan .tag {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--amber); color: var(--ink);
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.3rem 0.8rem; border-radius: 999px; white-space: nowrap;
}
.plan .amount { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; margin: 0.4rem 0 0; }
.plan .per { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.2rem; }
.plan ul { list-style: none; padding: 0; margin: 0 0 1.6rem; display: grid; gap: 0.5rem; }
.plan li::before { content: "✓"; color: var(--leaf); font-weight: 800; margin-right: 0.5rem; }
.plan .btn { margin-top: auto; justify-content: center; }
.fine { font-size: 0.9rem; color: var(--muted); margin-top: 1.5rem; }

/* FAQ */
.faq { max-width: 760px; margin-inline: auto; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; margin-bottom: 0.75rem; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 700; color: var(--clay); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0.75rem 0 0; color: var(--muted); }

/* Final CTA + footer */
.cta-final { background: var(--night); color: #fff; }
.cta-final .lead { color: rgba(255, 255, 255, 0.8); }
.site-footer { padding: 2rem 0; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }

/* ---------- Lesson unit pages ---------- */
.unit-hero { background: var(--night); color: #fff; padding: 48px 0 40px; }
.unit-hero .lead { color: rgba(255, 255, 255, 0.8); }
.unit-hero .eyebrow { color: var(--amber); }
.unit-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.unit-nav a { color: #fff; text-decoration: none; border: 1.5px solid rgba(255, 255, 255, 0.35); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.9rem; }
.unit-nav a:hover { border-color: var(--amber); }
.unit-section { padding: 48px 0; border-bottom: 1px solid var(--line); }

.flash-stage { display: grid; grid-template-columns: minmax(0, 460px); justify-content: center; gap: 1rem; }
.flashcard { perspective: 1000px; height: 240px; cursor: pointer; border: 0; background: none; padding: 0; font: inherit; color: inherit; width: 100%; }
.flashcard:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; border-radius: var(--radius); }
.flash-inner { position: relative; width: 100%; height: 100%; transition: transform 0.5s ease; transform-style: preserve-3d; }
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--radius); display: grid; place-content: center; text-align: center; padding: 1.5rem;
  box-shadow: var(--shadow);
}
.flash-front { background: var(--card); border: 1px solid var(--line); }
.flash-back { background: var(--night); color: #fff; transform: rotateY(180deg); }
.flash-word { font-family: var(--font-head); font-size: 2.1rem; font-weight: 700; }
.flash-sub { color: var(--muted); margin-top: 0.4rem; font-size: 0.95rem; }
.flash-back .flash-sub { color: var(--amber); }
.flash-example { margin-top: 0.8rem; font-style: italic; font-size: 0.95rem; opacity: 0.9; }
.flash-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; }
.flash-controls .btn { padding: 0.65rem 1.05rem; font-size: 0.95rem; }
.btn-soft { background: var(--sand); color: var(--ink); }
.btn-know { background: var(--leaf); color: #fff; }
.progress { text-align: center; color: var(--muted); font-size: 0.9rem; }
.progress-bar { height: 6px; border-radius: 999px; background: var(--sand); overflow: hidden; margin-top: 0.4rem; }
.progress-bar span { display: block; height: 100%; background: var(--amber); width: 0; transition: width 0.3s ease; }

.dialogue { display: grid; gap: 0.8rem; max-width: 760px; }
.line { display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem 1rem; }
.line.b { background: #fff8ea; }
.who { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--clay); min-width: 5.5rem; padding-top: 0.2rem; }
.line .en { font-weight: 500; }
.line .es { color: var(--muted); font-size: 0.93rem; margin-top: 0.2rem; }
.dialogue.hide-es .es { display: none; }
.speak { border: 1.5px solid var(--line); background: var(--cream); border-radius: 999px; width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; }
.speak:hover { border-color: var(--amber); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.2rem; }
.toolbar .btn { padding: 0.55rem 1rem; font-size: 0.9rem; }

.tips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 760px) { .tips { grid-template-columns: 1fr; } }
.tip .wrong { color: var(--danger); text-decoration: line-through; }
.tip .right { color: var(--leaf); font-weight: 600; }

.quiz { display: grid; gap: 1rem; max-width: 760px; }
.q { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; }
.q-title { font-weight: 600; margin-bottom: 0.8rem; }
.options { display: grid; gap: 0.5rem; }
.options button {
  text-align: left; font: inherit; padding: 0.7rem 0.9rem; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--cream); cursor: pointer; color: var(--ink);
}
.options button:hover:not(:disabled) { border-color: var(--amber); }
.options button.correct { background: #e3f4ec; border-color: var(--leaf); }
.options button.wrong { background: #fbe7e5; border-color: var(--danger); }
.options button:disabled { cursor: default; }
.explain { margin-top: 0.7rem; font-size: 0.93rem; color: var(--muted); display: none; }
.q.answered .explain { display: block; }
.score { position: sticky; bottom: 16px; justify-self: start; background: var(--night); color: #fff; padding: 0.6rem 1rem; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Shared top navigation (built by scripts/build-nav.mjs) ---------- */
.vm-nav { position: sticky; top: 0; z-index: 50; background: rgba(251, 246, 236, 0.96); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.vm-nav > .wrap { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.vm-nav .brand svg { width: 40px; height: 40px; }
.nav-main { display: flex; align-items: center; gap: .25rem; margin-left: 1.5rem; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: .3rem; padding: .55rem .8rem; border-radius: 999px; border: 0; background: none; font: 600 .95rem/1 var(--font-body); color: var(--ink); text-decoration: none; cursor: pointer; }
.nav-link:hover, .nav-link[aria-expanded="true"] { background: var(--sand); }
.nav-link:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.nav-link .chev { width: 16px; height: 16px; transition: transform .2s ease; }
.nav-link[aria-expanded="true"] .chev { transform: rotate(180deg); }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.dropdown { position: absolute; top: calc(100% + 10px); left: 0; min-width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 50px rgba(22, 48, 63, .18); padding: .5rem; display: none; }
.dropdown.open { display: block; animation: vm-drop .16s ease; }
@keyframes vm-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown > a { display: block; padding: .65rem .8rem; border-radius: 10px; text-decoration: none; font-weight: 500; }
.dropdown > a:hover { background: var(--cream); }
.mega-panel { left: -1.2rem; width: min(860px, calc(100vw - 32px)); padding: 1.2rem; }
.mm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.mm-group { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--clay); margin: 0 0 .5rem .6rem; }
.mm-col ul, .mobile-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.mm-item { display: flex; gap: .8rem; align-items: flex-start; padding: .7rem .75rem; border-radius: 12px; text-decoration: none; border: 1px solid transparent; }
.mm-item:hover { background: var(--cream); border-color: var(--line); }
.mm-item.is-current { background: var(--sand); }
.mm-icon { font-size: 1.4rem; line-height: 1.2; width: 2rem; text-align: center; flex: none; }
.mm-text { display: grid; gap: .1rem; }
.mm-text strong { font-family: var(--font-head); font-size: 1.05rem; }
.mm-desc { color: var(--muted); font-size: .88rem; line-height: 1.35; }
.mm-meta { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: .15rem; }
.mm-price em { font-style: normal; background: var(--clay); color: #fff; border-radius: 999px; padding: .05rem .45rem; margin-left: .25rem; font-size: .7rem; letter-spacing: .04em; }
.mm-price s { opacity: .7; }
.mm-price .regular { display: none; }
.mm-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; border-top: 1px solid var(--line); margin-top: 1rem; padding: .9rem .6rem 0; font-size: .9rem; color: var(--muted); }
.mm-foot a { font-weight: 700; color: var(--night); text-decoration: none; }
.mm-foot a:hover { text-decoration: underline; }
.nav-burger { display: none; width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; padding: 0 10px; flex-direction: column; justify-content: center; gap: 5px; }
.nav-burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu { border-top: 1px solid var(--line); background: var(--cream); max-height: calc(100vh - 68px); overflow-y: auto; padding: 1rem 0 1.5rem; }
.mobile-courses a { display: flex; gap: .6rem; padding: .75rem .6rem; border-radius: 10px; text-decoration: none; font-weight: 600; }
.mobile-courses a[aria-current="page"], .mobile-courses a:hover { background: var(--sand); }
.mobile-courses + .mm-group { margin-top: 1rem; }
.mobile-links { display: grid; gap: .25rem; border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
.mobile-links a { padding: .65rem .6rem; text-decoration: none; font-weight: 600; color: var(--night); }
@media (max-width: 960px) {
  .nav-main { display: none; }
  .nav-burger { display: inline-flex; }
}
@media (max-width: 480px) {
  .vm-nav .lang-toggle button { padding: .4rem .55rem; }
}
/* Course overview page (/cursos) */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; margin-top: 1.2rem; }
.course-card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.course-card:hover { transform: translateY(-2px); border-color: var(--amber); }
.course-card h3 { margin: .3rem 0 0; }
.course-card p { margin: 0; color: var(--muted); }
.cc-icon { font-size: 2rem; }
.cc-meta { font-size: .88rem; font-weight: 600; margin-top: .4rem !important; }
.cc-go { margin-top: auto; padding-top: .8rem; font-weight: 700; color: var(--clay); }
.vm-nav .mobile-menu .wrap { display: block; min-height: 0; }
.vm-nav .brand span { font-family: var(--font-head); }
