/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
    --civitas-blue: #003366;
    --civitas-red: #cc0000;
    --text-main: #222222;
    --bg-color: #f9f9f9;
    --white: #ffffff;
    --footer-bg: #003366;
    --footer-dark: #002244;
    --container-width: 1280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lora', serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Contenedor Principal */
.main-container {
    max-width: var(--container-width);
    margin: 20px auto;
    background-color: var(--white);
    padding: 30px 40px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
    min-height: 100vh;
}

/* =========================================
   2. HEADER, NAV Y TOP BAR
   ========================================= */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.top-left-tools {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f4f4f4;
    padding: 6px 15px;
    border-radius: 30px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Arial', sans-serif;
    font-size: 13px;
    width: 150px;
}

.search-box i {
    color: #888;
    font-size: 13px;
    margin-right: 8px;
}

.btn-stereo {
    background-color: var(--civitas-red);
    color: white;
    font-family: 'Arial', sans-serif;
    font-weight: 700;
    font-size: 11px;
    padding: 8px 15px;
    border-radius: 4px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-stereo:hover {
    background-color: #a00000;
}

.lang-selector select {
    border: none;
    background: transparent;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}

/* Header Branding */
.header {
    text-align: center;
    padding: 10px 0 25px 0;
}

.logo {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 3.8rem;
    line-height: 1;
    margin-bottom: 8px;
}

.civitas-color {
    color: var(--civitas-blue);
}

.journal-color {
    color: var(--civitas-red);
    margin-left: 10px;
}

.date-line {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #555;
    border-top: 1px solid #ccc;
    border-bottom: 3px solid var(--civitas-blue);
    display: inline-block;
    padding: 4px 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Navegación */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.nav-links a {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #111;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.nav-links a:hover {
    color: var(--civitas-red);
}

/* CLASE ACTIVA (Para marcar la página actual) */
.nav-links a.active-nav {
    color: var(--civitas-red);
    border-bottom: 2px solid var(--civitas-red);
}

.hamburger-btn {
    display: none;
}

/* =========================================
   3. ANUNCIOS (Ticker)
   ========================================= */
.announcements-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    padding-bottom: 25px;
    border-bottom: 4px double #eee;
    margin-bottom: 35px;
}

.announcement-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--civitas-red); /* Rojo por defecto */
    padding: 10px 15px;
    border-radius: 4px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: transform 0.2s;
}

/* Variación Azul (Para Clubes/Semilleros) */
.announcement-card.blue-theme {
    border-left-color: var(--civitas-blue);
}

.announcement-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.announcement-icon {
    color: var(--civitas-red);
    font-size: 18px;
    margin-top: 2px;
}

.announcement-icon.blue-theme {
    color: var(--civitas-blue);
}

.announcement-text {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    line-height: 1.3;
    color: #444;
}

