/* ==========================================================================
   CONTEXTO CHACO — hoja de estilos del sitio público
   Estático, autocontenido, sin dependencias externas.
   Dirección "nativo digital": sans-forward, base clara, acento cobalto.
   ========================================================================== */

/* -- Fuentes autohospedadas (sin CDN) -------------------------------------- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/spacegrotesk-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('../fonts/spacegrotesk-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* -- Tokens ---------------------------------------------------------------- */
:root {
  --bg:        #ffffff;
  --panel:     #f4f6fa;
  --ink:       #14161a;
  --muted:     #5b6270;
  --teal:      #14161a;   /* barras oscuras (topbar/nav/footer): casi-negro */
  --teal-deep: #0b0c0f;
  --teal-soft: #262a30;   /* hover sobre superficies oscuras */
  --accent:    #1449e6;   /* cobalto */
  --gold:      #3f6fe8;   /* cobalto claro (acentos secundarios) */
  --line:      #e2e5ea;
  --white:     #ffffff;
  --display: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sans:  system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --maxw: 1200px;
}

/* -- Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); line-height: 1.15; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ==========================================================================
   Banners publicitarios
   ========================================================================== */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  margin: 18px auto;
}
.ad-slot a { display: block; }
.ad-slot img { border: 0; }
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  width: 100%; height: 100%;
}
.ad-avail { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.ad-avail-ico { font-size: 15px; letter-spacing: 0; }
.ad-728  { width: 728px; max-width: 100%; height: 90px; }
.ad-970  { width: 970px; max-width: 100%; height: 90px; }
.ad-300x600 { width: 300px; height: 600px; }
.ad-300x250 { width: 300px; height: 250px; }

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 40px;
}
.topbar-social { display: flex; gap: 14px; align-items: center; }
.topbar-social a { color: var(--muted); display: flex; }
.topbar-social a:hover { color: var(--accent); }
.topbar-social svg { width: 15px; height: 15px; fill: currentColor; }
.topbar-meta { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.topbar-meta .sep { opacity: .45; }
.topbar-search { display: flex; }
.topbar-search input {
  background: var(--white); border: 1px solid var(--line);
  color: var(--ink); font-size: 13px;
  padding: 6px 10px; width: 180px; border-radius: 6px 0 0 6px;
}
.topbar-search input::placeholder { color: #9aa1ab; }
.topbar-search button {
  background: var(--accent); border: 1px solid var(--accent);
  color: var(--white); cursor: pointer; padding: 0 12px;
  border-radius: 0 6px 6px 0;
}
.topbar-search button svg { width: 14px; height: 14px; fill: currentColor; }

/* ==========================================================================
   Masthead (logo)
   ========================================================================== */
.masthead { background: var(--white); padding: 22px 0 18px; }
.masthead-inner { display: flex; align-items: baseline; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 8px; line-height: 1; }
.brand .brand-top {
  font-family: var(--display); font-weight: 700; font-size: 33px;
  letter-spacing: -.01em; color: var(--ink);
}
.brand .brand-bottom {
  font-family: var(--display); font-weight: 700; font-size: 33px;
  color: var(--accent); letter-spacing: -.01em;
}
.brand-sep { display: none; }
.brand-tagline {
  margin-left: auto; font-size: 13px; letter-spacing: .01em; color: var(--muted);
  text-transform: none; line-height: 1.4; text-align: right;
}

/* ==========================================================================
   Navegación principal
   ========================================================================== */
.mainnav {
  background: var(--white); position: sticky; top: 0; z-index: 50;
  border-top: 1px solid var(--line); border-bottom: 2px solid var(--ink);
}
.mainnav-inner { display: flex; align-items: stretch; min-height: 46px; }
.nav-toggle {
  display: none; background: none; border: 0; color: var(--ink);
  font-size: 22px; padding: 8px 14px; cursor: pointer;
}
.nav-list { display: flex; align-items: stretch; flex: 1; }
.nav-list li { display: flex; }
.nav-list a {
  display: flex; align-items: center; padding: 0 15px;
  color: var(--ink); font-size: 13px; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase;
}
.nav-list a:hover { color: var(--accent); }
.nav-list a.nav-home { color: var(--accent); }
.nav-list a.nav-home svg { width: 16px; height: 16px; fill: currentColor; }
.nav-list a.nav-highlight {
  background: var(--accent); color: var(--white); font-weight: 500;
  margin-left: auto; padding: 0 14px;
}

/* ==========================================================================
   Tarjetas y bloques de portada
   ========================================================================== */
.kicker {
  display: inline-block;
  background: var(--accent); color: var(--white);
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; padding: 4px 9px;
}
.kicker a { color: inherit; }
.meta {
  color: var(--muted); font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; display: flex; gap: 8px; align-items: center;
}
.meta .dot::before { content: '·'; }

/* Héroe */
.hero { display: grid; grid-template-columns: 7fr 5fr; gap: 22px; margin-top: 8px; }

/* Carrusel del héroe: slides apilados con fade suave */
.hero-carousel { position: relative; }
.hero-track { position: relative; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease;
  pointer-events: none;
}
.hero-slide.is-active {
  position: relative;
  opacity: 1; visibility: visible;
  pointer-events: auto;
}
/* Sin JS: se ve el primer slide igual (position relative por is-active) */
.hero-slide .hero-image { position: relative; }
.hero-slide .kicker { position: absolute; left: 14px; bottom: 14px; }
.hero-slide .hero-image img { width: 100%; aspect-ratio: 3/2; object-fit: cover; background: var(--teal-deep); }

/* Bloque de texto con ALTURA FIJA para que el carrusel no salte al rotar.
   Título y bajada se recortan a un número fijo de líneas. */
.hero-body { height: 150px; overflow: hidden; padding-top: 14px; }
.hero-slide h2 {
  font-size: 34px; font-weight: 700; margin: 0 0 8px; line-height: 1.12;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.hero-slide h2 a:hover { color: var(--accent); }
.hero-slide .excerpt {
  color: var(--muted); font-size: 16px; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* Controles */
.hero-controls {
  position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; z-index: 3;
}
.hero-btn {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(11,12,16,.6); color: #fff; font-size: 18px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.hero-btn:hover { background: var(--accent); }
/* Dots anclados sobre la imagen: el bloque de texto mide 150px fijo, así que
   bottom: 162px los deja centrados en el borde inferior de la imagen. */
.hero-dots {
  position: absolute; left: 0; right: 0; bottom: 162px; display: flex; gap: 7px;
  justify-content: center; z-index: 3; pointer-events: none;
}
.hero-dot {
  width: 9px; height: 9px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.6); box-shadow: 0 1px 3px rgba(11,12,16,.5);
  transition: background .2s, transform .2s; pointer-events: auto;
}
.hero-dot.is-active { background: var(--gold); transform: scale(1.3); }

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; }
.card-overlay { position: relative; overflow: hidden; background: var(--teal-deep); min-height: 200px; }
.card-overlay img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.card-overlay .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,12,16,0) 30%, rgba(11,12,16,.92) 100%);
}
.card-overlay .card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 14px; }
.card-overlay h3 { color: var(--white); font-size: 17.5px; font-weight: 700; margin: 8px 0 6px; }
.card-overlay h3 a:hover { color: var(--gold); }
.card-overlay .meta { color: #9aa4b2; }

/* Secciones */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--teal); margin: 34px 0 20px; padding-bottom: 8px;
}
.section-head h2 {
  font-size: 24px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--teal);
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: ''; width: 5px; height: 22px; background: var(--accent); display: inline-block;
}
.section-head .more {
  color: var(--accent); font-size: 12.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
}

