/* Spanish for Foreigners con Karina Anderson
   Palette follows the Yo Hablo México logo (green #005411); font matches the original site. */

:root {
  --bg: #f6f9f6;
  --surface: #ffffff;
  --surface-alt: #e7f0e9;
  --text: #707071;
  --muted: #707071;
  --accent: #005411;
  --accent-hover: #0b7a28;
  --line: #b6d0bc;
  --radius: 10px;
  --max: 1080px;
  --font: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { color: var(--accent); font-weight: 400; line-height: 1.25; margin: 0 0 .6em; overflow-wrap: break-word; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: #fff; padding: .5em 1em; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */

/* Centered header like the original Webador site: big title, centered menu */
.site-header {
  background: var(--surface);
}

.header-inner {
  max-width: var(--max); margin: 0 auto; padding: .9rem 1rem .35rem;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
  text-align: center;
}

.brand { display: block; line-height: 0; }
/* Logo size by screen width: desktop / tablet / phone */
.brand img { width: 500px; max-width: 100%; height: auto; }
@media (max-width: 1024px) { .brand img { width: 400px; } }
@media (max-width: 600px) { .brand img { width: 65vw; } }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 6px;
  padding: .4rem .6rem; font: inherit; color: var(--accent); cursor: pointer;
}

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1rem;
}

.site-nav a {
  display: block; padding: .4rem .7rem;
  color: var(--muted); text-decoration: none; font-size: .95rem;
  text-transform: uppercase;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { background: var(--accent); color: #fff; }

.lang-switch {
  max-width: var(--max); margin: 0 auto; padding: .25rem 1rem 1.25rem;
  display: flex; gap: .4rem; justify-content: center; font-size: .85rem;
}
.lang-switch button {
  background: var(--surface-alt); border: 0; border-radius: 999px;
  padding: .25rem .8rem; font: inherit; color: var(--muted); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* Language filter: the page shows all three by default */
body[data-lang="es"] [lang="en"], body[data-lang="es"] [lang="fr"],
body[data-lang="en"] [lang="es"], body[data-lang="en"] [lang="fr"],
body[data-lang="fr"] [lang="es"], body[data-lang="fr"] [lang="en"] { display: none; }
/* Testimonials exist in one language only: always show them, whatever the filter */
body[data-lang] .testimonial blockquote[lang] { display: block; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
}

/* ---------- Layout ---------- */

main { display: block; }

.section {
  max-width: var(--max); margin: 0 auto; padding: 3rem 1rem;
}

.section.alt { background: var(--surface-alt); max-width: none; }
.section.alt > .inner { max-width: var(--max); margin: 0 auto; }

/* Green band with centered white text (the intro under the banner on the original site) */
.section.dark {
  background: var(--accent); color: #fff; max-width: none;
  text-align: center; font-size: 1.2rem;
}
.section.dark > .inner { max-width: var(--max); margin: 0 auto; }
.section.dark h1, .section.dark h2, .section.dark h3 { color: #fff; font-weight: 400; }
.section.dark a { color: #fff; }
.section.dark .btn { background: #fff; color: var(--accent); }

.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center;
}
.split.reverse > :first-child { order: 2; }
.split img { border-radius: var(--radius); width: 100%; max-height: 640px; object-fit: cover; }

/* Photo edge to edge on one half, text on the other (Karina section on the original homepage) */
.section.bleed { max-width: none; padding: 0; }
.split.bleed { gap: 0; align-items: stretch; }
/* Like the original site: the photo fills its half of the screen and is cut to the
   height of the text beside it (contain: size stops the photo setting the row height) */
.split.bleed img { border-radius: 0; max-height: none; height: auto;
  min-height: max(420px, 36vw); /* never wider than the original's shape, even with one language shown */
  contain: size; align-self: stretch; object-position: 50% 58%; }
.split.bleed > div { padding: 3rem clamp(1rem, 4vw, 3.5rem); align-self: center; max-width: 40rem; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; gap: 1.5rem; }
  .split.bleed img { contain: none; align-self: auto; min-height: 0; max-height: 480px; aspect-ratio: 12 / 13; }
  .split.reverse > :first-child { order: 0; }
}

/* Trilingual text blocks: a thin rule between languages */
.tri > [lang] + [lang] { padding-top: 1em; }
body[data-lang] .tri > [lang] + [lang] { padding-top: 0; }

/* ---------- Hero ---------- */

/* Short banner with centered, light-weight text like the original */
.hero {
  position: relative; color: #fff; min-height: min(45vh, 420px);
  display: flex; align-items: center;
  background: var(--accent) var(--hero, none) 72% 62%/cover no-repeat;
  text-align: center;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,70,20,.32);
}
.hero .inner {
  position: relative; max-width: var(--max); margin: 0 auto; padding: 3rem 1rem; width: 100%;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.hero h1 { color: #fff; font-weight: 400; }
@media (max-width: 600px) { .hero { background-image: var(--hero-sm, var(--hero, none)); background-position: center; } }
.hero p { font-size: clamp(1.2rem, 2.6vw, 1.9rem); line-height: 1.3; max-width: 52rem; margin: 0 auto .6em; }
.hero .btn-row { justify-content: center; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: .6rem 1.1rem; border-radius: 4px; text-decoration: none; font-weight: 400;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn.light { background: #fff; color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Cards / quotes ---------- */

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem;
}
.card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,84,17,.08);
}
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card .body { padding: 1.25rem; }

blockquote {
  margin: 0; padding: 1.5rem; background: var(--surface);
  border-left: 4px solid var(--accent); border-radius: var(--radius);
  font-style: italic;
}
blockquote footer { font-style: normal; font-weight: 700; color: var(--accent); margin-top: .5rem; }

.testimonial {
  display: grid; grid-template-columns: 160px 1fr; gap: 1.5rem; align-items: center;
  margin-bottom: 2rem;
}
.testimonial img { width: 160px; height: 160px; object-fit: cover; border-radius: 50%; }
@media (max-width: 560px) {
  .testimonial { grid-template-columns: 1fr; justify-items: center; text-align: center; }
}

ul.features { padding-left: 1.2em; }
ul.features li { margin-bottom: .4em; }

/* ---------- Gallery ---------- */

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
  margin: 0; padding: 0; list-style: none;
}
.gallery figure { margin: 0; }
.gallery a { display: block; }
.gallery img { aspect-ratio: 1/1; object-fit: cover; width: 100%; border-radius: var(--radius); }
.gallery figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }

/* ---------- Contact ---------- */

.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem;
}
.contact-card {
  background: var(--surface); border-radius: var(--radius); padding: 1.5rem; text-align: center;
  box-shadow: 0 1px 3px rgba(0,84,17,.08);
}
.contact-card h3 { margin-bottom: .3rem; }
.contact-card p { word-break: break-word; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--bg); color: var(--accent); text-align: center; padding: 2rem 1rem; font-size: .95rem;
  border-top: 1px solid var(--surface-alt);
}
.site-footer a { color: var(--accent); }
.site-footer .social { display: flex; justify-content: center; gap: 1.25rem; margin-bottom: .75rem; }
