/* =============================================================
   Reforma y Hogar — styles.css
   Estilo: crema cálido + azul marino + amarillo obra + ladrillo
   ============================================================= */

/* 1. Tokens */
:root {
  --bg:      #FBF1E4;   /* crema */
  --bg-2:    #F2E4CF;   /* crema oscuro */
  --navy:    #10243E;   /* azul marino */
  --navy-2:  #1B3556;
  --yellow:  #FFC21A;   /* amarillo obra */
  --brick:   #D9480F;   /* ladrillo */
  --ink:     #10243E;
  --ink-soft:#2A3B52;
  --ink-mute:#586577;
  --line:    rgba(16, 36, 62, 0.18);

  --display: "Bricolage Grotesque", "Archivo Black", Impact, system-ui, sans-serif;
  --sans:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --wrap: 1160px;
  --gutter: clamp(1.2rem, 5vw, 3rem);
  --nav-h: 64px;
  --radius: 10px;
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  color: var(--ink-soft); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display); font-weight: 800; color: var(--ink);
  text-wrap: balance; line-height: 1.02; letter-spacing: -0.025em;
}
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--yellow); color: var(--navy); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 4px; }

/* 3. Utilidades */
.skip-link {
  position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem;
  background: var(--navy); color: var(--yellow); z-index: 10001; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 8vw, 6rem); }

.kicker {
  font-family: var(--sans); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--brick);
  display: inline-flex; align-items: center; gap: 0.55rem;
}
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--navy); }

.section-head { max-width: 46ch; margin-bottom: clamp(2rem, 5vw, 3rem); }
.section-title { font-size: clamp(2.1rem, 5.2vw, 3.6rem); margin-top: 0.8rem; }
.section-title em, .hero-title em {
  font-style: normal;
  background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%);
  padding: 0 0.08em;
}
.section-sub { margin-top: 1rem; color: var(--ink-mute); max-width: 46ch; }

/* 5. Componentes */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.85rem 1.6rem; border-radius: 999px;
  font-family: var(--display); font-weight: 800; font-size: 0.95rem;
  transition: transform .3s var(--ease-soft), background-color .25s, color .25s, border-color .25s;
}
.btn-primary { background: var(--yellow); color: var(--navy); }
.btn-primary:hover { transform: translateY(-2px); background: #FFD04D; }
.btn-ghost { color: var(--navy); border: 2px solid var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--yellow); }

.ph {
  position: relative; display: grid; place-items: center;
  border-radius: var(--radius); border: 2px dashed rgba(16, 36, 62, 0.35);
  background: repeating-linear-gradient(45deg, rgba(16,36,62,0.05) 0 10px, transparent 10px 20px), var(--bg-2);
  color: var(--ink-mute); overflow: hidden;
}
.ph figcaption {
  font-family: var(--sans); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.4rem 0.8rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line);
}
.ph-hero { aspect-ratio: 4 / 5; }
.hero-img { aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; border: 3px solid var(--navy); background: var(--navy); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-card { aspect-ratio: 16 / 10; }

.ad-slot {
  margin-block: clamp(1.5rem, 5vw, 3rem); min-height: 100px; display: grid; place-items: center;
  border: 2px dashed var(--line); border-radius: var(--radius);
  color: var(--ink-mute); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase;
}
.link-arrow {
  display: inline-block; margin-top: 1.4rem; font-family: var(--display); font-weight: 800;
  color: var(--yellow); border-bottom: 3px solid var(--yellow); padding-bottom: 2px;
}
.link-arrow:hover { color: #fff; border-color: #fff; }

/* 6. Nav (banda azul marino) */
.nav { position: fixed; top: 0; inset-inline: 0; z-index: 100; background: var(--navy); color: var(--bg); }
.nav-inner {
  max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter);
  height: var(--nav-h); display: flex; align-items: center; gap: 1.4rem;
}
.nav-brand { display: flex; align-items: center; gap: 0.65rem; margin-right: auto; }
.nav-brand-mark {
  font-family: var(--display); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.02em;
  padding: 0.25rem 0.5rem; border: 2px solid var(--yellow); border-radius: 8px; color: var(--yellow);
}
.nav-brand-text { font-family: var(--display); font-weight: 800; font-size: 1.05rem; color: var(--bg); }
.nav-links { display: none; gap: 1.6rem; }
.nav-link { position: relative; font-size: 0.9rem; font-weight: 500; color: var(--bg); padding: 0.2rem 0; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--yellow);
  transform: scaleX(0); transform-origin: right; transition: transform .3s var(--ease-soft);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { display: none; padding: 0.5rem 1.15rem; font-size: 0.85rem; }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px; width: 40px; height: 40px;
  align-items: center; justify-content: center; border: 2px solid var(--yellow); border-radius: 10px;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--yellow); transition: transform .3s var(--ease-out); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-6px) rotate(-45deg); }
