/* =============================================
   Inside Agwa - Main Stylesheet
   ============================================= */

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --header-bg: #1A1228;
    --header-text: #ffffff;
    --accent: #457b9d;
    --dark: #1d1d1d;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #6c757d;
    --gray-700: #495057;
    --text: #212529;
    --text-muted: #6c757d;
    --border: #e9ecef;
    --white: #ffffff;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
    --radius: 6px;
    --font-main: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --transition: all 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-main);
    color: var(--text);
    background: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }

/* ---- BREAKING NEWS TICKER ---- */
.breaking-news-bar {
    background: var(--primary);
    color: white;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
}
.breaking-news-bar .breaking-label {
    background: #fff;
    color: var(--primary);
    padding: 2px 12px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.breaking-news-bar .ticker-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.breaking-news-bar .ticker-content {
    display: flex;
    align-items: center;
    gap: 0;
    animation: ticker 35s linear infinite;
    white-space: nowrap;
}
.breaking-news-bar .ticker-content:hover { animation-play-state: paused; }
@keyframes ticker {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
.breaking-news-bar .d-flex { display: flex; align-items: center; gap: 16px; padding: 0 20px; }

/* ---- TOP BAR ---- */
.top-bar {
    background: #f0f2f5;
    padding: 6px 0;
    font-size: 12px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--border);
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: var(--gray-500); }
.top-bar a:hover { color: var(--primary); }

/* ---- HEADER ---- */
.site-header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 16px 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-logo img { max-height: 54px; width: auto; display: block; flex-shrink: 0; }
.site-logo > div { text-align: left; }
.site-logo .logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 900;
    color: white;
    letter-spacing: -0.5px;
    line-height: 1.1;
    white-space: nowrap;
}
.site-logo .logo-text span { color: var(--primary); }
.site-logo .logo-tagline { font-size: 10px; color: rgba(255,255,255,0.5); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }

@media (max-width: 480px) {
    .site-logo img { max-height: 38px; }
    .site-logo .logo-text { font-size: 17px; }
    .site-logo .logo-tagline { display: none; }
}

.header-search { display: flex; align-items: center; }
.header-search form { display: flex; }
.header-search input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 13px;
    width: 200px;
    outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search input:focus { background: rgba(255,255,255,0.15); border-color: var(--primary); }
.header-search button {
    background: var(--primary);
    border: none;
    color: white;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 0 var(--radius) var(--radius) 0;
    transition: var(--transition);
}
.header-search button:hover { background: var(--primary-dark); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .btn-subscribe {
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.header-actions .btn-subscribe:hover { background: var(--primary-dark); color: white; }

/* ---- NAV WRAPPER (sticky shell for header+nav) ---- */
.site-nav-wrapper { position: -webkit-sticky; position: sticky; top: 0; z-index: 1000; }
.mobile-header-spacer { display: none; height: 0; }

/* ---- NAVIGATION ---- */
.main-nav {
    background: #130D1E;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.main-nav .container { display: flex; align-items: center; overflow-x: auto; scrollbar-width: none; }
.main-nav .container::-webkit-scrollbar { display: none; }
.main-nav a {
    color: rgba(255,255,255,0.8);
    padding: 12px 16px;
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    display: block;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}
.main-nav a:hover, .main-nav a.active {
    color: white;
    border-bottom-color: var(--primary);
}
.main-nav .nav-more {
    position: relative;
}
.main-nav .nav-more .dropdown-trigger { cursor: pointer; }
.main-nav .nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--header-bg);
    min-width: 200px;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-hover);
    z-index: 100;
    padding: 8px 0;
}
.main-nav .nav-more:hover .nav-dropdown { display: block; }
.main-nav .nav-dropdown a {
    display: block;
    padding: 10px 20px;
    border-bottom: none;
    font-size: 13px;
}
.main-nav .nav-dropdown a:hover { background: rgba(255,255,255,0.1); color: white; }

/* ---- CONTAINER ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-fluid { padding: 0 20px; }

/* ---- HERO / FEATURED SECTION ---- */
.hero-section { padding: 30px 0; }

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

