/* =====================================================
   DESIGN SYSTEM
===================================================== */

:root {
    --primary: #FF8A4C;
    --primary-hover: #E07035;

    --bg-main: #F4F4F4;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;

    --text-main: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #888888;

    --border: #E0E0E0;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .1);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .15);

    --transition: 0.2s ease;
}

/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* --- CLASSES UTILITÁRIAS (Grid e Flex) --- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- ANÚNCIO TOPO --- */
.ad-banner-top {
    margin: 20px 0;
    width: 100%;
}

.ad-banner-top img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 970 / 150;
    object-fit: cover;
}

/* --- SEÇÃO DESTAQUE (HERO) --- */
/* Mobile First: Coluna única por padrão */
.hero-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.featured-news {
    position: relative;
    height: 300px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.featured-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: #fff;
}

/* Image scaling on hover */
.featured-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.featured-link:hover .featured-bg {
    transform: scale(1.05);
}

/* Gradient Overlay */
.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 30%, rgba(0, 0, 0, 0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
    z-index: 10;
}

.badge {
    background-color: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.featured-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.featured-excerpt {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    color: #f0f0f0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.secondary-news {
    position: relative;
    height: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.secondary-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    color: #fff;
}

.secondary-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.secondary-link:hover .secondary-bg {
    transform: scale(1.05);
}

.secondary-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 30%, rgba(0, 0, 0, 0.9) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    z-index: 10;
}

.secondary-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.secondary-excerpt {
    font-size: 0.8rem;
    opacity: 0.85;
    margin: 0;
    color: #f0f0f0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* --- BARRA DE TÍTULO --- */
.section-header {
    background-color: var(--bg-secondary);
    color: var(--primary);
    padding: 12px 16px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.section-header h2 {
    font-size: 0.85rem;
    /* 13.6px - Balanced size for mobile */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    color: var(--primary);
    line-height: 1.3;
}

.view-all-btn {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    text-transform: none;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.view-all-btn:hover {
    color: var(--primary);
}

/* --- CONTEÚDO INFERIOR + SIDEBAR --- */
/* Mobile First: Coluna única */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-item {
    background-color: var(--bg-card);
    height: 200px;
    display: flex;
    /* align-items: center; justify-content: center; removed to allow full content fill */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.sidebar-ad {
    background-color: var(--bg-card);
    color: var(--text-muted);
    display: none;
    /* Hide on mobile */
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 300 / 600;
}

.sidebar-ad img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =====================================================
   RESPONSIVIDADE (DESKTOP)
===================================================== */
@media (min-width: 768px) {

    /* Section Headers - Desktop */
    .section-header {
        padding: 14px 20px;
    }

    .section-header h2 {
        font-size: 1.1rem;
        /* 17.6px */
        letter-spacing: 0.8px;
    }

    .view-all-btn {
        font-size: 0.85rem;
    }

    /* ======================
       CONTENT LAYOUT DESKTOP
    ====================== */
    .hero-section {
        display: grid;
        grid-template-columns: 2fr 1fr;
        grid-template-rows: 200px 200px;
        gap: 20px;
    }

    .featured-news {
        grid-row: 1 / span 2;
        height: auto;
    }

    .secondary-news {
        height: auto;
    }

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

    .list-item {
        height: 250px;
    }

    .sidebar-ad {
        display: flex;
    }
}

/* --- SEÇÃO DE VÍDEOS --- */
.video-section {
    margin-bottom: 40px;
}

/* Mobile-First: Carousel otimizado para touch */
.video-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 15px;
    padding: 0 15px 20px 15px;
    margin: 0 -15px;
    /* Extend to edges on mobile */

    /* Scroll behavior optimizations */
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* iOS momentum scrolling */
    overscroll-behavior-x: contain;
    /* Prevent scroll chaining */

    /* Touch optimizations */
    touch-action: pan-x;
    /* Only allow horizontal scrolling */
    cursor: grab;
    user-select: none;
    /* Prevent text selection during drag */
    -webkit-user-select: none;
}

.video-carousel:active {
    cursor: grabbing;
}

/* Prevent pointer events on iframes during scroll */
.video-carousel.is-dragging iframe {
    pointer-events: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.video-carousel::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.video-carousel {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Mobile-First: Cards take most of screen width */
.video-item {
    flex: 0 0 calc(100vw - 60px);
    /* Full width minus padding and gap */
    min-width: 280px;
    max-width: 400px;
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    scroll-snap-align: center;
    /* Center snap for better mobile UX */
    scroll-snap-stop: always;
    /* Force stop at each item */
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Subtle scale effect on active card (optional visual feedback) */
.video-item:active {
    transform: scale(0.98);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.video-info .badge {
    align-self: flex-start;
}

.video-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Tablet: Slightly larger cards */
@media (min-width: 600px) {
    .video-carousel {
        gap: 20px;
        padding: 0 20px 20px 20px;
        margin: 0 -20px;
    }

    .video-item {
        flex: 0 0 calc(50vw - 40px);
        /* Two cards visible */
        max-width: 380px;
    }
}

/* Desktop: Larger cards, start snap alignment */
@media (min-width: 768px) {
    .video-carousel {
        padding: 0 0 20px 0;
        margin: 0;
        gap: 20px;
        cursor: default;
    }

    .video-carousel:active {
        cursor: default;
    }

    .video-item {
        flex: 0 0 360px;
        scroll-snap-align: start;
        /* Start alignment on desktop */
    }

    .video-item:active {
        transform: none;
    }

    .video-item:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
    }
}

/* Large Desktop: Even larger cards */
@media (min-width: 1024px) {
    .video-item {
        flex: 0 0 400px;
    }
}

/* --- CAROUSEL INDICATORS --- */
.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 10px 0;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.indicator-dot:hover {
    background-color: var(--text-muted);
    transform: scale(1.2);
}

.indicator-dot.active {
    background-color: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.indicator-dot:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Hide indicators on desktop if desired */
@media (min-width: 768px) {
    .carousel-indicators {
        display: none;
        /* Optional: hide on desktop */
    }
}


/* --- FOOTER --- */
.main-footer {
    background-color: #ffffff;
    color: var(--text-secondary);
    padding: 30px 0 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

.main-footer .footer-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: flex-start;
    padding-bottom: 20px;
}

/* Logo */
.footer-logo {
    display: flex;
    align-items: center;
}

.footer-logo img {
    height: 32px;
    width: auto;
}

/* Navigation */
.footer-nav h4 {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-nav li {
    margin: 0;
}

.footer-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    display: inline-block;
    position: relative;
}

.footer-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width var(--transition);
}

.footer-nav a:hover {
    color: var(--primary);
}

.footer-nav a:hover::after {
    width: 100%;
}

/* Footer Bottom */
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

/* Responsive Footer - Desktop */
@media (min-width: 768px) {
    .main-footer .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 40px;
        padding-bottom: 25px;
    }

    .footer-nav ul {
        gap: 10px 30px;
    }
}