/* El Efecto Tiempo — hoja de estilos única */
:root {
  --paper: #f6f2ea;
  --paper-2: #efe8db;
  --card: #fffdf8;
  --ink: #1b2420;
  --ink-2: #4a5550;
  --ink-3: #7a837e;
  --line: #e2d9c8;
  --green: #1f5e4a;
  --green-2: #2f7a61;
  --green-soft: #dcebe3;
  --gold: #c8963e;
  --gold-soft: #f3e4c6;
  --red: #b4513a;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 36, 32, .05), 0 8px 24px -12px rgba(27, 36, 32, .18);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: var(--green-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin-top: 1.8em; }
h3 { font-size: 1.2rem; margin-top: 1.4em; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--card); padding: 8px 12px; z-index: 10; }

/* Cabecera */
.site-header { border-bottom: 1px solid var(--line); background: rgba(246, 242, 234, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.2rem; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 22px; font-size: .95rem; }
.nav a { color: var(--ink-2); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--green); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; color: var(--ink); cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; border-bottom: 1px solid var(--line); }
}

/* Portada */
.hero { padding: 72px 0 40px; }
.hero .eyebrow, .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--gold); margin-bottom: 14px; }
.hero h1 { max-width: 16ch; }
.hero h1 em { font-style: italic; color: var(--green); }
.hero .lead { font-size: 1.2rem; color: var(--ink-2); max-width: 58ch; }
.hero-quote { margin-top: 28px; padding-left: 16px; border-left: 3px solid var(--gold); color: var(--ink-2); font-family: var(--serif); font-style: italic; max-width: 52ch; }

.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; padding: 16px 0 64px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .2s ease, border-color .2s ease; }
.tool-card:hover { transform: translateY(-3px); border-color: var(--green-2); color: var(--ink); }
.tool-card .icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.tool-card h2, .tool-card h3 { font-size: 1.25rem; margin: 6px 0 0; }
.tool-card p { color: var(--ink-2); font-size: .95rem; margin: 0; }
.tool-card .go { margin-top: auto; padding-top: 8px; color: var(--green); font-weight: 600; font-size: .92rem; }

.band { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 56px 0; }
.cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; }
.cols-3 h3 { margin-top: 0; }

/* Página de calculadora */
.crumbs { font-size: .85rem; color: var(--ink-3); padding-top: 24px; }
.crumbs a { color: var(--ink-3); }
.page-head { padding: 18px 0 8px; }
.page-head .lead { font-size: 1.12rem; color: var(--ink-2); max-width: 64ch; }

.calc { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 22px; margin: 22px 0 8px; }
@media (max-width: 880px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.input { position: relative; }
.input input, .input select, select.input-plain {
  width: 100%; font: 500 1.05rem var(--sans); color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 44px 11px 12px;
  transition: border-color .15s, box-shadow .15s; -moz-appearance: textfield;
}
.input select { padding-right: 12px; }
.input input::-webkit-outer-spin-button, .input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input input:focus, .input select:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px var(--green-soft); }
.input .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: .9rem; pointer-events: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: 500 .85rem var(--sans); color: var(--ink-2); cursor: pointer; }
.chip:hover, .chip.on { border-color: var(--green-2); color: var(--green); background: var(--green-soft); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg label { flex: 1; text-align: center; margin: 0; font-weight: 500; font-size: .9rem; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 6px; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: var(--green); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--gold); }

.result-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.result-label { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.big { font-family: var(--serif); font-size: clamp(2.2rem, 6vw, 3.3rem); font-weight: 600; color: var(--green); line-height: 1.05; }
.sentence { color: var(--ink-2); margin: 10px 0 18px; }
.sentence strong { color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--paper); border-radius: 10px; padding: 12px 14px; }
.stat .k { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.stat .v { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat.gold { background: var(--gold-soft); }
.stat.green { background: var(--green-soft); }

.chart { position: relative; margin-top: 6px; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--ink-2); margin-bottom: 6px; }
.chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: .8rem; padding: 8px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); opacity: 0; transition: opacity .12s; font-variant-numeric: tabular-nums; }
.chart .tip.show { opacity: 1; }

details.table-wrap { margin-top: 16px; }
details.table-wrap summary { cursor: pointer; font-weight: 600; color: var(--green); font-size: .95rem; }
.table-scroll { overflow-x: auto; margin-top: 10px; max-height: 420px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { position: sticky; top: 0; background: var(--card); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }

.note { font-size: .82rem; color: var(--ink-3); margin-top: 14px; }

/* Artículo */
.article { max-width: 720px; padding: 24px 0 40px; }
.article h2:first-child { margin-top: .6em; }
.article ul, .article ol { padding-left: 1.3em; }
.article li { margin-bottom: .4em; }
.formula { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; overflow-x: auto; }
.callout { background: var(--green-soft); border-radius: 12px; padding: 16px 18px; margin: 1.2em 0; }
.callout.gold { background: var(--gold-soft); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--green); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 0; }
.related a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 600; }
.related a span { display: block; font-weight: 400; font-size: .85rem; color: var(--ink-3); }
.related a:hover { border-color: var(--green-2); }

/* Huecos publicitarios (se activan cuando AdSense apruebe la web) */
.ad-slot { margin: 28px 0; min-height: 0; }
.ad-slot:empty { display: none; }

/* Legales y contacto */
.legal { max-width: 760px; padding: 24px 0 56px; }
.legal h2 { font-size: 1.3rem; }
.ph { background: var(--gold-soft); padding: 0 4px; border-radius: 4px; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 48px; font-size: .9rem; color: var(--ink-2); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--sans); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--green); }
.disclaimer { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; font-size: .8rem; color: var(--ink-3); }

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

/* Barra de reparto (sueldo neto) */
.split { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--paper-2); margin: 4px 0 8px; }
.split span { display: block; height: 100%; transition: width .3s ease; }
.split-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--ink-2); margin-bottom: 18px; }
.split-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.field .check, .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--green); }

/* Caja de autor al final de cada artículo */
.author-box { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink-2); }
.author-box .author-name { font-weight: 600; color: var(--ink); margin-bottom: .3em; }

/* Tablas dentro de artículos: que no desborden en móvil */
.article table { display: block; max-width: 100%; overflow-x: auto; }
