/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #ffffff;
  --bg-2:      #f6f5f2;
  --ink:       #121215;
  --ink-soft:  #3a3a3f;
  --ink-mute:  #6f6f76;
  --accent:    #1e40af;   /* azul oscuro tecnología */
  --accent-dark: #16327f;
  --accent-light: #7fa7f5; /* para hovers sobre fondos oscuros */
  --dark:      #121215;   /* bandas oscuras / footer */
  --dark-2:    #1b1b1f;
  --line:      #e6e4df;
  --line-dark: rgba(255,255,255,0.14);

  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --script: "Yellowtail", cursive;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1200px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  overflow-x: clip;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  width: 100%;
  max-width: 740px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 6px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Typography helpers
   ============================================================= */
.kicker {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .5rem;
}
.kicker a { transition: color .25s var(--ease-out); }
.kicker a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

.kicker-sm {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .25rem;
}

.byline {
  font-size: .82rem;
  color: var(--ink-mute);
}
.byline strong { color: var(--ink-soft); font-weight: 700; }
.byline--light { color: rgba(255,255,255,.62); }
.byline--light strong { color: rgba(255,255,255,.85); }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-block;
  padding: .55rem 1.15rem;
  font-weight: 800;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  transition: background .25s var(--ease-out), transform .25s var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }

/* --- Barra última hora --- */
.breaking {
  background: var(--accent);
  color: #fff;
}
.breaking-inner {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding-block: .45rem;
  font-size: .8rem;
  min-width: 0;
}
.breaking-tag {
  flex-shrink: 0;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .68rem;
  border: 1px solid rgba(255,255,255,.6);
  padding: .12rem .5rem;
}
.breaking-link {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breaking-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- Masthead --- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease-out);
}
.masthead.is-scrolled { box-shadow: 0 4px 24px rgba(18,18,21,.08); }
.masthead-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding-block: .7rem;
}
.brand {
  grid-column: 2;
  font-family: var(--script);
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1;
  color: var(--ink);
  transition: color .25s var(--ease-out);
}
.brand:hover { color: var(--accent); }
.brand--footer { color: #fff; font-size: 2rem; }
.masthead-actions {
  grid-column: 3;
  justify-self: end;
}

.nav-burger {
  grid-column: 1;
  justify-self: start;
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .5rem;
}
.nav-burger span {
  width: 22px; height: 2px;
  background: var(--ink);
  transition: transform .3s var(--ease-out), opacity .3s var(--ease-out);
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Nav de categorías --- */
.catnav {
  border-top: 1px solid var(--line);
}
.catnav-inner {
  display: flex;
  justify-content: center;
  gap: clamp(.9rem, 2.5vw, 1.8rem);
  overflow-x: auto;
  scrollbar-width: none;
}
.catnav-inner::-webkit-scrollbar { display: none; }
.catnav-link {
  position: relative;
  flex-shrink: 0;
  padding-block: .65rem;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-soft);
  transition: color .25s var(--ease-out);
}
.catnav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: -1px;
  height: 3px;
  background: var(--accent);
  transition: right .3s var(--ease-out);
}
.catnav-link:hover { color: var(--ink); }
.catnav-link:hover::after,
.catnav-link.is-active::after { right: 0; }
.catnav-link.is-active { color: var(--ink); }

/* --- Cards --- */
.card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  margin-bottom: .8rem;
}
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease-out), filter .7s var(--ease-out);
}
.card:hover .card-media img,
.cat-lead:hover .card-media img,
.hero-main:hover .hero-media img {
  transform: scale(1.05);
  filter: saturate(1.1);
}
.card-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: .5rem;
}
.card-title a { transition: color .25s var(--ease-out); }
.card-title a:hover { color: var(--accent); }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Hero --- */
.hero {
  display: grid;
  gap: 2rem;
  padding-block: clamp(1.5rem, 4vw, 2.8rem);
}
.hero-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--bg-2);
  margin-bottom: 1.1rem;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease-out), filter .8s var(--ease-out);
}
.hero-title {
  font-size: clamp(1.7rem, 4.2vw, 2.7rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  margin-bottom: .7rem;
  max-width: 22ch;
}
.hero-title a { transition: color .25s var(--ease-out); }
.hero-title a:hover { color: var(--accent); }
.hero-dek {
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 58ch;
  margin-bottom: .8rem;
}

.side-heading {
  font-size: .85rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding-bottom: .6rem;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 1rem;
}
.side-list {
  display: flex;
  flex-direction: column;
}
.side-item a {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: .85rem;
  align-items: start;
  padding-block: .85rem;
  border-bottom: 1px solid var(--line);
}
.side-item:last-child a { border-bottom: 0; }
.side-item img {
  width: 96px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--bg-2);
}
.side-item h3 {
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.3;
  transition: color .25s var(--ease-out);
}
.side-item a:hover h3 { color: var(--accent); }

