/* --- 1. VARIABLES Y RESET --- */
:root {
    --primary: #008f51; /* Verde Pentágono */
    --primary-dark: #006b3c;
    --accent: #cc0000; /* Rojo Breaking News */
    --dark: #121212;
    --light: #f4f4f4;
    --white: #ffffff;
    --gray: #888888;
    --border: #e0e0e0;
    
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Merriweather', serif;
    --font-ui: 'Roboto Condensed', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--white);
    color: var(--dark);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; }
img { max-width: 100%; display: block; }

/* --- 2. HEADER Y NAV --- */
.main-header { background: var(--dark); color: var(--white); }

.top-bar {
    display: flex; justify-content: space-between; padding: 5px 5%;
    background: #000; font-family: var(--font-ui); font-size: 12px;
    border-bottom: 1px solid #333;
}
.social-icons a { color: #ccc; margin-left: 10px; font-size: 14px; }
.social-icons a:hover { color: var(--primary); }

.brand-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; border-bottom: 4px solid var(--primary);
}

.logo-container img { height: 60px; filter: brightness(1.1); }

.search-trigger, .menu-mobile-btn {
    background: none; border: none; color: var(--white);
    font-size: 20px; cursor: pointer;
}
.menu-mobile-btn { display: none; } 

.main-nav { background: #1a1a1a; position: relative; }
.nav-list {
    display: flex; justify-content: center; gap: 20px;
    font-family: var(--font-heading); font-weight: 500;
    overflow-x: auto; padding: 15px 5%; scrollbar-width: none;
}
.nav-list::-webkit-scrollbar { display: none; }

.nav-list li {
    cursor: pointer; text-transform: uppercase; white-space: nowrap;
    color: #ccc; font-size: 14px; position: relative;
}
.nav-list li:hover, .nav-list li.active { color: var(--primary); }
.nav-list li.active::after {
    content: ''; position: absolute; bottom: -5px; left: 0;
    width: 100%; height: 3px; background: var(--primary);
}

/* --- 3. TICKER (ÚLTIMA HORA) --- */
.breaking-news-bar {
    display: flex; background: var(--light); height: 40px;
    border-bottom: 1px solid var(--border); overflow: hidden;
}

.bn-label {
    background: var(--primary); color: var(--white);
    padding: 0 20px; font-family: var(--font-heading);
    font-weight: 700; display: flex; align-items: center;
    white-space: nowrap; z-index: 10; font-size: 14px;
}

.bn-content-wrapper {
    flex-grow: 1; overflow: hidden; position: relative;
    display: flex; align-items: center;
}

.bn-content {
    display: inline-block; white-space: nowrap;
    animation: ticker 40s linear infinite;
    font-family: var(--font-ui); font-weight: 700;
    padding-left: 100%;
}

.ticker-item { margin-right: 50px; font-size: 14px; }
.ticker-item::before { content: '●'; color: var(--primary); margin-right: 10px; }

@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* --- 3.5 SECCIÓN DE HISTORIAS (STORIES) --- */
.stories-section {
    padding: 25px 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.stories-header {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 1px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.stories-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 5px 5px 15px 5px; /* Espacio para la sombra/hover */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.stories-container::-webkit-scrollbar { display: none; } /* Chrome/Safari */

/* Skeleton Loading para Historias */
.story-skeleton {
    min-width: 110px;
    height: 170px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 12px;
}
@keyframes loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Diseño de cada Historia */
.story-ring-wrapper {
    min-width: 110px; /* Ancho de la historia */
    height: 170px;    /* Alto de la historia */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    /* Anillo Gradiente Pentágono */
    background: linear-gradient(45deg, var(--primary), #aaffa9);
    padding: 3px; /* Grosor del borde */
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.story-ring-wrapper:hover {
    transform: translateY(-5px); /* Movimiento vertical al pasar mouse */
    box-shadow: 0 10px 20px rgba(0, 143, 81, 0.3);
}

.story-ring-wrapper.seen {
    background: #e0e0e0; /* Gris si ya se vio */
}

.story-inner {
    width: 100%;
    height: 100%;
    border-radius: 9px; /* Un poco menos que el padre */
    position: relative;
    overflow: hidden;
    background: #000;
}

.story-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.story-ring-wrapper:hover .story-inner img {
    transform: scale(1.1); /* Zoom suave a la imagen */
}

.story-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
}

.story-title {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Máximo 2 líneas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.user-avatar {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    background: #fff;
    z-index: 5;
    overflow: hidden;
    padding: 2px;
}
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; }

/* --- 4. LAYOUT PRINCIPAL --- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.main-layout {
    display: grid; grid-template-columns: 2.2fr 1fr; gap: 40px; margin-top: 40px;
}

/* SLIDESHOW */
.hero-section {
    height: 500px; position: relative; border-radius: 4px;
    overflow: hidden; background: #000; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.loading-box { display: flex; justify-content: center; align-items: center; height: 100%; color: #666; font-family: var(--font-ui); }

.slider-wrapper { position: relative; width: 100%; height: 100%; }
.slide-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: opacity 0.8s ease-in-out; background-color: #000; }
.hero-card { width: 100%; height: 100%; position: relative; cursor: pointer; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 40px; background: linear-gradient(to top, rgba(0,0,0,0.95), transparent); color: white; }
.hero-overlay h1 { font-family: var(--font-heading); font-size: 36px; line-height: 1.1; margin: 10px 0; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.cat-tag { background: var(--primary); color: white; padding: 5px 10px; font-family: var(--font-heading); font-size: 12px; text-transform: uppercase; display: inline-block; }
.meta-info { font-family: var(--font-ui); font-size: 13px; opacity: 0.8; text-transform: uppercase; margin-top: 5px; }

/* SIDEBAR & LISTAS */
.section-title { border-bottom: 2px solid var(--dark); margin-bottom: 20px; padding-bottom: 5px; }
.section-title h3 { font-family: var(--font-heading); font-size: 20px; text-transform: uppercase; margin: 0; }

.trend-item { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.trend-item:hover { background: #f9f9f9; padding-left: 5px; }
.trend-item:last-child { border-bottom: none; }
.trend-rank { font-family: var(--font-heading); font-size: 32px; font-weight: 700; color: #e0e0e0; line-height: 1; min-width: 30px; text-align: center; }
.trend-info h4 { margin: 0 0 5px 0; font-family: var(--font-heading); font-size: 16px; line-height: 1.3; }

/* WIDGET CLIMA (PREMIUM) */
.weather-widget-pro { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); border-top: 4px solid var(--primary); font-family: var(--font-heading); text-align: center; margin-bottom: 30px; }
.weather-header { font-size: 12px; color: #888; letter-spacing: 1px; margin-bottom: 15px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.weather-main { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 10px; }
.weather-temp { font-size: 42px; font-weight: bold; color: #333; line-height: 1; }
.weather-desc { font-size: 14px; color: #666; text-transform: uppercase; font-weight: bold; margin-bottom: 15px; }
.weather-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #f9f9f9; padding: 10px; border-radius: 6px; }
.weather-stat { font-size: 11px; color: #555; }
.weather-stat b { display: block; font-size: 14px; color: #000; margin-top: 2px; }

/* --- 5. MULTIMEDIA STRIP --- */
.multimedia-strip { background: var(--dark); color: var(--white); padding: 50px 0; margin: 40px 0; }
.section-title.dark { border-bottom-color: #444; color: white; }
.video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.video-card { background: #222; border-radius: 6px; overflow: hidden; cursor: pointer; transition: 0.3s; }
.video-card:hover { transform: translateY(-5px); }
.video-thumb { height: 180px; position: relative; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 40px; color: white; opacity: 0.9; }
.video-info { padding: 15px; }
.video-info h5 { font-family: var(--font-heading); font-size: 14px; margin: 0; line-height: 1.4; color: #ddd; }

/* --- 6. GRID GENERAL --- */
.standard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px; }
.news-card { background: var(--white); cursor: pointer; transition: 0.3s; border-radius: 4px; overflow: hidden; border: 1px solid #f0f0f0; }
.news-card:hover { box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.news-card:hover h3 { color: var(--primary); }
.news-card img { height: 200px; width: 100%; object-fit: cover; border-bottom: 4px solid var(--primary); margin-bottom: 15px; }
.card-body { padding: 20px; }
.news-card h3 { font-family: var(--font-heading); font-size: 20px; line-height: 1.3; margin: 5px 0 10px 0; }
.news-excerpt { font-size: 14px; color: #666; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- 7. FOOTER --- */
.main-footer { background: #111; color: #aaa; padding: 60px 0 20px; border-top: 5px solid var(--primary); }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-logo { height: 50px; margin-bottom: 20px; filter: grayscale(100%); opacity: 0.7; }
.footer-col h4 { color: white; font-family: var(--font-heading); margin-bottom: 20px; }
.footer-col ul li { margin-bottom: 8px; font-size: 14px; }
.footer-col ul li a:hover { color: var(--primary); }
.footer-bottom { text-align: center; border-top: 1px solid #222; padding-top: 20px; font-size: 12px; }

/* --- 8. BÚSQUEDA --- */
.search-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95); z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: 0.3s;
}
.search-overlay.active { opacity: 1; pointer-events: all; }
.close-btn { position: absolute; top: 30px; right: 30px; font-size: 30px; background: none; border: none; color: white; cursor: pointer; }
.search-container { width: 90%; max-width: 800px; }
#search-input { width: 100%; background: none; border: none; border-bottom: 2px solid var(--primary); color: white; font-size: 32px; padding: 10px; font-family: var(--font-heading); outline: none; }
.search-results-grid { margin-top: 30px; max-height: 60vh; overflow-y: auto; }
.search-item { display: flex; gap: 20px; padding: 15px; border-bottom: 1px solid #333; color: white; cursor: pointer; }
.search-item img { width: 100px; height: 70px; object-fit: cover; }

/* --- VISOR DE HISTORIAS (MODAL) --- */
.story-viewer-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000; z-index: 5000;
    display: none; /* Flex al activar */
    justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.story-viewer-overlay.active { display: flex; opacity: 1; }

.close-story {
    position: absolute; top: 20px; right: 20px; z-index: 5010;
    background: none; border: none; color: white; font-size: 30px; cursor: pointer;
}

.story-content-box {
    width: 100%; max-width: 450px; height: 90vh;
    background: #000; position: relative; border-radius: 12px;
    overflow: hidden; box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

.story-full-img { width: 100%; height: 100%; object-fit: cover; }

.story-full-overlay {
    position: absolute; bottom: 0; width: 100%; padding: 40px 20px;
    background: linear-gradient(to top, #000, transparent);
    color: white; text-align: center;
}

.story-progress-bar {
    position: absolute; top: 10px; left: 10px; right: 10px;
    height: 3px; background: rgba(255,255,255,0.3);
    border-radius: 2px;
}
.story-progress-fill {
    height: 100%; background: white; width: 0%;
    transition: width 0.1s linear;
}

.btn-story-action {
    background: var(--primary); color: white; padding: 10px 25px;
    border-radius: 20px; font-weight: 700; font-family: var(--font-ui);
    display: inline-block; margin-top: 15px; border: 1px solid rgba(255,255,255,0.2);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .main-layout { grid-template-columns: 1fr; }
    .hero-section { height: 400px; }
    .hero-overlay h1 { font-size: 28px; }
    .video-grid { display: flex; overflow-x: auto; padding-bottom: 20px; scroll-snap-type: x mandatory; }
    .video-card { min-width: 260px; scroll-snap-align: start; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }
    .menu-mobile-btn { display: block; }
    .nav-list { justify-content: flex-start; }
    
    .story-content-box { height: 100vh; border-radius: 0; max-width: 100%; }
}