/* ============================================================
   SOS EPS - style.css del theme
   Paleta extraída del header oficial del sitio
   ============================================================ */

:root {
    --sos-navy:       #2c438e;
    --sos-navy-dark:  #1f3270;
    --sos-gold:       #fed259;
    --sos-text:       #1f2937;
    --sos-muted:       #6b7280;
    --sos-border:      #e5e7eb;
    --sos-bg-light:    #f5f7fb;
}

/* ============================================================
   Base: imágenes fluidas en todo el sitio
   ============================================================ */

img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   Fix de layout: el wrapper .module.news.showall del core de
   Exponent puede traer padding/margin que rompe el negative
   margin del .row de Bootstrap, dejando hueco a la derecha.
   Se neutraliza aquí sin tocar el core.
   ============================================================ */

.module.news.showall {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    padding-left: 0;
    padding-right: 0;
}

.module.news.showall [id$="list"] {
    width: 100%;
    max-width: 100%;
}

.module.news.showall .news-grid-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.module.news.showall .news-grid-row > .col {
    box-sizing: border-box;
    padding: 0.75rem;
}

/* ============================================================
   Tarjetas de noticias / blog (newslist.tpl, showall.tpl)
   ============================================================ */

.news-card {
    border: 1px solid var(--sos-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(44, 67, 142, 0.14);
}

.news-card.unapproved {
    outline: 2px dashed var(--sos-gold);
    outline-offset: 2px;
}

.news-card .news-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 60%; /* relación 5:3 */
    overflow: hidden;
    background: var(--sos-bg-light);
    flex-shrink: 0;
}

.news-card .news-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}

.news-card .news-date-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sos-navy);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    z-index: 2;
}

.news-card .news-body {
    padding: 1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-card .news-meta {
    font-size: 0.78rem;
    color: var(--sos-muted);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.news-card .news-meta i {
    color: var(--sos-navy);
}

.news-card h2,
.news-card h3 {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.news-card h2 a,
.news-card h3 a {
    color: var(--sos-text);
    text-decoration: none;
    font-weight: 700;
}

.news-card h2 a:hover,
.news-card h3 a:hover {
    color: var(--sos-navy);
}

.news-card .bodycopy {
    font-size: 0.88rem;
    color: var(--sos-muted);
    flex: 1;
}

.news-card .bodycopy p {
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .read-more-link {
    display: block;
    width: max-content;
    margin-top: 0.5rem;
    padding: 0.35rem 0.85rem;
    border: 1.5px solid var(--sos-navy);
    border-radius: 999px;
    color: var(--sos-navy);
    background: transparent;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.4;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.news-card .read-more-link::after {
    content: " →";
    display: inline;
    transition: margin-left 0.2s ease;
}

.news-card .read-more-link:hover {
    background-color: var(--sos-navy);
    color: #fff;
}

.news-card .read-more-link:hover::after {
    margin-left: 3px;
}

.news-card .item-actions {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--sos-border);
    display: flex;
    gap: 0.4rem;
}

.news-card .social-row {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

/* ============================================================
   Vista de detalle (show.tpl + newsitem.tpl)
   Contenedor de lectura, imagen 16:9, tipografía editorial,
   listas, navegación prev/next.
   ============================================================ */

.module.news.show {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

/* --- Navegación prev/next (arriba y abajo) --- */

.module.news.show .module-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0;
    border: none !important;
}

.module.news.show .module-actions hr {
    display: none;
}

.module.news.show .module-actions span {
    float: none !important;
    display: flex;
    align-items: center;
    max-width: 46%;
}

.module.news.show .module-actions span:last-child {
    justify-content: flex-end;
    text-align: right;
    margin-left: auto;
}

.module.news.show .module-actions .loader {
    display: none;
}

.module.news.show a.newsnav {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--sos-navy);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.module.news.show a.newsnav:hover {
    text-decoration: underline;
}

.module.news.show a.newsnav img {
    flex-shrink: 0;
}

/* --- Encabezado del artículo --- */

.module.news.show .item > .heading {
    font-size: 2.1rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--sos-text);
    margin: 0.4rem 0 0.6rem;
}

.module.news.show .item > .date,
.module.news.show .item > .post-date {
    display: inline-block;
    color: var(--sos-muted);
    font-size: 0.85rem;
    font-style: normal;
    margin-bottom: 0.4rem;
    margin-right: 0.75rem;
}

.module.news.show .news-views-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--sos-muted);
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
}

.module.news.show .news-views-counter i {
    color: var(--sos-navy);
    font-size: 0.78rem;
}

.module.news.show .news-views-today {
    color: var(--sos-navy);
    font-weight: 600;
}

.module.news.show .item > .item-actions {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

/* --- Imagen destacada: 16:9, integrada sin marco de "tarjeta" --- */

.module.news.show .bodycopy {
    position: relative;
}

.module.news.show .bodycopy > img:first-child,
.module.news.show .bodycopy > a:first-child img,
.module.news.show .bodycopy > div:first-child > img,
.module.news.show .bodycopy > figure:first-child img,
.module.news.show .newsitem-img-placeholder {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 2rem;
    box-shadow: none;
}

.module.news.show .bodycopy > a:first-child {
    display: block;
}

/* --- Tipografía del cuerpo del artículo --- */

.module.news.show .bodycopy {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--sos-text);
}

.module.news.show .bodycopy p {
    margin-bottom: 1.4rem;
}

.module.news.show .bodycopy p:first-of-type {
    font-size: 1.18rem;
    line-height: 1.6;
    font-weight: 500;
    color: var(--sos-text);
}

.module.news.show .bodycopy h2,
.module.news.show .bodycopy h3,
.module.news.show .bodycopy h4 {
    color: var(--sos-navy);
    font-weight: 700;
    margin: 2rem 0 0.85rem;
    line-height: 1.35;
}

.module.news.show .bodycopy h2 { font-size: 1.4rem; }
.module.news.show .bodycopy h3 { font-size: 1.2rem; }
.module.news.show .bodycopy h4 { font-size: 1.05rem; }

.module.news.show .bodycopy a {
    color: var(--sos-navy);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(44, 67, 142, 0.35);
    text-decoration-thickness: 1px;
}

.module.news.show .bodycopy a:hover {
    text-decoration-color: var(--sos-navy);
}

.module.news.show .bodycopy strong,
.module.news.show .bodycopy b {
    color: var(--sos-navy-dark);
    font-weight: 700;
}

.module.news.show .bodycopy blockquote {
    margin: 2rem 0;
    padding: 1.1rem 1.5rem;
    border-left: 4px solid var(--sos-gold);
    background: var(--sos-bg-light);
    border-radius: 0 10px 10px 0;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--sos-text);
}

.module.news.show .bodycopy img:not(:first-child) {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

/* --- Listas (ul / ol) dentro del cuerpo del artículo --- */

.module.news.show .bodycopy ul,
.module.news.show .bodycopy ol {
    margin: 0 0 1.4rem;
    padding-left: 0;
    list-style: none;
}

.module.news.show .bodycopy ul li,
.module.news.show .bodycopy ol li {
    position: relative;
    padding-left: 1.9rem;
    margin-bottom: 0.65rem;
    line-height: 1.6;
}

.module.news.show .bodycopy ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sos-gold);
}

