/* Casas Alemanas — hoja de estilos
   Temas: oscuro por defecto; claro con data-theme="light" (botón del encabezado). */

:root {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-alt: #0f1829;
  --surface: #131d31;
  --text: #e7ebf2;
  --muted: #a4aec0;
  --border: #243049;
  --primary: #e7ebf2;
  --link: #8db4ff;
  --accent: #e0a36a;
  --accent-text: #e9b27f;
  --on-accent: #0b1220;
  --hero-bg: linear-gradient(135deg, #07142f 0%, #0d2352 100%);
  --hero-text: #ffffff;
  --hero-muted: #b9c6e0;
  --good: #5cc98f;
  --bad: #f08276;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  --shadow-lg: 0 8px 30px rgb(0 0 0 / .45);
  --header-bg: rgb(11 18 32 / .85);
  --img-filter: brightness(.9) contrast(1.05);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ef;
  --bg-alt: #efe9df;
  --surface: #ffffff;
  --text: #1a2230;
  --muted: #566072;
  --border: #e2dace;
  --primary: #001b4c;
  --link: #0b4aa8;
  --accent: #c98a4b;
  --accent-text: #8f5220;
  --on-accent: #001b4c;
  --hero-bg: linear-gradient(135deg, #001b4c 0%, #0a2e6e 100%);
  --hero-text: #ffffff;
  --hero-muted: #c9d5ec;
  --good: #1f7a4a;
  --bad: #b3372b;
  --shadow: 0 1px 2px rgb(16 24 40 / .06), 0 4px 16px rgb(16 24 40 / .06);
  --shadow-lg: 0 8px 30px rgb(16 24 40 / .12);
  --header-bg: rgb(247 244 239 / .85);
  --img-filter: none;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; filter: var(--img-filter); }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; color: var(--primary); margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.125rem); font-weight: 750; }
h3 { font-size: clamp(1.125rem, 1.05rem + .4vw, 1.3rem); font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
strong { font-weight: 700; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: .6em 1em; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 88px); }
.section--alt { background: var(--bg-alt); }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head p { color: var(--muted); font-size: 1.075em; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-text); margin-bottom: .6em;
}
.lead { font-size: 1.15em; color: var(--muted); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  color: var(--primary); text-decoration: none; font-weight: 800; letter-spacing: .08em; font-size: 1rem;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand span { white-space: nowrap; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a {
  display: block; padding: .5em .8em; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 550; font-size: .95rem;
}
.nav a:hover { background: var(--bg-alt); }
.nav a[aria-current="page"] { color: var(--accent-text); background: var(--bg-alt); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
.nav-toggle { display: none; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; padding: 8px var(--gutter) 16px; }
  .nav a { padding: .8em .75em; font-size: 1.05rem; }
}
@media (max-width: 380px) {
  .brand span { font-size: .85rem; letter-spacing: .05em; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.35em; border-radius: 999px;
  font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--ghost { border-color: currentColor; color: inherit; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-text); position: relative; overflow: hidden; }
.hero::after {
  /* patrón sutil de entramado de madera */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image:
    linear-gradient(90deg, #fff 1px, transparent 1px),
    linear-gradient(0deg, #fff 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(90deg, transparent, #000 60%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; gap: clamp(28px, 5vw, 56px); align-items: center;
  padding-block: clamp(48px, 8vw, 104px);
}
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.15fr .85fr; } }
.hero h1 { color: var(--hero-text); }
.hero .eyebrow { color: var(--accent); }
.hero p { color: var(--hero-muted); font-size: 1.125em; max-width: 60ch; }
.hero .btn-row { margin-top: 28px; }
.hero-media {
  border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgb(0 0 0 / .35);
  border: 1px solid rgb(255 255 255 / .12);
}
.hero-media img { width: 100%; filter: none; }

.page-hero { background: var(--hero-bg); color: var(--hero-text); }
.page-hero .container { padding-block: clamp(40px, 6vw, 72px); }
.page-hero h1 { color: var(--hero-text); margin-bottom: .3em; }
.page-hero p { color: var(--hero-muted); max-width: 65ch; font-size: 1.1em; margin: 0; }
.page-hero .eyebrow { color: var(--accent); }

/* ---------- Callout ---------- */
.callout {
  display: grid; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--accent);
  border-radius: var(--radius); padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow);
}
@media (min-width: 700px) { .callout { grid-template-columns: auto 1fr; } }
.callout-icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  background: var(--bg-alt); color: var(--accent-text);
}
.callout-icon svg { width: 28px; height: 28px; }
.callout h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem); margin-bottom: .35em; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: clamp(16px, 2.5vw, 24px); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px); box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--muted); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--bg-alt); color: var(--accent-text);
}
.card-icon svg { width: 24px; height: 24px; }

/* ---------- Split (texto + imagen) ---------- */
.split { display: grid; gap: clamp(24px, 5vw, 56px); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } .split--rev > :first-child { order: 2; } }
.split figure { margin: 0; }

.figure { margin: 0; }
.figure img { border-radius: var(--radius-sm); width: 100%; box-shadow: var(--shadow); background: var(--bg-alt); }
.figure figcaption { font-size: .875rem; color: var(--muted); margin-top: .5em; }

/* ---------- Tira de pasos (inicio) ---------- */
.steps-strip {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  counter-reset: s;
}
.steps-strip a {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; line-height: 1.3;
}
.steps-strip a:hover { border-color: var(--accent); }
.steps-strip .num {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .9rem;
}

