/* ==========================================================================
   MF Español — shared stylesheet
   Mobile-first. All design tokens live in :root.
   ========================================================================== */

/* ---------- Fonts (self-hosted, no third-party requests — DSGVO) ---------- */
@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair-display-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/assets/fonts/playfair-display-latin-wght-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  /* Brand colours, sampled from the logo */
  --color-primary: #6E7A52;       /* olive green of the logo background */
  --color-primary-dark: #55613F;  /* hover / buttons / links (5.8:1 on cream) */
  --color-primary-deep: #434E32;  /* darkest green, text on light when needed */
  --color-accent: #A9835E;        /* earth/terracotta end of the logo gradient (decorative only) */
  --color-accent-text: #7A6A3E;   /* accent for small text: passes WCAG AA on cream */
  --color-cream: #F4EFE2;         /* cream of the "MF" — light backgrounds, text on green */
  --color-paper: #FBF8F1;         /* page background */
  --color-ink: #2E3226;           /* body text */
  --color-muted: #5A5E4E;         /* secondary text */
  --color-line: #CFC8AC;          /* hairlines, like the logo's circle */

  /* Gradients (hero + footer only). Darkened vs. the logo to keep cream text readable */
  --gradient-brand: linear-gradient(135deg, #46573A 0%, #5B6A45 48%, #7C6848 100%);
  --gradient-footer: linear-gradient(160deg, #3F4D33 0%, #4E5A3B 60%, #6B5A3E 100%);

  /* Typography */
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-300: 0.8125rem;
  --fs-400: 1rem;
  --fs-500: 1.125rem;
  --fs-600: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  --fs-700: clamp(1.625rem, 1.3rem + 1.4vw, 2.25rem);
  --fs-800: clamp(2.125rem, 1.5rem + 2.8vw, 3.5rem);
  --tracking-wide: 0.25em;        /* the "E S P A Ñ O L" spacing */

  /* Spacing & shape */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: clamp(3.5rem, 2.5rem + 5vw, 6.5rem);
  --radius: 8px;
  --radius-lg: 14px;
  --container: 70rem;
  --container-narrow: 46rem;
  --header-h: 4.5rem;
  --shadow-soft: 0 1px 2px rgba(46, 50, 38, 0.06), 0 8px 24px rgba(46, 50, 38, 0.06);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: 1.7;
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--color-primary-dark); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-primary-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-accent-text); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.15; color: var(--color-ink); text-wrap: balance; }
h1 { font-size: var(--fs-800); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); }
p, li { text-wrap: pretty; }
ul, ol { padding-left: 1.25rem; }
strong { font-weight: 600; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--color-ink); color: var(--color-paper); padding: 0.75rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--color-paper); }

/* ---------- Layout ---------- */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.container--narrow { width: min(100% - 2rem, var(--container-narrow)); margin-inline: auto; }
.section { padding-block: var(--space-6); }
.section--cream { background: var(--color-cream); }
.section--tight { padding-block: var(--space-5); }
.section + .section:not(.section--cream):not(.cta-band) { border-top: 1px solid var(--color-line); }
.section-head { max-width: 42rem; margin-bottom: var(--space-5); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head p { margin-top: var(--space-2); color: var(--color-muted); font-size: var(--fs-500); }
.stack > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-3); }

