/* Momento Ahorro — hoja de estilos principal */
:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --text: #161a23;
  --muted: #5b6475;
  --border: #e3e6ee;
  --accent: #b45309;
  --accent-2: #15803d;
  --accent-soft: #fef3c7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Segoe UI Variable Display", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12110d;
    --surface: #1c1a14;
    --text: #e8ebf2;
    --muted: #9aa3b5;
    --border: #2f2b21;
    --accent: #f59e0b;
    --accent-2: #4ade80;
    --accent-soft: #3a2a0a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-top: .3em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); }
h3 { font-size: 1.2rem; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 16px; }

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 1.3rem; color: var(--text); text-decoration: none; }
.logo strong { color: var(--accent); }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: .9rem;
}
.nav-links { display: flex; gap: 4px; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--accent-soft); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); font-size: 1.2rem; border-radius: 8px; padding: 4px 10px; cursor: pointer; }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 16px 16px;
  }
  .nav-links.open { display: flex; }
}

/* Portada */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); background: var(--accent-soft); padding: 4px 12px; border-radius: 99px; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.btn { display: inline-block; background: var(--accent); color: #fff; padding: 12px 22px; border-radius: 10px; text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font-size: 1rem; font-family: inherit; }
.btn:hover { color: #fff; filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); margin-left: 8px; }
.btn-ghost:hover { color: var(--text); background: var(--accent-soft); }
.hero-visual {
  aspect-ratio: 1 / 1; border-radius: 28px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 30% 30%, var(--accent-2), transparent 55%), radial-gradient(circle at 70% 70%, var(--accent), transparent 60%), #10131c;
}
.hero-visual::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px;
}
.hero-visual code { position: absolute; z-index: 1; left: 24px; bottom: 24px; color: #fff; font-size: .9rem; opacity: .85; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-visual { aspect-ratio: 16 / 9; } }

.section { padding: 32px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0 0 16px; }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s ease;
}
.card:hover { transform: translateY(-3px); }
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 1.15rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .meta { margin-top: auto; font-size: .82rem; color: var(--muted); }
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.card-featured .thumb { aspect-ratio: auto; min-height: 260px; }
.card-featured h3 { font-size: 1.6rem; }
@media (max-width: 760px) { .card-featured { grid-template-columns: 1fr; } }

