/* ════════════════════════════════════════════════════════════════
   HackPR — theme.css  v1.0.0
   Portal de noticias tech · Dark mode editorial
   ════════════════════════════════════════════════════════════════ */


/* ── 1. RESET ────────────────────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body, h1, h2, h3, h4, h5, h6,
p, ul, ol, li, figure, blockquote, dl, dd {
    margin: 0;
    padding: 0;
}

ul, ol { list-style: none; }

img, video, svg {
    display: block;
    max-width: 100%;
}

/* Todas las imágenes del theme: nunca crecen por su tamaño natural */
img {
    width: 100%;
    height: auto;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
    font: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--tp-accent);
    outline-offset: 3px;
    border-radius: 3px;
}


/* ── 2. TOKENS ───────────────────────────────────────────────── */

:root {
    /* Fondos */
    --tp-bg:          #09090b;
    --tp-bg-header:   #0d0d10;
    --tp-surface:     #111116;
    --tp-surface2:    #1c1c22;
    --tp-surface3:    #26262e;

    /* Bordes */
    --tp-border:      rgba(255,255,255,.07);
    --tp-border2:     rgba(255,255,255,.13);
    --tp-border3:     rgba(255,255,255,.22);

    /* Texto */
    --tp-text:        #e6e6f0;
    --tp-text-soft:   #aaaab8;
    --tp-text-muted:  #6a6a80;

    /* Acento */
    --tp-accent:      #4f8ef7;
    --tp-accent-h:    #3b7de8;
    --tp-accent-dim:  rgba(79,142,247,.14);

    /* Breaking */
    --tp-red:         #ef4444;

    /* Tipografía */
    --f-headline: 'Syne', system-ui, sans-serif;
    --f-ui:       'Inter', system-ui, sans-serif;

    /* Espaciado */
    --sp-xs:  4px;
    --sp-sm:  8px;
    --sp-md:  16px;
    --sp-lg:  24px;
    --sp-xl:  40px;
    --sp-2xl: 64px;

    /* Radios */
    --r-sm:  6px;
    --r-md:  10px;
    --r-lg:  16px;

    /* Transiciones */
    --ease:     cubic-bezier(.22,.68,0,1.2);
    --ease-out: cubic-bezier(0,0,.2,1);

    /* Layout */
    --tp-max-w:     1280px;
    --tp-gap:       20px;
    --tp-header-h:  64px;
    --tp-breaking-h: 36px;
}


/* ── 3. BASE GLOBAL ──────────────────────────────────────────── */

body {
    background-color: var(--tp-bg);
    color: var(--tp-text);
    font-family: var(--f-ui);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--tp-header-h);
}

body.tp-has-breaking {
    padding-top: calc(var(--tp-header-h) + var(--tp-breaking-h));
}

h1, h2, h3, h4 {
    font-family: var(--f-headline);
    line-height: 1.15;
    letter-spacing: -.02em;
    color: var(--tp-text);
}

a:hover { color: var(--tp-accent); }

/* Contenedor de ancho máximo */
.tp-container {
    width: 100%;
    max-width: var(--tp-max-w);
    margin-inline: auto;
    padding-inline: var(--sp-lg);
}

/* Screen-reader only */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -999px;
    left: var(--sp-md);
    z-index: 9999;
    padding: var(--sp-sm) var(--sp-md);
    background: var(--tp-accent);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--sp-md); }

/* Divisor editorial */
.tp-divider {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    margin-block: var(--sp-xl);
}
.tp-divider::before,
.tp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--tp-border2);
}
.tp-divider__label {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tp-text-muted);
    white-space: nowrap;
}


/* ── 4. BREAKING BAR ─────────────────────────────────────────── */

.tp-breaking {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    height: var(--tp-breaking-h);
    background: var(--tp-red);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.tp-breaking__label {
    flex-shrink: 0;
    padding-inline: var(--sp-md);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0,0,0,.25);
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,.2);
}

.tp-breaking__track {
    overflow: hidden;
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
}

.tp-breaking__text {
    display: inline-block;
    white-space: nowrap;
    font-size: .8rem;
    font-weight: 500;
    color: #fff;
    padding-left: 100%;
    animation: tp-ticker 28s linear infinite;
}
.tp-breaking__text:hover { animation-play-state: paused; }

