/* =========================================================================
   LEADMAFIA — Blog stylesheet
   Editorial · after-dark luxe · ivory / noir / gold
   Built on styles.css design tokens.
   ========================================================================= */

/* ---------- shared page chrome ---------- */
.blog { background: var(--paper); }

.blog__crumb {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.blog__crumb a { color: var(--muted); }
.blog__crumb a:hover { color: var(--ink); }
.blog__crumb .sep { opacity: .5; }
.blog__crumb .current { color: var(--ink); }

.nav__links a.is-current { color: var(--ink); background: rgba(20,17,12,.05); }

/* =========================================================================
   HUB — index of articles
   ========================================================================= */
.hub { padding: clamp(40px, 5vw, 72px) 0 clamp(64px, 8vw, 120px); }

.hub__head {
  display: grid; gap: 20px;
  padding: clamp(20px, 3vw, 32px) 0 clamp(32px, 4vw, 52px);
  border-bottom: 1px solid var(--line-2);
  margin-bottom: clamp(36px, 4vw, 56px);
}
.hub__eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 10px;
}
.hub__eyebrow::before { content: ""; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }
.hub__title {
  font-size: clamp(40px, 6vw, 88px); line-height: .98; letter-spacing: -.035em;
  font-weight: 460; max-width: 16ch;
}
.hub__title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.hub__sub { color: var(--ink-2); max-width: 60ch; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5; }
.hub__stats { display: flex; gap: clamp(20px, 4vw, 56px); flex-wrap: wrap; margin-top: 6px; }
.hub__stat { display: flex; flex-direction: column; gap: 2px; }
.hub__stat b { font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; letter-spacing: -.02em; }
.hub__stat span { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* filter pills */
.hub__filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: clamp(28px, 3vw, 40px); }
.hub__filter {
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
  background: var(--card); cursor: pointer;
  transition: all var(--t-fast) var(--ease); white-space: nowrap;
}
.hub__filter:hover { border-color: var(--ink); }
.hub__filter.is-on { background: var(--ink); color: #ECE6D7; border-color: var(--ink); }
.hub__filter .c { color: var(--accent); margin-left: 6px; }
.hub__filter.is-on .c { color: var(--gold-2); }

/* featured row */
.hub__featured {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(20px, 2.4vw, 32px);
  margin-bottom: clamp(36px, 4vw, 56px);
}
@media (max-width: 860px){ .hub__featured { grid-template-columns: 1fr; } }

.feat {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 320px; padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--ink); color: #ECE6D7;
  border: 1px solid var(--ink);
}
.feat::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 90% at 85% 8%, rgba(201,162,39,.20), transparent 55%),
    repeating-linear-gradient(135deg, rgba(236,230,215,.035) 0 2px, transparent 2px 9px);
  pointer-events: none;
}
.feat > * { position: relative; z-index: 1; }
.feat__cat {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-2); margin-bottom: auto;
  display: inline-flex; align-items: center; gap: 8px;
}
.feat__cat::before { content: ""; width: 6px; height: 6px; background: var(--gold); border-radius: 50%; }
.feat__title {
  font-size: clamp(26px, 3vw, 42px); line-height: 1.04; letter-spacing: -.025em;
  font-weight: 470; margin: 18px 0 10px; max-width: 22ch;
}
.feat__title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.feat__dek { color: rgba(236,230,215,.66); font-size: 15px; line-height: 1.55; max-width: 48ch; }
.feat__meta { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; color: rgba(236,230,215,.5); margin-top: 16px; }
.feat:hover .feat__title { color: #fff; }

.feat--alt { background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); min-height: 0; }
.feat--alt::after {
  background:
    radial-gradient(120% 90% at 90% 10%, rgba(138,106,22,.10), transparent 55%),
    repeating-linear-gradient(135deg, rgba(20,17,12,.025) 0 2px, transparent 2px 9px);
}
.feat--alt .feat__cat { color: var(--accent); }
.feat--alt .feat__cat::before { background: var(--accent); }
.feat--alt .feat__dek { color: var(--muted); }
.feat--alt .feat__meta { color: var(--muted-2); }
.feat--alt:hover .feat__title { color: var(--ink); }

