@import url("./core.css");
@import url("./content.css");
@import url("./responsive.css");
@import url("./polish.css");
@import url("./product-metrics-responsive.css");
@import url("./sources-plans.css");
@import url("./guides-home.css");
@import url("./legal-brand.css");
@import url("./ux-enhancements.css");
@import url("./adaptive.css");
@import url("./final-fixes.css");
@import url("./requested-fixes.css");

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMonoVar-Roman-Latin1.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

.site-header { background: rgba(63, 114, 133, .97); }
.hero-note { opacity: 1; }
.site-nav a[aria-current="page"] { background: var(--cream); color: var(--navy); }

/*
 * Mejora progresiva del menú: sin JavaScript la navegación móvil permanece
 * visible y utilizable. Con JS, .nav-enhanced recupera el menú compacto.
 */
@media (max-width: 1180px) {
  .site-header:not(.nav-enhanced) { flex-wrap: wrap; }
  .site-header:not(.nav-enhanced) .nav-toggle { display: none; }
  .site-header:not(.nav-enhanced) .site-nav {
    position: static;
    display: block;
    flex: 1 0 100%;
    margin-left: 0;
    padding: .4rem 0 0;
    background: transparent;
    box-shadow: none;
  }
}

/*
 * Modo oscuro Nuvacta: solo paleta de marca y contraste alto.
 * No se remapea --cream a un tono oscuro porque esa variable también actúa
 * como color de texto/CTA. Se usan navy/navy-2 como fondos y marfil/ácido
 * como texto y acento para conservar legibilidad y jerarquía.
 */
html[data-theme="dark"] {
  color-scheme: dark;
  --cream: #f7f7ed;
  --white: #353052;
  --ink: #f7f7ed;
  --ink-soft: rgba(247, 247, 237, .8);
  --line: rgba(247, 247, 237, .24);
  --line-light: rgba(247, 247, 237, .32);
  --shadow: 0 32px 72px -42px rgba(0, 0, 0, .84);
}

html[data-theme="dark"] body {
  background: var(--navy);
  color: var(--cream);
}

html[data-theme="dark"] :focus-visible { outline-color: var(--acid); }
html[data-theme="dark"] .eyebrow { color: var(--acid); }

/* Excepción editorial explícita: este rótulo debe ser blanco en ambos temas. */
.climate-risk-callout .eyebrow,
html[data-theme="dark"] .climate-risk-callout .eyebrow {
  color: var(--cream);
}
html[data-theme="dark"] .lede,
html[data-theme="dark"] .source-note,
html[data-theme="dark"] .plan-foot,
html[data-theme="dark"] .future-sources p,
html[data-theme="dark"] .business-plans p,
html[data-theme="dark"] .article-body p,
html[data-theme="dark"] .legal-main p,
html[data-theme="dark"] .legal-main li { color: var(--ink-soft); }

html[data-theme="dark"] .plan:not(.plan--premium),
html[data-theme="dark"] .home-resource-card,
html[data-theme="dark"] .resource-index-card,
html[data-theme="dark"] .article-aside,
html[data-theme="dark"] .article-summary,
html[data-theme="dark"] .article-callout,
html[data-theme="dark"] section[aria-labelledby="faq-title"] details,
html[data-theme="dark"] .source-row,
html[data-theme="dark"] .future-sources,
html[data-theme="dark"] .business-plan,
html[data-theme="dark"] .support-form,
html[data-theme="dark"] .legal-main {
  background: var(--navy-2);
  color: var(--cream);
  border-color: var(--line);
}

html[data-theme="dark"] .fact-board { background: var(--navy-2); color: var(--cream); }
html[data-theme="dark"] .fact-row { border-color: var(--line); }
html[data-theme="dark"] .fact-row b { color: rgba(247, 247, 237, .86); }
html[data-theme="dark"] .fact-icon,
html[data-theme="dark"] img[src^="/assets/icons/"],
html[data-theme="dark"] img[src*="/assets/icons/"] {
  filter: brightness(0) invert(1);
}
html[data-theme="dark"] .fact-row--icon > .fact-icon {
  border-color: rgba(254, 253, 113, .55);
  background: var(--acid);
  filter: none;
}