.hero-main { position: relative; overflow: hidden; border-radius: var(--radius); }
.hero-main .hero-image { width: 100%; height: 480px; object-fit: cover; border-radius: var(--radius); }
.hero-main .hero-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 40px 28px 28px;
    border-radius: 0 0 var(--radius) var(--radius);
}
.hero-main .cat-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 3px;
    margin-bottom: 10px;
}
.hero-main h1 {
    color: white;
    font-family: var(--font-heading);
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 10px;
}
.hero-main h1 a { color: white; }
.hero-main h1 a:hover { color: var(--primary); }
.hero-main .hero-meta { color: rgba(255,255,255,0.7); font-size: 13px; }
.hero-main .hero-meta span { margin-right: 14px; }

.hero-sidebar { display: flex; flex-direction: column; gap: 16px; }
.hero-sidebar .side-post { display: flex; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.hero-sidebar .side-post:last-child { border-bottom: none; padding-bottom: 0; }
.hero-sidebar .side-post img { width: 100px; height: 75px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.hero-sidebar .side-post .cat-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
.hero-sidebar .side-post h3 { font-size: 14px; font-weight: 700; line-height: 1.4; font-family: var(--font-heading); }
.hero-sidebar .side-post h3 a:hover { color: var(--primary); }
.hero-sidebar .side-post .post-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ---- SECTION HEADER ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}
.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: var(--primary);
    border-radius: 2px;
}
.section-header .view-all {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-header .view-all:hover { color: var(--primary-dark); }

/* ---- NEWS SECTION (TNW-style) ---- */
.news-section { padding: 30px 0; border-top: 1px solid var(--border); }

.news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.news-featured { position: relative; }
.news-featured .feat-image { width: 100%; height: 280px; object-fit: cover; border-radius: var(--radius); }
.news-featured .cat-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary);
    margin: 12px 0 6px;
    display: block;
}
.news-featured h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--dark);
}
.news-featured h3 a:hover { color: var(--primary); }
.news-featured .post-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

.news-list { display: flex; flex-direction: column; gap: 0; }
.news-list-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.news-list-item:first-child { padding-top: 0; }
.news-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-list-item img { width: 110px; height: 78px; object-fit: cover; border-radius: var(--radius); }
.news-list-item .cat-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; display: block; }
.news-list-item h4 { font-size: 14px; font-weight: 700; line-height: 1.4; font-family: var(--font-heading); }
.news-list-item h4 a:hover { color: var(--primary); }
.news-list-item .post-meta { font-size: 11px; color: var(--text-muted); margin-top: 5px; }

/* ---- TRENDING / POPULAR ---- */
.trending-section { background: var(--gray-100); padding: 30px 0; }
.trending-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.trending-card { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.trending-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.trending-card img { width: 100%; height: 160px; object-fit: cover; }
.trending-card .card-body { padding: 14px; }
.trending-card .cat-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; display: block; }
.trending-card h4 { font-size: 14px; font-weight: 700; line-height: 1.4; font-family: var(--font-heading); }
.trending-card h4 a:hover { color: var(--primary); }
.trending-card .post-meta { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* ---- AD BANNER ---- */
.ad-section { padding: 20px 0; text-align: center; }
.ad-banner {
    background: var(--gray-100);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 30px;
    color: var(--gray-500);
    font-size: 13px;
}

/* ---- SIDEBAR ---- */
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; padding: 30px 0; }
.content-layout > * { min-width: 0; }

