/**
 * bengali-portal.css - Modern Bengali News & Magazine Portal Styling
 * Optimized for Bangladesh readers with Google Font Hind Siliguri,
 * Dark/Light mode, high-contrast readability, and responsive design.
 */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Noto+Sans+Bengali:wght@400;600;700&display=swap');

:root {
    --primary: #d62828;
    --primary-dark: #b71c1c;
    --primary-light: #ffebee;
    --secondary: #003049;
    --accent: #f77f00;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --ticker-bg: #003049;
    --ticker-text: #ffffff;
    --badge-bg: #d62828;
    --badge-text: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --font-bengali: 'Hind Siliguri', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg-body: #0b0f19;
    --bg-card: #151d2c;
    --bg-header: #111827;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #243046;
    --ticker-bg: #0d1424;
    --ticker-text: #f8fafc;
    --primary-light: rgba(214, 40, 40, 0.15);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

body {
    font-family: var(--font-bengali);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 17px;
    letter-spacing: -0.01em;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-bengali);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* Top Utility Bar */
.top-header-bar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    padding: 6px 0;
    color: var(--text-secondary);
}

.top-header-bar a {
    color: var(--text-secondary);
    margin-right: 12px;
}

.top-header-bar a:hover {
    color: var(--primary);
}

.date-weather-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Main Brand Header */
.main-header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
}

.site-logo img {
    max-height: 48px;
    width: auto;
}

.ad-banner-slot {
    max-width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.ad-banner-slot img {
    width: 100%;
    max-height: 90px;
    object-fit: cover;
}

/* Navigation Navbar */
.primary-navbar {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.primary-navbar .nav-link {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 12px 14px;
    transition: all 0.2s ease;
}

.primary-navbar .nav-link:hover,
.primary-navbar .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn-lang-toggle, .btn-theme-toggle {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-lang-toggle:hover, .btn-theme-toggle:hover {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Breaking News Ticker */
.breaking-news-bar {
    background-color: var(--ticker-bg);
    color: var(--ticker-text);
    padding: 8px 0;
    font-size: 15px;
    font-weight: 500;
}

.ticker-badge {
    background-color: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.ticker-marquee-wrapper {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
}

.ticker-marquee {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 25s linear infinite;
}

.ticker-marquee:hover {
    animation-play-state: paused;
}

@keyframes marquee {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

.ticker-marquee a {
    color: var(--ticker-text);
    margin-right: 40px;
    transition: color 0.2s;
}

.ticker-marquee a:hover {
    color: var(--accent);
}

/* News Cards & Grids */
.news-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #cbd5e1;
}

.card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-card:hover .card-img-wrap img {
    transform: scale(1.05);
}

.category-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: auto;
}

/* Featured Lead Story */
.lead-story-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    min-height: 440px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.lead-story-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s ease;
}

.lead-story-card:hover img {
    transform: scale(1.04);
}

.lead-story-overlay {
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.6) 60%, rgba(0,0,0,0) 100%);
    padding: 2rem 1.5rem 1.5rem;
    color: #ffffff;
}

.lead-story-overlay h2 {
    color: #ffffff;
    font-size: 1.85rem;
    margin-bottom: 0.75rem;
}

.lead-story-overlay p {
    color: #e2e8f0;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* Section Header */
.section-header {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 0.5rem;
}

.section-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0;
    position: relative;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}

/* Sidebar Widgets */
.sidebar-widget {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.mini-news-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.mini-news-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mini-news-thumb {
    width: 80px;
    height: 65px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.mini-news-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-news-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
}

.mini-news-title a:hover {
    color: var(--primary);
}

.mini-news-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Single Article Reader */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--primary);
    width: 0%;
    z-index: 2000;
    transition: width 0.1s;
}

.article-header {
    margin-bottom: 1.5rem;
}

.article-headline {
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-meta-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.article-featured-img {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.article-featured-img img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
}

.article-content {
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 1.4rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background-color: var(--primary-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    font-size: 1.25rem;
}

/* Social Share Bar */
.social-share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
    border: none;
}

.share-btn:hover {
    opacity: 0.9;
}

.share-whatsapp { background-color: #25D366; }
.share-facebook { background-color: #1877F2; }
.share-twitter  { background-color: #000000; }
.share-copy     { background-color: #475569; }

/* Comments Section */
.comment-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.comment-author {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Live Search Modal */
.search-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.7);
    z-index: 3000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.search-modal-backdrop.active {
    display: flex;
}

.search-modal-box {
    background-color: var(--bg-card);
    width: 90%;
    max-width: 650px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    position: relative;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.search-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
}

.search-input-group input {
    flex: 1;
    font-family: var(--font-bengali);
    font-size: 18px;
    padding: 10px 16px;
    border: 2px solid var(--primary);
    border-radius: 6px;
    background-color: var(--bg-body);
    color: var(--text-primary);
    outline: none;
}

.search-results-list {
    overflow-y: auto;
    max-height: 400px;
}

/* Toast alert */
.portal-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    font-size: 15px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.portal-toast.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.site-footer {
    background-color: var(--secondary);
    color: #cbd5e1;
    padding: 50px 0 20px;
    margin-top: 60px;
}

.site-footer a {
    color: #cbd5e1;
}

.site-footer a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 40px;
    font-size: 14px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .article-headline {
        font-size: 1.75rem;
    }
    .lead-story-card {
        min-height: 320px;
    }
    .lead-story-overlay h2 {
        font-size: 1.35rem;
    }
    body {
        font-size: 16px;
    }
}