html[data-theme="dark"] .step {
  border-color: var(--line);
  border-top-color: var(--blue);
  background: var(--navy-2);
  color: var(--cream);
  box-shadow: 0 20px 48px -42px rgba(0, 0, 0, .72);
}
html[data-theme="dark"] .step::after { color: rgba(247, 247, 237, .22); }
html[data-theme="dark"] .step h3::before {
  border-color: rgba(254, 253, 113, .55);
  background: var(--acid);
  color: var(--navy);
}
html[data-theme="dark"] .step-num {
  border-color: rgba(254, 253, 113, .38);
  background: var(--acid);
  color: var(--navy);
}

html[data-theme="dark"] .source-row--record .source-status,
html[data-theme="dark"] .source-row--complementary .source-status,
html[data-theme="dark"] .source-status {
  background: rgba(247, 247, 237, .08);
  color: var(--cream);
}
html[data-theme="dark"] .source-row--record .source-status::before,
html[data-theme="dark"] .source-status::before { background: var(--acid); }
html[data-theme="dark"] .source-row--complementary::before {
  border-color: var(--line);
  color: var(--acid);
}
html[data-theme="dark"] .future-source {
  border: 1px solid var(--line);
  background: var(--navy);
  color: var(--cream);
}

html[data-theme="dark"] .plan:not(.plan--premium) .plan-list li::before {
  background: rgba(254, 253, 113, .12);
  color: var(--cream);
}
html[data-theme="dark"] .plan:not(.plan--premium) .plan-list li:nth-child(8)::before {
  background: rgba(247, 247, 237, .08);
  color: var(--ink-soft);
}

html[data-theme="dark"] .home-resources-head::after {
  border-color: var(--line);
  background: linear-gradient(90deg, var(--navy-2), rgba(63, 114, 133, .24));
  color: var(--cream);
}
html[data-theme="dark"] .home-resource-status {
  background: rgba(247, 247, 237, .08);
  color: var(--cream);
}
html[data-theme="dark"] .home-resource-status::before { background: var(--acid); }
html[data-theme="dark"] .home-resource-card::before { color: rgba(247, 247, 237, .24); }

html[data-theme="dark"] .resource-index-card__category { color: var(--cream); }
html[data-theme="dark"] .resource-index-card__num { color: rgba(247, 247, 237, .24); }
html[data-theme="dark"] .resource-index-card__link { color: var(--acid); }
html[data-theme="dark"] .resource-index-visual { border: 1px solid var(--line); }
html[data-theme="dark"] .article-hero__back { color: var(--acid); }
html[data-theme="dark"] .article-steps li {
  border-color: var(--line);
  background: var(--navy-2);
}
html[data-theme="dark"] .article-steps li::before { color: var(--acid); }

html[data-theme="dark"] .button--primary {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--navy);
}
html[data-theme="dark"] .button--cream {
  border-color: var(--cream);
  background: var(--cream);
  color: var(--navy);
}
html[data-theme="dark"] .button--secondary {
  border-color: rgba(247, 247, 237, .78);
  background: rgba(247, 247, 237, .06);
  color: var(--cream);
}
html[data-theme="dark"] .button--outline {
  border-color: var(--acid);
  background: transparent;
  color: var(--cream);
}
html[data-theme="dark"] .button--outline:hover,
html[data-theme="dark"] .button--outline:focus-visible {
  background: var(--acid);
  color: var(--navy);
}
html[data-theme="dark"] .plan:nth-child(2) .plan-cta .button {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--navy);
}

html[data-theme="dark"] .back-to-top {
  border-color: var(--acid);
  background: var(--acid);
  color: var(--navy);
}
html[data-theme="dark"] .back-to-top:hover { background: var(--cream); }