@keyframes tp-ticker {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}


/* ── 5. HEADER ───────────────────────────────────────────────── */

.tp-header {
    position: fixed;
    left: 0; right: 0;
    z-index: 100;
    height: var(--tp-header-h);
    background: var(--tp-bg-header);
    border-bottom: 1px solid var(--tp-border);
    transition: background .3s var(--ease-out),
                border-color .3s var(--ease-out),
                box-shadow .3s var(--ease-out);
}

body.tp-has-breaking .tp-header { top: var(--tp-breaking-h); }
body:not(.tp-has-breaking) .tp-header { top: 0; }

.tp-header.is-scrolled {
    background: rgba(9,9,11,.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--tp-border2);
    box-shadow: 0 1px 24px rgba(0,0,0,.4);
}

.tp-header__inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-lg);
}

/* Logo */
.tp-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    text-decoration: none;
}

.tp-logo img {
    height: 32px;
    width: auto;
    aspect-ratio: auto;
    object-fit: contain;
}

.tp-logo__text {
    font-family: var(--f-headline);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--tp-text);
    line-height: 1;
}
.tp-logo__text span { color: var(--tp-accent); }

/* Nav */
.tp-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.tp-nav__list {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}

.tp-nav__item a {
    display: block;
    padding: 6px var(--sp-md);
    font-size: .85rem;
    font-weight: 500;
    color: var(--tp-text-soft);
    border-radius: var(--r-sm);
    transition: color .15s, background .15s;
}
.tp-nav__item a:hover,
.tp-nav__item.current-menu-item a,
.tp-nav__item.current_page_item a {
    color: var(--tp-text);
    background: var(--tp-surface2);
}
.tp-nav__item.current-menu-item a { color: var(--tp-accent); }

/* Header actions */
.tp-header__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
}

/* Botón icónico */
.tp-icon-btn {
    width: 38px; height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    color: var(--tp-text-soft);
    transition: color .15s, background .15s;
}
.tp-icon-btn:hover {
    color: var(--tp-text);
    background: var(--tp-surface2);
}
.tp-icon-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Hamburger */
.tp-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px; height: 38px;
    border-radius: var(--r-sm);
    padding: 8px;
    color: var(--tp-text-soft);
    transition: background .15s;
}
.tp-hamburger:hover { background: var(--tp-surface2); }

.tp-hamburger__line {
    display: block;
    width: 100%; height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform .25s var(--ease), opacity .25s;
    transform-origin: center;
}
.tp-hamburger[aria-expanded="true"] .tp-hamburger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tp-hamburger[aria-expanded="true"] .tp-hamburger__line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.tp-hamburger[aria-expanded="true"] .tp-hamburger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Search overlay */
.tp-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(9,9,11,.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s var(--ease-out);
}
.tp-search-overlay.is-open { opacity: 1; pointer-events: auto; }

.tp-search-overlay__inner {
    width: 100%;
    max-width: 640px;
    padding-inline: var(--sp-lg);
}

.tp-search-overlay__form {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    border-bottom: 2px solid var(--tp-border3);
    padding-bottom: var(--sp-md);
}

.tp-search-overlay__input {
    flex: 1;
    background: none;
    font-family: var(--f-headline);
    font-size: 2rem;
    font-weight: 700;
    color: var(--tp-text);
    outline: none;
}
.tp-search-overlay__input::placeholder { color: var(--tp-text-muted); }

.tp-search-overlay__close {
    color: var(--tp-text-muted);
    padding: var(--sp-sm);
    border-radius: var(--r-sm);
    transition: color .15s;
}
.tp-search-overlay__close:hover { color: var(--tp-text); }

.tp-search-overlay__hint {
    margin-top: 12px;
    font-size: .78rem;
    color: var(--tp-text-muted);
}

/* Mobile nav */
.tp-mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: var(--tp-bg-header);
    padding-inline: var(--sp-xl);
    display: flex;
    flex-direction: column;
    gap: var(--sp-xl);
    transform: translateX(100%);
    transition: transform .3s var(--ease);
}
body.tp-has-breaking .tp-mobile-nav { padding-top: calc(var(--tp-header-h) + var(--tp-breaking-h) + var(--sp-xl)); }
body:not(.tp-has-breaking) .tp-mobile-nav { padding-top: calc(var(--tp-header-h) + var(--sp-xl)); }
.tp-mobile-nav.is-open { transform: translateX(0); }

