@import "./utils/a.css";
/* =========================================
   VARIABLES Y CONFIGURACIÓN DE TEMAS
   ========================================= */

:root {
    /* Variables estructurales fijas */
    --alert: #ea580c;
    --radius: 12px;
    --transition: 0.3s ease;
}

/* --- 1. CONFIGURACIÓN DE MODOS (Estructura de Fondos y Textos) --- */
[data-theme="light"] {
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --alert-bg: #ffedd5;
    --alert-text: #9a3412;
    --hero-overlay: rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --alert-bg: #7c2d12;
    --alert-text: #ffedd5;
    --hero-overlay: rgba(0, 0, 0, 0.7);
}

/* --- 2. PALETAS DE COLORES SELECCIONABLES (4 Temas Diferentes) --- */
/* Tema 1: Teal (Verde azulado original - Comunidad) */
[data-theme-colors="teal"] {
    --primary: #0f766e;
    --primary-hover: #0d9488;
}

/* Tema 2: Blue (Azul Institucional - Confianza) */
[data-theme-colors="blue"] {
    --primary: #1e40af;
    --primary-hover: #2563eb;
}

/* Tema 3: Terracotta (Cálido - Otoñal/Ladrillo) */
[data-theme-colors="terracotta"] {
    --primary: #b45309;
    --primary-hover: #d97706;
}

/* Tema 4: Forest (Verde Bosque - Ecología y Seguridad) */
[data-theme-colors="forest"] {
    --primary: #166534;
    --primary-hover: #16a34a;
}


/* =========================================
   REGLAS GENERALES Y RESETEO
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition), color var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* =========================================
   HEADER, NAVEGACIÓN Y SELECTORES
   ========================================= */
header {
    background-color: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    position: relative;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color var(--transition);
}

/* CONTROLES DE TEMA PERSONALIZADOS */
.theme-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
    margin-right: 15px;
}

.color-selectors {
    display: flex;
    gap: 6px;
    background: var(--bg-body);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.active {
    border-color: var(--text-main);
    transform: scale(1.1);
}

/* Colores de los botones de paleta */
.color-dot.teal {
    background-color: #0f766e;
}

.color-dot.blue {
    background-color: #1e40af;
}

.color-dot.terracotta {
    background-color: #b45309;
}

.color-dot.forest {
    background-color: #166534;
}

/* Botón Interruptor Modo Oscuro */
.theme-toggle-btn {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition);
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: inline;
}

[data-theme="dark"] .icon-sun {
    display: inline;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

/* Botón de Menú Móvil */
.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
    transition: color var(--transition);
}

.menu-toggle:hover {
    color: var(--primary-hover);
}

/* Enlaces de Navegación */
.nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    box-shadow: 0 10px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    gap: 20px;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.4s ease-in-out, background-color var(--transition);
}

.nav-links.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.nav-links a {
    font-weight: 600;
    color: var(--text-muted);
    transition: color var(--transition);
    display: block;
    text-align: center;
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-primary {
    background-color: var(--primary);
    color: white !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    transition: background-color var(--transition);
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}


/* =========================================
   BANNER DE ALERTA (MARQUEE)
   ========================================= */
.alert-banner {
    background-color: var(--alert-bg);
    color: var(--alert-text);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: background-color var(--transition), color var(--transition);
}

.alert-banner-text {
    display: inline-block;
    font-weight: 600;
    font-size: 0.95rem;
    animation: scroll-left 20s linear infinite;
}

.alert-banner:hover .alert-banner-text {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100vw);
    }

    100% {
        transform: translateX(-100%);
    }
}


/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1518005020951-eccb494ad742?ixlib=rb-4.0.3&auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: var(--radius);
    margin: 30px 0;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 1;
    overflow: hidden;
}

/* Capa dinámica sobre la imagen según el tema para legibilidad del texto */
.hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--hero-overlay);
    z-index: -1;
    transition: background-color var(--transition);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.95;
}


/* =========================================
   DISEÑO PRINCIPAL (GRILLA Y CARDS)
   ========================================= */
.main-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: border-color var(--transition);
}

.posts-flex {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 50px;
}

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.news-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: transform var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.news-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
    object-fit: contain;
    overflow: hidden;

}

.img-news-public {
    image-resolution: cover;
    width: 90%;
    height: 300px;
    margin: auto;
    border-radius: 5px;
    margin-bottom: 25px;
}

.img-news-content {
    image-resolution: cover;
    width: 90%;
    height: 200px;
    margin: auto;
    border-radius: 5px;
    margin-bottom: 25px;
}

.tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 10px;
    width: max-content;
}

.tag.obras {
    background: #dbeafe;
    color: #1e40af;
}

.tag.seguridad {
    background: #fee2e2;
    color: #991b1b;
}

.tag.eventos {
    background: #fef08a;
    color: #854d0e;
}

.news-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-main);
    transition: color var(--transition);
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.news-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 15px;
    flex-grow: 1;
    transition: color var(--transition);
}

.card-link {
    color: var(--primary);
    font-weight: 600;
    transition: color var(--transition);
}

.card-link:hover {
    text-decoration: underline;
}


/* =========================================
   SIDEBAR & WIDGETS
   ========================================= */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: background-color var(--transition), border-color var(--transition);
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    transition: color var(--transition), border-color var(--transition);
}

.widget-text {
    color: var(--text-muted);
    transition: color var(--transition);
}

.emergency-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    flex-wrap: wrap;
    transition: border-color var(--transition);
}

.emergency-list li:last-child {
    border-bottom: none;
}

.emergency-number {
    color: var(--alert);
    font-size: 1.1rem;
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: #25D366;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    width: 100%;
    margin-top: 10px;
    transition: opacity var(--transition);
}

.btn-whatsapp:hover {
    opacity: 0.9;
}

/* =========================================
   PUBLICACIONES
   ========================================= */
.main-pulicaciones {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 40px;
}

.sidebar-pulicaciones {
    width: 30%;
}

.pulicaciones {
    width: 70%;
    justify-content: end;

}

/* =========================================
   FOOTER
   ========================================= */
footer {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 40px 0;
    text-align: center;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


/* =========================================
   MEDIA QUERIES (Responsividad Escritorio)
   ========================================= */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .nav-links {
        position: static;
        flex-direction: row;
        width: auto;
        box-shadow: none;
        padding: 0;
        clip-path: none;
        align-items: center;
    }

    .nav-links a {
        text-align: left;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero h1 {
        font-size: 3rem;
    }
}

@media (min-width: 992px) {
    .main-layout {
        grid-template-columns: 2fr 1fr;
        /* 2/3 Noticias, 1/3 Sidebar */
    }
}