.hub__secondary { display: grid; gap: clamp(16px, 1.6vw, 20px); }

/* card grid */
.hub__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: clamp(16px, 1.8vw, 24px);
}
@media (max-width: 980px){ .hub__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px){ .hub__grid { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; gap: 12px;
  padding: clamp(20px, 2vw, 26px); min-height: 230px;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r); transition: border-color var(--t-fast), transform var(--t-fast);
}
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.card__cat {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 7px;
}
.card__cat::before { content: ""; width: 5px; height: 5px; background: var(--accent); border-radius: 50%; flex-shrink: 0; }
.card__title {
  font-size: clamp(18px, 1.5vw, 21px); line-height: 1.18; letter-spacing: -.018em;
  font-weight: 500; color: var(--ink);
}
.card__title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.card__dek { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: -2px; }
.card__meta {
  margin-top: auto; padding-top: 10px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: var(--muted-2);
  display: flex; gap: 10px; align-items: center;
}
.card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.card.is-hidden { display: none; }

/* category wayfinding tones — muted, brand-harmonious (oklch: same L/C, varied hue) */
.card[data-cat="comparativas"] .card__cat { color: oklch(0.47 0.07 80); }
.card[data-cat="comparativas"] .card__cat::before { background: oklch(0.47 0.07 80); }
.card[data-cat="sectores"] .card__cat { color: oklch(0.47 0.07 140); }
.card[data-cat="sectores"] .card__cat::before { background: oklch(0.47 0.07 140); }
.card[data-cat="criterios"] .card__cat { color: oklch(0.47 0.08 28); }
.card[data-cat="criterios"] .card__cat::before { background: oklch(0.47 0.08 28); }
.card[data-cat="guias"] .card__cat { color: oklch(0.5 0.08 55); }
.card[data-cat="guias"] .card__cat::before { background: oklch(0.5 0.08 55); }
.card[data-cat="datos-ia"] .card__cat { color: oklch(0.48 0.06 250); }
.card[data-cat="datos-ia"] .card__cat::before { background: oklch(0.48 0.06 250); }
.card:hover .card__title { color: oklch(0.2 0 0); }
.card[data-cat="comparativas"]:hover { border-color: oklch(0.47 0.07 80); }
.card[data-cat="sectores"]:hover { border-color: oklch(0.47 0.07 140); }
.card[data-cat="criterios"]:hover { border-color: oklch(0.47 0.08 28); }
.card[data-cat="guias"]:hover { border-color: oklch(0.5 0.08 55); }
.card[data-cat="datos-ia"]:hover { border-color: oklch(0.48 0.06 250); }
.card mark { background: var(--gold-tint); color: var(--ink); padding: 0 1px; border-radius: 2px; }
.feat mark { background: rgba(201,162,39,.28); color: inherit; padding: 0 1px; border-radius: 2px; }

.hub__empty { display: none; padding: 48px 0; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.hub__empty.is-on { display: block; }

/* =========================================================================
   ARTICLE — reading view
   ========================================================================= */
.article { padding: clamp(36px, 4vw, 64px) 0 clamp(64px, 8vw, 120px); }

.article__wrap { max-width: 720px; margin: 0 auto; }

.article__head { margin: 22px 0 clamp(28px, 3vw, 44px); }
.article__kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 9px; margin-bottom: 18px;
}
.article__kicker::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.article__title {
  font-size: clamp(30px, 4.4vw, 56px); line-height: 1.04; letter-spacing: -.03em;
  font-weight: 460; text-wrap: balance;
}
.article__title em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.article__dek {
  margin-top: 18px; color: var(--ink-2); font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5; max-width: 60ch; text-wrap: pretty;
}
.article__meta {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em; color: var(--muted);
}
.article__meta .byline { color: var(--ink); }
.article__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

