/* ========================================
   NOTICIAS BONAO - MAIN STYLESHEET
   Dominican Republic News Portal
   ======================================== */

/* ========== RESET & BASE STYLES ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Force disable ALL animations and transitions to prevent flickering */
*, *::before, *::after {
    transition: none !important;
    animation: none !important;
}

:root {
    /* Dominican Republic Colors */
    --primary-color: #002D62;      /* Blue from DR flag */
    --secondary-color: #CE1126;    /* Red from DR flag */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #343a40;
    --text-color: #212529;
    --text-light: #6c757d;
    
    /* Category Colors */
    --local-color: #002D62;
    --nacional-color: #CE1126;
    --deportes-color: #28a745;
    --entretenimiento-color: #fd7e14;
    --opinion-color: #6f42c1;
    
    /* Layout */
    --max-width: 1200px;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: none; /* Disabled transitions to prevent flickering */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-gray);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

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

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

ul {
    list-style: none;
}

/* ========== HEADER ========== */
.header {
    background: var(--white);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 0;
    font-size: 0.875rem;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-links a {
    color: var(--white);
    margin-right: 15px;
    font-size: 1rem;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.top-info {
    display: flex;
    gap: 20px;
}

.weather {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== NAVBAR ========== */
.navbar {
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 0;
}

.logo .highlight {
    color: var(--secondary-color);
}

.logo .tagline {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

.nav-menu {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
    border-bottom-color: var(--secondary-color);
}

.search-box {
    display: flex;
    gap: 5px;
}

.search-box input {
    padding: 8px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    width: 200px;
}

.search-box button {
    padding: 8px 15px;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.search-box button:hover {
    background: #a00e1e;
}

/* ========== BREAKING NEWS ========== */
.breaking-news {
    background: var(--secondary-color);
    color: var(--white);
    padding: 10px 0;
    overflow: hidden;
}

.breaking-news .container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.breaking-label {
    background: var(--white);
    color: var(--secondary-color);
    padding: 5px 12px;
    border-radius: var(--border-radius);
    font-weight: bold;
    white-space: nowrap;
}

.news-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    /* Remove shadow and transitions to avoid repaints/flicker */
    box-shadow: none;
    transition: none;
}

.news-card:hover {
    /* Disabled hover transform to reduce repaints */
    transform: none;
    box-shadow: none;
}

.news-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    /* Provide background color while image loads and improve rendering */
    background-color: #e9ecef;
    image-rendering: auto;
    display: block;
}

/* Card image background (to prevent flicker on category pages) */
.card-img {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #e9ecef;
    display: block;
    transform: translate3d(0, 0, 0);
}
.hero-section {
    background: var(--white);
    padding: 30px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.hero-main {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    /* remove shadow to avoid repaints */
    box-shadow: none;
}

.hero-main img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

/* Use background images for hero and side media to reserve layout space and avoid repaints */
.hero-media {
    width: 100%;
    height: 500px; /* reserved height to prevent layout shift */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    will-change: transform;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* simplified overlay to reduce compositor work */
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    padding: 30px;
}

.hero-content h2 {
    font-size: 2rem;
    margin: 10px 0;
    line-height: 1.3;
}

.hero-content .excerpt {
    margin: 15px 0;
    opacity: 0.9;
}

.category {
    display: inline-block;
    padding: 5px 12px;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.category.local { background: var(--local-color); color: var(--white); }
.category.nacional { background: var(--nacional-color); color: var(--white); }
.category.deportes { background: var(--deportes-color); color: var(--white); }
.category.entretenimiento { background: var(--entretenimiento-color); color: var(--white); }
.category.opinion { background: var(--opinion-color); color: var(--white); }

.meta {
    display: flex;
    gap: 20px;
    font-size: 0.875rem;
    margin: 15px 0;
    opacity: 0.8;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 500;
    margin-top: 10px;
}

.read-more:hover {
    background: #a00e1e;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.side-article {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    height: 240px;
}

.side-article img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-article .media {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.side-article .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: var(--white);
    padding: 20px;
}

.side-article h3 {
    font-size: 1.1rem;
    margin: 10px 0 5px;
}

.side-article .time {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ========== LATEST NEWS ========== */
.latest-news {
    padding: 40px 0;
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.news-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.news-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 1.2rem;
    margin: 10px 0;
    color: var(--text-color);
    line-height: 1.4;
}

.card-content p {
    color: var(--text-light);
    margin: 10px 0;
    font-size: 0.95rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--medium-gray);
}

.card-footer .date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.read-link {
    color: var(--primary-color);
    font-weight: 600;
}

.read-link:hover {
    color: var(--secondary-color);
}

.load-more {
    text-align: center;
    margin-top: 30px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--secondary-color);
}

/* ========== CATEGORIES SECTION ========== */
.categories-section {
    padding: 40px 0;
    background: var(--white);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 40px 30px;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
}

.category-card:hover {
    transform: scale(1.05);
}

.category-card i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.category-card h3 {
    font-size: 1.5rem;
    margin: 10px 0;
}

.category-card p {
    opacity: 0.9;
}

.category-card.local {
    background: linear-gradient(135deg, var(--local-color), #0047AB);
}

.category-card.nacional {
    background: linear-gradient(135deg, var(--nacional-color), #E63946);
}

.category-card.deportes {
    background: linear-gradient(135deg, var(--deportes-color), #38b557);
}

.category-card.entretenimiento {
    background: linear-gradient(135deg, var(--entretenimiento-color), #ff922b);
}

/* ========== NEWSLETTER ========== */
.newsletter-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 50px 0;
    text-align: center;
}

.newsletter-content i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.newsletter-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.newsletter-content p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.newsletter-form button {
    padding: 12px 30px;
    background: var(--white);
    color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    font-weight: bold;
    cursor: pointer;
}

.newsletter-form button:hover {
    background: var(--light-gray);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--dark-gray);
    color: var(--white);
    padding: 40px 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3,
.footer-col h4 {
    margin-bottom: 15px;
    color: var(--white);
}

.footer-col p {
    opacity: 0.8;
    margin-bottom: 15px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    opacity: 0.8;
}

.footer-col ul li a:hover {
    opacity: 1;
    color: var(--secondary-color);
}

.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.2rem;
}

.footer-social a:hover {
    background: var(--secondary-color);
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 5px 0;
    opacity: 0.7;
}

/* ========== SCROLL TO TOP ========== */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.scroll-top.active {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--primary-color);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-side {
        flex-direction: row;
    }
    
    .news-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--box-shadow);
        display: none;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
        width: 100%;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-side {
        flex-direction: column;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-main img {
        height: 300px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .hero-content h2 {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}
