/* Páginas de contenido: portada, artículos y archivo de la newsletter.
   Autónoma, igual que newsletter.css: la CSP no admite <style> inline y estas
   páginas no necesitan el peso completo de styles.css. */

:root {
    --navy: #0b1d3a;
    --navy-soft: #132a4d;
    --green: #00a86b;
    --green-dark: #007e51;
    --charcoal: #2f3742;
    --muted: #5d6673;
    --light: #f3f5f7;
    --warm: #f7f6f1;
    --line: #e3e7ec;
    --white: #ffffff;
    --heading: "Manrope", "Aptos", Arial, sans-serif;
    --body: "Manrope", "Aptos", Arial, sans-serif;
    --radius-button: 8px;
    --radius-card: 12px;
    --shadow-soft: 0 18px 50px rgba(11, 29, 58, 0.08);
    --shadow-card: 0 10px 28px rgba(11, 29, 58, 0.06);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--charcoal);
    background: var(--white);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--green-dark);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    transform: translateY(-150%);
    border-radius: 8px;
    color: var(--white);
    background: var(--navy);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    transform: translateY(0);
}

.container {
    width: min(1160px, calc(100% - 48px));
    margin-inline: auto;
}

.btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    font-family: var(--heading);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: var(--white);
    background: var(--navy);
}

.btn-primary:hover {
    background: var(--navy-soft);
}

.btn-accent {
    color: var(--white);
    background: var(--green);
    box-shadow: 0 10px 24px rgba(0, 168, 107, 0.2);
}

.btn-accent:hover {
    background: var(--green-dark);
    box-shadow: 0 12px 28px rgba(0, 168, 107, 0.28);
}

/* Cabecera */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 72px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 34px;
    width: auto;
}

.contenido-nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.contenido-nav>a:not(.btn) {
    font-family: var(--heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
}

.contenido-nav>a:not(.btn):hover {
    color: var(--green-dark);
}

/* Portada */
.contenido-hero {
    padding: 64px 0 40px;
    background: linear-gradient(180deg, var(--warm), var(--white));
}

.kicker {
    margin: 0 0 10px;
    font-family: var(--heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--green-dark);
}

.contenido-hero h1 {
    margin: 0 0 14px;
    max-width: 18ch;
    font-family: var(--heading);
    font-size: clamp(2rem, 4.4vw, 3rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
    color: var(--navy);
}

.bajada {
    margin: 0;
    max-width: 62ch;
    font-size: 1.06rem;
    color: var(--muted);
}

/* Un imperativo como "Suscríbete" tiene que ser pinchable donde se lee. */
.bajada a {
    color: var(--green-dark);
    font-weight: 600;
    text-underline-offset: 3px;
}

.seccion-articulos {
    padding: 52px 0 12px;
}

.seccion-ediciones {
    padding: 40px 0 80px;
}

.seccion-titulo {
    margin: 0 0 22px;
    font-family: var(--heading);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--navy);
}

/* Solo cuando el título lleva bajada debajo se acerca a ella; si va solo, conserva
   el aire que lo separa de las tarjetas. */
.seccion-titulo:has(+ .seccion-bajada) {
    margin-bottom: 6px;
}

.seccion-bajada {
    margin: 0 0 26px;
    color: var(--muted);
    font-size: 0.96rem;
}

.seccion-vacia {
    margin: 0;
    padding: 28px 26px;
    border: 1px dashed var(--line);
    border-radius: var(--radius-card);
    background: var(--light);
    color: var(--muted);
    max-width: 62ch;
}

/* Tarjetas de artículo */
.lista-articulos {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.tarjeta-articulo a {
    display: flex;
    flex-direction: column;
    gap: 9px;
    height: 100%;
    padding: 26px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.tarjeta-articulo a:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.tarjeta-kicker {
    font-family: var(--heading);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-dark);
}

.tarjeta-titulo {
    font-family: var(--heading);
    font-size: 1.22rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--navy);
}

.tarjeta-bajada {
    color: var(--muted);
    font-size: 0.95rem;
}

.tarjeta-mas {
    margin-top: auto;
    padding-top: 8px;
    font-family: var(--heading);
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--green-dark);
}

/* Lista de ediciones */
.lista-ediciones {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--line);
}

.tarjeta-edicion {
    border-bottom: 1px solid var(--line);
}

.tarjeta-edicion a {
    display: flex;
    gap: 22px;
    align-items: baseline;
    padding: 20px 8px;
    text-decoration: none;
    transition: background-color 160ms ease;
}

.tarjeta-edicion a:hover {
    background: var(--light);
}

.tarjeta-fecha {
    flex: 0 0 76px;
    display: flex;
    flex-direction: column;
    font-family: var(--heading);
    line-height: 1.2;
}

.tarjeta-dia {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--navy);
    text-transform: capitalize;
}

.tarjeta-anio {
    font-size: 0.78rem;
    color: var(--muted);
}

.tarjeta-cuerpo {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tarjeta-titular {
    font-family: var(--heading);
    font-size: 1.04rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--navy);
}

