/* =========================================================================
   Aerotermia Home — design system
   Static site, no build step. Mobile-first. Breakpoints: 540/720/960/1280/1600
   ========================================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --navy: #14324F;
  --navy-dark: #0D2439;
  --orange: #C9772B;
  --orange-dark: #A8611F;
  --bg: #F7F5F0;
  --cream: #FBFAF7;
  --card: #FFFFFF;
  --line: #E1DED4;
  --grey: #4A5361;
  --grey-light: #7A8391;
  --green: #2E7D4F;
  --green-bg: #EAF5EE;
  --red: #A23B3B;
  --red-bg: #FBEEEE;

  --serif: Georgia, 'Times New Roman', Times, serif;
  --display: 'Fraunces', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(20, 50, 79, .08);
  --shadow-md: 0 8px 24px rgba(20, 50, 79, .10);
  --shadow-lg: 0 18px 44px rgba(20, 50, 79, .16);

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --container-w: 1180px;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-dark); text-decoration-color: rgba(201, 119, 43, .35); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4, h5 { font-family: var(--display); color: var(--navy); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
button { font-family: inherit; }
table { border-collapse: collapse; width: 100%; }

/* ---------- 3. Utilities ---------- */
.container { width: 100%; max-width: var(--container-w); margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }
.section--tight { padding: 32px 0; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- 4. Typography helpers ---------- */
.lede { font-size: 1.15rem; color: var(--grey); max-width: 62ch; }
.chip {
  display: inline-block; font-size: .82rem; font-weight: 600; color: var(--navy);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; text-decoration: none;
}
.chip:hover { border-color: var(--orange); color: var(--orange-dark); }
.legal-placeholder {
  background: #FDF1DE; color: #8A5A12; border: 1px dashed #E0AD5C;
  border-radius: 4px; padding: 0 6px; font-style: italic; font-size: .92em;
}

/* ---------- 5. Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 300;
  background: var(--cream); border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.25rem; color: var(--navy);
  text-decoration: none; display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.brand span { color: var(--orange-dark); }
.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--navy); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }
.main-nav {
  position: fixed; top: 64px; left: 0; right: 0; bottom: 0;
  background: var(--cream); border-top: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
  overflow-y: auto;
}
.main-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.main-nav ul { list-style: none; margin: 0; padding: 12px 20px 32px; }
.main-nav li { border-bottom: 1px solid var(--line); }
.main-nav a { display: block; padding: 14px 4px; color: var(--navy); text-decoration: none; font-weight: 600; }
.main-nav a:hover { color: var(--orange-dark); }

/* ---------- 6. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange); color: #fff; border: 1px solid var(--orange);
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 700; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: background .15s var(--ease-out), transform .1s var(--ease-out), box-shadow .15s var(--ease-out);
}
.btn:hover { background: var(--orange-dark); border-color: var(--orange-dark); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--navy); color: #fff; }

/* ---------- 7. Hero ---------- */
.hero { padding: 56px 0 44px; background: linear-gradient(180deg, var(--cream), var(--bg)); border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); max-width: 18ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-search-terms { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-search-terms span {
  font-size: .82rem; font-weight: 600; color: var(--grey);
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}

/* ---------- 8. Cards / grids ---------- */
.category-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
.category-card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 22px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm);
  transition: box-shadow .18s var(--ease-out), transform .18s var(--ease-out), border-color .18s var(--ease-out);
}
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--orange); }
.category-card .count {
  display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--orange-dark); margin-bottom: 8px;
}
.category-card h3 { margin-bottom: 6px; font-size: 1.15rem; }
.category-card p { color: var(--grey); margin: 0; font-size: .95rem; }

.latest-grid, .related-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .18s var(--ease-out), transform .18s var(--ease-out);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-body { padding: 20px; }
.card .meta { font-size: .78rem; font-weight: 600; color: var(--grey-light); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card h3 a { color: var(--navy); text-decoration: none; }
.card h3 a:hover { color: var(--orange-dark); }
.card p { color: var(--grey); font-size: .92rem; margin: 0; }

/* ---------- 9. Breadcrumbs ---------- */
.breadcrumbs { font-size: .85rem; color: var(--grey-light); margin-bottom: 18px; }
.breadcrumbs a { color: var(--grey); text-decoration: none; }
.breadcrumbs a:hover { color: var(--orange-dark); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

/* ---------- 10. Category / tool page headers ---------- */
.category-header, .tool-page-header {
  padding: 40px 0 28px; background: var(--cream); border-bottom: 1px solid var(--line);
}
.category-header h1, .tool-page-header h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }

/* ---------- 11. Article ---------- */
.article-header h1 { font-size: clamp(1.6rem, 3.8vw, 2.35rem); max-width: 24ch; }
.article-meta { display: flex; align-items: center; gap: 12px; color: var(--grey-light); font-size: .88rem; margin-bottom: 8px; }

.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 14px 18px; margin: 24px 0; box-shadow: var(--shadow-sm);
}
.toc summary { font-weight: 700; cursor: pointer; color: var(--navy); }
.toc ol { margin: 12px 0 0; padding-left: 1.2em; }
.toc li { margin-bottom: 6px; font-size: .92rem; }
.toc a { color: var(--grey); text-decoration: none; }
.toc a:hover { color: var(--orange-dark); }

