/* ============================================================
   Publicaciones CP — style.css
   Diseño moderno de tarjetas de noticias / entradas WordPress.
   Solo se carga en páginas donde se usa [publicaciones_cp].
   ============================================================ */

/* ── FULL-WIDTH BREAKOUT ─────────────────────────────────── */
.sv-sec {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  box-sizing: border-box;
}

/* ── SECCIÓN ─────────────────────────────────────────────── */
.sv-pub-cp-sc.sv-sec {
  background: #fff;
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: clamp(56px, 8vw, 104px);
  padding-left: 0;
  padding-right: 0;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Contenedor interior centrado */
.sv-sec__in {
  width: 100%;
  max-width: min(var(--wp--style--global--wide-size, 1120px), calc(100vw - 48px));
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: border-box;
}

/* ── CABECERA DE SECCIÓN ────────────────────────────────── */
.sv-news-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.sv-news-eyebrow {
  margin: 0 0 .4em;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, .38);
}

.sv-h2 {
  margin: 0 0 .2em;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.07;
  color: #111;
  letter-spacing: -.025em;
}

.sv-lead {
  margin: 0;
  font-size: clamp(14px, 1.8vw, 16px);
  color: rgba(0, 0, 0, .50);
  line-height: 1.45;
}

.sv-news-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: .15em;
  border-bottom: 1.5px solid rgba(0, 0, 0, .25);
  transition: border-color .15s ease, gap .15s ease;
}

.sv-news-all-link svg {
  width: 14px;
  height: 14px;
  transition: transform .15s ease;
}

.sv-news-all-link:hover {
  border-bottom-color: #111;
  gap: 9px;
}

.sv-news-all-link:hover svg { transform: translateX(2px); }
.sv-news-all-link:focus-visible { outline: 2px solid rgba(0,0,0,.45); outline-offset: 3px; }

/* ── REVEAL (activado por JS con IntersectionObserver) ───── */
.sv-rv {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .5s cubic-bezier(.2, .8, .2, 1);
  will-change: opacity, transform;
}

.sv-rv.in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .sv-rv {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── GRID ────────────────────────────────────────────────── */
.sv-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 860px) {
  .sv-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .sv-news-grid { grid-template-columns: 1fr; }
}

/* ── TARJETA ─────────────────────────────────────────────── */
.sv-news-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .09);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  will-change: transform;
}

.sv-news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .10);
  border-color: rgba(0, 0, 0, .14);
}

.sv-news-card:focus-within {
  outline: 2px solid rgba(0, 0, 0, .35);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sv-news-card { transition: none !important; transform: none !important; }
}

/* ── IMAGEN ──────────────────────────────────────────────── */
.sv-news-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f0f0f0;
}

.sv-news-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}

.sv-news-card:hover .sv-news-img { transform: scale(1.05); }

@media (prefers-reduced-motion: reduce) {
  .sv-news-img { transition: none !important; transform: none !important; }
}

/* Placeholder si la entrada no tiene imagen destacada */
.sv-news-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* Gradiente inferior sutil sobre la imagen */
.sv-news-img-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}

/* ── BADGE DE CATEGORÍA ──────────────────────────────────── */
.sv-news-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 9px;
  background: #fff;
  color: #111;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, .10);
}

.sv-news-badge--alt {
  background: #111;
  color: #fff;
  border-color: transparent;
}

/* ── CUERPO ──────────────────────────────────────────────── */
.sv-news-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 22px 18px;
  gap: 10px;
}

/* ── META ────────────────────────────────────────────────── */
.sv-news-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sv-news-date,
.sv-news-read {
  font-size: 11.5px;
  color: rgba(0, 0, 0, .38);
}

.sv-news-dot {
  color: rgba(0, 0, 0, .25);
  font-size: 10px;
}

/* ── TÍTULO ──────────────────────────────────────────────── */
.sv-news-title {
  margin: 0;
  font-size: clamp(15px, 1.8vw, 17px);
  font-weight: 700;
  line-height: 1.3;
  color: #111;
  letter-spacing: -.01em;
}

.sv-news-link {
  color: inherit;
  text-decoration: none;
}

/* Área de clic ampliada a toda la tarjeta */
.sv-news-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}

.sv-news-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  outline: none;
}

/* ── EXTRACTO ────────────────────────────────────────────── */
.sv-news-exc {
  margin: 0;
  font-size: clamp(13px, 1.5vw, 14px);
  line-height: 1.65;
  color: rgba(0, 0, 0, .60);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── TAGS ────────────────────────────────────────────────── */
.sv-news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sv-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: rgba(0, 0, 0, .50);
  background: rgba(0, 0, 0, .04);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 100px;
}

/* ── PIE DE TARJETA ──────────────────────────────────────── */
.sv-news-foot {
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, .07);
  margin-top: auto;
}

.sv-news-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: #111;
  text-decoration: none;
  letter-spacing: .01em;
  position: relative;
  z-index: 1;
  transition: gap .14s ease;
}

.sv-news-more svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform .14s ease;
}

.sv-news-card:hover .sv-news-more { gap: 8px; }
.sv-news-card:hover .sv-news-more svg { transform: translateX(2px); }

@media (prefers-reduced-motion: reduce) {
  .sv-news-more,
  .sv-news-more svg { transition: none !important; }
}

/* ── BOTÓN VER TODAS ─────────────────────────────────────── */
.sv-news-cta-row {
  margin-top: 3rem;
  text-align: center;
}

.sv-news-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  background: transparent;
  color: #111;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid rgba(0, 0, 0, .45);
  border-radius: 100px;
  letter-spacing: .02em;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  cursor: pointer;
}

.sv-news-btn:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

@media (prefers-reduced-motion: reduce) {
  .sv-news-btn { transition: none !important; }
}

/* ── OVERFLOW MÓVIL ──────────────────────────────────────── */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
}

/* ── MENSAJE SIN ENTRADAS ────────────────────────────────── */
.sv-pub-cp-empty {
  padding: 2rem;
  text-align: center;
  color: rgba(0, 0, 0, .45);
  font-size: 14px;
}