.tp-mobile-nav__list { display: flex; flex-direction: column; gap: var(--sp-xs); }
.tp-mobile-nav__list a {
    display: block;
    padding: var(--sp-md);
    font-family: var(--f-headline);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--tp-text-soft);
    border-radius: var(--r-md);
    transition: color .15s, background .15s;
}
.tp-mobile-nav__list a:hover { color: var(--tp-text); background: var(--tp-surface); }

@media (max-width: 768px) {
    .tp-nav      { display: none; }
    .tp-hamburger { display: flex; }
}


/* ── 6. HOMEPAGE SECTIONS ────────────────────────────────────── */

.tp-main { min-height: 60vh; }

/* ── 6a. Hero ─────────────────────────────────────────────────── */

.tp-hero-section {
    padding-block: var(--sp-lg) var(--sp-xl);
}

.tp-hero {
    position: relative;
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--tp-surface);
    /* aspect-ratio controla la altura — nunca crece por la imagen */
    aspect-ratio: 21 / 9;
    max-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Imagen de fondo del hero */
.tp-hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.tp-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .8s ease;
    filter: brightness(.75);
}
.tp-hero:hover .tp-hero__media img { transform: scale(1.03); }

/* Veil sobre la imagen */
.tp-hero__veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(9,9,11,.2) 40%,
        rgba(9,9,11,.88) 75%,
        rgba(9,9,11,.98) 100%
    );
    pointer-events: none;
}

/* Cuerpo del hero — sobre el veil */
.tp-hero__body {
    position: relative;
    z-index: 2;
    padding: var(--sp-xl) var(--sp-xl) var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-md);
}

.tp-hero__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    flex-wrap: wrap;
}

.tp-hero__cat {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: var(--tp-accent-dim);
    color: var(--tp-accent);
    border: 1px solid rgba(79,142,247,.3);
    padding: 3px 10px;
    border-radius: var(--r-sm);
}

.tp-hero__time {
    font-size: .75rem;
    color: rgba(255,255,255,.55);
    font-variant-numeric: tabular-nums;
}

.tp-hero__title {
    font-family: var(--f-headline);
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.025em;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,.4);
    margin: 0;
    max-width: 720px;
}

.tp-hero__excerpt {
    font-size: .95rem;
    line-height: 1.65;
    color: rgba(255,255,255,.68);
    max-width: 560px;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tp-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tp-accent);
    margin-top: var(--sp-sm);
    transition: gap .2s var(--ease);
    text-decoration: none;
}
.tp-hero__link:hover { gap: 12px; color: var(--tp-accent); }
.tp-hero__link em { font-style: normal; }

/* Hero placeholder (sin imagen) */
.tp-hero--placeholder .tp-hero__media {
    background: linear-gradient(135deg, var(--tp-surface2) 0%, var(--tp-surface3) 100%);
}

/* ── 6b. Secondary cards ──────────────────────────────────────── */

.tp-secondary-section {
    padding-block: 0 var(--sp-xl);
}

.tp-secondary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--tp-gap);
}

/* Card base */
.tp-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .25s var(--ease), box-shadow .25s;
}
.tp-card:hover {
    border-color: var(--tp-border2);
    transform: translateY(-3px);
    box-shadow: 0 12px 36px rgba(0,0,0,.4);
}

.tp-card__link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Thumbnail — aspect-ratio fijo, nunca crece */
.tp-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--tp-surface2);
    flex-shrink: 0;
}

.tp-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease, filter .3s;
    filter: brightness(.9);
}
.tp-card:hover .tp-card__thumb img {
    transform: scale(1.05);
    filter: brightness(.75);
}

/* Placeholder thumb */
.tp-card__thumb--ph {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tp-surface2) 0%, var(--tp-surface3) 100%);
}
.tp-card__thumb--ph::after {
    content: '';
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--tp-border3);
    opacity: .3;
}

/* Card body */
.tp-card__body {
    padding: var(--sp-md) var(--sp-md) var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    flex: 1;
}

.tp-card__meta {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    flex-wrap: wrap;
}