/* body typography — editorial / long-read */
.article__body { font-size: 19.5px; line-height: 1.78; color: var(--ink-2); letter-spacing: -0.003em; }
.article__body > .standfirst + p::first-letter {
  font-family: var(--serif); font-size: 3.5em; line-height: .8; font-weight: 500;
  float: left; margin: 6px 14px -2px 0; color: var(--ink);
}
.article__body h2 {
  font-size: clamp(25px, 2.7vw, 35px); line-height: 1.14; letter-spacing: -.022em;
  font-weight: 500; color: var(--ink); margin: clamp(48px, 4.6vw, 68px) 0 18px;
  scroll-margin-top: 92px;
}
.article__body h2 em, .article__body h3 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.article__body h3 {
  font-size: clamp(19px, 1.8vw, 23px); line-height: 1.2; letter-spacing: -.015em;
  font-weight: 540; color: var(--ink); margin: 32px 0 12px;
}
.article__body p { margin: 0 0 24px; }
.article__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article__body a:hover { color: var(--ink); }
.article__body strong { color: var(--ink); font-weight: 600; }
.article__body ul, .article__body ol { margin: 0 0 22px; padding-left: 4px; display: grid; gap: 10px; }
.article__body li {
  position: relative; padding-left: 26px; line-height: 1.6;
}
.article__body ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}
.article__body ol { counter-reset: li; }
.article__body ol li { counter-increment: li; }
.article__body ol li::before {
  content: counter(li, decimal-leading-zero); position: absolute; left: 0; top: 1px;
  font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 500;
}

/* lead paragraph / deck */
.article__body .standfirst {
  font-size: clamp(21px, 2.1vw, 25px); line-height: 1.45; color: var(--ink-2); font-weight: 440;
  letter-spacing: -.012em; border: none; padding: 0; margin: 0 0 34px;
  font-family: var(--serif); font-style: italic;
}
.article__body .standfirst::first-letter { all: unset; }
.article__body .standfirst em { font-style: normal; }

/* pull quote */
.article__body blockquote {
  margin: clamp(40px, 5vw, 60px) 0; padding: 6px 0 6px 30px;
  border-left: 3px solid var(--accent);
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(24px, 3vw, 33px); line-height: 1.28; letter-spacing: -.014em;
  color: var(--ink); text-wrap: balance;
}
.article__body blockquote p { margin: 0; }
.article__body blockquote cite {
  display: block; margin-top: 14px; font-family: var(--mono); font-style: normal;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}

/* comparison table */
.compare {
  margin: clamp(28px, 3vw, 40px) 0; border: 1px solid var(--line-2); border-radius: var(--r);
  overflow: hidden; background: var(--card);
}
.compare__scroll { overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
.compare th, .compare td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; line-height: 1.45; }
.compare thead th {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; background: var(--paper-2);
}
.compare thead th.is-star { color: var(--accent); }
.compare tbody tr:last-child td { border-bottom: none; }
.compare td:first-child { font-weight: 500; color: var(--ink); font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.compare td.is-star { background: rgba(244,236,211,.4); color: var(--ink); font-weight: 500; }
.compare .tick { color: var(--good); font-weight: 600; }
.compare .cross { color: var(--muted-2); }

/* callout / verdict */
.callout {
  margin: clamp(28px, 3vw, 40px) 0; padding: clamp(22px, 2.6vw, 30px);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.callout__label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.callout__label::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; }
.callout p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--ink); }

.callout--ink { background: var(--ink); border-color: var(--ink); color: #ECE6D7; }
.callout--ink .callout__label { color: var(--gold-2); }
.callout--ink .callout__label::before { background: var(--gold); }
.callout--ink p { color: rgba(236,230,215,.78); }
.callout--ink strong { color: #fff; }
.callout--ink a { color: var(--gold-2); }

/* inline divider */
.article__body hr {
  border: none; height: 1px; background: var(--line-2);
  margin: clamp(36px, 4vw, 52px) 0;
}

/* tags */
.article__tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: clamp(36px, 4vw, 52px); }
.article__tags a {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em;
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-2); transition: border-color var(--t-fast);
}
.article__tags a:hover { border-color: var(--ink); }

