/* =====================================================================
   Nievas Consulting · site.css
   Sistema de diseño compartido para páginas internas (casos, guías, servicios).
   Mismo lenguaje editorial que la home: Fraunces + Geist, ink/teal/lime.
   ===================================================================== */

:root {
  --ink: #14201E;
  --teal: #0F3D3D;
  --body: #2A2A28;
  --paper: #FAFAF7;
  --line: #E2E2DC;
  --line-dark: rgba(255,255,255,0.13);
  --on-dark: rgba(255,255,255,0.74);
  --on-dark-soft: rgba(255,255,255,0.52);
  --lime: #C8FF00;
  --maxw: 1200px;
  --readw: 760px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--body);
  font-family: var(--sans); font-size: 17px; line-height: 1.6;
  letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 360; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); letter-spacing: -0.022em; line-height: 1.0; font-weight: 350; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); letter-spacing: -0.018em; line-height: 1.05; }
h3 { font-size: 1.35rem; letter-spacing: -0.012em; line-height: 1.18; font-weight: 420; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.lede { font-size: clamp(1.05rem, 1.7vw, 1.2rem); line-height: 1.55; color: var(--body); max-width: 620px; }
.kicker { font-family: var(--sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: #8a8f8c; margin: 0 0 22px; }
.on-dark .kicker { color: var(--on-dark-soft); }

.dark { background: var(--ink); color: var(--on-dark); }
.dark h1, .dark h2, .dark h3 { color: #fff; }
.dark .lede { color: var(--on-dark); }
.hl { color: var(--lime); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-weight: 500; font-size: 0.98rem; padding: 15px 26px; border-radius: 5px; border: 1px solid transparent; cursor: pointer; transition: background .2s ease, color .2s ease, border-color .2s ease; letter-spacing: 0; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: #eef0ec; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn .arw { transition: transform .2s ease; }
.btn:hover .arw { transform: translateX(3px); }

.arrow-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .2s ease; }
.on-dark .arrow-link { color: #fff; }
.arrow-link:hover { border-color: currentColor; }
.arrow-link .arw { color: var(--teal); transition: transform .2s ease; }
.on-dark .arrow-link .arw { color: var(--lime); }
.arrow-link:hover .arw { transform: translateX(3px); }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 60; background: rgba(20,32,30,0.86); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--line-dark); }
.hdr .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.hdr-logo { height: 26px; width: auto; filter: brightness(0) invert(1); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { color: rgba(255,255,255,0.7); font-size: 0.92rem; font-weight: 450; }
.nav a:hover { color: #fff; }
.nav .btn { padding: 10px 20px; font-size: 0.9rem; }
.nav a.btn-light { color: var(--ink); }
.nav a.btn-light:hover { color: var(--ink); }
@media (max-width: 880px) { .nav a.navlink { display: none; } }

/* ---------- Breadcrumb ---------- */
.crumb { font-size: 0.85rem; color: var(--on-dark-soft); margin-bottom: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb a { color: var(--on-dark-soft); border-bottom: 1px solid transparent; }
.crumb a:hover { color: #fff; border-color: currentColor; }
.crumb .sep { opacity: 0.5; }

/* ---------- Cabecera de artículo / caso (dark) ---------- */
.phead { background: var(--ink); color: var(--on-dark); padding: clamp(48px, 7vw, 92px) 0 clamp(40px, 6vw, 72px); }
.phead .eyebrow { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--on-dark-soft); margin-bottom: 18px; }
.phead h1 { color: #fff; max-width: 20ch; }
.phead .sub { color: var(--on-dark); font-size: clamp(1.05rem, 1.7vw, 1.22rem); line-height: 1.5; max-width: 56ch; margin: 22px 0 0; }
.phead .updated { font-size: 0.82rem; color: var(--on-dark-soft); margin-top: 26px; }

/* franja de KPI bajo la cabecera */
.kpi-band { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px 40px; margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--line-dark); }
.kpi-band .k-num { font-family: var(--serif); font-weight: 360; font-size: clamp(2.2rem, 4.4vw, 3.1rem); color: #fff; line-height: 1; letter-spacing: -0.02em; }
.kpi-band .k-num .hl { color: var(--lime); }
.kpi-band .k-lbl { font-size: 0.9rem; color: var(--on-dark-soft); margin-top: 10px; max-width: 28ch; }

/* ---------- Cuerpo de lectura ---------- */
.prose { max-width: var(--readw); margin: 0 auto; }
.prose h2 { margin: 2.4em 0 0.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.8em 0 0.4em; }
.prose p { color: var(--body); }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a.inline { color: var(--teal); border-bottom: 1px solid rgba(15,61,61,0.3); }
.prose a.inline:hover { border-color: var(--teal); }

/* TL;DR / respuesta corta */
.tldr { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 8px; padding: 26px 28px; margin: 0 0 36px; }
.tldr .t-lbl { font-family: var(--sans); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); margin-bottom: 12px; }
.tldr p { font-size: 1.08rem; line-height: 1.55; color: var(--ink); margin: 0; }
.tldr p + p { margin-top: 0.7em; }

/* lista de puntos clave */
.keypoints { list-style: none; padding: 0; margin: 0 0 36px; }
.keypoints li { position: relative; padding: 0 0 0 28px; margin-bottom: 12px; color: var(--body); }
.keypoints li::before { content: "→"; position: absolute; left: 0; top: 0; color: var(--teal); font-weight: 600; }

/* tabla de contenido editorial */
.ctable { width: 100%; border-collapse: collapse; margin: 1.6em 0 2em; font-size: 0.96rem; }
.ctable th { text-align: left; font-family: var(--sans); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8a8f8c; padding: 0 16px 12px 0; border-bottom: 1px solid var(--line); }
.ctable td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--body); }
.ctable td:last-child, .ctable th:last-child { padding-right: 0; }
.ctable .aft { color: var(--ink); font-weight: 500; }
.ctable .aft::before { content: "→ "; color: var(--teal); }

/* cita destacada */
.pullquote { margin: 2.4em 0; padding: 0 0 0 26px; border-left: 3px solid var(--lime); }
.pullquote p { font-family: var(--serif); font-weight: 360; font-size: clamp(1.4rem, 2.6vw, 1.8rem); line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 12px; }
.pullquote cite { font-style: normal; font-size: 0.9rem; color: #8a8f8c; }

/* nota / estimado */
.note { font-size: 0.86rem; color: #8a8f8c; font-style: italic; }

/* ---------- FAQ ---------- */
.faqwrap { max-width: var(--readw); margin: 0 auto; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; list-style: none; padding: 24px 44px 24px 0; font-family: var(--serif); font-weight: 420; font-size: 1.18rem; color: var(--ink); position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-family: var(--sans); font-size: 1.4rem; font-weight: 300; color: var(--teal); transition: transform .2s ease; }
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details p { margin: 0; padding: 0 44px 24px 0; color: var(--body); max-width: 75ch; }

/* ---------- Lista de casos (hub) ---------- */
.case-row { display: grid; grid-template-columns: 1fr auto; gap: 24px 40px; align-items: center; padding: 36px 0; border-top: 1px solid var(--line); transition: padding-left .25s ease; }
.case-row:last-child { border-bottom: 1px solid var(--line); }
.case-row:hover { padding-left: 8px; }
.case-row .c-meta { font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: #8a8f8c; margin-bottom: 10px; }
.case-row h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 380; margin-bottom: 8px; max-width: 24ch; }
.case-row p { margin: 0; color: var(--body); max-width: 54ch; font-size: 0.98rem; }
.case-row .c-kpi { text-align: right; min-width: 150px; }
.case-row .c-kpi .n { font-family: var(--serif); font-weight: 360; font-size: clamp(1.8rem, 3.4vw, 2.5rem); color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.case-row .c-kpi .l { font-size: 0.82rem; color: #8a8f8c; margin-top: 8px; }
@media (max-width: 720px) { .case-row { grid-template-columns: 1fr; gap: 16px; } .case-row .c-kpi { text-align: left; } }

/* ---------- CTA cierre ---------- */
.close { background: var(--teal); color: #fff; text-align: center; }
.close h2 { color: #fff; max-width: 18ch; margin: 0 auto 18px; }
.close .lede { color: rgba(255,255,255,0.8); margin: 0 auto 30px; }

/* ---------- Footer ---------- */
.ftr { background: var(--ink); color: var(--on-dark-soft); padding: 64px 0 32px; font-size: 0.92rem; border-top: 1px solid var(--line-dark); }
.ftr-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 26px; border-bottom: 1px solid var(--line-dark); }
.ftr-logo { height: 28px; width: auto; filter: brightness(0) invert(1); }
.ftr-social { display: flex; gap: 10px; }
.ftr-social a { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-dark); display: flex; align-items: center; justify-content: center; color: var(--on-dark); transition: border-color .2s ease, color .2s ease, transform .2s ease; }
.ftr-social a:hover { border-color: var(--lime); color: var(--lime); transform: translateY(-2px); }
.ftr-social svg { width: 16px; height: 16px; fill: currentColor; display: block; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 30px; padding: 26px 0; border-bottom: 1px solid var(--line-dark); }
.ftr-links a { color: var(--on-dark); font-size: 0.92rem; transition: color .2s ease; }
.ftr-links a:hover { color: var(--lime); }
.ftr-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 26px; font-size: 0.85rem; color: var(--on-dark-soft); }
.ftr-bottom a { color: var(--on-dark-soft); text-decoration: underline; }
.ftr-bottom a:hover { color: #fff; }
@media (max-width: 640px) { .ftr-top { flex-direction: column; align-items: flex-start; gap: 18px; } .ftr-bottom { flex-direction: column; align-items: flex-start; } }

/* reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }
