/* ========================================
   SP Opinión — Columnas de opinión v2
   ======================================== */

.sp-op {
    padding: 5rem 0 6rem;
    background: linear-gradient(to bottom, #f9fafb, #fff);
    position: relative;
    overflow: hidden;
}
.sp-op__top-line {
    position: absolute; top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e5e7eb, transparent);
}
.sp-op__container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--px-mobile);
}
@media (min-width: 768px) { .sp-op__container { padding: 0 var(--px-desktop); } }

/* ---- Header ---- */
.sp-op__header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
@media (min-width: 1024px) {
    .sp-op__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
    }
}
.sp-op__tag {
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: 1rem;
}
.sp-op__tag-line {
    width: 2.5rem; height: 2px;
    background: var(--analdex-yellow);
    border-radius: 9999px;
}
.sp-op__tag span {
    color: #0C256A;
    font-weight: 900;
    letter-spacing: .35em;
    text-transform: uppercase;
    font-size: 12px;
}
.sp-op__title {
    font-size: 2.25rem;
    font-weight: 900;
    color: var(--analdex-navy);
    line-height: 1.15;
    margin-bottom: .5rem;
}
@media (min-width: 768px) { .sp-op__title { font-size: 3rem; } }
.sp-op__desc {
    color: #9ca3af;
    font-size: 14px;
    max-width: 32rem;
    line-height: 1.6;
}

/* ---- Author mini profiles ---- */
.sp-op__authors {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.sp-op__author {
    display: flex; align-items: center; gap: .625rem;
}
.sp-op__author-avatar {
    width: 2.25rem; height: 2.25rem;
    border-radius: 50%;
    background: rgba(var(--analdex-navy-rgb), .1);
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
    flex-shrink: 0;
}
.sp-op__author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sp-op__author-info { display: none; }
@media (min-width: 640px) { .sp-op__author-info { display: block; } }
.sp-op__author-name {
    color: var(--analdex-navy); font-weight: 700;
    font-size: 11px; line-height: 1.2; display: block;
}
.sp-op__author-role { color: #9ca3af; font-size: 9px; display: block; }

/* ---- Filter pills ---- */
.sp-op__filtros {
    display: flex; align-items: center; gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}
.sp-op__pill {
    font-size: 12px; font-weight: 700;
    padding: .5rem 1rem;
    border-radius: 9999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    transition: all .3s;
    cursor: pointer;
    font-family: inherit;
}
.sp-op__pill:hover { border-color: #d1d5db; color: var(--analdex-navy); }
.sp-op__pill--active {
    background: var(--analdex-navy) !important;
    color: #fff !important;
    border-color: var(--analdex-navy) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.sp-op__count {
    color: #d1d5db;
    font-size: 12px;
    font-weight: 600;
    margin-left: .5rem;
}

/* ---- Tema badges ---- */
.sp-op__tema {
    font-size: 8px; font-weight: 900;
    letter-spacing: .1em; text-transform: uppercase;
    padding: .25rem .625rem;
    border-radius: 9999px;
    border: 1px solid;
    display: inline-block;
}
.sp-op__tema--blue   { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.sp-op__tema--violet { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }
.sp-op__tema--amber  { background: #fffbeb; color: #b45309; border-color: #fef3c7; }
.sp-op__tema--green  { background: #f0fdf4; color: #15803d; border-color: #dcfce7; }
.sp-op__tema--indigo { background: #eef2ff; color: #4338ca; border-color: #e0e7ff; }

/* ============================================
   FEATURED CARDS
   ============================================ */
.sp-op__featured-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .sp-op__featured-grid { grid-template-columns: repeat(2, 1fr); }
}

.sp-op__featured {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    background: var(--analdex-navy);
    display: flex;
    flex-direction: column;
    min-height: 360px;
}
.sp-op__featured-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .7s;
}
.sp-op__featured:hover .sp-op__featured-bg { transform: scale(1.05); }

.sp-op__featured-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.40), rgba(0,0,0,.10));
}
.sp-op__featured-quote {
    position: absolute; top: 1.25rem; right: 1.25rem;
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    background: rgba(var(--analdex-yellow-rgb), .2);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    color: var(--analdex-yellow);
    z-index: 5;
}
.sp-op__featured-content {
    position: relative;
    z-index: 10;
    margin-top: auto;
    padding: 1.75rem;
}
.sp-op__featured-tags {
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .75rem;
}
.sp-op__meta-light {
    color: rgba(255,255,255,.4);
    font-size: 10px; font-weight: 600;
}
.sp-op__featured-content h3 {
    color: #fff; font-weight: 900;
    font-size: 1.125rem; line-height: 1.3;
    margin-bottom: 1rem;
    max-width: 28rem;
}
@media (min-width: 768px) { .sp-op__featured-content h3 { font-size: 1.25rem; } }
.sp-op__featured-content > p {
    color: rgba(255,255,255,.45);
    font-size: 12px; line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 28rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer inside featured */
.sp-op__featured-foot {
    display: flex; align-items: center; justify-content: space-between;
}
.sp-op__featured-author {
    display: flex; align-items: center; gap: .75rem;
}
.sp-op__featured-author-img {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,.2);
    flex-shrink: 0;
}
.sp-op__featured-author-img img { width: 100%; height: 100%; object-fit: cover; }
.sp-op__featured-author-name {
    color: #fff; font-weight: 700; font-size: 11px; display: block;
}
.sp-op__featured-author-meta {
    color: rgba(255,255,255,.4); font-size: 9px; display: block;
}

/* "Leer →" link — featured */
.sp-op__leer {
    display: inline-flex; align-items: center;
    gap: .375rem;
    color: var(--analdex-yellow);
    font-weight: 900; font-size: 11px;
    transition: gap .3s;
    flex-shrink: 0;
}
.sp-op__featured:hover .sp-op__leer { gap: .625rem; }

/* ============================================
   SECONDARY CARDS — 3-column grid
   ============================================ */
.sp-op__grid-secondary {
    display: grid;
    gap: 1.25rem;
}
@media (min-width: 640px) { .sp-op__grid-secondary { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .sp-op__grid-secondary { grid-template-columns: repeat(3, 1fr); } }

.sp-op__sec-card {
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    transition: all .5s;
}
.sp-op__sec-card:hover {
    border-color: rgba(var(--analdex-yellow-rgb), .25);
    box-shadow: 0 20px 60px rgba(0,0,0,.1);
}

/* Image wrapper */
.sp-op__sec-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}
.sp-op__sec-img > img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .7s;
}
.sp-op__sec-card:hover .sp-op__sec-img > img { transform: scale(1.05); }
.sp-op__sec-img-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.60), rgba(0,0,0,.15), transparent);
}

