/* -------------------------------------------------------
   PORTADAS DE DIARIOS (portada pública)
------------------------------------------------------- */

/* El carrusel horizontal no debe aportar su ancho completo al
   min-content de la grilla: sin esto la columna principal se
   ensancha y el hero de noticias destacadas queda gigante. */
.home-layout__main {
  min-width: 0;
}

.portadas-section {
  min-width: 0;
  max-width: 100%;
  margin-top: var(--space-5, 24px);
}

.portadas-slider {
  position: relative;
  min-width: 0;
  max-width: 100%;
}

.portadas-slider__track {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 2px 2px 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.portadas-slider__track::-webkit-scrollbar {
  display: none;
}

.portada-card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(148px, 17vw, 210px);
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 10px;
  cursor: zoom-in;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}

.portada-card:focus-visible {
  outline: 3px solid var(--primary, #7600b3);
  outline-offset: 3px;
}

.portada-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  transition: transform .2s ease, box-shadow .2s ease;
}

.portada-card:hover .portada-card__img {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.portada-card__date {
  position: absolute;
  left: 8px;
  bottom: 14px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.portadas-slider__arrow {
  position: absolute;
  top: calc(50% - 5px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0 0 3px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: var(--primary, #7600b3);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .16);
  transform: translateY(-50%);
  transition: background .18s ease, color .18s ease;
}

.portadas-slider__arrow:hover {
  background: var(--primary, #7600b3);
  color: #fff;
}

.portadas-slider__arrow--prev { left: -10px; }
.portadas-slider__arrow--next { right: -10px; }

@media (max-width: 640px) {
  .portada-card { width: 142px; }
  .portadas-slider__arrow {
    width: 34px;
    height: 34px;
    font-size: 23px;
  }
  .portadas-slider__arrow--prev { left: 0; }
  .portadas-slider__arrow--next { right: 0; }
}

/* Visor ampliado */
.portada-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .92);
}

.portada-lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  max-width: min(1000px, 94vw);
  max-height: 92vh;
}

.portada-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(92vh - 44px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
}

.portada-lightbox__caption {
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.portada-lightbox__close,
.portada-lightbox__arrow {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(0, 0, 0, .48);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease;
}

.portada-lightbox__close:hover,
.portada-lightbox__arrow:hover {
  background: rgba(255, 255, 255, .18);
}

.portada-lightbox__close {
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: 26px;
  line-height: 1;
}

.portada-lightbox__arrow {
  top: 50%;
  width: 48px;
  height: 48px;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

.portada-lightbox__arrow--prev { left: 14px; }
.portada-lightbox__arrow--next { right: 14px; }

.portada-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: rgba(255, 255, 255, .9);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transform: translateX(-50%);
}

.portada-lightbox__arrow[disabled] {
  display: none;
}

body.portadas-lock {
  overflow: hidden;
}

@media (max-width: 640px) {
  .portada-lightbox { padding: 10px; }
  .portada-lightbox__close { top: 8px; right: 8px; width: 40px; height: 40px; }
  .portada-lightbox__arrow { width: 42px; height: 42px; font-size: 29px; }
  .portada-lightbox__arrow--prev { left: 4px; }
  .portada-lightbox__arrow--next { right: 4px; }
  .portada-lightbox__counter { bottom: 8px; }
}