/* author / source note */
.article__note {
  margin-top: clamp(28px, 3vw, 40px); padding-top: 22px; border-top: 1px solid var(--line-2);
  font-size: 13.5px; color: var(--muted); line-height: 1.6;
}
.article__note a { color: var(--accent); }

/* CTA */
.article__cta {
  margin-top: clamp(48px, 5vw, 72px); padding: clamp(30px, 4vw, 48px);
  border-radius: var(--r-xl); background: var(--ink); color: #ECE6D7; position: relative; overflow: hidden;
}
.article__cta::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 90% 0%, rgba(201,162,39,.18), transparent 55%);
  pointer-events: none;
}
.article__cta > * { position: relative; }
.article__cta .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-2); }
.article__cta h3 { font-size: clamp(24px, 2.8vw, 36px); font-weight: 470; letter-spacing: -.02em; margin: 14px 0 10px; line-height: 1.08; }
.article__cta h3 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.article__cta p { color: rgba(236,230,215,.7); max-width: 52ch; font-size: 15.5px; line-height: 1.55; }
.article__cta .btn-row { margin-top: 24px; }

/* related */
.article__related { margin-top: clamp(56px, 6vw, 88px); }
.article__related h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.article__related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px){ .article__related-grid { grid-template-columns: 1fr; } }
.rel {
  display: flex; flex-direction: column; gap: 8px; padding: 20px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color var(--t-fast);
}
.rel:hover { border-color: var(--ink); }
.rel__cat { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.rel__title { font-size: 15.5px; line-height: 1.3; letter-spacing: -.01em; font-weight: 500; color: var(--ink); }

/* reading progress */
.read-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--gold)); z-index: 60;
  transition: width .08s linear;
}

@media (max-width: 600px){
  .article__body { font-size: 16.5px; }
  .article__body > p:first-of-type::first-letter { font-size: 3em; }
}

/* =========================================================================
   ENHANCEMENTS — search · on-this-page rail · back-to-top
   ========================================================================= */

/* hub search */
.hub__search-wrap { position: relative; margin-bottom: 18px; }
.hub__search {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  padding: 15px 18px 15px 46px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--card);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.hub__search::placeholder { color: var(--muted-2); }
.hub__search:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(20,17,12,.04); }
.hub__search-wrap svg { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.hub__count { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--muted); margin: -6px 0 22px; }
.hub__count b { color: var(--ink); }

/* on-this-page rail (fixed, large screens only) */
.toc-rail {
  position: fixed; top: 50%; transform: translateY(-50%);
  left: max(20px, calc((100vw - var(--maxw)) / 2 - 200px));
  width: 190px; max-height: 70vh; overflow-y: auto;
  z-index: 30; opacity: 0; transition: opacity .3s var(--ease); pointer-events: none;
}
.toc-rail.is-on { opacity: 1; pointer-events: auto; }
.toc-rail h5 {
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted-2); margin: 0 0 12px; padding-left: 13px;
}
.toc-rail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.toc-rail a {
  display: block; font-size: 12.5px; line-height: 1.35; color: var(--muted);
  padding: 5px 0 5px 13px; border-left: 2px solid var(--line-2);
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.toc-rail a:hover { color: var(--ink); }
.toc-rail a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
@media (max-width: 1320px){ .toc-rail { display: none; } }

/* back to top */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: #ECE6D7; border: 1px solid var(--ink);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease), background var(--t-fast);
  box-shadow: 0 6px 24px rgba(20,17,12,.18);
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: #2A2620; }
@media (max-width: 600px){ .to-top { right: 16px; bottom: 16px; } }