.section-layout { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }

.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.card h3 { font-size: 20px; font-weight: 700; margin: 12px 0 6px; }
.card h3 a:hover { color: var(--accent); }
.card .excerpt { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.card img { width: 100%; aspect-ratio: 8/5; object-fit: cover; background: var(--line); }

/* Últimas noticias (grilla compacta) */
.compact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 26px; }
.card-compact { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.card-compact img { width: 110px; height: 82px; object-fit: cover; background: var(--line); }
.card-compact .cat {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.card-compact h3 { font-size: 15.5px; font-weight: 700; margin: 3px 0 4px; line-height: 1.25; }
.card-compact .meta { font-size: 11px; }

.load-more-wrap { display: flex; justify-content: center; margin: 26px 0 8px; }
.load-more {
  border: 1.5px solid var(--accent); color: var(--accent); background: transparent;
  font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 11px 26px; cursor: pointer; font-family: var(--sans);
  display: inline-flex; align-items: center; gap: 8px;
}
.load-more:hover { background: var(--accent); color: var(--white); }

/* ==========================================================================
   Artículo
   ========================================================================== */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; margin-top: 10px; }
.breadcrumbs { font-size: 12.5px; color: var(--muted); margin: 14px 0 4px; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 6px; opacity: .6; }

.article h1 { font-size: 36px; font-weight: 700; margin: 10px 0 10px; }
.article .lead { font-size: 18px; color: var(--muted); margin: 0 0 14px; font-weight: 400; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 10px 0; margin-bottom: 18px;
}
.article-cover figcaption,
.article-body figcaption {
  font-size: 12.5px; color: var(--muted); padding-top: 6px;
}
.article-body { font-size: 17px; line-height: 1.7; }
.article-body p { margin: 0 0 1.1em; }
.article-body h2, .article-body h3, .article-body h4 { margin: 1.4em 0 .5em; color: var(--teal); }
.article-body h2 { font-size: 26px; } .article-body h3 { font-size: 22px; } .article-body h4 { font-size: 18px; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.article-body ul, .article-body ol { margin: 0 0 1.1em 1.4em; }
.article-body ul { list-style: disc; } .article-body ol { list-style: decimal; }
.article-body li { margin-bottom: .35em; }
.article-body blockquote {
  border-left: 4px solid var(--accent); background: var(--panel);
  margin: 1.2em 0; padding: 14px 18px; font-family: var(--display);
  font-size: 18px; color: var(--muted);
}
.article-body blockquote p { margin: 0; }
.article-body table {
  border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 15px;
}
.article-body th, .article-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-body th { background: var(--panel); }
.article-body figure { margin: 1.4em 0; }
.article-body pre {
  background: var(--teal-deep); color: #dfe3ea; padding: 14px;
  overflow-x: auto; font-size: 14px; border-radius: 4px;
}
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }

.embed-video { position: relative; aspect-ratio: 16/9; background: var(--teal-deep); }
.embed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Galería */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 1.4em 0; }
.gallery .gallery-item { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }
.gallery figcaption { font-size: 11.5px; }