/* Miniaturas generadas con CSS (sin imágenes de terceros) */
.thumb {
  aspect-ratio: 16 / 9; display: grid; place-items: center; position: relative; overflow: hidden;
  color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 2.6rem; letter-spacing: -.02em;
}
.thumb::before {
  content: ""; position: absolute; inset: 0; opacity: .25;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1px); background-size: 18px 18px;
}
.thumb span { position: relative; text-shadow: 0 2px 20px rgba(0,0,0,.25); }
.thumb-ia { background: linear-gradient(135deg, #5b4bff, #b44bff); }
.thumb-ciber { background: linear-gradient(135deg, #0f766e, #22c55e); }
.thumb-hard { background: linear-gradient(135deg, #f97316, #e11d48); }
.thumb-futuro { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.thumb-hero { border-radius: var(--radius); margin: 24px 0; font-size: clamp(3rem, 9vw, 5rem); }

.tag { display: inline-block; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 99px; width: fit-content; }
.tag-ia { background: #ecebff; color: #4636e0; }
.tag-ciber { background: #dcfce7; color: #166534; }
.tag-hard { background: #ffedd5; color: #c2410c; }
.tag-futuro { background: #e0f2fe; color: #0369a1; }

/* Categorías */
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
  text-decoration: none; color: var(--text); display: block;
}
.cat:hover { border-color: var(--accent); color: var(--text); }
.cat strong { display: block; font-family: var(--font-head); font-size: 1.1rem; }
.cat small { color: var(--muted); }

/* Filtros del blog */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 28px; }
.filters button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 7px 16px;
  border-radius: 99px; cursor: pointer; font: inherit; font-size: .9rem;
}
.filters button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Artículo */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); z-index: 60; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-top: 32px; padding-bottom: 48px; }
@media (max-width: 960px) { .article-layout { grid-template-columns: 1fr; } }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.post-meta { color: var(--muted); font-size: .92rem; }
.post-body { max-width: 720px; }
.post-body p, .post-body li { color: var(--text); }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li { margin-bottom: .4em; }
.post-body blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.callout { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 1.5em 0; }
.callout strong:first-child { font-family: var(--font-head); }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 22px; margin: 24px 0; }
.toc ol { margin: 6px 0 0; }
table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-family: var(--font-head); }
.table-wrap { overflow-x: auto; }

.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar .box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; position: relative; }
.sidebar .box h4 { margin: 0 0 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.sidebar li:last-child { border: 0; }
.sidebar li a { color: var(--text); text-decoration: none; }
.sidebar li a:hover { color: var(--accent); }
.sticky { position: sticky; top: 88px; }

.author-box { display: flex; gap: 16px; align-items: center; margin-top: 40px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.avatar { flex: 0 0 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-family: var(--font-head); }
.author-box p { margin: 0; font-size: .92rem; color: var(--muted); }

/* Espacios publicitarios AdSense */
.ad-slot { margin: 32px 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-preview .ad-slot ins { min-height: 90px; border: 1px dashed var(--border); border-radius: 10px; background: repeating-linear-gradient(45deg, transparent 0 10px, color-mix(in srgb, var(--border) 40%, transparent) 10px 20px); }

/* Páginas de texto (legales, sobre nosotros) */
.page { max-width: 780px; padding-top: 40px; padding-bottom: 64px; }
.page h2 { font-size: 1.35rem; }
.form { display: grid; gap: 14px; margin-top: 24px; }
.form label { font-weight: 600; font-size: .92rem; display: grid; gap: 6px; }
.form input, .form textarea {
  font: inherit; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }

/* Pie */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 40px 0 24px; margin-top: 48px; font-size: .92rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h4 { color: var(--text); margin: 0 0 10px; font-size: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---- Específico de Momento Ahorro ---- */
@media (prefers-color-scheme: dark) { .btn:not(.btn-ghost), .btn:not(.btn-ghost):hover, .filters button.active { color: #1a1206; } }
.thumb-guias { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.thumb-ahorro { background: linear-gradient(135deg, #16a34a, #0d9488); }
.thumb-ayudas { background: linear-gradient(135deg, #2563eb, #0891b2); }
.thumb-equipos { background: linear-gradient(135deg, #7c3aed, #db2777); }
.tag-guias { background: #ffedd5; color: #9a3412; }
.tag-ahorro { background: #dcfce7; color: #166534; }
.tag-ayudas { background: #dbeafe; color: #1e40af; }
.tag-equipos { background: #f3e8ff; color: #6b21a8; }

.hero-sun { background: linear-gradient(180deg, #fde68a 0%, #fb923c 55%, #7c2d12 100%); }
.hero-sun::after { display: none; }
.hero-sun .sun { position: absolute; width: 38%; aspect-ratio: 1; border-radius: 50%; top: 12%; left: 31%; background: radial-gradient(circle, #fffbeb 0 40%, #fde047 41% 100%); box-shadow: 0 0 80px 30px rgba(253, 224, 71, .6); }
.hero-sun .panels { position: absolute; left: -10%; right: -10%; bottom: 0; height: 42%; transform: perspective(500px) rotateX(35deg); transform-origin: bottom;
  background: linear-gradient(90deg, rgba(255,255,255,.35) 2px, transparent 2px) 0 0 / 12.5% 100%, linear-gradient(rgba(255,255,255,.35) 2px, transparent 2px) 0 0 / 100% 25%, linear-gradient(160deg, #1e3a8a, #0f172a); }

.hero-photo { background: #1c1a14; }
.hero-photo::after { display: none; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-badge { position: absolute; left: 16px; bottom: 16px; background: rgba(255,255,255,.92); color: #1a1206; padding: 10px 16px; border-radius: 99px; font-weight: 600; font-size: .92rem; text-decoration: none; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.hero-badge:hover { color: #b45309; }
.thumb-photo { background: var(--border); }
.thumb-photo::before { display: none; }
.thumb-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb-photo img { transform: scale(1.04); }
.post-figure { margin: 24px 0; }
.post-figure img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--radius); display: block; background: var(--border); }
.post-figure.banner img { aspect-ratio: 3 / 1; }
.post-figure figcaption { font-size: .82rem; color: var(--muted); margin-top: 8px; }
.calc-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px 32px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 15%, var(--surface))); border: 1px solid var(--border); }
.calc-cta h2 { margin: 0 0 6px; }
.calc-cta p { margin: 0; color: var(--muted); max-width: 40em; }
.calc-box p { margin: 0 0 12px; color: var(--muted); font-size: .95rem; }

.page-wide { max-width: 1000px; }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin: 24px 0; align-items: start; }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } }
.calc-form { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.calc-form small { font-weight: 400; color: var(--muted); font-size: .82rem; }
.form select { font: inherit; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.calc-results { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: .82rem; color: var(--muted); }
.stat strong { font-family: var(--font-head); font-size: 1.5rem; line-height: 1.2; }
.stat small { color: var(--muted); font-size: .8rem; }
.stat-hi { background: var(--accent-soft); border-color: var(--accent); }
.stat-hi strong { color: var(--accent); }

.info-rgpd { font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; font-weight: 400; }
.info-rgpd strong { color: var(--text); display: block; margin-bottom: 6px; }
.info-rgpd dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; }
.info-rgpd dt { font-weight: 600; color: var(--text); }
.info-rgpd dd { margin: 0; }
@media (max-width: 520px) { .info-rgpd dl { grid-template-columns: 1fr; } .info-rgpd dd { margin-bottom: 6px; } }

/* Sin consentimiento de publicidad no se reservan huecos para anuncios */
.no-ads .ad-slot { display: none; }

.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.site-footer .link-btn { color: var(--muted); text-decoration: none; }
.site-footer .link-btn:hover, .link-btn:hover { color: var(--accent); }
.page .link-btn { color: var(--accent); }

/* Aviso de cookies */
.cookie-banner { position: fixed; z-index: 100; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-top: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.25); padding: 20px 22px; animation: ck-in .3s ease; }
@keyframes ck-in { from { transform: translateY(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cookie-banner { animation: none; } }
.cookie-banner h2 { font-size: 1.15rem; margin: 0 0 6px; }
.cookie-banner p { margin: 0; font-size: .92rem; color: var(--muted); }
.ck-config { display: grid; gap: 10px; margin-top: 14px; }
.ck-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font-size: .9rem; color: var(--muted); }
.ck-opt strong { display: block; color: var(--text); }
.ck-opt input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 auto; }
.ck-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.ck-actions .btn { margin: 0; padding: 10px 18px; font-size: .95rem; }
@media (max-width: 520px) { .ck-actions .btn { flex: 1 1 100%; } .cookie-banner { padding: 18px; } }
