/* ============================================================
   EcoObras — Design System v2
   Rehabilitación energética y obras ecológicas
   Paleta: verde ecológico + ámbar energía + neutros fríos
   Tipografía: Space Grotesk (display) + Inter (cuerpo)
   v2: hero a pantalla completa + versión móvil pulida
   ============================================================ */

:root {
  /* Primitives */
  --green-900: #0a4f2c;
  --green-800: #0d5c33;
  --green-700: #0e6b3c;
  --green-600: #128a4c;
  --green-500: #1a9d5b;
  --green-100: #d9f2e3;
  --green-50:  #eef8f1;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-50:  #fef7e8;
  --ink-900: #1a2530;
  --ink-700: #33424f;
  --ink-500: #64748b;
  --ink-400: #8b98a6;
  --line: #e6ebef;
  --surface: #ffffff;
  --surface-soft: #f6f9f7;

  /* Semantic */
  --color-primary: var(--green-700);
  --color-primary-dark: var(--green-800);
  --color-accent: var(--amber-500);
  --color-text: var(--ink-900);
  --color-muted: var(--ink-500);
  --color-border: var(--line);
  --color-surface: var(--surface);
  --color-surface-soft: var(--surface-soft);

  /* Type scale (1.25) */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;
  --text-4xl: 3rem;

  /* Spacing (8px unit) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-md: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.04);
  --shadow-lg: 0 20px 40px -12px rgba(10,79,44,.18);

  --header-h: 64px;
}

/* ---------- Base ---------- */
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-base);
  line-height: 1.65;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

a { color: var(--color-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--color-primary-dark); }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--soft { background: var(--surface-soft); }
.section--green { background: linear-gradient(160deg, var(--green-800), var(--green-700)); color: #fff; }
.section--green h2, .section--green h3 { color: #fff; }

.eyebrow {
  display: inline-block;
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.section--green .eyebrow { color: var(--amber-400); }

.lead { font-size: var(--text-lg); color: var(--color-muted); max-width: 60ch; }
.section--green .lead { color: rgba(255,255,255,.85); }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(16,24,40,.04);
}
.inside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin-inline: auto;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem);
  gap: var(--space-4);
  min-height: var(--header-h);
}

/* Branding: logo (isotipo) + texto */
.site-branding-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.site-logo {
  display: flex;
  align-items: center;
  line-height: 0;
}
.site-logo img.header-image,
.site-logo img.is-logo-image,
.site-branding img.custom-logo,
.site-branding img.header-image {
  height: 40px;
  width: auto;
  max-width: none;
  border-radius: 10px;
  display: block;
}
.site-branding .main-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.site-branding .main-title a { color: var(--green-800); text-decoration: none; }
.site-branding .main-title a:hover { color: var(--green-600); }
.site-branding .site-description {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin: 2px 0 0;
  line-height: 1.2;
}

/* Navigation */
.main-navigation .main-nav ul li a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-700);
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.main-navigation .main-nav ul li a:hover,
.main-navigation .main-nav ul li.current-menu-item > a {
  color: var(--color-primary);
  background: var(--green-50);
}
.main-navigation .menu-toggle {
  border-radius: 8px;
  padding: 0.5rem;
  line-height: 1;
}

/* Botón CTA en menú */
.menu-cta a,
.main-nav ul li.menu-item-cta > a {
  background: var(--color-primary) !important;
  color: #fff !important;
  padding: 0.5rem 1.125rem !important;
  border-radius: 999px !important;
  font-weight: 600;
}
.main-nav ul li.menu-item-cta > a:hover {
  background: var(--color-primary-dark) !important;
  color: #fff !important;
}

/* Ocultar el título de página "Inicio" en la portada: el hero ya lleva su propio H1 */
.home .entry-header { display: none; }

