/* ===== VARIABLES CSS ===== */
:root {
    --primary-color: #c62828;
    --primary-dark: #8e0000;
    --primary-light: #ff5f52;
    --secondary-color: #f5f5f5;
    --accent-color: #333333;
    --text-color: #222222;
    --text-light: #888888;
    --light-color: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* ===== RESET Y ESTILOS BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    overflow-x: hidden;
}

/* Contenedor principal centrado al 80% */
.container {
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 768px) {
    .container {
        width: 90%;
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== CINTILLO SUPERIOR ===== */
.top-bar {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 10px 0;
    font-size: 0.9rem;
    position: relative;
    z-index: 1002;
    width: 100%;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.top-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .top-content {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .top-content {
        width: 95%;
    }
}

.location-time {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time {
    font-weight: 600;
}

.location::before {
    content: "📍";
    margin-right: 5px;
}

.weather-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.weather-icon {
    font-size: 1.2rem;
}

/* Botón de actualización del clima */
.weather-refresh {
    background: transparent;
    border: none;
    color: var(--light-color);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.weather-refresh:hover {
    opacity: 1;
    transform: scale(1.15);
}

.weather-refresh.loading i {
    animation: weather-spin 1s linear infinite;
}

.weather-refresh:disabled {
    cursor: wait;
    opacity: 0.5;
}

@keyframes weather-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== CARRUSEL DE NOTICIAS ===== */
.news-ticker {
    background-color: var(--accent-color);
    color: #ffcc00;
    padding: 12px 0;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid var(--primary-color);
    width: 100%;
}

.ticker-container {
    display: flex;
    align-items: center;
    gap: 0;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .ticker-container {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .ticker-container {
        width: 95%;
    }
}

.ticker-label {
    background-color: var(--primary-color);
    color: var(--light-color);
    padding: 4px 16px;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 2;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 40s linear infinite;
    padding-left: 20px;
}

.ticker-item {
    display: inline-block;
    padding: 0 30px;
    position: relative;
}

.ticker-item::after {
    content: "•";
    position: absolute;
    right: -5px;
    color: var(--primary-light);
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
    .ticker-container {
        flex-wrap: wrap;
    }
    
    .ticker-label {
        margin-bottom: 5px;
        width: 100%;
        text-align: center;
    }
    
    .ticker-wrapper {
        width: 100%;
        flex: none;
    }
    
    .ticker-content {
        padding-left: 0;
    }
}

/* ===== HEADER Y MENÚ ===== */
header {
    background-color: var(--light-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1001;
    border-bottom: 3px solid var(--primary-color);
    width: 100%;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    flex-wrap: wrap;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .header-content {
        width: 90%;
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .header-content {
        width: 95%;
    }
}

/* ===== LOGO ===== */
.logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    border-left: 4px solid var(--primary-color);
    padding-left: 12px;
}

.logo-indicaciones {
    font-family: 'Times New Roman', Times, serif;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-light);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2px;
    text-align: left;
}

.logo-principal {
    font-family: 'Times New Roman', Times, serif;
    font-weight: 900;
    font-size: 3rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.logo-sub {
    font-family: 'Times New Roman', Times, serif;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--accent-color);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 4px;
    border-top: 1px dotted var(--primary-light);
    padding-top: 4px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .logo-principal {
        font-size: 1.8rem;
    }
    
    .logo-indicaciones {
        font-size: 0.7rem;
    }
    
    .logo-sub {
        font-size: 0.65rem;
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .logo-principal {
        font-size: 1.5rem;
    }
    
    .logo {
        padding-left: 8px;
    }
    
    .logo-sub {
        font-size: 0.6rem;
    }
}

/* ===== INFORMACIÓN EN HEADER (SCROLL) ===== */
.header-info {
    display: none;
    align-items: center;
    gap: 15px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.85rem;
    margin: 0 10px;
    transition: all 0.3s ease;
}

.header-info.visible {
    display: flex;
}

.header-time {
    font-weight: 600;
    white-space: nowrap;
}

.header-weather {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-weather-icon {
    font-size: 1rem;
}

.header-weather-temp {
    font-weight: 600;
}

@media (max-width: 992px) {
    .header-info {
        order: 3;
        width: 100%;
        margin: 10px 0 0;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-info {
        margin: 10px 0;
    }
}

/* ===== MENÚ DE NAVEGACIÓN ===== */
.main-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    justify-content: flex-end;
}

.menu-item {
    display: block;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    border-radius: 4px;
    transition: var(--transition);
    letter-spacing: 0.3px;
    color: var(--text-color);
}

.menu-item:hover {
    background-color: rgba(198, 40, 40, 0.1);
    color: var(--primary-color);
}

.menu-item.active {
    background-color: var(--primary-color);
    color: var(--light-color);
}

@media (max-width: 768px) {
    .main-menu {
        justify-content: center;
        gap: 3px;
    }
    
    .menu-item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* ===== CONTENIDO PRINCIPAL ===== */
main {
    width: 100%;
}

.main-content {
    padding: 30px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .main-content {
        grid-template-columns: 2fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .main-content {
        width: 95%;
    }
}

/* ===== SLIDER PRINCIPAL ===== */
.featured-slider {
    position: relative;
    height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    width: 100%;
}

.slides-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    z-index: 5;
    pointer-events: auto;
}

.slide-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}

.slide-image {
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    width: 100%;
}

.slide-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.1) 100%);
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    color: var(--light-color);
    z-index: 5;
    pointer-events: none;
}

.slide-category {
    background-color: var(--primary-color);
    color: var(--light-color);
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.slide-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1.3;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.slide-date {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.slide-date::before {
    content: "📅";
    font-size: 0.8rem;
}

.slider-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    transform: translateY(-50%);
    z-index: 20;
}

.slider-arrow {
    background-color: rgba(0,0,0,0.6);
    color: var(--light-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.slider-arrow:hover {
    background-color: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 20;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: var(--transition);
}

.slider-dot.active {
    background-color: var(--light-color);
    transform: scale(1.2);
}

/* ===== SECCIÓN DE NOTICIAS LATERALES ===== */
.side-news {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.news-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: var(--transition);
    width: 100%;
}

.news-link:hover {
    transform: translateY(-5px);
}

.side-item {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    width: 100%;
}

.side-image {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
}

.side-content {
    padding: 20px;
    position: relative;
}

.side-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--accent-color);
}

.news-category {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.side-date {
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 5px;
}

.side-date::before {
    content: "⏱️";
    font-size: 0.7rem;
}

/* ===== SLIDER HORIZONTAL DE NOTICIAS DESTACADAS - 1 TARJETA POR SLIDE ===== */
.horizontal-slider-container {
    margin-top: 40px;
    width: 100%;
    overflow: visible;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    color: var(--accent-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background-color: var(--primary-light);
}

.horizontal-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    width: 100%;
    margin: 0 auto;
}

.horizontal-slides {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
    will-change: transform;
}

.horizontal-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    box-sizing: border-box;
}

.horizontal-slide .news-card {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.news-card {
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    flex-shrink: 0;
}

.news-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-category {
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.news-card-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--accent-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.6em;
    font-weight: 600;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.horizontal-indicators {
    display: flex;
    gap: 10px;
}

.horizontal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: var(--transition);
}

.horizontal-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
}

/* ===== MINI SLIDER ===== */
.mini-news-slider {
    margin-top: 50px;
    margin-bottom: 30px;
    width: 100%;
}

.mini-slider-container {
    position: relative;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    overflow: hidden;
    width: 100%;
}

.mini-slides {
    display: flex;
    transition: transform 0.5s ease;
    width: 100%;
}

.mini-slide {
    flex: 0 0 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    box-sizing: border-box;
}

.mini-news-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.mini-news-item:hover {
    background-color: rgba(198, 40, 40, 0.05);
    transform: translateX(5px);
}

.mini-news-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.mini-news-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mini-news-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.6em;
}

.mini-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.mini-indicators {
    display: flex;
    gap: 8px;
}

.mini-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ddd;
    cursor: pointer;
    border: none;
    padding: 0;
    transition: var(--transition);
}

.mini-dot.active {
    background-color: var(--primary-color);
}

/* ===== CLICK INDICATOR ===== */
.click-indicator {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    z-index: 15;
    pointer-events: none;
}

.news-link:hover .click-indicator,
.slide-link:hover .click-indicator {
    opacity: 1;
}

/* ===== FOOTER ===== */
footer {
    background-color: var(--accent-color);
    color: var(--light-color);
    padding: 40px 0 20px;
    margin-top: 50px;
    border-top: 5px solid var(--primary-color);
    width: 100%;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 30px;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .footer-content {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .footer-content {
        width: 95%;
    }
}

.footer-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--primary-light);
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-description {
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-link:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-menu {
    list-style: none;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    opacity: 0.9;
    transition: var(--transition);
    display: inline-block;
}

.footer-menu a:hover {
    opacity: 1;
    color: var(--primary-light);
    padding-left: 5px;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.contact-info i {
    color: var(--primary-light);
    width: 20px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
    width: 80%;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .footer-bottom {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .footer-bottom {
        width: 95%;
    }
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 0.85rem;
    opacity: 0.8;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary-light);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .news-image {
        height: 180px;
    }
}

@media (max-width: 992px) {
    .mini-slide {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .news-image {
        height: 160px;
    }
    
    .news-card-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .featured-slider {
        height: 300px;
    }
    
    .slide-title {
        font-size: 1.4rem;
    }
    
    .slide-content {
        padding: 20px;
    }
    
    .slider-controls {
        padding: 0 10px;
    }
    
    .slider-arrow {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .horizontal-slide .news-card {
        max-width: 100%;
    }
    
    .news-image {
        height: 180px;
    }
    
    .mini-slide {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .featured-slider {
        height: 250px;
    }
    
    .slide-title {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .horizontal-controls {
        gap: 15px;
    }
    
    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .news-image {
        height: 160px;
    }
    
    .mini-news-image {
        width: 60px;
        height: 60px;
    }
}