.announcement-text strong {
    display: block;
    color: var(--civitas-blue); /* Texto fuerte azul */
    font-size: 10px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

/* =========================================
   4. LAYOUT GENERAL Y NOTICIAS
   ========================================= */
.newspaper-grid {
    display: grid;
    grid-template-columns: 3.5fr 1fr;
    gap: 40px;
    align-items: start;
}

.news-feed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.main-card {
    grid-column: span 3;
    padding-bottom: 30px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.main-card img {
    aspect-ratio: 21/9;
    border-radius: 2px;
    margin-bottom: 15px;
}

.secondary-card {
    grid-column: span 1;
    padding-right: 15px;
    border-right: 1px solid #eee;
}

.secondary-card:nth-child(3n + 1) {
    border-right: none;
    padding-right: 0;
}

.secondary-card:last-child {
    border-right: none;
}

.secondary-card img {
    aspect-ratio: 4/3;
    margin-bottom: 12px;
    border-radius: 2px;
}

/* Tipografía de Noticias */
.headline-link {
    color: #000;
    font-weight: 700;
}

.headline-link:hover {
    color: var(--civitas-red);
    text-decoration: underline;
}

.headline-xl {
    font-family: 'Playfair Display', serif;
    font-size: 2.4rem;
    line-height: 1.1;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.headline-md {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    line-height: 1.25;
    margin-bottom: 8px;
    font-weight: 700;
}

.lead {
    font-size: 1.1rem;
    color: #444;
    margin-bottom: 10px;
}

.pub-date {
    font-family: 'Arial', sans-serif;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
}

.author {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: var(--civitas-blue);
}

figcaption {
    font-family: 'Arial', sans-serif;
    font-size: 10px;
    color: #888;
    text-align: right;
    margin-top: 5px;
}

/* =========================================
   5. BARRA LATERAL (SIDEBAR) & WIDGETS
   ========================================= */
.sidebar {
    padding-left: 25px;
    border-left: 1px solid #000;
    height: 100%;
}

.section-title {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--civitas-blue);
    border-bottom: 2px solid var(--civitas-blue);
    padding-bottom: 5px;
    margin-bottom: 20px;
}

.sidebar-list li {
    font-size: 13px;
    line-height: 1.5;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 12px;
    list-style: none;
}

/* Widget: Agenda */
.calendar-widget {
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 30px;
}

.calendar-event {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

.calendar-event:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.event-date {
    background-color: var(--civitas-blue);
    color: white;
    padding: 5px;
    border-radius: 4px;
    text-align: center;
    width: 45px;
    height: 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1;
}

.event-day {
    font-size: 16px;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
}

.event-month {
    font-size: 9px;
    text-transform: uppercase;
    font-family: 'Arial', sans-serif;
}

.event-info p {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.event-info span {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    color: #777;
}

/* Widget: Lo Más Leído / Tendencias (Unificado) */
.most-read-list {
    list-style: none;
    counter-reset: news-counter; /* Contador personalizado */
    padding: 0;
    margin-bottom: 40px;
}

.most-read-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.most-read-item::before {
    counter-increment: news-counter;
    content: counter(news-counter);
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Playfair Display', serif; /* O 'Arial' si prefieres el estilo Semilleros */
    font-size: 24px;
    font-weight: 700;
    color: var(--civitas-red); /* O #e0e0e0 para gris */
    line-height: 1;
}

.most-read-link {
    font-family: 'Arial', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: block;
    line-height: 1.4;
}

.most-read-link:hover {
    color: var(--civitas-blue);
}

/* Widget: Frase */
.quote-box {
    background-color: #fcfcfc;
    border: 1px solid #eee;
    border-left: 4px solid var(--civitas-red);
    padding: 20px;
    margin: 30px 0;
}

.quote-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 18px;
    color: var(--civitas-blue);
    line-height: 1.4;
    margin-bottom: 10px;
}

.quote-author {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    display: block;
    text-align: right;
}

/* Widget: Publicidad (Estilo Mejorado de Semilleros) */
.ad-box {
    background: #f0f0f0;
    border: 1px solid #ddd;
    text-align: center;
    padding: 30px 10px;
    margin-top: 30px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ad-box p {
    font-family: 'Arial', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.ad-box small {
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

/* Widget: Breves (Encuestas Sidebar) */
.breves-container {
    margin-bottom: 30px;
    padding-bottom: 10px;
}

.breves-title {
    color: var(--civitas-blue);
    border-bottom: 2px solid var(--civitas-blue);
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-size: 11px;
    font-family: 'Arial', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.breves-poll-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s, padding-left 0.2s;
}

.breves-poll-item:hover {
    background-color: #f9f9f9;
    padding-left: 5px;
}

.breves-tag {
    font-weight: bold;
    color: var(--civitas-red);
    margin-right: 5px;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    font-family: 'Arial', sans-serif;
}

.breves-question {
    flex-grow: 1;
    font-weight: 500;
    font-family: 'Lora', serif;
    line-height: 1.3;
}

.breves-icon {
    color: var(--civitas-blue);
    font-size: 16px;
    margin-left: 10px;
}

/* =========================================
   6. ARTICULO INDIVIDUAL
   ========================================= */
.article-page-container {
    max-width: 800px;
    margin: 40px auto;
    background-color: #fff;
    padding: 50px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.article-title-main {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--civitas-blue);
    margin-bottom: 10px;
}

.article-meta {
    font-family: 'Arial', sans-serif;
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: center;
    gap: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-featured-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 30px;
}

.article-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2c2c2c;
}

.article-body p {
    margin-bottom: 25px;
}

.article-body h3 {
    font-family: 'Playfair Display', serif;
    color: var(--civitas-blue);
    font-size: 1.6rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-nav {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-nav-article {
    text-decoration: none;
    padding: 10px 25px;
    border-radius: 4px;
    font-family: 'Arial', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: 0.3s;
}

.btn-nav-secondary {
    background-color: transparent;
    color: var(--civitas-blue);
    border: 2px solid var(--civitas-blue);
}

.btn-nav-secondary:hover {
    background-color: var(--civitas-blue);
    color: white;
}

/* =========================================
   7. ENCUESTA (POLL)
   ========================================= */
.poll-page-container {
    max-width: 700px;
    margin: 30px auto !important;
    padding: 40px !important;
    min-height: 80vh !important;
}

.poll-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--civitas-red);
    padding-bottom: 20px;
}

.poll-title {
    font-family: 'Arial', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--civitas-blue);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.poll-lead {
    font-style: italic;
    color: #666;
    font-size: 1rem;
    margin-bottom: 20px;
}

.poll-question {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--civitas-red);
}

.poll-options-grid {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.poll-btn-vote {
    flex-grow: 1;
    padding: 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.poll-btn-vote i {
    font-size: 2rem;
}

.poll-btn-vote:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.poll-btn-si {
    background-color: var(--civitas-blue);
    color: white;
}

.poll-btn-si:hover {
    background-color: #004488;
}

.poll-btn-no {
    background-color: var(--civitas-red);
    color: white;
}

.poll-btn-no:hover {
    background-color: #a00000;
}

/* Resultados de Encuesta */
.poll-results-display {
    margin-top: 30px;
}

.result-bar-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 15px;
}

.result-label {
    width: 35%;
    font-weight: 500;
    color: #333;
}

.result-bar-container {
    flex-grow: 1;
    height: 30px;
    background-color: #eee;
    border-radius: 15px;
    margin: 0 15px;
    overflow: hidden;
}

.result-bar-container .result-bar {
    height: 100%;
    border-radius: 15px;
    transition: width 0.7s ease-out;
}

.result-bar-container .bar-si {
    background-color: var(--civitas-blue);
}

.result-bar-container .bar-no {
    background-color: var(--civitas-red);
}

.result-percentage {
    width: 10%;
    text-align: right;
    font-weight: bold;
    font-family: 'Arial', sans-serif;
}

.poll-footer-info {
    text-align: center;
    font-size: 0.9rem;
    color: #777;
    margin-top: 20px;
}

/* =========================================
   8. FOOTER Y BOTÓN VOLVER ARRIBA
   ========================================= */
.main-footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 20px 40px;
    margin-top: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 1.8rem;
}

.footer-right a {
    color: white;
    margin-left: 20px;
    font-size: 18px;
    opacity: 0.8;
}

.footer-right a:hover {
    opacity: 1;
}

.copyright {
    background-color: var(--footer-dark);
    color: #aaa;
    text-align: center;
    font-size: 11px;
    padding: 15px;
    font-family: 'Arial', sans-serif;
}

/* Scroll Top Button */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    background: var(--civitas-blue);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
}

#scrollTopBtn:hover {
    background: var(--civitas-red);
    transform: translateY(-3px);
}

/* =========================================
   9. RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 900px) {
    .main-container {
        padding: 15px;
        width: 100%;
        box-shadow: none;
        margin: 0;
    }

    .logo {
        font-size: 2.8rem;
    }

    .hamburger-btn {
        display: block;
        background: none;
        border: none;
        font-size: 22px;
        cursor: pointer;
        position: absolute;
        left: 0;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 40px;
        text-align: left;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #f5f5f5;
        padding: 10px 0;
    }

    .announcements-container {
        grid-template-columns: 1fr;
    }

    .newspaper-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .news-feed {
        grid-template-columns: 1fr;
    }

    .main-card,
    .secondary-card {
        grid-column: span 1;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
    }

    .sidebar {
        border-left: none;
        border-top: 2px solid #000;
        padding-left: 0;
        padding-top: 30px;
    }

    .top-bar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .article-page-container {
        padding: 20px;
        margin: 10px;
        width: 100%;
        border: none;
        box-shadow: none;
    }

    .article-title-main {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .poll-page-container {
        padding: 20px !important;
    }

    .poll-question {
        font-size: 1.5rem;
    }

    .poll-options-grid {
        flex-direction: column;
        gap: 15px;
    }

    .result-bar-item {
        flex-wrap: wrap;
    }

    .result-label {
        width: 100%;
        margin-bottom: 5px;
    }

    .result-percentage {
        width: 100%;
        text-align: left;
        margin-top: 5px;
    }

    .result-bar-container {
        margin: 0;
        width: 100%;
    }
}