.grid { display: grid; gap: var(--space-3); }
@media (min-width: 48rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
}
@media (min-width: 40rem) and (max-width: 47.99rem) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Brand details ---------- */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-300);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: var(--space-2);
}
.lead { font-size: var(--fs-500); color: var(--color-muted); }
.ornament {
  display: flex; align-items: center; gap: 0.875rem; color: var(--color-line);
  margin-block: var(--space-3);
}
.ornament::before, .ornament::after { content: ""; height: 1px; flex: 1; background: currentColor; max-width: 5rem; }
.ornament svg { width: 14px; height: 14px; color: var(--color-accent); }
.ornament--center { justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.75rem 1.5rem;
  font: 600 1rem/1.2 var(--font-body);
  border-radius: var(--radius); border: 1px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--primary { background: var(--color-primary-dark); color: var(--color-paper); }
.btn--primary:hover { background: var(--color-primary-deep); color: var(--color-paper); text-decoration: none; }
.btn--light { background: var(--color-paper); color: var(--color-primary-deep); }
.btn--light:hover { background: var(--color-cream); color: var(--color-ink); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--color-primary-dark); border-color: var(--color-line); }
.btn--ghost:hover { border-color: var(--color-primary-dark); color: var(--color-primary-deep); text-decoration: none; }
.btn--ghost-light { background: transparent; color: var(--color-paper); border-color: rgba(244, 239, 226, 0.55); }
.btn--ghost-light:hover { border-color: var(--color-paper); color: var(--color-paper); text-decoration: none; background: rgba(244, 239, 226, 0.08); }
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.text-link { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
.text-link::after { content: "→"; transition: transform 0.2s ease; }
.text-link:hover { text-decoration: underline; }
.text-link:hover::after { transform: translateX(3px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 241, 0.94);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--color-line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: var(--space-2); }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--color-ink); }
.brand:hover { color: var(--color-ink); text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.brand__tag { font-size: 0.6875rem; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-muted); margin-top: 0.2rem; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border: 1px solid var(--color-line); border-radius: var(--radius);
  background: transparent; color: var(--color-ink); cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block; width: 20px; height: 1.5px; background: currentColor; position: relative; transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav { display: none; }
.site-nav.is-open {
  display: block; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--color-paper); border-bottom: 1px solid var(--color-line);
  padding: var(--space-2) 1rem var(--space-3);
}
.site-nav ul { list-style: none; padding: 0; }
.site-nav a { display: block; padding: 0.75rem 0.25rem; text-decoration: none; color: var(--color-ink); font-weight: 500; border-bottom: 1px solid var(--color-line); }
.site-nav li:last-child a { border-bottom: 0; }
.site-nav a[aria-current="page"] { color: var(--color-primary-dark); font-weight: 600; }
.site-nav .nav-cta { margin-top: var(--space-2); text-align: center; border: 0; color: var(--color-paper); }
.site-nav .nav-cta:hover { color: var(--color-paper); }

@media (min-width: 64rem) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.is-open { display: block; position: static; padding: 0; border: 0; background: none; }
  .site-nav ul { display: flex; align-items: center; gap: 0.25rem; }
  .site-nav a { border: 0; padding: 0.5rem 0.75rem; font-size: 0.9375rem; border-radius: var(--radius); }
  .site-nav a:hover { color: var(--color-primary-dark); text-decoration: underline; }
  .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--color-accent); text-decoration-thickness: 2px; }
  .site-nav .nav-cta { margin: 0 0 0 0.75rem; padding: 0.625rem 1.125rem; min-height: auto; }
  .site-nav .nav-cta:hover { text-decoration: none; }
}

/* ---------- Hero ---------- */
.hero { background: var(--gradient-brand); color: var(--color-cream); overflow: hidden; }
.hero__inner { display: grid; gap: var(--space-4); align-items: center; padding-block: var(--space-5) var(--space-6); }
.hero h1 { color: var(--color-paper); }
.hero .eyebrow { color: var(--color-cream); opacity: 0.92; }
.hero__lead { font-size: var(--fs-500); margin-top: var(--space-3); max-width: 38rem; color: var(--color-cream); }
.hero__meta { margin-top: var(--space-3); font-size: 0.875rem; letter-spacing: 0.04em; color: var(--color-cream); opacity: 0.92; }
.hero__mark { justify-self: center; width: min(62vw, 15rem); order: -1; }
.hero__mark img { width: 100%; height: auto; border-radius: 50%; box-shadow: 0 0 0 1px rgba(244, 239, 226, 0.25); }
@media (min-width: 56rem) {
  .hero__inner { grid-template-columns: 1.35fr 1fr; gap: var(--space-5); padding-block: var(--space-6); }
  .hero__mark { order: 0; width: min(100%, 24rem); }
}