.tp-card__source {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: var(--tp-accent-dim);
    color: var(--tp-accent);
    border: 1px solid rgba(79,142,247,.2);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.tp-card__time {
    font-size: .72rem;
    color: var(--tp-text-muted);
    font-variant-numeric: tabular-nums;
}

.tp-card__title {
    font-family: var(--f-headline);
    font-size: .975rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
    color: var(--tp-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.tp-card:hover .tp-card__title { color: #fff; }

.tp-card__excerpt {
    font-size: .825rem;
    line-height: 1.55;
    color: var(--tp-text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── 6c. More news grid ───────────────────────────────────────── */

.tp-more-section {
    padding-bottom: var(--sp-2xl);
}

.tp-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--tp-gap);
}

/* Compact card — igual que tp-card pero sin excerpt */
.tp-card--compact .tp-card__thumb {
    aspect-ratio: 3 / 2;
}
.tp-card--compact .tp-card__body {
    padding: var(--sp-sm) var(--sp-md) var(--sp-md);
}
.tp-card--compact .tp-card__title {
    font-size: .9rem;
    -webkit-line-clamp: 2;
}

/* ── 6d. Widget / Banner area ─────────────────────────────────── */

.tp-banner-section {
    padding-block: var(--sp-xl);
    border-top: 1px solid var(--tp-border);
    border-bottom: 1px solid var(--tp-border);
    margin-bottom: var(--sp-2xl);
}

/* Newsletter inline */
.tp-newsletter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-md);
    text-align: center;
    padding-block: var(--sp-lg);
}

.tp-newsletter__label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tp-accent);
}

.tp-newsletter__title {
    font-family: var(--f-headline);
    font-size: clamp(1.3rem, 2.5vw, 1.9rem);
    font-weight: 800;
    color: var(--tp-text);
    max-width: 500px;
}

.tp-newsletter__form {
    display: flex;
    gap: var(--sp-sm);
    width: 100%;
    max-width: 440px;
}

.tp-newsletter__input {
    flex: 1;
    padding: 10px var(--sp-md);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border2);
    border-radius: var(--r-sm);
    color: var(--tp-text);
    font-size: .9rem;
    transition: border-color .15s;
}
.tp-newsletter__input:focus {
    outline: none;
    border-color: var(--tp-accent);
}
.tp-newsletter__input::placeholder { color: var(--tp-text-muted); }

.tp-newsletter__btn {
    padding: 10px var(--sp-lg);
    background: var(--tp-accent);
    color: #fff;
    border-radius: var(--r-sm);
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background .15s;
}
.tp-newsletter__btn:hover { background: var(--tp-accent-h); }

/* Widget area placeholder */
.tp-widget-area {
    min-height: 80px;
    border: 1px dashed var(--tp-border2);
    border-radius: var(--r-md);
    padding: var(--sp-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--tp-text-muted);
    font-size: .875rem;
    text-align: center;
    gap: var(--sp-sm);
}


/* ── 7. FOOTER ───────────────────────────────────────────────── */

.tp-footer {
    background: var(--tp-bg-header);
    border-top: 1px solid var(--tp-border);
}

.tp-footer__body {
    padding-block: var(--sp-2xl) var(--sp-xl);
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--sp-2xl);
    align-items: start;
}

/* Branding col */
.tp-footer__logo {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    margin-bottom: var(--sp-md);
}
.tp-footer__logo-text {
    font-family: var(--f-headline);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -.03em;
    color: var(--tp-text);
}
.tp-footer__logo-text span { color: var(--tp-accent); }

.tp-footer__tagline {
    font-size: .9rem;
    color: var(--tp-text-muted);
    line-height: 1.6;
    max-width: 260px;
    margin-bottom: var(--sp-lg);
}

/* Social */
.tp-footer__social { display: flex; gap: var(--sp-sm); }

.tp-footer__social-link {
    width: 34px; height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    color: var(--tp-text-muted);
    transition: color .15s, border-color .15s, background .15s;
}
.tp-footer__social-link:hover {
    color: var(--tp-text);
    border-color: var(--tp-border2);
    background: var(--tp-surface2);
}
.tp-footer__social-link svg { width: 15px; height: 15px; }

/* Widget cols */
.tp-widget__title {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tp-text-muted);
    margin-bottom: var(--sp-md);
    padding-bottom: var(--sp-sm);
    border-bottom: 1px solid var(--tp-border);
}

