/* ============================================
   PRIMENEWS x LARAVEL — additions beyond the copied template CSS.
   styles.css + overrides.css are verbatim template files; everything
   the server-rendered port needs that the SPA did not have lives here.
   ============================================ */

/* --- Hero slider: the server renders ALL slides; CSS picks the active one.
       (The original SPA re-rendered a single slide every 5.5s.) --- */
.hero-slide { display: none; }
.hero-slide.active { display: block; }

/* --- Localization --- */
/* Bengali font stack prepended when the active locale is bn (fonts already
   loaded by the layout's Google Fonts link alongside the Latin families). */
html[lang="bn"] {
    --font-sans: "Noto Sans Bengali", "Inter", system-ui, sans-serif;
    --font-serif: "Noto Serif Bengali", "Merriweather", Georgia, serif;
    --font-display: "Noto Serif Bengali", "Playfair Display", Georgia, serif;
}

/* Language selector mirrors template top-bar styling */
.lang-select { color: #adb5bd; font-size: 12px; }
.lang-select select {
    background: transparent;
    border: 0;
    color: #adb5bd;
    font-size: 12px;
    outline: 0;
    cursor: pointer;
}
.lang-select option { color: #1a1a2e; }

/* Auth-state buttons in header/topbar */
.header-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

/* --- Flash + validation feedback --- */
.frontend-flash {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.frontend-flash .flash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: #161b22;
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: flash-in .25s ease;
}
.frontend-flash .flash-item.success { border-left: 3px solid #27ae60; }
.frontend-flash .flash-item.error { border-left: 3px solid #e74c3c; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.field-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #e74c3c;
    min-height: 0;
    transition: all .2s ease;
}
.field-error:empty {
    display: none;
}
.comment-field-group {
    margin-bottom: 12px;
}
.comment-field-group .form-control.is-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}
.comment-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 575px) {
    .comment-fields {
        grid-template-columns: 1fr;
    }
}

/* honeypot fields are never visible */
.hp-field { position: absolute !important; left: -9999px !important; }

/* --- Video embeds --- */
.video-embed-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-thumb-embed { position: relative; aspect-ratio: 16 / 9; }

/* --- Lightbox shell used across gallery pages --- */
.lightbox-image { max-height: 78vh; width: auto; margin: 0 auto; border-radius: var(--radius-md); }

/* --- Print: strip chrome --- */
@media print {
    .top-bar, .breaking-news-bar, .main-nav, .mobile-nav,
    .site-header, .site-footer, .back-to-top, .slider-controls,
    .slider-dots, .sidebar, .article-tools, .comment-form,
    .inline-ad, .ad-placeholder, .footer-ad { display: none !important; }
    body { background: #fff; color: #000; }
}

/* --- Opinion grid (missing from template CSS) --- */
.opinion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* --- Home gallery (modifier for gallery-grid on homepage) --- */
.home-gallery {
    columns: 3;
    column-gap: 12px;
}

/* --- Misc --- */
.article-hero-image { width: 100%; border-radius: var(--radius-lg); }

/* Mobile: opinion grid collapses to single column */
@media (max-width: 991px) {
    .opinion-grid {
        grid-template-columns: 1fr;
    }
    .home-gallery {
        columns: 2;
    }
}
@media (max-width: 767px) {
    .home-gallery {
        columns: 1;
    }
}

/* Ensure the sidebar sticky position works in the wider layout */
@media (min-width: 1400px) {
    .sidebar.sticky-top,
    .sidebar[data-sticky] {
        position: sticky;
        top: 80px;
    }
}
.tag-badge { cursor: pointer; }
.comment-avatar { width: 44px; height: 44px; border-radius: var(--radius-full); object-fit: cover; }

/* ============================================
   WIDE-SCREEN OVERRIDES (≥1400px)
   Let the homepage hero sidebar, card grids, and
   content sections breathe on ultra-wide monitors.
   ============================================ */
@media (min-width: 1400px) {
    /* Remove the container cap so content spans the viewport */
    .news-container {
        max-width: none;
        padding: 0 var(--spacing-lg);
    }

    /* Hero: wider sidebar + tighter gap ratio */
    .hero-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 28px;
    }

    /* Main content + sidebar layout also widens */
    .content-with-sidebar {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 32px;
    }

    /* Category page layout */
    .category-page-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 32px;
    }

    /* Card grids: show 4 columns on wide screens */
    .card-grid.three-columns {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .card-grid.two-columns {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }

    /* Category section grid: 3 columns */
    .category-section-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Opinion grid: 4 columns on wide screens */
    .opinion-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    /* Gallery: 5 columns */
    .gallery-grid {
        columns: 5;
        column-gap: 16px;
    }

    .home-gallery {
        columns: 5;
        column-gap: 16px;
    }
}

@media (min-width: 1600px) {
    /* Even wider: 5-column card grid, bigger sidebar */
    .hero-layout {
        grid-template-columns: minmax(0, 1fr) 400px;
    }

    .content-with-sidebar,
    .category-page-layout {
        grid-template-columns: minmax(0, 1fr) 380px;
    }

    .card-grid.three-columns {
        grid-template-columns: repeat(5, 1fr);
    }

    .card-grid.two-columns {
        grid-template-columns: repeat(4, 1fr);
    }

    .opinion-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .gallery-grid {
        columns: 6;
    }

    .home-gallery {
        columns: 6;
    }
}

/* --- Admin-controlled in-article ad slot --- */
.article-ad-banner {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    margin: 28px 0;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.article-ad-banner .ad-slot-content {
    width: 100%;
    text-align: center;
}

.article-ad-banner img,
.article-ad-banner iframe {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* ============================================
   FOOTER — newsletter band, tag cloud, bottom links
   ============================================ */
.footer-newsletter-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #000));
    border-radius: var(--radius-sm);
    padding: 28px 32px;
    margin: 0 0 40px;
    color: #fff;
}

.footer-band-copy h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-band-copy p {
    margin: 0;
    font-size: 13px;
    opacity: .85;
    max-width: 480px;
}

.footer-band-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1 1 320px;
    max-width: 460px;
}

.footer-band-form input[type="email"] {
    flex: 1 1 180px;
    height: 44px;
    padding: 0 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.95);
    color: var(--text, #212529);
    font-size: 14px;
}

.footer-band-form input[type="email"]:focus {
    outline: 2px solid rgba(255,255,255,.7);
}

.footer-tags-heading {
    margin-top: 20px;
}

.footer-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-tag-chip {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #8d9db5;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.footer-tag-chip:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

@media (max-width: 767px) {
    .footer-newsletter-band {
        flex-direction: column;
        align-items: stretch;
        padding: 22px 18px;
    }

    .footer-band-form {
        max-width: none;
    }
}


/* Native players and new account forms must stay inside narrow screens. */
[hidden] { display: none !important; }
.video-embed-frame { max-width: 100%; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.dashboard-content, .dashboard-panel { min-width: 0; overflow-wrap: anywhere; }
.dashboard-content label, .auth-card label { display: block; }
.dashboard-content input, .dashboard-content textarea { max-width: 100%; box-sizing: border-box; }
.pagination { flex-wrap: wrap; gap: .4rem; }

