/* ============================================
   STYLE.CSS - Estilos globales del sitio unificados
   Diario Costa Tropical
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;900&family=Source+Sans+Pro:wght@400;600;700&display=swap');

/* ============================================
   1. ROOT VARIABLES
   ============================================ */
:root {
    /* Fuerza esquema oscuro para que Android pinte los botones en blanco sobre el azul marino */
    color-scheme: dark;

    --primary: #0d1b2a;
    --primary-light: #1b3a5c;
    --secondary: #007887;
    --gold: #ffd700;
    --accent: #007887;
    --text: #1a1a1a;
    --text-light: #4a4a4a;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 30px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
    
    /* Fuentes */
    --font-primary: 'Inter', 'Source Sans Pro', 'Arial', sans-serif;
    --font-display: 'Playfair Display', serif;
    --font-portada-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
    --font-portada-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Colores adicionales */
    --color-text: #1a1a2e;
    --color-text-light: #6c757d;
    --color-text-portada-light: #555;
    --color-accent: #007887;
    --max-width-content: 820px;
}

/* ============================================
   2. RESET Y BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Fondo raíz en azul marino del footer (#0d1b2a) para que la zona de botones sea oscura */
    background-color: #0d1b2a; 
}

body {
    font-family: var(--font-primary);
    color: var(--text);
    background: var(--bg-light);
    line-height: 1.7;
    overflow-y: scroll;
}