html[data-theme="dark"] .support-form input,
html[data-theme="dark"] .support-form textarea {
  border-color: var(--line);
  background: var(--navy);
  color: var(--cream);
  caret-color: var(--acid);
}
html[data-theme="dark"] .support-form input::placeholder,
html[data-theme="dark"] .support-form textarea::placeholder { color: rgba(247, 247, 237, .62); }
html[data-theme="dark"] .support-form input:focus,
html[data-theme="dark"] .support-form textarea:focus { border-color: var(--acid); }
html[data-theme="dark"] .support-form__feedback.is-error { color: var(--acid); }
html[data-theme="dark"] .support-form__feedback.is-success { color: var(--cream); }

html[data-theme="dark"] main a:not(.button):not(.brand) { color: var(--acid); }
html[data-theme="dark"] .home-resource-card h3 a,
html[data-theme="dark"] .resource-index-card h2 a,
html[data-theme="dark"] .resource-index-card h3 a { color: inherit; }
html[data-theme="dark"] .site-footer {
  border-color: var(--line);
  color: var(--cream);
}
html[data-theme="dark"] .footer-links a,
html[data-theme="dark"] .share-button { color: var(--cream); }

/* Recuperar la jerarquía editorial original: mayúsculas y pesos diferenciados. */
.hero h1,
.article-hero h1 { text-transform: uppercase; }
.article-hero h1 {
  line-height: 1.02;
}
.home-resource-card h3 { line-height: 1.16; }
.resource-index-card h2 { line-height: 1.14; }
.home-resource-card h3 a,
.resource-index-card h2 a { font-weight: inherit; }

/* Guías destacadas: enlace reconocible sin convertir la tarjeta en un falso botón. */
.home-resource-link {
  color: inherit;
  text-decoration-color: var(--blue-deep);
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}
.home-resource-link:hover { text-decoration-color: currentColor; }
.home-resource-link:focus-visible {
  border-radius: var(--surface-radius);
  outline: 3px solid var(--navy);
  outline-offset: 4px;
}
html[data-theme="dark"] .home-resource-link { text-decoration-color: var(--acid); }
html[data-theme="dark"] .home-resource-link:focus-visible { outline-color: var(--acid); }

/* 404: Phill visible mientras se incorpora la pose específica de “sin datos”. */
.error-card .error-phill {
  width: min(280px, 68vw);
  max-height: 330px;
  margin: 1.4rem auto .4rem;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .28));
}


/* Consentimiento de analítica web · 29/08/2026 */
.analytics-consent {
  position: fixed;
  z-index: 1000;
  left: clamp(.75rem, 2vw, 1.5rem);
  right: clamp(.75rem, 2vw, 1.5rem);
  bottom: clamp(.75rem, 2vw, 1.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 1.5rem;
  align-items: center;
  max-width: 78rem;
  margin-inline: auto;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(247, 247, 237, .18);
  border-radius: var(--surface-radius);
  background: rgba(42, 37, 67, .97);
  color: var(--cream);
  box-shadow: 0 24px 70px -28px rgba(0, 0, 0, .8);
}
.analytics-consent[hidden] { display: none; }
.analytics-consent__copy {
  display: grid;
  gap: .35rem;
  line-height: 1.45;
}
.analytics-consent__copy strong {
  font: 850 1rem/1.1 var(--font-ui);
  text-transform: uppercase;
}
.analytics-consent__copy span {
  color: rgba(247, 247, 237, .82);
  font-size: .9rem;
}
.analytics-consent__copy a {
  width: fit-content;
  color: var(--acid);
  font-weight: 750;
}
.analytics-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  justify-content: flex-end;
}
.analytics-consent__actions .button {
  min-width: 11.5rem;
  border: 2px solid var(--cream);
  background: transparent;
  color: var(--cream);
  box-shadow: none;
}
.analytics-consent__actions .button:hover,
.analytics-consent__actions .button:focus-visible {
  background: var(--cream);
  color: var(--navy);
}
.analytics-settings-button {
  display: inline-flex;
  margin: .8rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
  opacity: .76;
}
.analytics-settings-button:hover,
.analytics-settings-button:focus-visible { opacity: 1; }
@media (max-width: 48rem) {
  .analytics-consent { grid-template-columns: 1fr; }
  .analytics-consent__actions { justify-content: stretch; }
  .analytics-consent__actions .button { width: 100%; }
}
