/* ==========================================================
   Novedades FJA - estilos públicos (portada, listado y detalle)
   ========================================================== */
:root {
    --fja-navy: #0a192f;
    --fja-blue: #005691;
    --fja-sky: #38bdf8;
    --fja-bg-light: #f4f7f9;
}

/* ---- Estructura compartida (páginas PHP: listado y detalle) ---- */
.fja-public { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: #2b2b2b; background: #fff; }
.fja-public .top-contact-bar { background: #06101e; font-size: .85rem; color: rgba(255,255,255,.8); border-bottom: 1px solid rgba(255,255,255,.1); }
.fja-public .navbar-fja { background: var(--fja-navy) !important; box-shadow: 0 4px 15px rgba(0,0,0,.25); }
.fja-public .navbar-fja .nav-link { color: rgba(255,255,255,.9) !important; font-weight: 500; padding: .5rem 1rem; }
.fja-public .navbar-fja .nav-link:hover,
.fja-public .navbar-fja .nav-link.active { color: var(--fja-sky) !important; }
.fja-public .brand-logo { height: 48px; width: auto; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); }
.fja-footer { background: #06101e; color: rgba(255,255,255,.85); }

/* ---- Encabezado de sección ---- */
.news-eyebrow {
    color: var(--fja-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .06em;
}

/* ---- Badges ---- */
.news-cat {
    display: inline-flex; align-items: center; gap: .35rem;
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: .32rem .7rem; border-radius: 50rem;
    color: #fff; background: var(--cat, var(--fja-blue));
}
.news-date { font-size: .82rem; color: #6b7280; }
.news-featured {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    background: #fef3c7; color: #92400e; padding: .28rem .6rem; border-radius: 50rem;
}

/* ---- Tarjeta estándar ---- */
.news-card {
    display: flex; flex-direction: column; height: 100%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(10, 25, 47, .07);
    border: 1px solid #edf1f5;
    text-decoration: none;
    color: inherit;
    transition: transform .25s ease, box-shadow .25s ease;
}
.news-card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(10, 25, 47, .14); color: inherit; }
.news-card .media {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden;
    background: linear-gradient(135deg, var(--fja-navy), var(--fja-blue));
}
.news-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.news-card:hover .media img { transform: scale(1.05); }
.news-card .media .news-cat { position: absolute; top: 12px; left: 12px; }
.news-card .media .placeholder-logo {
    position: absolute; inset: 0; display: grid; place-items: center;
}
.news-card .media .placeholder-logo img { width: 74px; height: 74px; object-fit: cover; border-radius: 50%; opacity: .5; }
.news-card .body { padding: 1.2rem 1.3rem 1.35rem; display: flex; flex-direction: column; flex: 1; }
.news-card h3 {
    font-size: 1.12rem; font-weight: 700; color: var(--fja-navy);
    line-height: 1.35; margin: .45rem 0 .55rem;
}
.news-card p { font-size: .92rem; color: #5b6472; margin: 0; }
.news-card .more { margin-top: auto; padding-top: .9rem; font-size: .85rem; font-weight: 600; color: var(--fja-blue); }
.news-card.is-featured { border-color: #fcd34d; }
.line-clamp-2, .line-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }

/* ---- Portada: nota principal ---- */
.news-lead {
    position: relative; display: block; height: 100%; min-height: 440px;
    border-radius: 16px; overflow: hidden; color: #fff; text-decoration: none;
    background: linear-gradient(135deg, var(--fja-navy), var(--fja-blue));
    box-shadow: 0 14px 40px rgba(10, 25, 47, .2);
}
.news-lead img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.news-lead:hover img { transform: scale(1.04); }
.news-lead::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,25,47,0) 25%, rgba(10,25,47,.55) 55%, rgba(10,25,47,.95) 100%);
}
.news-lead .content { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem; z-index: 1; }
.news-lead h3 { font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 800; line-height: 1.2; margin: .75rem 0 .6rem; }
.news-lead p { color: rgba(255,255,255,.82); margin-bottom: 0; max-width: 640px; }
.news-lead .news-date { color: rgba(255,255,255,.75); }
.news-lead .badge-new {
    position: absolute; top: 18px; right: 18px; z-index: 1;
    background: var(--fja-sky); color: var(--fja-navy);
    font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    padding: .35rem .7rem; border-radius: 50rem;
}
@media (max-width: 576px) {
    .news-lead { min-height: 360px; }
    .news-lead .content { padding: 1.35rem; }
}

/* ---- Portada: notas secundarias en lista ---- */
.news-mini {
    display: flex; gap: 1rem; align-items: stretch;
    padding: .85rem; border-radius: 12px; background: #fff;
    border: 1px solid #edf1f5; text-decoration: none; color: inherit;
    transition: background .2s, box-shadow .2s;
}
.news-mini:hover { background: #f8fbfe; box-shadow: 0 6px 20px rgba(10,25,47,.08); color: inherit; }
.news-mini .thumb {
    width: 128px; flex-shrink: 0; border-radius: 9px; overflow: hidden;
    background: linear-gradient(135deg, var(--fja-navy), var(--fja-blue));
    aspect-ratio: 4 / 3;
}
.news-mini .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-mini h4 { font-size: 1rem; font-weight: 700; color: var(--fja-navy); line-height: 1.35; margin: .3rem 0 0; }
.news-mini .news-cat { font-size: .62rem; padding: .22rem .55rem; }
@media (max-width: 400px) { .news-mini .thumb { width: 96px; } }

/* ---- Skeleton de carga ---- */
.skeleton {
    background: linear-gradient(90deg, #eef2f6 25%, #e3e9ef 37%, #eef2f6 63%);
    background-size: 400% 100%;
    animation: skeleton 1.4s ease infinite;
    border-radius: 12px;
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Listado ---- */
.news-hero-small {
    background: linear-gradient(135deg, rgba(10,25,47,.94), rgba(0,86,145,.88)), var(--hero-bg, none) center/cover;
    color: #fff; padding: 64px 0 56px;
}
.news-hero-small h1 { font-weight: 800; }
.news-filters .btn { border-radius: 50rem; font-size: .85rem; font-weight: 600; }
.news-filters .btn-cat { background: #fff; border: 1px solid #dfe6ee; color: #334155; }
.news-filters .btn-cat:hover { border-color: var(--fja-blue); color: var(--fja-blue); }
.news-filters .btn-cat.active { background: var(--fja-navy); border-color: var(--fja-navy); color: #fff; }
.pagination .page-link { color: var(--fja-navy); }
.pagination .active > .page-link { background: var(--fja-navy); border-color: var(--fja-navy); }

/* ---- Detalle ---- */
.article-hero {
    position: relative; color: #fff; padding: 90px 0 70px;
    background: linear-gradient(135deg, var(--fja-navy), var(--fja-blue));
    overflow: hidden;
}
.article-hero .bg {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    filter: saturate(1.05);
}
.article-hero::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,25,47,.55) 0%, rgba(10,25,47,.88) 70%, rgba(10,25,47,.96) 100%);
}
.article-hero .container { position: relative; z-index: 1; }
.article-hero h1 { font-size: clamp(1.75rem, 4vw, 2.9rem); font-weight: 800; line-height: 1.15; max-width: 920px; }
.article-hero .breadcrumb a { color: rgba(255,255,255,.75); text-decoration: none; }
.article-hero .breadcrumb-item.active, .article-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.55); }
.article-meta { color: rgba(255,255,255,.8); font-size: .92rem; }

.article-body { margin-top: -40px; position: relative; z-index: 2; }
.article-card {
    background: #fff; border-radius: 16px;
    box-shadow: 0 14px 40px rgba(10,25,47,.09);
    padding: clamp(1.4rem, 4vw, 3rem);
}
.article-lead {
    font-size: 1.22rem; line-height: 1.6; color: #334155; font-weight: 500;
    padding-bottom: 1.5rem; margin-bottom: 1.75rem; border-bottom: 1px solid #edf1f5;
}
.article-cover { margin: 0 0 2rem; }
.article-cover img { width: 100%; border-radius: 12px; max-height: 560px; object-fit: cover; }

.article-section-title {
    font-size: 1.1rem; font-weight: 700; color: var(--fja-navy);
    display: flex; align-items: center; gap: .5rem; margin: 2.5rem 0 1rem;
}

.article-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .75rem; }
.article-gallery button {
    border: 0; padding: 0; background: #e5e7eb; border-radius: 10px; overflow: hidden;
    aspect-ratio: 4 / 3; position: relative; cursor: zoom-in;
}
.article-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.article-gallery button:hover img { transform: scale(1.06); }
.article-gallery button:focus-visible { outline: 3px solid var(--fja-sky); outline-offset: 2px; }