/* Compact page hero for inner pages */
.page-hero { background: var(--color-cream); border-bottom: 1px solid var(--color-line); padding-block: var(--space-5); }
.page-hero .lead { margin-top: var(--space-3); max-width: 44rem; }
.page-hero .btn-row { margin-top: var(--space-3); }

/* Breadcrumbs */
.breadcrumbs { font-size: 0.8125rem; color: var(--color-muted); margin-bottom: var(--space-3); }
.breadcrumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.breadcrumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--color-line); }
.breadcrumbs a { color: var(--color-muted); }

/* ---------- Features (numbered) ---------- */
.feature { border-top: 1px solid var(--color-line); padding-top: var(--space-3); }
.feature__num { font-family: var(--font-display); font-style: italic; font-size: 1.75rem; color: var(--color-accent-text); line-height: 1; display: block; margin-bottom: var(--space-2); }
.feature h3 { margin-bottom: var(--space-1); }
.feature p { color: var(--color-muted); }

/* ---------- Cards ---------- */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--color-paper); border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.section--cream .card { background: var(--color-paper); }
.card:hover { border-color: var(--color-primary); }
.card__kicker { font-size: 0.75rem; font-weight: 600; letter-spacing: var(--tracking-wide); text-transform: uppercase; color: var(--color-accent-text); }
.card p { color: var(--color-muted); }
.card .text-link { margin-top: auto; padding-top: var(--space-1); }
.card--link { position: relative; }
.card--link .text-link::before { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
@media (prefers-reduced-motion: no-preference) { .card--link:hover { transform: translateY(-2px); } }

/* ---------- Split (text + image) ---------- */
.split { display: grid; gap: var(--space-4); align-items: center; }
@media (min-width: 52rem) {
  .split { grid-template-columns: 1fr 1.2fr; gap: var(--space-6); }
  .split--reverse > :first-child { order: 2; }
}
.photo { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-line); background: var(--color-primary); }
.photo img { width: 100%; height: auto; }
.photo figcaption { font-size: 0.8125rem; color: var(--color-muted); padding: 0.5rem 0.75rem; background: var(--color-paper); }

/* ---------- Lists ---------- */
.check-list { list-style: none; padding: 0; }
.check-list li { position: relative; padding-left: 2rem; }
.check-list li + li { margin-top: 0.75rem; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.45em; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  border: 1px solid var(--color-primary);
  background: radial-gradient(circle, var(--color-primary) 0 3px, transparent 3.5px);
}
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: var(--space-3); }
.steps li { counter-increment: step; position: relative; padding-left: 3.5rem; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -0.1rem;
  font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: var(--color-accent-text);
}
.steps h3 { font-size: var(--fs-500); font-family: var(--font-body); font-weight: 600; margin-bottom: 0.25rem; }
.steps p { color: var(--color-muted); }
@media (min-width: 48rem) { .steps--row { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); } }

.levels { display: grid; gap: var(--space-2); }
@media (min-width: 48rem) { .levels { grid-template-columns: repeat(3, 1fr); } }
.level { border: 1px solid var(--color-line); border-radius: var(--radius); padding: var(--space-3); background: var(--color-paper); }
.level__tag { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--color-primary-dark); line-height: 1.2; }
.level p { color: var(--color-muted); margin-top: 0.25rem; }