a {
    color: var(--secondary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #005f6b;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.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;
}

/* ============================================
   3. HEADER & STICKY
   ============================================ */
.header { position: sticky; top: 0; z-index: 1000; background: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.08); transition: all 0.3s ease; }
.header.is-sticky .header-top { display: none !important; }
.header-top { background: #0d1b2a; color: rgba(255,255,255,0.8); padding: 8px 0; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.header-top .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: nowrap; }
.header-top-left { display: flex; align-items: center; gap: 15px; flex-wrap: nowrap; overflow: hidden; }
.header-fecha { white-space: nowrap; font-size: 13px; }
.header-tiempo { white-space: nowrap; flex-shrink: 0; color: #007887 !important; display: inline-flex; align-items: center; gap: 4px; }
.header-tiempo i, .header-tiempo .temp { color: #fff !important; }
.header-top-right { display: flex; align-items: center; gap: 12px; }

.header-main { background: #ffffff; border-bottom: 3px solid #007887; padding: 12px 0; position: relative; z-index: 950; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: all 0.3s ease; width: 100%; }
.header.is-sticky .header-main { padding: 5px 0; box-shadow: 0 4px 15px rgba(0,0,0,0.12); border-bottom-width: 2px; }
.header-main .container { display: flex; justify-content: space-between; align-items: center; }

.logo img { max-height: 55px; width: auto; height: auto; display: block; transition: all 0.3s ease; }
.header.is-sticky .logo-img { max-height: 40px; }

.menu-toggle { display: none; background: none; border: none; color: #0d1b2a; cursor: pointer; padding: 8px 10px; border-radius: 6px; z-index: 1001; width: 44px; height: 44px; align-items: center; justify-content: center; }
.menu-toggle:hover { background: rgba(0, 120, 135, 0.08); }

.main-nav { display: flex; align-items: center; }
.main-nav ul { display: flex; list-style: none; gap: 5px; align-items: center; margin: 0; padding: 0; }
.main-nav ul li a { color: #333; font-size: 0.8rem; font-weight: 600; padding: 8px 14px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.main-nav ul li a:hover { color: #007887; background: rgba(0, 120, 135, 0.05); }
.header.is-sticky .main-nav ul li a { font-size: 13px; padding: 6px 10px; }

.search-form { display: flex; align-items: center; background: #f5f5f5; border-radius: 25px; padding: 4px 6px; border: 1px solid #e0e0e0; transition: all 0.3s ease; }
.search-form:focus-within { border-color: #007887; background: #ffffff; }
.search-form input { background: none; border: none; padding: 6px 12px; font-size: 0.8rem; outline: none; width: 140px; }
.search-form button { background: none; border: none; color: #666; padding: 6px 10px; cursor: pointer; }
.search-form button:hover { color: #007887; }

/* OFFCANVAS */
body.offcanvas-open { overflow: hidden; }
#offcanvas-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(255, 255, 255, 0.7); backdrop-filter: blur(4px); z-index: 9998; opacity: 0; visibility: hidden; transition: opacity 0.4s ease; pointer-events: none; }
#offcanvas-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }
#offcanvas-menu { position: fixed; top: 0; left: -340px; width: 340px; max-width: 85vw; height: 100vh; background: #ffffff; z-index: 9999; transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; padding: 16px 20px 30px; box-shadow: 4px 0 30px rgba(0,0,0,0.1); }
#offcanvas-menu.active { left: 0; }
.offcanvas-info { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; margin-bottom: 12px; background: #f0f4f8; border-radius: 8px; border: 1px solid #e8ecf0; }
.offcanvas-fecha { color: #4a5568; font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.offcanvas-tiempo { color: #007887 !important; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.offcanvas-tiempo i, .offcanvas-tiempo .temp { color: #007887 !important; }
.offcanvas-search { margin-bottom: 16px; }
.offcanvas-search .search-form { width: 100%; background: #f0f4f8; }
.offcanvas-search .search-form input { width: 100%; padding: 8px 12px; font-size: 14px; color: #1a202c; }
.offcanvas-nav ul { list-style: none; padding: 0; margin: 0; }
.offcanvas-nav ul li a { display: flex; align-items: center; gap: 14px; color: #2d3748; padding: 10px 14px; border-radius: 8px; font-size: 15px; font-weight: 500; }
.offcanvas-nav ul li a:hover { background: #edf2f7; color: #007887; }
.offcanvas-nav ul li a i { width: 20px; text-align: center; color: #007887; }

.header-admin-link { font-size: 12px; color: #95a5a6; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.header-admin-link:hover { color: #3498db; }
.offcanvas-admin-link { display: block; padding: 10px 20px; color: #95a5a6; text-decoration: none; font-size: 14px; border-top: 1px solid #eee; margin-top: 10px; }
.offcanvas-admin-link:hover { color: #3498db; }

@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.header.is-sticky { animation: slideDown 0.4s ease forwards; }

@media (max-width: 991px) {
    .header-top.desktop-only { display: none !important; }
    .menu-toggle { display: flex !important; }
    .main-nav { display: none !important; }
}
@media (min-width: 992px) {
    .menu-toggle { display: none !important; }
    .main-nav { display: flex !important; }
    #offcanvas-menu, #offcanvas-overlay { display: none !important; }
}

/* ============================================
   4. FOOTER & ANCLAJE INFERIOR ANDROID
   ============================================ */
.site-footer { 
    background: #0d1b2a; /* Azul marino corporativo exacto */
    color: rgba(255, 255, 255, 0.8); 
    padding: 18px 0; 
    margin-top: 40px; 
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); 
}

/* Franja fija inferior para asegurar que el azul marino cubra el borde físico de los botones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

body::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: env(safe-area-inset-bottom, 20px);
    background-color: #0d1b2a;
    z-index: 99999;
    pointer-events: none;
}

.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-content { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.footer-copy { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.8); }
.footer-copy strong { color: #ffffff; font-weight: 600; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; font-size: 13px; }
.footer-legal a { color: rgba(255, 255, 255, 0.6); text-decoration: none; transition: color 0.25s ease; }
.footer-legal a:hover { color: #ffffff; }
.footer-sep { color: rgba(255, 255, 255, 0.2); }
.footer-admin { color: rgba(255, 255, 255, 0.6) !important; font-size: 13px !important; }
.footer-admin:hover { color: #ffffff !important; }

@media (min-width: 768px) {
    .site-footer { padding: 22px 0; }
    .footer-content { flex-direction: row; justify-content: space-between; text-align: left; }
}