.lightbox .modal-content { background: rgba(6, 16, 30, .97); }
.lightbox .carousel-item img { max-height: 78vh; width: auto; max-width: 100%; margin: 0 auto; display: block; border-radius: 8px; }
.lightbox .caption { color: rgba(255,255,255,.85); text-align: center; padding: .9rem 1rem 0; min-height: 2.5rem; }
.lightbox .counter { color: rgba(255,255,255,.6); font-size: .85rem; }

.attach-row {
    display: flex; align-items: center; gap: .9rem;
    padding: .85rem 1rem; border: 1px solid #e6ebf1; border-radius: 12px;
    text-decoration: none; color: inherit; background: #fff; transition: border-color .2s, background .2s;
}
.attach-row:hover { border-color: var(--fja-blue); background: #f5f9fd; color: inherit; }
.attach-row .ico {
    width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.35rem;
    background: #eef2ff; color: #4338ca; flex-shrink: 0;
}
.attach-row .ico.pdf { background: #fee2e2; color: #b91c1c; }
.attach-row .ico.doc, .attach-row .ico.docx { background: #dbeafe; color: #1d4ed8; }
.attach-row .ico.xls, .attach-row .ico.xlsx, .attach-row .ico.csv { background: #dcfce7; color: #15803d; }

.link-row {
    display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem;
    border-radius: 10px; background: var(--fja-bg-light); text-decoration: none; color: var(--fja-navy);
    font-weight: 600; transition: background .2s;
}
.link-row:hover { background: #e7f0f8; color: var(--fja-blue); }
.link-row small { color: #64748b; font-weight: 400; }

.article-aside { position: sticky; top: 100px; }
.share-btn {
    width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
    border: 1px solid #dfe6ee; color: var(--fja-navy); background: #fff; font-size: 1.05rem; transition: all .2s;
}
.share-btn:hover { background: var(--fja-navy); color: #fff; border-color: var(--fja-navy); }
.aside-card { background: #fff; border-radius: 14px; border: 1px solid #edf1f5; padding: 1.3rem; box-shadow: 0 4px 18px rgba(10,25,47,.05); }

.preview-banner {
    background: repeating-linear-gradient(45deg, #fef3c7, #fef3c7 12px, #fde68a 12px, #fde68a 24px);
    color: #78350f; font-weight: 600; padding: .6rem 0; font-size: .9rem;
}

@media (max-width: 991px) { .article-aside { position: static; } }
.min-w-0 { min-width: 0; }