.tp-footer-menu { display: flex; flex-direction: column; gap: var(--sp-sm); }
.tp-footer-menu a { font-size: .875rem; color: var(--tp-text-soft); transition: color .15s; }
.tp-footer-menu a:hover { color: var(--tp-accent); }

/* Widget default styles */
.tp-widget ul { display: flex; flex-direction: column; gap: var(--sp-sm); }
.tp-widget li a { font-size: .875rem; color: var(--tp-text-soft); transition: color .15s; }
.tp-widget li a:hover { color: var(--tp-accent); }

/* Bar de copyright */
.tp-footer__bar {
    border-top: 1px solid var(--tp-border);
    padding-block: var(--sp-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-md);
    flex-wrap: wrap;
}
.tp-footer__copy { font-size: .8rem; color: var(--tp-text-muted); }
.tp-footer__bar-links { display: flex; gap: var(--sp-lg); }
.tp-footer__bar-links a { font-size: .8rem; color: var(--tp-text-muted); transition: color .15s; }
.tp-footer__bar-links a:hover { color: var(--tp-text-soft); }


/* ── 8. PÁGINAS INTERIORES ───────────────────────────────────── */

/* Página estática */
.tp-page {
    padding-block: var(--sp-2xl);
    max-width: 760px;
    margin-inline: auto;
}
.tp-page__title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: var(--sp-xl);
}
.tp-page__content { font-size: 1rem; line-height: 1.75; color: var(--tp-text-soft); }
.tp-page__content h2 { font-size: 1.4rem; margin-block: var(--sp-xl) var(--sp-md); color: var(--tp-text); }
.tp-page__content h3 { font-size: 1.15rem; margin-block: var(--sp-lg) var(--sp-sm); color: var(--tp-text); }
.tp-page__content p  { margin-bottom: var(--sp-md); }
.tp-page__content a  { color: var(--tp-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* Single */
.tp-single {
    padding-block: var(--sp-2xl);
    max-width: 720px;
    margin-inline: auto;
}
.tp-single__cat {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tp-accent);
    margin-bottom: var(--sp-md);
}
.tp-single__title {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 800;
    margin-bottom: var(--sp-md);
}
.tp-single__meta {
    font-size: .82rem;
    color: var(--tp-text-muted);
    display: flex;
    align-items: center;
    gap: var(--sp-md);
    flex-wrap: wrap;
    margin-bottom: var(--sp-xl);
}
.tp-single__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--tp-surface);
    margin-bottom: var(--sp-xl);
}
.tp-single__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tp-single__content { font-size: 1.05rem; line-height: 1.8; color: var(--tp-text-soft); }
.tp-single__content h2 { font-size: 1.4rem; margin-block: var(--sp-xl) var(--sp-md); color: var(--tp-text); }
.tp-single__content p  { margin-bottom: var(--sp-md); }
.tp-single__content a  { color: var(--tp-accent); }

/* Search */
.tp-search-header { padding-block: var(--sp-2xl) var(--sp-xl); border-bottom: 1px solid var(--tp-border); margin-bottom: var(--sp-xl); }
.tp-search-header__title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
.tp-search-header__title em { font-style: normal; color: var(--tp-accent); }

/* No results */
.tp-no-results { text-align: center; padding: var(--sp-2xl) var(--sp-lg); color: var(--tp-text-muted); }
.tp-no-results__icon { font-size: 3rem; margin-bottom: var(--sp-lg); opacity: .3; }

/* Paginación */
.tp-pagination { display: flex; justify-content: center; gap: var(--sp-sm); padding-block: var(--sp-xl); }
.page-numbers {
    display: flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px;
    padding-inline: var(--sp-sm);
    border-radius: var(--r-sm);
    font-size: .875rem; font-weight: 500;
    color: var(--tp-text-soft);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    transition: color .15s, border-color .15s, background .15s;
}
.page-numbers:hover,
.page-numbers.current { color: var(--tp-accent); border-color: var(--tp-accent-dim); background: var(--tp-accent-dim); }


/* ── 9. RESPONSIVE ───────────────────────────────────────────── */

