/* ═══════════════════════════════════════════════════════════════════
   COMPONENTE: BLOQUE DE NOTICIAS
   Estética editorial — medio especializado en economía.
   Paleta base: --color-brand-primary (#405481)
   ═══════════════════════════════════════════════════════════════════ */

.comp-news {
    --news-ink:      var(--color-text, #17203a);
    --news-muted:    var(--color-text-muted, #6b7590);
    --news-line:     var(--color-border, #dfe3ec);
    --news-brand:    var(--color-brand-primary, #405481);
    --news-brand-lt: #6a7da8;
    --news-surface:  #ffffff;
    --news-tint:     rgba(64, 84, 129, 0.06);

    padding-block: clamp(40px, 5vw, 72px);
    color: var(--news-ink);
}

.comp-news--bg-white { background: #ffffff; }
.comp-news--bg-alt   { background: var(--color-bg-alt, #f5f6fa); }

.comp-news--bg-dark {
    --news-ink:     #ffffff;
    --news-muted:   rgba(255, 255, 255, 0.62);
    --news-line:    rgba(255, 255, 255, 0.14);
    --news-brand:   #a9b8d8;
    --news-surface: rgba(255, 255, 255, 0.04);
    --news-tint:    rgba(255, 255, 255, 0.06);
    background: var(--color-brand-primary, #405481);
}

.comp-news--bg-black {
    --news-ink:     #ffffff;
    --news-muted:   rgba(255, 255, 255, 0.58);
    --news-line:    rgba(255, 255, 255, 0.12);
    --news-brand:   #8b9cc4;
    --news-surface: rgba(255, 255, 255, 0.04);
    --news-tint:    rgba(255, 255, 255, 0.06);
    background: #0e1116;
}

/* ─── Encabezado de sección ─────────────────────────────────────── */

.comp-news__header {
    margin-bottom: clamp(20px, 3vw, 32px);
}

.comp-news__header.has-divider {
    padding-bottom: 12px;
    border-bottom: 2px solid var(--news-brand);
}

.comp-news__eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    color: var(--news-brand);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.comp-news__section-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--news-ink);
}

.comp-news__section-title a {
    color: inherit;
    text-decoration: none;
}

.comp-news__section-title a:hover { color: var(--news-brand); }

.comp-news__section-sub {
    margin: 8px 0 0;
    max-width: 62ch;
    color: var(--news-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* ─── Tarjeta base ──────────────────────────────────────────────── */

.comp-news__card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.comp-news__thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background: var(--news-tint);
}

.comp-news__thumb--16-9 { aspect-ratio: 16 / 9; }
.comp-news__thumb--4-3  { aspect-ratio: 4 / 3; }
.comp-news__thumb--3-2  { aspect-ratio: 3 / 2; }
.comp-news__thumb--1-1  { aspect-ratio: 1 / 1; }

.comp-news__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.comp-news__card:hover .comp-news__img { transform: scale(1.035); }

.comp-news__body {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.comp-news__kicker {
    align-self: flex-start;
    color: var(--news-brand);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1;
}

.comp-news__kicker:hover { text-decoration: underline; }

.comp-news__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.011em;
    color: var(--news-ink);
}

.comp-news__title a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 260ms ease;
}

.comp-news__title a:hover { background-size: 100% 1px; }

.comp-news__excerpt {
    margin: 0;
    color: var(--news-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.comp-news__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    color: var(--news-muted);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.comp-news__meta > * + *::before {
    content: "·";
    margin-right: 10px;
    opacity: 0.55;
}

.comp-news__author { font-weight: 600; }

/* ─── LAYOUT: PORTADA (destacada + sidebar) ─────────────────────── */

.comp-news__cover {
    display: grid;
    gap: clamp(24px, 3vw, 40px);
}

.comp-news__sidebar {
    display: flex;
    flex-direction: column;
}

.comp-news__card--lead .comp-news__title {
    font-size: clamp(1.4rem, 3vw, 2.05rem);
    line-height: 1.16;
    letter-spacing: -0.022em;
}

.comp-news__card--lead .comp-news__excerpt {
    font-size: 1rem;
    line-height: 1.6;
}

.comp-news__card--side {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding-block: 16px;
    border-top: 1px solid var(--news-line);
}

.comp-news__sidebar > .comp-news__card--side:first-child {
    padding-top: 0;
    border-top: 0;
}

.comp-news__card--side .comp-news__thumb {
    flex: 0 0 88px;
    width: 88px;
    aspect-ratio: 1 / 1;
}

.comp-news__card--side .comp-news__title { font-size: 1.1rem; }

@media (min-width: 900px) {
    .comp-news__cover {
        grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
        align-items: start;
    }

    .comp-news__cover.is-reversed .comp-news__lead    { order: 2; }
    .comp-news__cover.is-reversed .comp-news__sidebar { order: 1; }

    .comp-news__sidebar {
        padding-inline-start: clamp(20px, 2.2vw, 32px);
        border-inline-start: 1px solid var(--news-line);
    }

    .comp-news__cover.is-reversed .comp-news__sidebar {
        padding-inline: 0 clamp(20px, 2.2vw, 32px);
        border-inline: 0 1px solid var(--news-line);
    }
}

/* ─── LAYOUT: FILA DESTACADA ────────────────────────────────────── */

.comp-news__featured {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 3vw, 36px);
}

.comp-news__card--hero .comp-news__title {
    font-size: clamp(1.5rem, 3.4vw, 2.35rem);
    line-height: 1.13;
    letter-spacing: -0.025em;
}

.comp-news__card--hero .comp-news__excerpt {
    max-width: 68ch;
    font-size: 1.02rem;
}

.comp-news__featured-row {
    display: grid;
    gap: clamp(18px, 2.4vw, 30px);
    padding-top: clamp(20px, 2.5vw, 28px);
    border-top: 1px solid var(--news-line);
    grid-template-columns: 1fr;
}

@media (min-width: 700px) {
    .comp-news__featured-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
    .comp-news__featured-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ─── LAYOUT: GRILLA ────────────────────────────────────────────── */

.comp-news__grid {
    display: grid;
    gap: clamp(20px, 2.6vw, 34px);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .comp-news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .comp-news__grid, .comp-news__covergrid-items {
    gap: 26px !important;
  }
}

@media (min-width: 960px) {
    .comp-news--cols-2 .comp-news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comp-news--cols-3 .comp-news__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .comp-news--cols-4 .comp-news__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ─── LAYOUT: LISTADO HORIZONTAL ────────────────────────────────── */

.comp-news__list {
    display: flex;
    flex-direction: column;
}

.comp-news__card--row {
    flex-direction: row;
    align-items: flex-start;
    gap: clamp(14px, 2vw, 24px);
    padding-block: clamp(18px, 2.2vw, 26px);
    border-top: 1px solid var(--news-line);
}

.comp-news__list > .comp-news__card--row:first-child {
    padding-top: 0;
    border-top: 0;
}

.comp-news__card--row .comp-news__thumb {
    flex: 0 0 clamp(110px, 26vw, 230px);
    width: clamp(110px, 26vw, 230px);
}

.comp-news__card--row .comp-news__title { font-size: clamp(1rem, 1.7vw, 1.3rem); }

/* ─── LAYOUT: COMPACTO NUMERADO ─────────────────────────────────── */

.comp-news__compact {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: none;
}

.comp-news__compact > li { border-top: 1px solid var(--news-line); }
.comp-news__compact > li:first-child { border-top: 0; }

.comp-news__card--compact {
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
    padding-block: 14px;
}

.comp-news__index {
    flex: 0 0 auto;
    color: var(--news-brand);
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    opacity: 0.55;
}

.comp-news__card--compact .comp-news__title {
    font-size: 0.9875rem;
    font-weight: 600;
}

/* ─── LAYOUT: TITULARES ─────────────────────────────────────────── */

.comp-news__headlines {
    display: grid;
    gap: clamp(16px, 2vw, 28px);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .comp-news__headlines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
    .comp-news--cols-2 .comp-news__headlines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comp-news--cols-3 .comp-news__headlines { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .comp-news--cols-4 .comp-news__headlines { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.comp-news__card--headline {
    padding-inline-start: 14px;
    border-inline-start: 3px solid var(--news-brand);
}

.comp-news__card--headline .comp-news__title { font-size: 1rem; }

/* ─── LAYOUT: CINTILLO ──────────────────────────────────────────── */

.comp-news__ticker {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.comp-news__card--ticker {
    flex: 0 0 clamp(230px, 62vw, 300px);
    scroll-snap-align: start;
    padding: 14px;
    border: 1px solid var(--news-line);
    border-radius: 6px;
    background: var(--news-surface);
}

.comp-news__card--ticker .comp-news__title { font-size: 0.9375rem; }

.comp-news__ticker::-webkit-scrollbar { height: 6px; }
.comp-news__ticker::-webkit-scrollbar-thumb {
    background: var(--news-brand);
    border-radius: 99px;
    opacity: 0.4;
}

/* ─── Footer / CTA ──────────────────────────────────────────────── */

.comp-news__footer {
    margin-top: clamp(22px, 3vw, 34px);
    padding-top: 16px;
    border-top: 1px solid var(--news-line);
}

.comp-news__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--news-brand);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    text-transform: uppercase;
}

.comp-news__cta span { transition: transform 200ms ease; }
.comp-news__cta:hover span { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
    .comp-news__img,
    .comp-news__cta span,
    .comp-news__title a {
        transition: none !important;
    }
}


/* ─── LAYOUT: PORTADA 2×2 ───────────────────────────────────────── */

.comp-news__covergrid {
    display: grid;
    gap: clamp(16px, 2.2vw, 28px);
    grid-template-columns: 1fr;
}

.comp-news__covergrid-items {
    display: grid;
    gap: clamp(16px, 2.2vw, 28px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 900px) {
    .comp-news__covergrid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }
}

@media (max-width:600px) {
    .comp-news__covergrid-items {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Tarjeta destacada con texto sobre la imagen */

.comp-news__card--overlay {
    position: relative;
    height: 100%;
    min-height: 320px;
    border-radius: 4px;
    overflow: hidden;
    background: #14192b;
}

.comp-news__card--overlay .comp-news__thumb {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
    border-radius: 0;
    margin: 0;
}

.comp-news__card--overlay .comp-news__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Degradado para que el título se lea sobre cualquier foto */
.comp-news__card--overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10, 14, 26, 0.92) 0%,
        rgba(10, 14, 26, 0.55) 38%,
        rgba(10, 14, 26, 0.12) 68%,
        rgba(10, 14, 26, 0) 100%
    );
    pointer-events: none;
}

.comp-news__card--overlay .comp-news__body {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding: clamp(20px, 2.6vw, 34px);
}

.comp-news__card--overlay .comp-news__title {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: #fff;
}

.comp-news__card--overlay .comp-news__title a {
    color: #fff;
}

.comp-news__card--overlay .comp-news__kicker {
    color: #a9b8d8;
}

.comp-news__card--overlay .comp-news__meta {
    color: rgba(255, 255, 255, 0.72);
}

@media (min-width: 900px) {
    .comp-news__card--overlay {
        min-height: 100%;
    }
}