/* ---------- Price / info box ---------- */
.info-box {
  border: 1px solid var(--color-line); border-left: 3px solid var(--color-accent);
  border-radius: var(--radius); padding: var(--space-3); background: var(--color-paper);
}
.info-box h3 { font-size: var(--fs-500); font-family: var(--font-body); font-weight: 600; margin-bottom: 0.25rem; }
.price { font-family: var(--font-display); font-size: var(--fs-700); font-weight: 700; color: var(--color-primary-deep); line-height: 1.2; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--color-line); }
.faq details { border-bottom: 1px solid var(--color-line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-2);
  padding: var(--space-3) 0; font-family: var(--font-display); font-size: var(--fs-500); font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--font-body); font-weight: 400; font-size: 1.5rem; line-height: 1;
  color: var(--color-primary-dark); flex: none; transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--color-primary-dark); }
.faq .faq__answer { padding-bottom: var(--space-3); color: var(--color-muted); max-width: 44rem; }

/* ---------- Related links ---------- */
.related { display: grid; gap: var(--space-2); }
@media (min-width: 48rem) { .related { grid-template-columns: repeat(3, 1fr); } }
.related a {
  display: block; padding: var(--space-3); border: 1px solid var(--color-line); border-radius: var(--radius);
  text-decoration: none; color: var(--color-ink); background: var(--color-paper);
}
.related a:hover { border-color: var(--color-primary); }
.related strong { display: block; font-family: var(--font-display); font-size: var(--fs-500); color: var(--color-primary-deep); }
.related span { font-size: 0.9375rem; color: var(--color-muted); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--color-cream); border-top: 1px solid var(--color-line); text-align: center; }
.cta-band p { color: var(--color-muted); font-size: var(--fs-500); margin-top: var(--space-2); }
.cta-band .btn-row, .btn-row--center { justify-content: center; }

/* ---------- Contact ---------- */
.contact-card { text-align: left; }
.contact-card .btn { margin-top: auto; align-self: flex-start; }
.contact-card__icon { width: 2.75rem; height: 2.75rem; border-radius: 50%; display: grid; place-items: center; background: var(--color-cream); color: var(--color-primary-dark); border: 1px solid var(--color-line); }
.contact-card__icon svg { width: 1.35rem; height: 1.35rem; }
.data-list { display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1.25rem; }
.data-list dt { font-weight: 600; }
.data-list dd { margin: 0; color: var(--color-muted); overflow-wrap: anywhere; }

/* ---------- Legal / prose ---------- */
.prose { max-width: var(--container-narrow); }
.prose h2 { font-size: var(--fs-600); margin-top: var(--space-5); margin-bottom: var(--space-2); }
.prose h3 { font-size: var(--fs-500); margin-top: var(--space-4); margin-bottom: var(--space-1); }
.prose p, .prose ul, .prose address { margin-bottom: var(--space-2); }
.prose address { font-style: normal; }
.prose li + li { margin-top: 0.35rem; }
.prose > h2:first-child { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--gradient-footer); color: var(--color-cream); padding-block: var(--space-5) var(--space-3); font-size: 0.9375rem; }
.site-footer a { color: var(--color-cream); text-decoration-color: rgba(244, 239, 226, 0.45); }
.site-footer a:hover { color: #fff; text-decoration-color: currentColor; }
.footer-grid { display: grid; gap: var(--space-4); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: var(--space-5); } }
.footer-brand { display: flex; align-items: center; gap: 0.875rem; margin-bottom: var(--space-2); }
.footer-brand img { width: 56px; height: 56px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(244, 239, 226, 0.3); }
.footer-brand span { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; }
.footer-title { font-size: 0.75rem; letter-spacing: var(--tracking-wide); text-transform: uppercase; font-weight: 600; margin-bottom: var(--space-2); font-family: var(--font-body); color: var(--color-cream); }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li + li { margin-top: 0.5rem; }
.footer-bottom {
  margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid rgba(244, 239, 226, 0.25);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-2); font-size: 0.8125rem;
}
.footer-bottom ul { display: flex; gap: var(--space-3); }
.footer-bottom li + li { margin-top: 0; }

/* ---------- Utilities ---------- */
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.center { text-align: center; }
.muted { color: var(--color-muted); }
.small { font-size: 0.875rem; }