/* ---------- Proceso ---------- */
.process { list-style: none; margin: 0; padding: 0; position: relative; }
.step { position: relative; display: grid; gap: 16px 24px; padding-bottom: clamp(40px, 6vw, 64px); }
@media (min-width: 720px) {
  .step { grid-template-columns: 56px 1fr; }
  .step::before {
    content: ""; position: absolute; left: 27px; top: 60px; bottom: 8px; width: 2px;
    background: linear-gradient(var(--border), var(--border));
  }
  .step:last-child::before { display: none; }
}
.step-num {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 1.25rem;
  box-shadow: 0 0 0 6px var(--bg);
}
:root[data-theme="light"] .step-num { background: var(--primary); color: var(--bg); }
.step-body h2 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.8rem); margin-top: .35em; }
.step-body > p { max-width: 70ch; }
.step-figs { display: grid; gap: 16px; margin-top: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.step-figs .figure img { aspect-ratio: 3 / 2; object-fit: cover; }

/* ---------- Pros / contras ---------- */
.pc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.pc-list > li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; }
.pc-list h3 { font-size: 1.05rem; margin: 0 0 .25em; }
.pc-list p, .pc-list ul { color: var(--muted); margin: 0; }
.pc-list ul { padding-left: 1.1em; }
.pc-list ul li + li { margin-top: .35em; }
.pc-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.pc-mark svg { width: 16px; height: 16px; }
.pc-mark--good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pc-mark--bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.card--pros { border-top: 5px solid var(--good); }
.card--cons { border-top: 5px solid var(--bad); }
.card h2 { font-size: 1.5rem; }

/* ---------- Recursos ---------- */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-list a {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
.doc-list a:hover { border-color: var(--accent); }
.doc-icon {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad);
  font-size: .7rem; font-weight: 800; letter-spacing: .03em;
}
.doc-icon--ext { background: var(--bg-alt); color: var(--accent-text); }
.doc-icon svg { width: 20px; height: 20px; }
.doc-title { font-weight: 650; line-height: 1.3; }
.doc-meta { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.doc-arrow { color: var(--muted); }
.doc-arrow svg { width: 18px; height: 18px; }
.sub-h { margin-top: 40px; }

.video-card {
  display: grid; gap: 20px; align-items: center;
  background: var(--hero-bg); color: var(--hero-text); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow-lg);
}
@media (min-width: 760px) { .video-card { grid-template-columns: auto 1fr auto; } }
.video-card h3 { color: var(--hero-text); margin: 0 0 .25em; }
.video-card p { color: var(--hero-muted); margin: 0; }
.video-card .play {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
}
.video-card .play svg { width: 26px; height: 26px; margin-left: 3px; }

/* ---------- Galería ---------- */
.gallery {
  list-style: none; margin: 0 0 clamp(32px, 5vw, 56px); padding: 0;
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 220px), 1fr));
}
.gallery button {
  display: block; width: 100%; padding: 0; border: 0; background: var(--bg-alt);
  border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; position: relative;
}
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease; }
.gallery button:hover img { transform: scale(1.04); }
.gallery button:focus-visible { outline-offset: 2px; }
.gallery-group h2 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.6rem); }

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgb(5 10 20 / .94); color: #fff;
}
.lightbox::backdrop { background: rgb(5 10 20 / .6); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.lb-counter { font-variant-numeric: tabular-nums; color: #c9d1de; font-size: .95rem; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 12px; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; filter: none; }
.lb-caption { text-align: center; padding: 12px 16px 20px; color: #dfe5ef; min-height: 3.2em; }
.lb-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgb(255 255 255 / .25); background: rgb(255 255 255 / .08); color: #fff; cursor: pointer;
}
.lb-btn:hover { background: rgb(255 255 255 / .18); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-prev, .lb-next { position: absolute; top: 50%; transform: translateY(-50%); }
.lb-prev { left: 12px; } .lb-next { right: 12px; }

/* ---------- Contacto ---------- */
.contact-card { text-align: center; max-width: 640px; margin-inline: auto; }
.contact-card .card-icon { margin-inline: auto; }
.contact-card .email { font-size: clamp(1.1rem, 1rem + 1vw, 1.5rem); font-weight: 700; word-break: break-word; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list svg { width: 22px; height: 22px; flex: none; color: var(--accent-text); margin-top: 2px; }

/* ---------- CTA ---------- */
.cta {
  background: var(--hero-bg); color: var(--hero-text); border-radius: var(--radius);
  padding: clamp(28px, 5vw, 56px); display: grid; gap: 20px; align-items: center; box-shadow: var(--shadow-lg);
}
@media (min-width: 800px) { .cta { grid-template-columns: 1fr auto; } }
.cta h2 { color: var(--hero-text); margin-bottom: .3em; }
.cta p { color: var(--hero-muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding-block: 36px; font-size: .95rem; }
.footer-inner { display: grid; gap: 24px; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { font-size: 1rem; margin-bottom: .6em; }
.site-footer p { color: var(--muted); margin: 0 0 .4em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3em; }
.site-footer a { color: var(--text); }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding-block: clamp(64px, 12vw, 140px); }
.notfound .big { font-size: clamp(4rem, 3rem + 6vw, 7rem); font-weight: 900; color: var(--accent-text); line-height: 1; margin-bottom: .2em; }
.notfound .btn-row { justify-content: center; }

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