/* ---------- Hero (pantalla completa) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(245,158,11,.18), transparent 60%),
    linear-gradient(150deg, #0a4f2c 0%, #0e6b3c 55%, #128a4c 100%);
  color: #fff;
  overflow: hidden;
}
.hero .container {
  position: relative;
  width: 100%;
  padding-block: calc(var(--header-h) + 2rem) clamp(2rem, 5vw, 4rem);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-12);
  align-items: center;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 500;
  backdrop-filter: blur(4px);
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
  margin: var(--space-4) 0;
}
.hero h1 em { font-style: normal; color: var(--amber-400); }
.hero__sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,.88);
  max-width: 46ch;
  line-height: 1.6;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,.18);
}
.hero__stat .num {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: var(--text-2xl);
  font-weight: 700;
  color: #fff;
}
.hero__stat .label { font-size: var(--text-sm); color: rgba(255,255,255,.75); }

.hero__card {
  background: #fff;
  color: var(--ink-900);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
}
.hero__card h3 { font-size: var(--text-xl); margin: 0 0 var(--space-4); }
.hero__card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.hero__card li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--text-sm);
  color: var(--ink-700);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line);
}
.hero__card li:last-child { border-bottom: none; padding-bottom: 0; }
.hero__card .check { color: var(--green-600); font-weight: 700; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: var(--text-base);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--amber-500); color: var(--ink-900); }
.btn--primary:hover { background: var(--amber-400); color: var(--ink-900); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--outline { background: #fff; color: var(--color-primary); border-color: var(--green-100); }
.btn--outline:hover { background: var(--green-50); color: var(--color-primary-dark); }
.btn:focus-visible { outline: 2px solid var(--amber-500); outline-offset: 2px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: var(--space-6); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-100);
  color: inherit;
}
.card .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--green-50);
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
}
.card h3 { margin: 0; font-size: var(--text-xl); }
.card p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); }
.card .card-link { font-weight: 600; font-size: var(--text-sm); color: var(--color-primary); }

/* ---------- Highlight band (hueco de oro) ---------- */
.highlight {
  background: linear-gradient(135deg, var(--amber-50), #fff);
  border: 1px solid #f3e0b0;
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: var(--space-8);
  align-items: center;
}
.highlight .tag {
  display: inline-block;
  background: var(--amber-500);
  color: var(--ink-900);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  margin-bottom: var(--space-3);
}
.highlight h3 { font-size: var(--text-2xl); margin: 0 0 var(--space-3); }
.highlight .big-num {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: var(--color-primary);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1;
}

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: var(--space-6); counter-reset: step; }
.step { position: relative; padding-top: var(--space-8); }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--green-100);
}
.step h3 { font-size: var(--text-lg); margin: 0 0 var(--space-2); }