.module.news.show .bodycopy ol {
    counter-reset: sos-ol;
}

.module.news.show .bodycopy ol li::before {
    counter-increment: sos-ol;
    content: counter(sos-ol);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--sos-navy);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module.news.show .bodycopy ul ul,
.module.news.show .bodycopy ol ol,
.module.news.show .bodycopy ul ol,
.module.news.show .bodycopy ol ul {
    margin-top: 0.65rem;
    margin-bottom: 0;
}

/* --- Tags + social al cierre del artículo --- */

.module.news.show .tags-assigned,
.module.news.show .social-row {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--sos-border);
}

@media (max-width: 576px) {
    .module.news.show .item > .heading {
        font-size: 1.5rem;
    }

    .module.news.show .module-actions span {
        max-width: 48%;
        font-size: 0.78rem;
    }
}

/* ============================================================
   "También te podría interesar" (prev/next con thumbnail)
   Estructura propia, sin .row/.col de Bootstrap: grid CSS de
   2 columnas iguales + flexbox dentro de cada tarjeta. Cero
   dependencia de que el grid de Bootstrap esté bien cargado.
   ============================================================ */

.othernews {
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--sos-border);
}

.othernews-title {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--sos-navy);
    margin: 0 0 1.75rem 0;
}

.othernews-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.othernews-card {
    position: relative;
    display: block;
    width: 100%;
    min-height: 96px;
    padding: 0;
    background-color: var(--sos-bg-light);
    border: 1px solid var(--sos-border);
    border-radius: 14px;
    overflow: hidden;
    box-sizing: border-box;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.othernews-card:hover {
    background-color: #eef1f9;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(44, 67, 142, 0.12);
    text-decoration: none;
}

.othernews-empty {
    background: transparent;
    border: none;
}

.othernews-thumb {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 96px;
    overflow: hidden;
    background-color: #fff;
}

.othernews-thumb-right {
    left: auto;
    right: 0;
}

.othernews-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    margin: 0;
}

.othernews-thumb-desktop {
    display: block;
}

.othernews-arrow-mobile {
    display: none;
}

.othernews-text {
    display: block;
    margin-left: 112px;
    margin-right: 16px;
    padding: 0.9rem 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sos-text);
    line-height: 1.35;
    min-height: 96px;
    display: flex;
    align-items: center;
}

.othernews-card-reverse .othernews-text {
    margin-left: 16px;
    margin-right: 112px;
    text-align: right;
    justify-content: flex-end;
}

.othernews-card:hover .othernews-text {
    color: var(--sos-navy);
}

@media (max-width: 640px) {
    .othernews-grid {
        grid-template-columns: 1fr;
    }

    .othernews-thumb-desktop {
        display: none;
    }

    .othernews-arrow-mobile {
        display: flex;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 48px;
        align-items: center;
        justify-content: center;
        font-size: 1.4rem;
        color: var(--sos-navy);
    }

    .othernews-card-reverse .othernews-arrow-mobile {
        left: auto;
        right: 0;
    }

    .othernews-text {
        margin-left: 56px;
        margin-right: 16px;
        font-size: 0.9rem;
        text-align: center;
        justify-content: center;
        min-height: 64px;
    }

    .othernews-card-reverse .othernews-text {
        margin-left: 16px;
        margin-right: 56px;
        text-align: center;
        justify-content: center;
    }
}
