@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;1,700&family=Inter:wght@300;400;600;800&display=swap');

/* =========================
   VARIABLES
========================= */
:root {
    --bg-paper: #fdfdfb;
    --text-main: #1a1a1a;
    --text-muted: #666;
    --accent: #b91c1c;
    --border: #e5e5e2;
    --tooltip-bg: #1a1a1a;
}

/* =========================
   BASE
========================= */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-paper);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

h1, h2, h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
}

/* =========================
   PAGE HEADER
========================= */
.page-header {
    margin-bottom: 3rem;
    border-bottom: 4px double var(--border);
    padding-bottom: 1.5rem;
}

.page-header h1,
.page-header h2 {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-subtitle {
    margin-top: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
}

/* =========================
   MAIN HEADER / FOOTER
========================= */
.main-header {
    border-bottom: 4px double var(--border);
    padding: 2rem 0;
    margin-bottom: 3rem;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.brand-link {
    color: inherit;
    text-decoration: none;
}

.brand-title {
    font-size: 3rem;
    margin: 0;
    letter-spacing: -2px;
}

.header-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.current-date {
    font-weight: 400;
}

.archive-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.archive-link:hover {
    opacity: 0.7;
}

.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-footer {
    margin-top: 5rem;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.main-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* =========================
   DASHBOARD GRID
========================= */
.dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: stretch;
}

/* =========================
   COUNTRY CARD
========================= */
.country-card {
    background: #fff;
    border: 1px solid var(--border);
    padding: 1.25rem;
    flex: 1 1 calc(33.333% - 1.5rem);
    min-width: 300px;
    display: flex;
    flex-direction: column;

    /* animación (definición final) */
    opacity: 0;
    animation: slideUpFade 0.6s ease-out forwards;  
}

.country-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* stagger (tal cual estaba) */
.country-card:nth-child(1) { animation-delay: 0.1s; }
.country-card:nth-child(2) { animation-delay: 0.2s; }
.country-card:nth-child(3) { animation-delay: 0.3s; }
.country-card:nth-child(4) { animation-delay: 0.4s; }
.country-card:nth-child(5) { animation-delay: 0.5s; }
.country-card:nth-child(6) { animation-delay: 0.6s; }

/* =========================
   COUNTRY HEADER / FLAG
========================= */
.country-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--text-main);
    padding-bottom: 0.4rem;
    margin-bottom: 1.5rem;
}

.country-header a,
.country-flag,
.flag-link {
    text-decoration: none !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    outline: none;
}

.country-flag {
    font-size: 1.5rem;
    line-height: 1;
    user-select: none;
    filter: grayscale(0.3) opacity(0.6) saturate(0.7);
    transition: all 0.3s ease;
}

.country-card:hover .country-flag {
    filter: grayscale(0) opacity(1) saturate(1);
}

/* =========================
   NEWSPAPER ROW
========================= */
.newspaper-row {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 0.8rem;
    border-left: 2px solid var(--border);
}

.newspaper-row:last-child {
    margin-bottom: 0;
}

.newspaper-row:hover {
    border-left-color: var(--accent);
}

.newspaper-row .name {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.3rem;
}

.newspaper-row .headline {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main);
    text-decoration: none;
    display: block;
}

.newspaper-row .headline:hover {
    color: var(--accent);
}

/* =========================
   TOOLTIP (definición final)
========================= */
.tooltip-box {
    position: absolute;
    bottom: 110%;
    left: 0;
    width: 280px;
    padding: 15px;
    background-color: var(--tooltip-bg);
    color: #fff;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
    z-index: 100;

    visibility: hidden;
    opacity: 0;
    pointer-events: none;

    transform: translateY(10px);
    transition: opacity 0.3s ease,
                transform 0.3s ease,
                visibility 0.3s;

    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.tooltip-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 20px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--tooltip-bg) transparent transparent transparent;
}

.newspaper-row:hover .tooltip-box {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.tooltip-label {
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.6rem;
    color: #999;
    display: block;
}

.tooltip-label:not(:first-child) {
    margin-top: 10px;
}

.tooltip-text {
    margin: 5px 0 10px;
    font-style: italic;
}

.tooltip-url {
    display: block;
    color: #88c0d0;
    font-size: 0.7rem;
    word-break: break-all;
    text-decoration: none;
}

/* =========================
   STATUS BAR
========================= */
.status-bar {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-title h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-main);
}

.status-badge {
    font-size: 0.7rem;
    font-weight: bold;
    letter-spacing: 1px;
    color: var(--text-main);
    background: #f0f0ed;
    padding: 5px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-offline {
    color: var(--text-muted);
}

.pulse-dot {
    color: #22c55e;
    animation: pulse 2s infinite;
}

/* =========================
   ARCHIVE
========================= */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 3rem;
}

.month-column h3 {
    font-size: 1.4rem;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
    text-transform: capitalize;
}

.month-list {
    list-style: none;
    padding: 0;
}

.month-list li {
    margin-bottom: 0.8rem;
}

.date-link {
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 4px;
    transition: all 0.2s;
}

.date-link:hover {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

.date-link .view-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* =========================
   TIMELINE
========================= */
.timeline-day {
    margin-bottom: 3rem;
    position: relative;
}

.sticky-date {
    position: sticky;
    top: 0;
    background: var(--bg-paper);
    z-index: 10;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-transform: capitalize;
    color: var(--accent);
}

.sticky-date:hover {
    color: var(--text-main);
}

.headlines-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 1rem;
}


/* =========================
   INFO
========================= */

.info-container {
    margin: 0 auto;
    line-height: 1.8;
}

.info-section {
    margin-bottom: 3rem;
}

.info-section h3 {
    font-size: 1.2rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}
.info-section p {
    text-align: justify;
    text-justify: inter-word;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.feature-list {
    padding-left: 1.2rem;
    list-style-type: square;
}

.feature-list li {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.feature-list strong {
    color: var(--text-main);
    font-weight: 600;
}
.directory-grid {
    display: grid;
    /* Esto crea tantas columnas de 200px como quepan en la pantalla */
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 
    gap: 3rem;
    margin-top: 2rem;
    width: 100%; /* Asegura que use todo el ancho disponible */
}

/* Evita que los nombres largos de periódicos rompan el diseño */
.directory-list a {
    word-break: break-word;
    display: block;
}

@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
/* =========================
   ANIMATIONS
========================= */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .tooltip-box {
        width: 90vw;
        left: 5%;
    }
}