/* Tema badge — positioned top-left inside image */
.sp-op__sec-tema {
    position: absolute; top: .75rem; left: .75rem;
    font-size: 7px;
    z-index: 2;
}
/* Quote icon — top-right */
.sp-op__sec-quote-icon {
    position: absolute; top: .75rem; right: .75rem;
    width: 1.75rem; height: 1.75rem;
    border-radius: 50%;
    background: rgba(var(--analdex-yellow-rgb), .9);
    display: flex; align-items: center; justify-content: center;
    color: var(--analdex-navy);
    z-index: 2;
}
/* Footer inside image */
.sp-op__sec-img-foot {
    position: absolute; bottom: .75rem; left: .75rem; right: .75rem;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 2;
}
.sp-op__sec-img-foot > span:first-child {
    color: rgba(255,255,255,.7); font-size: 9px; font-weight: 600;
}
.sp-op__sec-dur {
    color: #fff; font-size: 8px; font-weight: 700;
    background: rgba(0,0,0,.4);
    backdrop-filter: blur(8px);
    padding: .125rem .5rem;
    border-radius: 9999px;
}

/* Body */
.sp-op__sec-body {
    display: flex; flex-direction: column;
    flex: 1; padding: 1.25rem;
}

/*
 * La plantilla escribe estas clases propias en lugar de apoyarse en el
 * elemento (h4, p) dentro de .sp-op__sec-body. Sin ellas la tarjeta salía sin
 * relleno ni separaciones y el texto aparecía amontonado contra el borde.
 */
.sp-op__sec-content {
    display: flex; flex-direction: column;
    flex: 1; padding: 1.25rem;
}
.sp-op__sec-tags {
    display: flex; flex-wrap: wrap;
    gap: .375rem;
    margin-bottom: .625rem;
}
/* Sin etiquetas, el contenedor no debe dejar un hueco suelto. */
.sp-op__sec-tags:empty { display: none; }

.sp-op__sec-title {
    color: var(--analdex-navy); font-weight: 900;
    font-size: 13px; line-height: 1.4;
    margin: 0 0 .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-op__sec-desc {
    color: #9ca3af; font-size: 11px; line-height: 1.6;
    margin: 0 0 1rem;
    /* Empuja el pie al fondo para que todas las tarjetas lo alineen. */
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-op__sec-meta {
    color: #9ca3af; font-size: 9px;
    font-weight: 600;
    line-height: 1.4;
}

.sp-op__sec-body h4 {
    color: var(--analdex-navy); font-weight: 900;
    font-size: 13px; line-height: 1.4;
    margin-bottom: .5rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-op__sec-body > p {
    color: #9ca3af; font-size: 11px; line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
.sp-op__sec-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: .75rem;
    border-top: 1px solid #f1f5f9;
}
.sp-op__sec-author {
    display: flex; align-items: center; gap: .5rem;
}
.sp-op__sec-author-img {
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}
.sp-op__sec-author-img img { width: 100%; height: 100%; object-fit: cover; }
.sp-op__sec-author-name {
    color: var(--analdex-navy); font-weight: 700;
    font-size: 10px; display: block;
}
.sp-op__sec-author-date {
    color: #9ca3af; font-size: 8px; display: block;
}

/* "Leer →" link — secondary */
.sp-op__leer-sm {
    display: inline-flex; align-items: center;
    gap: .25rem;
    color: var(--analdex-navy);
    font-weight: 900; font-size: 10px;
    transition: all .3s;
    flex-shrink: 0;
}
.sp-op__sec-card:hover .sp-op__leer-sm {
    gap: .5rem;
    color: var(--analdex-yellow);
}

/*
 * La plantilla reutiliza .sp-op__leer en las tarjetas secundarias, pero ese
 * estilo se pensó para las destacadas, que van sobre imagen oscura. En blanco
 * el amarillo apenas se lee, así que aquí se parte del azul corporativo y el
 * amarillo se reserva para el hover.
 */
.sp-op__sec-card .sp-op__leer {
    color: var(--analdex-navy);
    font-size: 10px;
}
.sp-op__sec-card:hover .sp-op__leer {
    gap: .625rem;
    color: var(--analdex-yellow);
}

/* ---- Hidden state for filter ---- */
.sp-op__card--hidden { display: none !important; }
/* Botón "Ver todos" */
.sp-op__header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.sp-op__ver-todos { display: inline-flex; align-items: center; gap: 0.4rem; flex-shrink: 0; padding: 0.6rem 1.25rem; background: var(--analdex-navy); color: #fff; border-radius: 999px; font-size: 0.8rem; font-weight: 700; transition: opacity 0.2s; white-space: nowrap; }
.sp-op__ver-todos:hover { opacity: 0.88; }