/* --- Secciones genéricas --- */
.section { padding-block: clamp(1.8rem, 4vw, 3rem); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 3px solid var(--ink);
  padding-bottom: .6rem;
  margin-bottom: 1.4rem;
}
.section-title {
  font-size: clamp(1.2rem, 2.6vw, 1.55rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.section-title::before {
  content: "";
  display: inline-block;
  width: .55em; height: .55em;
  background: var(--accent);
  margin-right: .5rem;
}
.section-title--light { color: #fff; }
.section-more {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-mute);
  transition: color .25s var(--ease-out);
  white-space: nowrap;
}
.section-more:hover { color: var(--accent); }

.grid-3 {
  display: grid;
  gap: 1.8rem;
}

/* --- Banda oscura: selección del editor --- */
.editors {
  background: var(--dark);
  color: #fff;
  padding-block: clamp(2rem, 5vw, 3.4rem);
}
.editors .section-head { border-bottom-color: rgba(255,255,255,.9); }
.card--dark .card-title a:hover { color: var(--accent-light); }

/* --- Bloques por categoría --- */
.cat-blocks {
  display: grid;
  gap: 2.5rem;
}
.cat-block-title {
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 3px solid var(--accent);
  padding-bottom: .5rem;
  margin-bottom: 1.1rem;
}
.cat-block-title a:hover { color: var(--accent); }
.cat-lead .card-title { font-size: 1.25rem; }
.cat-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
}
.cat-list li {
  border-top: 1px solid var(--line);
}
.cat-list a {
  display: block;
  padding-block: .75rem;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.4;
  transition: color .25s var(--ease-out), padding-left .3s var(--ease-out);
}
.cat-list a:hover { color: var(--accent); padding-left: .4rem; }

/* --- Boletín --- */
.newsletter {
  background: var(--accent);
  color: #fff;
  padding-block: clamp(2rem, 5vw, 3.2rem);
}
.newsletter-inner {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}
.newsletter-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 900;
  margin-bottom: .4rem;
}
.newsletter-dek {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: rgba(255,255,255,.88);
  max-width: 48ch;
}
.newsletter-form {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}
.newsletter-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: .7rem 1rem;
  border: 0;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.newsletter-form input::placeholder { color: var(--ink-mute); }
.newsletter-form .btn { flex-shrink: 0; }
.newsletter-form.is-sent input { opacity: .5; pointer-events: none; }

/* --- Footer --- */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.75);
  padding-block: clamp(2.2rem, 5vw, 3.5rem) 1.2rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line-dark);
}
.footer-tagline {
  font-family: var(--serif);
  font-size: .95rem;
  margin-top: .5rem;
  color: rgba(255,255,255,.55);
}
.footer-contact {
  margin-top: 1rem;
  font-style: normal;
  font-size: .88rem;
  line-height: 1.7;
  color: rgba(255,255,255,.7);
}
.footer-contact strong { color: #fff; }
.footer-contact a {
  color: rgba(255,255,255,.85);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .25s var(--ease-out);
}
.footer-contact a:hover { color: var(--accent-light); }
.footer-h {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #fff;
  margin-bottom: .8rem;
}
.footer nav li { margin-bottom: .45rem; }
.footer nav a {
  font-size: .9rem;
  transition: color .25s var(--ease-out);
}
.footer nav a:hover { color: var(--accent-light); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  padding-top: 1.2rem;
  font-size: .78rem;
  color: rgba(255,255,255,.45);
}

/* =============================================================
   7. Artículo
   ============================================================= */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 200;
  background: transparent;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}

.article-head {
  padding-block: clamp(1.8rem, 5vw, 3rem) 1.4rem;
  text-align: center;
}
.article-title {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 900;
  letter-spacing: -0.028em;
  margin-bottom: 1rem;
}
.article-dek {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 56ch;
  margin-inline: auto;
  margin-bottom: 1.2rem;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--ink-mute);
}
.article-meta .byline { font-size: .85rem; }
.meta-sep { color: var(--line); }

.article-hero { margin-bottom: clamp(1.6rem, 4vw, 2.6rem); }
.article-hero img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  background: var(--bg-2);
}
.article-hero figcaption {
  font-size: .78rem;
  color: var(--ink-mute);
  padding-top: .5rem;
  font-family: var(--serif);
  font-style: italic;
}