@media (max-width: 1024px) {
    .tp-more-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
    .tp-secondary-grid { grid-template-columns: repeat(2, 1fr); }
    .tp-more-grid      { grid-template-columns: repeat(2, 1fr); }
    .tp-footer__body   { grid-template-columns: 1fr 1fr; }
    .tp-footer__brand  { grid-column: 1 / -1; }
    .tp-hero           { aspect-ratio: 16 / 9; max-height: 400px; }
    .tp-hero__body     { padding: var(--sp-lg) var(--sp-lg) var(--sp-md); }
}

@media (max-width: 560px) {
    .tp-container { padding-inline: var(--sp-md); }
    .tp-secondary-grid,
    .tp-more-grid        { grid-template-columns: 1fr; }
    .tp-footer__body     { grid-template-columns: 1fr; }
    .tp-footer__bar      { flex-direction: column; align-items: flex-start; gap: var(--sp-sm); }
    .tp-hero             { aspect-ratio: 4 / 3; max-height: 320px; }
    .tp-hero__body       { padding: var(--sp-md); }
    .tp-newsletter__form { flex-direction: column; }
    .tp-newsletter__btn  { width: 100%; justify-content: center; }
}


/* ── 10. CONTENT AREA — the_content() wrapper ────────────────────
   .tp-content-area envuelve the_content() en front-page.php.
   Estas reglas aseguran que cualquier HTML que WordPress renderice
   — bloques nativos, shortcodes, HTML libre — se vea integrado
   con el diseño oscuro del theme sin requerir clases adicionales.
   ──────────────────────────────────────────────────────────────── */

.tp-content-area {
    padding-block: var(--sp-lg) var(--sp-2xl);
}

/* Elimina márgenes colapsados del primer y último elemento */
.tp-content-area > *:first-child { margin-top: 0; }
.tp-content-area > *:last-child  { margin-bottom: 0; }

/* ── Bloques y shortcodes: que llenen el ancho disponible ──────── */
.tp-content-area > * {
    max-width: 100%;
}

/* ── Bloques Gutenberg dentro del content area ─────────────────── */
.tp-content-area .wp-block-group,
.tp-content-area .wp-block-columns,
.tp-content-area .wp-block-cover {
    margin-block: var(--sp-xl);
}

/* ── Tipografía libre (si el editor tiene párrafos/titulares) ───── */
.tp-content-area h1,
.tp-content-area h2,
.tp-content-area h3,
.tp-content-area h4 {
    font-family: var(--f-headline);
    color: var(--tp-text);
    margin-bottom: var(--sp-md);
}

.tp-content-area p {
    color: var(--tp-text-soft);
    line-height: 1.75;
    margin-bottom: var(--sp-md);
}

.tp-content-area a {
    color: var(--tp-accent);
}

.tp-content-area img {
    border-radius: var(--r-md);
    height: auto;
}

/* ── Shortcode output: fondo transparente, sin padding extra ────── */
/*
 * Cuando un shortcode renderiza un contenedor raíz con fondo propio
 * (por ejemplo un dashboard de noticias con su propio --bg), estas
 * reglas garantizan que el primer hijo directo del content-area
 * no duplique el padding ni el fondo del body.
 *
 * Se aplica con :where() para mantener especificidad baja —
 * el shortcode puede sobreescribir si necesita su propio fondo.
 */
:where(.tp-content-area) > :where(section, div, article):first-child {
    margin-top: 0;
}

/* ── Imágenes dentro de shortcodes: nunca se desbordan ─────────── */
.tp-content-area img,
.tp-content-area iframe,
.tp-content-area video {
    max-width: 100%;
    display: block;
}

/* ── Tablas dentro del content area ────────────────────────────── */
.tp-content-area table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    color: var(--tp-text-soft);
}
.tp-content-area th,
.tp-content-area td {
    padding: var(--sp-sm) var(--sp-md);
    border-bottom: 1px solid var(--tp-border);
    text-align: left;
}
.tp-content-area th {
    font-weight: 600;
    color: var(--tp-text);
    font-size: .8rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Listas dentro del content area ────────────────────────────── */
.tp-content-area ul,
.tp-content-area ol {
    padding-left: var(--sp-lg);
    color: var(--tp-text-soft);
    line-height: 1.75;
    margin-bottom: var(--sp-md);
}
.tp-content-area ul { list-style: disc; }
.tp-content-area ol { list-style: decimal; }
.tp-content-area li { margin-bottom: var(--sp-xs); }