.nav-drawer {
  display: flex; flex-direction: column; padding: 0 var(--gutter); max-height: 0; overflow: hidden;
  background: var(--navy); transition: max-height .4s var(--ease-out);
}
.nav-drawer[aria-hidden="false"] { max-height: 340px; padding-block: 0.4rem 1.2rem; }
.nav-drawer a { padding: 0.8rem 0; font-family: var(--display); font-weight: 800; font-size: 1.2rem; color: var(--bg); border-bottom: 1px solid rgba(251,241,228,0.15); }

/* 7. Portada */
.hero { padding-top: calc(var(--nav-h) + clamp(2rem, 6vw, 4.5rem)); padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
.hero-title { font-size: clamp(2.5rem, 7.4vw, 5rem); line-height: 0.96; letter-spacing: -0.03em; max-width: 14ch; margin-top: 0.9rem; }
.hero-sub { margin-top: 1.4rem; max-width: 44ch; font-size: 1.08rem; color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }
.hero-tags a {
  font-size: 0.82rem; font-weight: 600; padding: 0.35rem 0.85rem; border-radius: 999px;
  border: 2px solid var(--navy); color: var(--navy); transition: background-color .25s, color .25s;
}
.hero-tags a:hover { background: var(--yellow); }

/* 8. Artículos */
.guias-grid { display: grid; gap: 2rem 1.6rem; grid-template-columns: 1fr; }
.guia-card { background: transparent; border-top: 3px solid var(--navy); padding-top: 1rem; }
.guia-link { display: block; }
.guia-card .ph-card, .guia-img { border-radius: var(--radius); }
.guia-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--navy); }
.guia-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-soft); }
.guia-card:hover .guia-img img { transform: scale(1.05); }
.guia-body { padding-top: 1rem; }
.guia-kicker {
  display: inline-block; background: var(--yellow); color: var(--navy);
  font-weight: 600; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 999px;
}
.guia-card h3 { font-size: 1.3rem; line-height: 1.08; margin-top: 0.7rem; transition: color .2s; }
.guia-card:hover h3 { color: var(--brick); }
.guia-excerpt { margin-top: 0.6rem; color: var(--ink-mute); font-size: 0.93rem; }
.guia-meta { margin-top: 0.8rem; display: flex; gap: 0.4rem; font-size: 0.78rem; color: var(--ink-mute); }
.guia-body::after { content: "Leer guía →"; display: block; margin-top: 0.7rem; font-weight: 600; font-size: 0.9rem; color: var(--brick); }

.guias-cats { margin-top: 3rem; padding-top: 2rem; border-top: 3px solid var(--navy); }
.guias-cats-label { font-weight: 600; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brick); margin-bottom: 1rem; }
.guias-cats ul { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.guias-cats a {
  display: inline-block; padding: 0.45rem 1rem; border-radius: 999px; border: 2px solid var(--navy);
  font-size: 0.85rem; font-weight: 600; color: var(--navy); transition: background-color .25s;
}
.guias-cats a:hover { background: var(--yellow); }

/* 9. Ventajas */
.ventajas { border-top: 3px solid var(--navy); }
.pillars { display: grid; gap: 2.2rem; }
.pillar-num { font-family: var(--display); font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--brick); }
.pillars h3 { font-size: 1.5rem; margin-top: 0.5rem; }
.pillars p { margin-top: 0.5rem; color: var(--ink-mute); }

/* 10. Energía solar (banda azul marino) */
.solar { background: var(--navy); color: var(--bg); padding-block: clamp(3.5rem, 8vw, 6rem); }
.solar .kicker { color: var(--yellow); }
.solar .section-title { color: var(--bg); }
.solar .section-title em { background: none; color: var(--yellow); }
.solar-grid { display: grid; gap: 2.5rem; align-items: start; }
.solar-text p { margin-top: 1.1rem; color: rgba(251,241,228,0.82); max-width: 46ch; }
.solar-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; padding-top: 1.6rem; border-top: 3px solid var(--yellow); }
.solar-stats dt { font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.2rem); line-height: 1; color: var(--yellow); }
.solar-stats dd { margin-top: 0.5rem; font-size: 0.82rem; color: rgba(251,241,228,0.8); }