.article-body {
  font-family: var(--serif);
  font-size: 1.13rem;
  line-height: 1.75;
  color: var(--ink-soft);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}
.article-body > * + * { margin-top: 1.3em; }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color .25s var(--ease-out);
}
.article-body a:hover { color: var(--accent-dark); }
.article-body h2 {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--ink);
  margin-top: 1.8em;
}
.article-body ul { padding-left: 1.2em; list-style: disc; }
.article-body ol { padding-left: 1.2em; list-style: decimal; }
.article-body li { margin-bottom: .4em; }
.article-body li::marker { color: var(--accent); }
.article-body strong { color: var(--ink); }

.lede { font-size: 1.22rem; }
.dropcap {
  float: left;
  font-family: var(--sans);
  font-weight: 900;
  font-size: 4.4em;
  line-height: .82;
  padding-right: .12em;
  color: var(--accent);
}

.pullquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.4rem;
  margin-block: 2rem;
}
.pullquote p {
  font-size: 1.45rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: balance;
}
.pullquote cite {
  display: block;
  margin-top: .7rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-mute);
}

.article-cta {
  text-align: center;
  margin-block: 2.2rem !important;
}
.article-cta .btn {
  font-size: .9rem;
  padding: .85rem 1.6rem;
}
.article-cta .btn:hover { transform: translateY(-2px); }
/* Los enlaces del cuerpo son azules subrayados; el botón debe seguir blanco */
.article-body a.btn {
  color: #fff;
  text-decoration: none;
}
.article-body a.btn:hover { color: #fff; }

.affiliate-note {
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--ink-mute);
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 2.2rem !important;
}

/* --- Fichas de producto (guías de compra) --- */
.product-review {
  font-family: var(--sans);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  padding: clamp(1.2rem, 3vw, 1.8rem);
  margin-block: 2.4rem !important;
}
.product-rank {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .3rem;
}
.product-review h2 {
  margin-top: 0 !important;
  font-size: 1.35rem !important;
}
.product-stars {
  margin-top: .4rem;
  font-size: .95rem;
  color: #d99a06;
  letter-spacing: .1em;
}
.product-stars span {
  color: var(--ink-mute);
  font-size: .82rem;
  letter-spacing: 0;
  margin-left: .4rem;
}
.product-review > p, .product-review li {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.65;
}
.product-facts {
  list-style: none !important;
  padding-left: 0 !important;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}
.product-facts li {
  padding-block: .7rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0 !important;
}
.product-facts strong { font-family: var(--sans); }
.product-warning {
  background: #fdf3e0;
  border-left: 4px solid #d99a06;
  padding: .9rem 1.1rem;
  margin-top: 1.2rem;
  font-size: .95rem !important;
}
.product-review .article-cta { margin-block: 1.4rem .2rem !important; }

.article-author {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 2.5rem !important;
  padding: 1.3rem;
  background: var(--bg-2);
  font-family: var(--sans);
}
.author-avatar {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  display: grid;
  place-items: center;
  letter-spacing: .03em;
}
.author-name { font-weight: 800; font-size: .95rem; color: var(--ink); }
.author-bio { font-size: .85rem; color: var(--ink-mute); line-height: 1.5; }

/* =============================================================
   8. Effects
   ============================================================= */
.reveal-item {
  transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft);
}
/* El estado oculto solo se aplica si JS arrancó (html.is-ready):
   sin JavaScript, todo el contenido es visible desde el primer render. */
html.is-ready .reveal-item:not(.is-revealed) {
  opacity: 0;
  transform: translateY(18px);
}

/* Transiciones entre páginas */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================================
   9. Responsive
   ============================================================= */
@media (max-width: 719.98px) {
  .nav-burger { display: flex; }
  .catnav {
    display: none;
    border-top: 1px solid var(--line);
  }
  .catnav.is-open { display: block; }
  .catnav-inner {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  .catnav-link {
    padding-block: .8rem;
    border-bottom: 1px solid var(--line);
  }
  .catnav-link::after { display: none; }
  .masthead-actions .btn { padding: .45rem .8rem; font-size: .72rem; }
}

@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .cat-blocks { grid-template-columns: 1fr 1fr; gap: 3rem; }
  .newsletter-inner { grid-template-columns: 1.2fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

@media (min-width: 960px) {
  .hero { grid-template-columns: 1.9fr 1fr; gap: 2.5rem; }
}

/* =============================================================
   10. Reduced-motion (solo efectos intrusivos)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .reveal-item {
    transition-duration: .2s;
  }
  /* Los hovers, subrayados y transiciones de color se mantienen:
     son feedback funcional, no movimiento intrusivo. */
}