/* ---------- Article / content page ---------- */
.entry-content { max-width: 72ch; }
.entry-content h2 { font-size: var(--text-2xl); margin-top: var(--space-12); }
.entry-content h3 { font-size: var(--text-xl); margin-top: var(--space-8); }
.entry-content p { color: var(--ink-700); }
.entry-content ul { color: var(--ink-700); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Source list ---------- */
.sources { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); }
.sources h3 { margin-top: 0; }
.sources ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.sources li a { font-size: var(--text-sm); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.72);
  font-size: var(--text-sm);
  padding-block: var(--space-8);
}
.site-footer .inside-footer { max-width: 1200px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.site-footer a { color: #fff; }

/* ============================================================
   MOBILE & RESPONSIVE
   ============================================================ */

/* Menú móvil: panel limpio al abrir */
@media (max-width: 768px) {
  .site-header { position: sticky; top: 0; }

  .inside-header { flex-wrap: wrap; gap: var(--space-2); }

  /* Branding compacto */
  .site-logo img.header-image,
  .site-logo img.is-logo-image,
  .site-branding img.custom-logo,
  .site-branding img.header-image { height: 34px; }
  .site-branding-container { gap: 0.6rem; }
  .site-branding .main-title { font-size: 1.15rem; }
  .site-branding .site-description { display: none; }

  /* Menú desplegable full-width, con fondo */
  .main-navigation.toggled .main-nav {
    width: 100%;
    background: #fff;
    border-top: 1px solid var(--line);
  }
  .main-navigation.toggled .main-nav > ul {
    padding: var(--space-3) 0 var(--space-5);
  }
  .main-navigation .main-nav ul li a {
    font-size: 1.05rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
  }
  /* CTA a ancho completo en móvil */
  .main-navigation.toggled .main-nav ul li.menu-item-cta > a {
    text-align: center;
    margin: 0.5rem 1rem;
  }
  .menu-toggle { display: flex; align-items: center; }

  /* Hero apilado */
  .hero .container {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-block: calc(var(--header-h) + 1.5rem) 2.5rem;
  }
  .hero h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem); }
  .hero__sub { font-size: 1.05rem; }
  .hero__stats { gap: var(--space-4); }
  .hero__stat .num { font-size: 1.35rem; }
  .hero__stat .label { font-size: 0.8rem; }

  /* Hero card: en móvil va debajo, compacta */
  .hero__card { padding: var(--space-5); }

  /* Botones a ancho completo en móvil */
  .hero__actions .btn { width: 100%; }

  .highlight { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .section { padding-block: 2.25rem; }
  .hero__actions { flex-direction: column; }
  .steps { grid-template-columns: 1fr; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ============================================================
   MEJORAS DE DISEÑO v3
   ============================================================ */

/* ---------- Animación de entrada (hero) ---------- */
@keyframes eco-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero__badge,
.hero h1,
.hero__sub,
.hero__actions,
.hero__stats {
  animation: eco-fade-up .7s ease both;
}
.hero h1      { animation-delay: .08s; }
.hero__sub    { animation-delay: .16s; }
.hero__actions{ animation-delay: .24s; }
.hero__stats  { animation-delay: .32s; }

/* Scroll cue en el hero */
.hero__scroll {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 999px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.hero__scroll::before {
  content: "";
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber-400);
  animation: eco-scroll 1.8s ease-in-out infinite;
}
@keyframes eco-scroll {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- Decoración del hero (formas suaves) ---------- */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}
.hero::before {
  width: 420px; height: 420px;
  background: rgba(245,158,11,.14);
  top: -120px; right: -80px;
}
.hero::after {
  width: 340px; height: 340px;
  background: rgba(255,255,255,.06);
  bottom: -140px; left: -100px;
}

/* ---------- Botones: brillo y elevación ---------- */
.btn--primary { position: relative; overflow: hidden; box-shadow: 0 6px 18px -6px rgba(245,158,11,.55); }
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.35) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.btn--primary:hover::after { transform: translateX(120%); }
.btn--primary:hover { transform: translateY(-2px); }

/* ---------- Tarjetas: flecha animada + borde superior acento ---------- */
.card { position: relative; }
.card .card-link { display: inline-flex; align-items: center; gap: .35rem; transition: gap .2s ease; }
.card:hover .card-link { gap: .6rem; color: var(--color-primary-dark); }
.card .icon { transition: transform .25s ease, background .25s ease; }
.card:hover .icon { transform: scale(1.08) rotate(-3deg); background: var(--green-100); }

/* ---------- Banda CTA antes del footer ---------- */
.cta-band {
  background:
    radial-gradient(700px 400px at 15% 0%, rgba(245,158,11,.22), transparent 55%),
    linear-gradient(150deg, var(--green-800), var(--green-700));
  color: #fff;
  text-align: center;
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 4vw, 2.5rem);
}
.cta-band h2 { color: #fff; font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 var(--space-3); }
.cta-band p { color: rgba(255,255,255,.85); max-width: 52ch; margin: 0 auto var(--space-6); font-size: var(--text-lg); }

/* ---------- Footer rico ---------- */
.eco-footer {
  background: var(--green-900);
  color: rgba(255,255,255,.72);
  font-size: var(--text-sm);
}
.eco-footer__grid {
  max-width: 1200px;
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 4vw, 2.5rem) 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: var(--space-8);
}
.eco-footer__brand img { height: 44px; width: auto; border-radius: 11px; margin-bottom: var(--space-4); }
.eco-footer__brand .name {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: var(--text-xl);
  color: #fff;
  margin: 0 0 2px;
}
.eco-footer__brand .tag { color: var(--amber-400); font-size: var(--text-xs); letter-spacing: .02em; }
.eco-footer__brand .desc { margin-top: var(--space-3); color: rgba(255,255,255,.6); line-height: 1.6; }
.eco-footer h4 {
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0 0 var(--space-3);
  letter-spacing: .02em;
}
.eco-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.eco-footer ul a { color: rgba(255,255,255,.7); text-decoration: none; transition: color .15s ease; }
.eco-footer ul a:hover { color: #fff; }
.eco-footer__contact a { color: #fff; }
.eco-footer__legal {
  border-top: 1px solid rgba(255,255,255,.12);
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space-5) clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,.45);
  font-size: var(--text-xs);
}
.eco-footer__legal a { color: rgba(255,255,255,.6); text-decoration: none; }
.eco-footer__legal a:hover { color: #fff; }

/* Ocultar el footer por defecto de GeneratePress */
.site-info { display: none; }

/* ---------- Responsive: footer + banda ---------- */
@media (max-width: 900px) {
  .eco-footer__grid { grid-template-columns: 1fr 1fr; }
  .hero__scroll { display: none; }
}
@media (max-width: 560px) {
  .eco-footer__grid { grid-template-columns: 1fr; gap: var(--space-6); }
  .eco-footer__legal { flex-direction: column; text-align: center; gap: var(--space-3); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__badge, .hero h1, .hero__sub, .hero__actions, .hero__stats,
  .hero__scroll::before { animation: none !important; }
}