/* 11. Contacto */
.contacto-grid { display: grid; gap: 2.5rem; }
.contacto-aside p { margin-top: 1rem; color: var(--ink-mute); max-width: 40ch; }
.contacto-mail {
  display: inline-block; margin-top: 1.3rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem;
  color: var(--navy); border-bottom: 3px solid var(--yellow);
}
.contacto-formwrap { position: relative; }
.cta-form {
  display: grid; gap: 0.9rem; padding: 1.8rem 1.7rem 2rem; border-radius: var(--radius);
  border: 3px solid var(--navy); background: var(--bg-2); transition: opacity .5s var(--ease-out), transform .5s var(--ease-soft);
}
.cta-form.is-sent { opacity: 0; transform: translateY(-10px); pointer-events: none; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 1.4rem 1rem 0.5rem; border: 2px solid var(--navy); border-radius: 10px;
  background: var(--bg); color: var(--ink); font: inherit; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--yellow); }
.field label { position: absolute; left: 1rem; top: 1rem; pointer-events: none; color: var(--ink-mute); font-size: 0.95rem; transition: all .2s var(--ease-out); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: 0.4rem; font-size: 0.62rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brick);
}
.cta-submit { width: 100%; margin-top: 0.3rem; }
.cta-form-note { font-size: 0.78rem; color: var(--ink-mute); line-height: 1.5; }
.cta-form-note a { color: var(--brick); font-weight: 600; }
.cta-success {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.7rem; border-radius: var(--radius); background: var(--yellow); border: 3px solid var(--navy);
  opacity: 0; transition: opacity .5s var(--ease-out); padding: 1.5rem;
}
.cta-success.is-visible { display: flex; opacity: 1; }
.cta-success-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: var(--yellow); font-size: 1.3rem; font-weight: 700; }
.cta-success p { color: var(--navy); max-width: 32ch; font-weight: 500; }

/* Tarjeta de contacto (solo correo) */
.contacto-card {
  display: grid; gap: 1rem; justify-items: start; padding: 2rem 1.9rem 2.1rem;
  border-radius: var(--radius); border: 3px solid var(--navy); background: var(--bg-2);
}
.contacto-card-label { font-weight: 600; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brick); }
.contacto-card-mail {
  font-family: var(--display); font-weight: 800; font-size: clamp(1.2rem, 3.4vw, 1.7rem);
  color: var(--navy); border-bottom: 3px solid var(--yellow); word-break: break-word;
}
.contacto-card-list { display: grid; gap: 0.4rem; }
.contacto-card-list li { position: relative; padding-left: 1.2rem; }
.contacto-card-list li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--navy); }
.contacto-card-note { font-size: 0.82rem; color: var(--ink-mute); }
.contacto-card-note a { color: var(--brick); font-weight: 600; text-decoration: underline; }

/* 12. Pie (azul marino) */
.footer { background: var(--navy); color: rgba(251,241,228,0.8); padding-block: clamp(2.5rem, 6vw, 3.5rem) 2rem; }
.footer-top { display: grid; gap: 2rem; grid-template-columns: 1fr; padding-bottom: 2rem; border-bottom: 1px solid rgba(251,241,228,0.2); }
.footer-brand p { margin-top: 0.9rem; font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--bg); max-width: 16ch; line-height: 1.05; }
.footer .nav-brand-mark { display: inline-block; }
.footer-cols { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.footer-cols h4 { font-family: var(--sans); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--yellow); margin-bottom: 0.9rem; }
.footer-cols li { margin-bottom: 0.55rem; }
.footer-cols a { font-size: 0.88rem; color: rgba(251,241,228,0.85); transition: color .25s; }
.footer-cols a:hover { color: var(--yellow); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 0.8rem 2rem; align-items: baseline; padding-top: 1.6rem; }
.footer-bottom p { font-size: 0.78rem; color: rgba(251,241,228,0.65); }
.footer-disclaimer { max-width: 60ch; }

/* 13. Efectos */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease-soft), transform .6s var(--ease-soft); }
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* 14. Responsive */
@media (min-width: 720px) {
  .guias-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: repeat(3, 1fr); }
  .footer-top { grid-template-columns: 0.8fr 2fr; align-items: start; }
}
@media (min-width: 960px) {
  :root { --nav-h: 72px; }
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-toggle, .nav-drawer { display: none; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
  .guias-grid { grid-template-columns: repeat(3, 1fr); }
  .guias-grid .guia-card:first-child { grid-column: span 2; }
  .guias-grid .guia-card:first-child .ph-card, .guias-grid .guia-card:first-child .guia-img { aspect-ratio: 21 / 9; }
  .guias-grid .guia-card:first-child h3 { font-size: 1.8rem; }
  .solar-grid { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; }
  .contacto-grid { grid-template-columns: 0.9fr 1.1fr; gap: 4rem; }
}

/* 15. Reduced motion */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