.tarjeta-resumen {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* Pieza: artículo o edición */
.pieza {
    padding: 34px 0 76px;
}

.pieza .container {
    width: min(760px, calc(100% - 48px));
}

.migas {
    margin-bottom: 26px;
    font-size: 0.85rem;
    color: var(--muted);
}

.migas a {
    color: var(--green-dark);
    font-weight: 600;
    text-decoration: none;
}

.migas a:hover {
    text-decoration: underline;
}

.pieza-cabecera {
    padding-bottom: 26px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.pieza-cabecera h1 {
    margin: 0 0 12px;
    font-family: var(--heading);
    font-size: clamp(1.75rem, 3.6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.022em;
    color: var(--navy);
}

.pieza-cabecera .kicker {
    text-transform: none;
    letter-spacing: 0.04em;
}

.firma {
    margin: 12px 0 0;
    font-size: 0.92rem;
    color: var(--muted);
}

.pieza-cuerpo h2 {
    margin: 44px 0 4px;
    font-family: var(--heading);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--green-dark);
}

.pieza-cuerpo h3 {
    margin: 10px 0 14px;
    font-family: var(--heading);
    font-size: 1.42rem;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -0.018em;
    color: var(--navy);
}

.pieza-cuerpo h4 {
    margin: 28px 0 10px;
    font-family: var(--heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
}

/* Un h2 seguido de h3 es rótulo de sección más titular: no deben separarse. */
.pieza-cuerpo h2+h3 {
    margin-top: 4px;
}

/* En las ediciones el h2 es el rótulo de la sección del correo y el h3 el titular.
   En un artículo no hay rótulos: el h2 es el subtítulo y manda en la jerarquía. */
.pieza-articulo h2 {
    margin: 40px 0 14px;
    font-size: 1.42rem;
    letter-spacing: -0.018em;
    text-transform: none;
    color: var(--navy);
}

.pieza-articulo h3 {
    margin: 30px 0 10px;
    font-size: 1.12rem;
}

.pieza-cuerpo p {
    margin: 0 0 18px;
}

.pieza-cuerpo a {
    color: var(--green-dark);
    font-weight: 500;
    text-underline-offset: 3px;
}

.pieza-cuerpo ul,
.pieza-cuerpo ol {
    margin: 0 0 18px;
    padding-left: 22px;
}

.pieza-cuerpo li {
    margin-bottom: 8px;
}

.pieza-cuerpo hr {
    height: 1px;
    margin: 34px 0;
    border: 0;
    background: var(--line);
}

.pieza-cuerpo .fuente {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--muted);
}

.destacado {
    margin: 0 0 20px;
    padding: 18px 22px;
    border: 0;
    border-left: 4px solid var(--green);
    border-radius: 0 var(--radius-button) var(--radius-button) 0;
    background: var(--light);
}

.destacado-rotulo {
    margin: 0 0 5px !important;
    font-family: var(--heading);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--navy);
}

.destacado p:last-child {
    margin-bottom: 0 !important;
}

/* Panel de indicadores y tablas de artículos */
.tabla-scroll {
    margin: 0 0 22px;
    overflow-x: auto;
}

.pieza-cuerpo table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}

.pieza-cuerpo th,
.pieza-cuerpo td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.pieza-cuerpo th {
    font-family: var(--heading);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--light);
    white-space: nowrap;
}

.pieza-cuerpo tbody td:first-child {
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}

/* Bloque de suscripción */
.suscripcion {
    margin: 44px 0 0;
    padding: 32px 30px;
    border-radius: var(--radius-card);
    background: var(--navy);
    color: var(--white);
}

.suscripcion h2 {
    margin: 0 0 8px;
    font-family: var(--heading);
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--white);
}

.suscripcion p {
    margin: 0 0 20px;
    max-width: 56ch;
    color: #dbe8f8;
    font-size: 0.97rem;
}

/* Paginación entre ediciones */
.paginacion {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-family: var(--heading);
    font-size: 0.9rem;
    font-weight: 600;
}

.paginacion a {
    color: var(--green-dark);
    text-decoration: none;
    max-width: 46%;
}

.paginacion a:hover {
    text-decoration: underline;
}

.paginacion-siguiente {
    margin-left: auto;
    text-align: right;
}

/* Pie */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--light);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 22px 0;
    font-size: 0.87rem;
    color: var(--muted);
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom a {
    color: var(--green-dark);
    font-weight: 600;
    text-decoration: none;
}

@media (max-width: 640px) {
    .container {
        width: calc(100% - 32px);
    }

    .pieza .container {
        width: calc(100% - 32px);
    }

    .contenido-hero {
        padding: 44px 0 32px;
    }

    .tarjeta-edicion a {
        flex-direction: column;
        gap: 8px;
    }

    .tarjeta-fecha {
        flex-direction: row;
        gap: 6px;
    }

    .paginacion a {
        max-width: 100%;
    }

    .paginacion-siguiente {
        margin-left: 0;
        text-align: left;
    }

    .suscripcion {
        padding: 26px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .btn,
    .tarjeta-articulo a {
        transition: none;
    }

    .btn:hover,
    .tarjeta-articulo a:hover {
        transform: none;
    }
}