/* Disclaimer legal al pie de la nota */
.article-disclaimer {
  margin: 26px 0 4px; padding: 14px 16px;
  border-left: 3px solid var(--muted); background: var(--panel);
  font-size: 12.5px; color: var(--muted); line-height: 1.55; font-style: italic;
}

/* Tags del artículo */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.article-tags a {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px;
}
.article-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* Relacionadas */
.related { margin-top: 26px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.sidebar .widget-title {
  font-family: var(--display); font-size: 17px; font-weight: 700;
  color: var(--teal); border-bottom: 2px solid var(--teal);
  padding-bottom: 6px; margin-bottom: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.sidebar .mini { display: grid; grid-template-columns: 84px 1fr; gap: 10px; margin-bottom: 14px; }
.sidebar .mini img { width: 84px; height: 64px; object-fit: cover; background: var(--line); }
.sidebar .mini h4 { font-size: 14px; font-weight: 700; line-height: 1.3; font-family: var(--sans); }
.sidebar .mini .meta { font-size: 10.5px; }

/* ==========================================================================
   Listados (categoría / tag / búsqueda)
   ========================================================================== */
.listing-head { margin: 18px 0 6px; }
.listing-head h1 {
  font-size: 30px; font-weight: 700; color: var(--teal);
  display: flex; align-items: center; gap: 12px;
}
.listing-head h1::before {
  content: ''; width: 6px; height: 26px; background: var(--accent); display: inline-block;
}
.listing-head .desc { color: var(--muted); margin: 6px 0 0; }
.listing { display: flex; flex-direction: column; gap: 22px; margin-top: 18px; }
.card-row { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.card-row img { width: 100%; aspect-ratio: 8/5; object-fit: cover; background: var(--line); }
.card-row h2 { font-size: 22px; font-weight: 700; margin: 6px 0; }
.card-row h2 a:hover { color: var(--accent); }
.card-row .excerpt { color: var(--muted); font-size: 14.5px; margin: 0 0 8px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0 10px; flex-wrap: wrap; }
.pagination a, .pagination span {
  border: 1px solid var(--line); padding: 8px 14px; font-size: 14px;
  background: var(--panel);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--teal); color: var(--white); border-color: var(--teal); }

/* Búsqueda */
.search-form { display: flex; margin: 18px 0; max-width: 560px; }
.search-form input {
  flex: 1; border: 1.5px solid var(--teal); background: var(--white);
  padding: 11px 14px; font-size: 15px; border-radius: 3px 0 0 3px;
}
.search-form button {
  background: var(--teal); color: var(--white); border: 1.5px solid var(--teal);
  padding: 0 20px; cursor: pointer; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; font-size: 12.5px; border-radius: 0 3px 3px 0;
}
.search-status { color: var(--muted); font-size: 14px; margin: 8px 0 4px; }

/* Página institucional */
.page-content { max-width: 760px; }
.j-mail { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.j-mail:hover { color: var(--teal); }
/* Estado "botón" antes de revelar */
.j-mail-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); text-decoration: none;
  padding: 10px 18px; border-radius: 6px; font-size: 14px; font-weight: 500;
}
/* Selector con elemento (a.j-mail-btn = 0,1,1) para ganarle sí o sí a
   .j-mail (0,1,0), que si no pisa el color en reposo. Blanco explícito. */
a.j-mail-btn, a.j-mail-btn:hover { color: #fff; text-decoration: none; }
.j-mail-btn span { color: #fff; }
.j-mail-btn .j-mail-ico { width: 16px; height: 16px; fill: #fff; flex: 0 0 auto; }
.j-mail-btn:hover { background: var(--ink); }
/* Desafío casero */
.j-mail-challenge {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 12px; font-size: 14px;
}
.j-mail-input {
  width: 56px; padding: 5px 8px; margin-left: 6px;
  border: 1px solid var(--line); border-radius: 4px; font-size: 14px;
}
.j-mail-go {
  background: var(--teal); color: var(--white); border: 0; border-radius: 4px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.j-mail-go:hover { background: var(--accent); }
.j-mail-msg { color: var(--err); font-size: 13px; }

/* Error 404 */
.error-page { text-align: center; padding: 70px 0; }
.error-page .code { font-family: var(--display); font-size: 96px; font-weight: 700; color: var(--teal); line-height: 1; }
.error-page p { color: var(--muted); }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer { background: var(--teal); color: #9aa4b2; margin-top: 44px; font-size: 14px; }
.footer-inner {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 300px; gap: 30px;
  padding: 40px 0 30px;
}
.footer .f-brand .brand-top { font-size: 30px; color: var(--white); }
.footer .f-brand .brand-bottom { font-size: 23px; }
.footer .f-desc { margin: 12px 0 10px; line-height: 1.6; }
.footer .f-contact { margin: 0 0 14px; }
.footer .f-contact a { color: var(--gold); font-weight: 600; }
.footer .f-contact a:hover { color: #fff; }
.footer .topbar-social a { color: #9aa4b2; }
.footer h4 {
  font-family: var(--sans); font-size: 12px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--white); margin-bottom: 14px;
}
.footer .f-links { columns: 1; }
.footer .f-links.two-col { columns: 2; column-gap: 26px; }
.footer .f-links li { margin-bottom: 9px; break-inside: avoid; }
.footer .f-links a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid var(--teal-soft);
  padding: 16px 0 22px; text-align: center; font-size: 12.5px;
}
.footer-bottom .ad-slot { margin-bottom: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .section-layout { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .ad-300x600 { display: none; }
}

@media (max-width: 640px) {
  .topbar-meta { display: none; }
  .masthead { padding: 18px 0 14px; }
  .brand .brand-top { font-size: 26px; }
  .brand .brand-bottom { font-size: 26px; }
  .brand-tagline { display: none; }
  .brand-sep { display: none; }

  .nav-toggle { display: block; }
  .nav-list { display: none; flex-direction: column; width: 100%; }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 13px 18px; width: 100%; }
  .nav-list a.nav-highlight { margin-left: 0; }
  .mainnav-inner { flex-wrap: wrap; }

  .hero-slide h2 { font-size: 26px; -webkit-line-clamp: 3; line-clamp: 3; }
  .hero-body { height: 160px; }
  .hero-dots { bottom: 172px; }
  .hero-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .compact-grid { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 1fr; }
  .article h1 { font-size: 27px; }
  .article-body { font-size: 16px; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .ad-970, .ad-728 { height: 60px; }
}
