/*
 * noticia.css — Página de artículo individual — CB Oncineda SK
 */

/* ── Variables locales ───────────────────────────────────────────────────── */
:root {
    --art-max:     720px;
    --art-pad:     2.5rem;
}

/* Safe area: en iOS, el área detrás del notch/isla dinámica se pinta con el
   fondo de <html>. Lo igualamos al inicio del degradado del art-hero para que
   no haya ninguna franja de color distinto durante la transición de navegación.
   El body NO se sobreescribe a blanco: heredar dark-blue de index.css evita el
   parpadeo blanco que iOS mostraba en la safe area al entrar a la página. */
html {
    background-color: var(--primary-blue);
}

/* main cubre todo el ancho (hero + contenido + relacionadas).
   El blanco aquí evita franjas oscuras en los márgenes del container
   y garantiza que el fondo visible del artículo sea siempre blanco.
   El art-hero y art-related tienen sus propios fondos que prevalecen. */
main {
    background-color: #ffffff;
}

/* ══════════════════════════════════════════════════════════════════════════
   HERO
══════════════════════════════════════════════════════════════════════════ */
.art-hero {
    position: relative;
    min-height: 52vh;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding-bottom: 0;
}

.art-hero--img {
    min-height: 58vh;
}

.art-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 15, 50, 0.88) 0%,
        rgba(0, 20, 60, 0.55) 45%,
        rgba(0, 30, 80, 0.25) 100%
    );
}

.art-hero__body {
    position: relative;
    z-index: 1;
    padding-top: 5rem;
    padding-bottom: 3rem;
    max-width: 860px;
}

/* Botón volver */
.art-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    margin-bottom: 20px;
    transition: color 0.2s, gap 0.2s;
}

.art-back:hover {
    color: var(--primary-yellow);
    gap: 9px;
}

/* Etiquetas sobre el hero */
.art-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.art-tag {
    background: var(--primary-yellow);
    color: var(--primary-blue);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    line-height: 1.5;
}

/* Título */
.art-title {
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 18px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Meta: fecha + autor */
.art-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.83rem;
}

.art-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.art-meta__sep {
    opacity: 0.4;
}

/* ══════════════════════════════════════════════════════════════════════════
   LAYOUT CUERPO
══════════════════════════════════════════════════════════════════════════ */
.art-layout {
    display: flex;
    justify-content: center;
    padding: 56px 0 72px;
}

.art-body {
    width: 100%;
    max-width: var(--art-max);
}

/* ══════════════════════════════════════════════════════════════════════════
   TIPOGRAFÍA DEL ARTÍCULO
══════════════════════════════════════════════════════════════════════════ */
.art-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2d3748;
}

.art-content p {
    margin: 0 0 1.4em;
}

.art-content p:first-child {
    font-size: 1.15rem;
    font-weight: 500;
    color: #1a202c;
    line-height: 1.75;
}

.art-content h2 {
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin: 2em 0 0.6em;
    line-height: 1.3;
}

.art-content h3 {
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 1.6em 0 0.5em;
}

.art-content img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5em 0;
    box-shadow: 0 4px 20px rgba(0, 61, 130, 0.1);
}

.art-content ul,
.art-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.4em;
}

.art-content li {
    margin-bottom: 0.4em;
}

.art-content blockquote {
    border-left: 4px solid var(--primary-yellow);
    margin: 1.8em 0;
    padding: 1rem 1.4rem;
    background: #f8f9fc;
    border-radius: 0 10px 10px 0;
    font-size: 1.05rem;
    font-style: italic;
    color: #4a5568;
}

.art-empty {
    color: #8a94a6;
    font-style: italic;
    text-align: center;
    padding: 3rem 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   FOOTER DEL ARTÍCULO
══════════════════════════════════════════════════════════════════════════ */
.art-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.art-footer__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.art-footer__tag {
    font-size: 0.72rem;
    font-weight: 600;
    background: #eef2ff;
    color: var(--primary-blue);
    padding: 3px 10px;
    border-radius: 20px;
}

.art-footer__back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    padding: 6px 14px;
    border: 1.5px solid #c5d3e8;
    border-radius: 20px;
    transition: background 0.2s, border-color 0.2s, color 0.2s, gap 0.2s;
    white-space: nowrap;
}

.art-footer__back:hover {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
    gap: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   NOTICIAS RELACIONADAS
══════════════════════════════════════════════════════════════════════════ */
.art-related {
    background: linear-gradient(180deg, #f0f4fb 0%, #e8edf8 100%);
    padding: 60px 0 72px;
}

.art-related__heading {
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-blue);
    margin-bottom: 28px;
    position: relative;
    padding-bottom: 12px;
}

.art-related__heading::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-yellow);
    border-radius: 2px;
}

.art-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Tarjeta relacionada */
.rel-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0, 61, 130, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.rel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0, 61, 130, 0.13);
}

.rel-card__img {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-blue) 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rel-card__body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rel-card__tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    background: var(--primary-yellow);
    color: var(--primary-blue);
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
    align-self: flex-start;
}

.rel-card__title {
    font-family: 'Helvetica Rounded', Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1.35;
    margin: 0 0 auto;
    padding-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rel-card__date {
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a94a6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 10px;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root { --art-pad: 1rem; }

    .art-hero        { min-height: 45vh; }
    .art-hero--img   { min-height: 50vh; }
    .art-hero__body  { padding-top: 4rem; padding-bottom: 2rem; }

    .art-title       { font-size: clamp(1.35rem, 6vw, 1.8rem); }

    .art-layout      { padding: 32px 0 48px; }

    .art-content     { font-size: 1rem; }
    .art-content p:first-child { font-size: 1.05rem; }

    .art-related__grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .rel-card        { flex-direction: row; }
    .rel-card__img   { width: 100px; height: auto; min-height: 100px; flex-shrink: 0; }

    .art-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .art-meta        { flex-direction: column; align-items: flex-start; gap: 4px; }
    .art-meta__sep   { display: none; }
}