.article-body { font-family: var(--serif); font-size: 1.08rem; line-height: 1.75; color: #2A2E36; margin-top: 24px; }
.article-body h2 { font-size: 1.5rem; margin-top: 1.6em; scroll-margin-top: 84px; }
.article-body h3 { font-size: 1.2rem; margin-top: 1.4em; font-family: var(--sans); }
.article-body p { margin-bottom: 1.1em; }
.article-body ul, .article-body ol { margin-bottom: 1.1em; }
.article-body li { margin-bottom: .4em; }
.article-body a { color: var(--orange-dark); }
.article-body strong { color: var(--navy); }
.article-body blockquote {
  margin: 1.4em 0; padding: 4px 20px; border-left: 4px solid var(--orange);
  background: var(--cream); color: var(--grey); font-style: italic; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body .tabla-wrap { overflow-x: auto; margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.article-body table { font-family: var(--sans); font-size: .92rem; min-width: 480px; }
.article-body th, .article-body td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.article-body th { background: var(--navy); color: #fff; font-weight: 700; white-space: nowrap; }
.article-body tbody tr:nth-child(even) { background: var(--cream); }
.article-body tbody tr:last-child td { border-bottom: none; }

/* ---------- 12. Tool box (inline CTA) ---------- */
.tool-box {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--green-bg); border: 1px solid #CFE8DB; border-radius: var(--radius-md);
  padding: 20px; margin: 32px 0;
}
.tool-box__icon { font-size: 1.8rem; line-height: 1; }
.tool-box h4 { margin-bottom: 4px; font-size: 1.05rem; }
.tool-box p { color: var(--grey); font-size: .92rem; margin-bottom: 12px; }

/* ---------- 13. Related ---------- */
.related { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.3rem; }

/* ---------- 14. Tool page ---------- */
.tool-frame {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-md);
}
.tool-frame iframe { width: 100%; border: 0; display: block; background: #fff; }
.tool-links { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 32px; }
.tool-links a {
  color: var(--navy); text-decoration: none; font-weight: 600; padding: 10px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.tool-links a:hover { border-color: var(--orange); color: var(--orange-dark); }

/* ---------- 15. Legal ---------- */
.legal-body { font-size: .98rem; color: var(--grey); }
.legal-body h2 { font-size: 1.2rem; margin-top: 1.6em; }
.legal-body ul { margin-bottom: 1.2em; }
.legal-body li { margin-bottom: .3em; }

/* ---------- 16. Footer ---------- */
.site-footer { background: var(--navy); color: #D9E2EC; padding: 44px 0 24px; margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; padding-bottom: 28px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 12px; }
.footer-col p { color: #AAB9C8; font-size: .9rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col a { color: #C7D3DF; text-decoration: none; font-size: .9rem; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px;
  display: flex; flex-direction: column; gap: 6px; font-size: .8rem; color: #8FA0B2;
}
.footer-bottom .legal-placeholder { background: rgba(255,255,255,.08); color: #E8C989; border-color: rgba(232,201,137,.4); }

/* ---------- 17. Ad slots ---------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #EDEAE1, #EDEAE1 10px, #E6E2D6 10px, #E6E2D6 20px);
  border: 1px dashed #C7C1AE; border-radius: var(--radius-sm);
  color: #9C9683; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.ad-slot::before { content: 'ANUNCIO'; }
.ad-slot--banner { width: 100%; min-height: 100px; margin: 28px 0; }
.ad-slot--incontent { width: 100%; min-height: 90px; margin: 32px 0; }
.ad-slot--corner {
  position: fixed; right: 16px; bottom: 16px; width: 220px; height: 90px;
  z-index: 400; box-shadow: 0 10px 30px rgba(20,50,79,.18);
  transform: translateY(140%); transition: transform .35s var(--ease-out);
  flex-direction: column; gap: 2px;
}
.ad-slot--corner.is-visible { transform: translateY(0); }
.ad-slot-close {
  position: absolute; top: -10px; right: -10px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--navy); color: #fff; border: 2px solid var(--bg);
  cursor: pointer; font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.ad-slot-close:hover { background: var(--orange-dark); }

/* ---------- 18. Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: var(--navy); color: #E7EDF3; box-shadow: 0 -6px 24px rgba(0,0,0,.18);
  transform: translateY(100%); transition: transform .35s var(--ease-out);
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner .container { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; padding-bottom: 16px; }
.cookie-banner p { margin: 0; font-size: .88rem; color: #C7D3DF; }
.cookie-banner a { color: #F0C98A; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-banner .btn--ghost { border-color: rgba(255,255,255,.5); color: #fff; }
.cookie-banner .btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }

/* =========================================================================
   19. Responsive — mobile-first breakpoints
   ========================================================================= */

/* ≥540px: small phones landscape / large phones */
@media (min-width: 540px) {
  .hero-actions, .cookie-actions { flex-wrap: nowrap; }
  .cookie-banner .container { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ≥720px: tablets */
@media (min-width: 720px) {
  .category-cards { grid-template-columns: repeat(2, 1fr); }
  .latest-grid, .related-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-box { align-items: center; }
}

/* ≥960px: small desktop — nav becomes inline */
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .main-nav {
    position: static; transform: none; opacity: 1; pointer-events: auto;
    background: none; border-top: none; overflow: visible;
  }
  .main-nav ul { display: flex; align-items: center; gap: 4px; padding: 0; margin: 0; }
  .main-nav li { border-bottom: none; }
  .main-nav a { padding: 8px 12px; border-radius: var(--radius-sm); font-weight: 500; }
  .main-nav a:hover { background: var(--bg); }

  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .category-cards { grid-template-columns: repeat(3, 1fr); }
  .latest-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 64px 0; }
}

/* ≥1280px: large desktop */
@media (min-width: 1280px) {
  .hero { padding: 76px 0 60px; }
}

/* ≥1600px: very large screens — cap readable width a touch wider */
@media (min-width: 1600px) {
  :root { --container-w: 1280px; }
}
