/* ================================================================
   CATEGORÍA (ARCHIVO) — Circuito Gastronómico
   Extiende styles.css. Tokens: --accent, --fg, --bg, --font-display…
   Jerarquía:
   Nav → Cat-Hero (dark, imagen de la categoría como fondo)
   → Publicidad horizontal → Barra de resultados → Grid de notas
   → Paginación → Publicidad horizontal → Newsletter → Footer
   ================================================================ */

/* Ad top: pegar el listado inmediatamente después (override del espaciado global) */
.sponsors + section { padding-top: 0 }

/* ============ HERO DE CATEGORÍA ============ */
/* Full-bleed cinematográfico, igual criterio que post-hero pero más bajo */
.cat-hero {
  position: relative;
  min-height: clamp(360px, 48vh, 520px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--night);
}

.cat-hero__bg { position: absolute; inset: 0 }
.cat-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) brightness(.38);
}

.cat-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(10,8,6,.98) 0%, rgba(10,8,6,.45) 55%, rgba(10,8,6,.18) 100%),
    radial-gradient(120% 80% at 12% 100%, rgba(156,30,33,.18), transparent 52%);
}

.cat-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-top: 120px;
  padding-bottom: clamp(36px, 6vh, 64px);
}

/* Breadcrumbs — idénticos a single-post.css para consistencia sobre fondo oscuro */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(255,255,255,.48);
}
.breadcrumbs a { color: rgba(255,255,255,.48); transition: color var(--fast) }
.breadcrumbs a:hover { color: rgba(255,255,255,.85) }
.breadcrumbs [aria-current="page"] { color: rgba(255,255,255,.7) }
.breadcrumbs__sep { color: rgba(255,255,255,.28); margin-inline: 2px }

/* Pill "Categoría" */
.cat-hero__kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 5px 13px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.cat-hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -.02em;
  color: #F2E8DC;
  margin-bottom: 16px;
  max-width: 850px;
}
.cat-hero__title em { font-style: italic; font-weight: 500; color: var(--accent-bright, #E05255) }

.cat-hero__desc {
  font-size: clamp(15px, 1.4vw, 18px);
  color: rgba(255,255,255,.72);
  line-height: 1.7;
  max-width: 640px;
  margin-bottom: 22px;
}

.cat-hero__stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
}
.cat-hero__stats strong { color: rgba(255,255,255,.85); font-weight: 700 }
.cat-hero__sep { color: rgba(255,255,255,.25) }

/* ============ BARRA DE RESULTADOS ============ */
.cat-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-block: clamp(18px, 2.5vw, 26px);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(24px, 3.5vw, 40px);
}
.cat-meta-bar__count {
  font-size: 13.5px;
  color: var(--fg-mute);
}
.cat-meta-bar__count strong { color: var(--fg); font-weight: 700 }
.cat-meta-bar__sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-mute);
}
.cat-meta-bar__sort select {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg-2);
  border: 1.5px solid var(--line);
  border-radius: 100px;
  padding: 6px 14px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--fast);
}
.cat-meta-bar__sort select:focus { border-color: var(--accent) }

/* ============ GRID DE NOTAS DEL ARCHIVO ============ */
.arc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2.2vw, 24px);
}
.arc-grid .card-3d { height: 380px }
.arc-grid .ed-main__img { height: 220px; flex: none }
.arc-grid .ed-main__title {
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.3;
}

/* ============ PAGINACIÓN ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(32px, 5vw, 56px);
}
.pagination__link,
.pagination__dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding-inline: 6px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--fg-dim);
  border: 1.5px solid var(--line);
  transition: border-color var(--fast), background var(--fast), color var(--fast);
}
.pagination__link:hover {
  border-color: var(--line-strong);
  background: var(--bg-2);
}
.pagination__link.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pagination__dots {
  border: none;
  color: var(--fg-mute);
  min-width: 20px;
}
.pagination__arrow svg { display: block }
.pagination__arrow.is-disabled {
  opacity: .35;
  pointer-events: none;
}

/* ============ BOTÓN VOLVER ARRIBA ============ */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 18px rgba(156,30,33,.36);
  z-index: 50;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity var(--base), transform var(--base) var(--ease), background var(--fast);
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto }
.back-to-top:hover { background: var(--accent-deep); transform: translateY(-3px) }
.back-to-top:active { transform: translateY(0) }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .arc-grid { grid-template-columns: repeat(2, 1fr) }
}

@media (max-width: 900px) {
  .cat-hero { min-height: clamp(320px, 46vh, 440px) }
}

@media (max-width: 760px) {
  .cat-hero { min-height: clamp(300px, 50vh, 400px) }
  .cat-hero__title { font-size: clamp(26px, 7vw, 38px) }
  .cat-hero__desc { font-size: 15px; margin-bottom: 16px }

  .cat-meta-bar { flex-direction: column; align-items: flex-start; gap: 10px }

  .arc-grid { grid-template-columns: 1fr }
  .arc-grid .card-3d { height: auto }
  .arc-grid .ed-main__img { height: 200px }

  .pagination__link,
  .pagination__dots { min-width: 34px; height: 34px; font-size: 13px }
}

@media (max-width: 480px) {
  .cat-hero__desc { display: none }
  .breadcrumbs { display: none }

  .back-to-top { width: 38px; height: 38px; bottom: 16px; right: 16px }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top:hover { transform: none }
}