.sidebar-widget { margin-bottom: 30px; }
.sidebar-widget h3 {
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--dark);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 16px;
}
.sidebar-posts .s-post { display: flex; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sidebar-posts .s-post:last-child { border-bottom: none; margin-bottom: 0; }
.sidebar-posts .s-post img { width: 70px; height: 55px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.sidebar-posts .s-post h5 { font-size: 13px; font-weight: 600; line-height: 1.4; }
.sidebar-posts .s-post h5 a:hover { color: var(--primary); }
.sidebar-posts .s-post .s-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.sidebar-categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 500;
}
.sidebar-categories a:hover { color: var(--primary); padding-left: 6px; }
.sidebar-categories .cat-count { background: var(--gray-100); color: var(--text-muted); padding: 1px 8px; border-radius: 20px; font-size: 12px; }

.newsletter-widget { background: var(--header-bg); color: white; padding: 20px; border-radius: var(--radius); }
.newsletter-widget h3 { color: white; border-bottom-color: var(--primary); }
.newsletter-widget p { font-size: 13px; color: rgba(255,255,255,0.7); margin-bottom: 14px; }
.newsletter-widget input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 8px;
    outline: none;
}
.newsletter-widget button {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 10px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.newsletter-widget button:hover { background: var(--primary-dark); }

/* ---- ARTICLE PAGE ---- */
.article-header { padding: 30px 0 20px; }
.article-header .cat-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 3px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 3px;
    margin-bottom: 14px;
}
.article-header h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--dark);
    margin-bottom: 16px;
}
.article-header .article-meta { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article-header .article-meta .author { font-weight: 600; color: var(--dark); }
.article-header .excerpt { font-size: 17px; color: var(--gray-700); line-height: 1.7; margin: 16px 0; }

.article-featured-img { width: 100%; max-height: 500px; object-fit: cover; border-radius: var(--radius); margin-bottom: 30px; }

.article-content { font-size: 16px; line-height: 1.85; color: var(--dark); }
.article-content { overflow-wrap: anywhere; word-break: break-word; }
.article-content { text-align: justify; text-justify: inter-word; hyphens: auto; }
.article-content p { margin-bottom: 20px; }
.article-content h2 { font-family: var(--font-heading); font-size: 24px; margin: 30px 0 14px; }
.article-content h3 { font-family: var(--font-heading); font-size: 20px; margin: 24px 0 12px; }
.article-content blockquote { border-left: 4px solid var(--primary); padding: 14px 20px; margin: 24px 0; background: var(--gray-100); color: var(--gray-700); font-style: italic; font-size: 17px; }
.article-content ul, .article-content ol { margin: 0 0 20px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content img { max-width: 100% !important; height: auto !important; border-radius: var(--radius); margin: 20px 0; }
.article-content video, .article-content iframe, .article-content embed, .article-content object { max-width: 100% !important; }
.article-content iframe { width: 100% !important; }
.article-content table { max-width: 100%; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-content pre { max-width: 100%; overflow-x: auto; }
.article-content a { color: var(--primary); text-decoration: underline; }

.article-tags { margin: 30px 0; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.article-tags .tag-label { font-size: 13px; font-weight: 700; color: var(--dark); margin-right: 10px; }
.tag-pill { display: inline-block; background: var(--gray-100); color: var(--gray-700); padding: 4px 12px; border-radius: 20px; font-size: 12px; margin: 4px; transition: var(--transition); }
.tag-pill:hover { background: var(--primary); color: white; }

.share-bar { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.share-bar .share-label { font-size: 13px; font-weight: 700; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: var(--transition); }
.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.twitter { background: #1da1f2; color: white; }
.share-btn.whatsapp { background: #25d366; color: white; }
.share-btn:hover { opacity: 0.85; }

/* ---- FOOTER ---- */
.site-footer { background: #0F0B17; color: rgba(255,255,255,0.75); }
.footer-main { padding: 50px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; }

.footer-brand .logo-text { font-family: var(--font-heading); font-size: 28px; font-weight: 900; color: white; }
.footer-brand .logo-text span { color: var(--primary); }
.footer-brand p { font-size: 13px; margin: 12px 0; color: rgba(255,255,255,0.55); line-height: 1.7; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); }

.footer-col h4 { color: white; font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 13px; color: rgba(255,255,255,0.6); transition: var(--transition); }
.footer-col ul li a:hover { color: var(--primary); padding-left: 4px; }

.footer-bottom { background: #090612; padding: 16px 0; text-align: center; font-size: 12px; color: rgba(255,255,255,0.4); border-top: 1px solid rgba(255,255,255,0.07); }
.footer-bottom a { color: rgba(255,255,255,0.5); }
.footer-bottom a:hover { color: var(--primary); }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--dark);
    transition: var(--transition);
}
.pagination a:hover, .pagination .current { background: var(--primary); color: white; border-color: var(--primary); }

/* ---- CATEGORY PAGE ---- */
.category-header { background: var(--header-bg); color: white; padding: 40px 0; margin-bottom: 30px; }
.category-header h1 { font-family: var(--font-heading); font-size: 32px; font-weight: 800; }
.category-header p { color: rgba(255,255,255,0.65); margin-top: 8px; font-size: 15px; }
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.post-card { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: var(--transition); }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.post-card img { width: 100%; height: 200px; object-fit: cover; }
.post-card .card-body { padding: 16px; }
.post-card .cat-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 6px; display: block; }
.post-card h3 { font-family: var(--font-heading); font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.post-card h3 a:hover { color: var(--primary); }
.post-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.post-card .card-footer-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; }

/* ---- SEARCH RESULTS ---- */
.search-result { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.search-result img { width: 140px; height: 90px; object-fit: cover; border-radius: var(--radius); }
.search-result h3 { font-family: var(--font-heading); font-size: 18px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.search-result h3 a:hover { color: var(--primary); }
.search-result p { font-size: 13px; color: var(--text-muted); }
.search-result .meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ---- ALERTS ---- */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ---- MOBILE HAMBURGER ---- */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 5px; }
.hamburger span { display: block; width: 24px; height: 2px; background: white; border-radius: 2px; transition: var(--transition); }

/* ---- BADGE ---- */
.badge-breaking {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ---- NOT FOUND ---- */
.not-found { text-align: center; padding: 80px 20px; }
.not-found h1 { font-size: 80px; font-weight: 900; color: var(--primary); }
.not-found h2 { font-size: 28px; margin-bottom: 16px; }
.not-found p { color: var(--text-muted); margin-bottom: 24px; }

/* =============================================
   RESPONSIVE & MOBILE STYLES
   ============================================= */

/* ---- TABLET (≤1024px) ---- */
@media (max-width: 1024px) {
    .container { padding: 0 16px; }

    /* Hero */
    .hero-grid { grid-template-columns: 1fr; }
    .hero-sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .hero-sidebar .side-post { flex: unset; }

    /* Layouts */
    .content-layout { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .trending-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }

    /* Nav */
    .main-nav .container { overflow-x: auto; }
}

/* ---- MOBILE NAV ---- */
.nav-links-wrapper { display: flex; }
@media (max-width: 768px) {
    .main-nav { display: none; }
    .main-nav.mob-open { display: block; }
    .main-nav .container { flex-direction: column; padding: 0; overflow: visible; }
    .nav-links-wrapper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
    .main-nav a { padding: 12px 8px; font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.06); border-left: none; border-bottom-color: rgba(255,255,255,0.06) !important; text-align: center; }
    .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .main-nav .nav-dropdown { position: static; box-shadow: none; background: rgba(0,0,0,0.2); }
    .main-nav .nav-more:hover .nav-dropdown { display: none; }
    .main-nav .nav-more.open .nav-dropdown { display: block; }
}

/* ---- MOBILE (≤768px) ---- */
@media (max-width: 768px) {
    html { font-size: 15px; }

    /* Utilities */
    .site-nav-wrapper { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 9000; }
    .mobile-header-spacer { display: block; height: var(--mobile-header-h, 72px); }
    .container { padding-left: calc(18px + env(safe-area-inset-left)); padding-right: calc(18px + env(safe-area-inset-right)); }
    .hamburger { display: flex; }
    .header-search { display: none; }
    .top-bar { display: none; }
    #waf-wrap { bottom: calc(16px + env(safe-area-inset-bottom)); right: calc(16px + env(safe-area-inset-right)); }

    /* Header */
    .site-header { padding: 12px 0; }
    .site-header .container { gap: 10px; }
    .site-logo .logo-text { font-size: 20px; }
    .site-logo .logo-tagline { display: none; }
    .header-actions .btn-subscribe { padding: 7px 12px; font-size: 12px; }

    /* Breaking news */
    .breaking-news-bar { font-size: 12px; padding: 6px 0; }

    /* Hero */
    .hero-section { padding: 16px 0; }
    .hero-main .hero-image { height: 220px; }
    .hero-main h1 { font-size: 18px; line-height: 1.3; }
    .hero-main h1 a { font-size: inherit; }
    .hero-meta { font-size: 11px; gap: 8px; flex-wrap: wrap; }
    .hero-sidebar { grid-template-columns: 1fr; gap: 10px; }
    .side-post { gap: 10px; }
    .side-post img { width: 80px; height: 60px; }
    .side-post h4 { font-size: 13px; }

    /* Sections */
    .section-header { margin-bottom: 14px; }
    .section-header h2 { font-size: 16px; }
    .news-grid { grid-template-columns: 1fr; gap: 14px; }
    .news-featured .feat-image { height: 180px; }
    .news-list { gap: 12px; }
    .news-section { margin-bottom: 28px; }

    /* Trending */
    .trending-section { padding: 16px 0; }
    .trending-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .trending-card .card-body { padding: 10px; }
    .trending-card h4 { font-size: 13px; line-height: 1.35; }
    .trending-card img, .trending-card > div:first-child { height: 130px; }

    /* Content layout */
    .content-layout { gap: 20px; }
    .sidebar { grid-template-columns: 1fr; gap: 14px; }
    .sidebar-widget { padding: 16px; }
    .sidebar-widget h3 { font-size: 15px; }

    /* Article */
    .article-wrap { padding: 16px 0; }
    .article-header { padding: 0; margin-bottom: 16px; }
    .article-header h1 { font-size: 22px; line-height: 1.3; }
    .article-header .article-meta { font-size: 12px; flex-wrap: wrap; gap: 8px; }
    .article-featured-img { border-radius: 8px; margin-bottom: 18px; }
    .article-content { font-size: 15px; line-height: 1.75; }
    .article-content h2 { font-size: 20px; }
    .article-content h3 { font-size: 17px; }
    .article-content blockquote { padding: 14px 16px; font-size: 15px; }
    .share-bar { flex-wrap: wrap; gap: 8px; }
    .share-btn { padding: 7px 12px; font-size: 12px; }
    .article-tags { flex-wrap: wrap; gap: 6px; }

    /* Posts grid */
    .posts-grid { grid-template-columns: 1fr; gap: 14px; }

    /* Search page */
    .search-form-wrap input { font-size: 14px; padding: 12px 16px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .footer-brand { margin-bottom: 4px; }
    .footer-bottom { text-align: center; font-size: 12px; }
    .site-footer .footer-main { padding: 28px 0 20px; }

    /* Comments */
    .comment-form input, .comment-form textarea { font-size: 14px; }

    /* Newsletter modal */
    #newsletter-modal > div { padding: 28px 20px !important; }
}

/* ---- SMALL MOBILE (≤480px) ---- */
@media (max-width: 480px) {
    html { font-size: 14px; }
    .container { padding-left: calc(16px + env(safe-area-inset-left)); padding-right: calc(16px + env(safe-area-inset-right)); }

    /* Hero */
    .hero-main .hero-image { height: 190px; }
    .hero-main h1 { font-size: 16px; }
    .hero-overlay { padding: 12px; }
    .cat-badge { font-size: 10px; padding: 2px 8px; }

    /* Trending — single column on very small screens */
    .trending-grid { grid-template-columns: 1fr; }

    /* News list items */
    .news-list-item { grid-template-columns: 85px 1fr; gap: 10px; }
    .news-list-item img { width: 85px; height: 62px; }
    .news-list-item h4 { font-size: 13px; }

    /* Article */
    .article-header h1 { font-size: 19px; }
    .article-content { font-size: 14.5px; }

    /* Buttons */
    .share-btn { padding: 6px 10px; font-size: 11px; }
    .btn-subscribe { display: none; }

    /* Header compact */
    .site-logo .logo-text { font-size: 18px; }
    .header-actions { gap: 4px; }

    /* Widgets: stack both floating widgets so they don't overlap */
    #waf-wrap  { bottom: calc(14px + env(safe-area-inset-bottom)); right: calc(14px + env(safe-area-inset-right)); }
    #waf-btn   { width: 50px; height: 50px; }
    #waf-btn i { font-size: 25px; }
    #media-popup { bottom: calc(14px + env(safe-area-inset-bottom)); left: calc(14px + env(safe-area-inset-left)); width: calc(100vw - 28px); max-width: 300px; }
    #media-popup .waf-panel { width: 100%; }
}
