/*
Theme Name: Mainqué Ecosystem Master Theme
Theme URI: https://mainque.gob.ar/
Author: Mainqué Development Team
Description: Master Hybrid Theme para el ecosistema de comunicación municipal (Hub-and-Spoke).
Version: 1.0.1
Requires at least: WordPress 6.0
License: GNU General Public License v3 or later.
Text Domain: mainque
*/

body {
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ============================================
   ESTILOS DE CABECERA (Escudo + Identidad)
   ============================================ */

.site-branding {
    padding: 1rem;
    text-align: center;
    background-color: #ffffff;
}

.site-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.site-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.site-identity {
    text-align: left;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    color: #005a9c;
    font-weight: 700;
    line-height: 1.2;
}

.site-slogan {
    margin: 2px 0 0 0;
    font-size: 0.9rem;
    color: #666666;
    font-style: italic;
    font-weight: 500;
}

/* ============================================
   ESTILOS DEL HUB (FRONT-PAGE)
   ============================================ */

.hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.hub-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hub-hero h1 {
    font-size: 2.5rem;
    color: #38b550;
    margin-bottom: 0.5rem;
}

.hub-hero p {
    font-size: 1.2rem;
    color: #4a4a4a;
}

.hub-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.area-section {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    border: 1px solid #eaeaea;
}

.area-title {
    font-size: 1.5rem;
    color: #38b550;
    margin-top: 0;
    margin-bottom: 1rem;
}

.area-title a {
    color: #38b550;
    text-decoration: none;
}

.area-title a:hover {
    color: #6b4333;
}

.area-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hub-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.hub-card-link:hover .hub-card {
    background-color: #f8f9fa;
    border-color: #c5ebfe;
}

.hub-card {
    display: flex;
    gap: 1rem;
    background: #ffffff;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    align-items: flex-start;
}

.card-image {
    flex-shrink: 0;
    width: 120px;
}

.card-image img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.card-content {
    flex: 1;
}

.card-content .date {
    font-size: 0.75rem;
    color: #6b4333;
    display: block;
    margin-bottom: 0.25rem;
}

.card-content h2 {
    font-size: 1rem;
    color: #6b4333;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.card-content p {
    font-size: 0.9rem;
    color: #4a4a4a;
    line-height: 1.4;
    margin: 0;
}

/* ============================================
   ESTILOS DEL MENÚ DE NAVEGACIÓN
   ============================================ */

.main-navigation {
    background-color: #38b550;
    padding: 1rem 0;
}

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

.network-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.network-menu li {
    margin: 0;
}

.network-menu a {
    color: #ffffff;
    text-decoration: none;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.network-menu a:hover,
.network-menu a:focus {
    background-color: #6b4333;
    color: #ffffff;
    text-decoration: none;
}

/* ============================================
   ESTILOS SINGLE POST
   ============================================ */

.site-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 2rem;
    color: #6b4333;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #021500;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.entry-content p {
    margin: 0 0 1.5rem 0;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* ============================================
   MODAL PWA
   ============================================ */

.pwa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.pwa-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    font-family: system-ui, -apple-system, sans-serif;
}

.pwa-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.pwa-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.pwa-modal-header h3 {
    margin: 0 0 8px 0;
    color: #005a9c;
    font-size: 20px;
}

.pwa-modal-header p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.pwa-topics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    max-height: 240px;
    overflow-y: auto;
}

.pwa-topic-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    background-color: #f9f9f9;
    transition: background 0.2s, border-color 0.2s;
}

.pwa-topic-chip:has(input:checked) {
    background-color: #e6f0fa;
    border-color: #005a9c;
    font-weight: 600;
}

.pwa-topic-chip input {
    margin: 0;
}

.pwa-modal-actions {
    text-align: center;
}

.pwa-btn-primary {
    width: 100%;
    background-color: #005a9c;
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================================
   RESPONSIVE (Móviles)
   ============================================ */

@media (max-width: 768px) {
    .site-logo-link {
        flex-direction: column;
        gap: 6px;
    }

    .site-identity {
        text-align: center;
    }

    .site-logo {
        height: 50px;
    }

    .site-title {
        font-size: 1.25rem;
    }

    .site-slogan {
        font-size: 0.85rem;
    }

    .hub-container {
        padding: 1rem 0.5rem;
    }

    .hub-hero h1 {
        font-size: 1.8rem;
    }

    .hub-hero p {
        font-size: 1rem;
    }

    .area-section {
        padding: 1rem;
    }

    .hub-card {
        flex-direction: column;
        align-items: stretch;
    }
    
    .card-image {
        width: 100%;
    }
    
    .card-image img {
        height: 150px;
    }

    .main-navigation {
        padding: 0.75rem 0;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 4px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0.5rem;
        margin: 0 auto;
    }

    .hamburger {
        width: 25px;
        height: 3px;
        background-color: #ffffff;
        border-radius: 2px;
    }

    .menu-toggle-label {
        color: #ffffff;
        font-size: 1rem;
        font-weight: 600;
        text-align: center;
        margin-top: 0.25rem;
    }

    .network-menu-container {
        display: none;
        margin-top: 1rem;
    }

    .network-menu-container.is-open {
        display: block;
    }

    .network-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .network-menu a {
        display: block;
        width: 100%;
        text-align: center;
    }

    .site-main {
        padding: 1rem 0.5rem;
    }

    .entry-title {
        font-size: 1.5rem;
    }

    .entry-content {
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .menu-toggle,
    .menu-toggle-label {
        display: none;
    }
}