/*
Theme Name: APN News Pro
Theme URI: https://aipunjabnews.com/
Author: AI Punjab News
Author URI: https://aipunjabnews.com/
Description: A complete professional Punjabi (Gurmukhi) news theme for aipunjabnews.com — ABP-style masthead, breaking ticker, card-based sections, full Customizer options, widgets, and ad slots. Works with zero configuration.
Version: 1.0.9
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: apn-news-pro
Tags: news, newspaper, magazine, Punjabi, Gurmukhi, customizer, widgets, responsive, breaking-news
*/

/* ============================================================
   1. CSS VARIABLES & THEME TOKENS
   ============================================================ */
:root {
    --apn-red: #D92323;
    --apn-red-dark: #A81212;
    --apn-maroon: #5C0A0A;
    --apn-gold: #FF6B00;
    --apn-black: #111111;
    --apn-ink: #1a1a1a;
    --apn-grey-dark: #333333;
    --apn-grey: #666666;
    --apn-grey-light: #999999;
    --apn-border: #e5e5e5;
    --apn-bg: #f4f4f4;
    --apn-white: #ffffff;
    --apn-header-bg: #ffffff;
    --apn-nav-bg: #ffffff;
    --apn-footer-bg: #1a1a1a;
    --apn-font: 'Noto Sans Gurmukhi', 'Mukta Mahee', 'Raavi', 'Nirmala UI', Arial, sans-serif;
    --apn-radius: 6px;
    --apn-shadow: 0 2px 10px rgba(0,0,0,.08);
    --apn-shadow-lg: 0 6px 24px rgba(0,0,0,.12);
    --apn-ticker-height: 44px;
    --apn-container: 1280px;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--apn-font);
    font-size: 16px; line-height: 1.65;
    color: var(--apn-ink);
    background: var(--apn-bg);
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--apn-red); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--apn-red-dark); }
h1,h2,h3,h4,h5,h6 { line-height: 1.35; font-weight: 700; color: var(--apn-black); margin-bottom: .6em; }
p { margin-bottom: 1em; }
ul, ol { margin: 0 0 1em 1.4em; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
button { cursor: pointer; }
.screen-reader-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.clearfix::after { content: ""; display: table; clear: both; }

/* Container */
.apn-container { max-width: var(--apn-container); margin: 0 auto; padding: 0 16px; }
body.apn-boxed .apn-site-wrap { max-width: var(--apn-container); margin: 0 auto; background: var(--apn-white); box-shadow: var(--apn-shadow-lg); }
body.apn-full .apn-site-wrap { background: var(--apn-white); }

/* Skip link */
.apn-skip-link { position: absolute; left: -9999px; top: 0; background: var(--apn-red); color: #fff; padding: 10px 16px; z-index: 99999; }
.apn-skip-link:focus { left: 8px; top: 8px; color: #fff; }

/* ============================================================
   3. TOP UTILITY BAR (maroon strip)
   ============================================================ */
.apn-topbar { background: var(--apn-maroon); color: #fff; font-size: 13px; }
.apn-topbar .apn-container { display: flex; align-items: center; justify-content: space-between; min-height: 36px; gap: 12px; }
.apn-topbar-date { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.apn-topbar-date .apn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--apn-gold); display: inline-block; animation: apn-pulse 2s infinite; }
@keyframes apn-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.apn-topbar-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; }
.apn-topbar-links a { color: rgba(255,255,255,.85); padding: 6px 8px; font-size: 13px; }
.apn-topbar-links a:hover { color: #fff; }
.apn-social-icons { display: flex; gap: 6px; list-style: none; margin: 0; }
.apn-social-icons a {
    width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 13px;
}
.apn-social-icons a:hover { background: var(--apn-gold); color: #fff; }

/* ============================================================
   4. MASTHEAD (logo | leaderboard ad | search)
   ============================================================ */
.apn-masthead { background: var(--apn-header-bg); border-bottom: 1px solid var(--apn-border); }
.apn-masthead .apn-container { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.apn-logo { flex: 0 0 auto; max-width: 280px; }
.apn-logo img { max-height: 84px; width: auto; }
.apn-logo .apn-site-title { font-size: 30px; font-weight: 800; color: var(--apn-red); line-height: 1.1; }
.apn-logo .apn-site-title span { color: var(--apn-maroon); }
.apn-logo .apn-tagline { font-size: 12px; color: var(--apn-grey); margin-top: 2px; }
.apn-masthead-ad { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.apn-masthead-ad .apn-ad-leaderboard { max-width: 728px; width: 100%; }
.apn-masthead-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.apn-search-toggle {
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--apn-border);
    background: #fff; color: var(--apn-ink); font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center; transition: all .2s;
}
.apn-search-toggle:hover { border-color: var(--apn-red); color: var(--apn-red); }

/* Search overlay */
.apn-search-overlay {
    position: fixed; inset: 0; background: rgba(17,17,17,.92); z-index: 99990;
    display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh;
    opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.apn-search-overlay.apn-open { opacity: 1; visibility: visible; }
.apn-search-overlay form { width: min(640px, 90vw); display: flex; gap: 0; }
.apn-search-overlay input[type="search"] {
    flex: 1; padding: 16px 20px; font-size: 18px; border: none; border-radius: 8px 0 0 8px; outline: none;
}
.apn-search-overlay button[type="submit"] {
    background: var(--apn-red); color: #fff; border: none; padding: 0 28px;
    font-size: 16px; font-weight: 700; border-radius: 0 8px 8px 0;
}
.apn-search-overlay button[type="submit"]:hover { background: var(--apn-red-dark); }
.apn-search-close { position: absolute; top: 24px; right: 32px; background: none; border: none; color: #fff; font-size: 34px; line-height: 1; }

/* ============================================================
   5. PRIMARY NAVIGATION (sticky white bar)
   ============================================================ */
.apn-nav { background: var(--apn-nav-bg); border-top: 3px solid var(--apn-red); border-bottom: 1px solid var(--apn-border); position: relative; z-index: 900; }
.apn-nav.apn-sticky { position: sticky; top: 0; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.apn-nav .apn-container { display: flex; align-items: center; justify-content: space-between; }
.apn-nav-menu { display: flex; list-style: none; margin: 0; padding: 0; }
.apn-nav-menu > li { position: relative; }
.apn-nav-menu > li > a {
    display: block; padding: 14px 16px; font-size: 15px; font-weight: 700; color: var(--apn-ink);
    text-transform: none; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.apn-nav-menu > li > a:hover, .apn-nav-menu > li.current-menu-item > a {
    color: var(--apn-red); border-bottom-color: var(--apn-red);
}
.apn-nav-menu .sub-menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff;
    box-shadow: var(--apn-shadow-lg); list-style: none; margin: 0; padding: 8px 0; border-top: 3px solid var(--apn-red); z-index: 950;
}
.apn-nav-menu li:hover > .sub-menu, .apn-nav-menu li:focus-within > .sub-menu { display: block; }
.apn-nav-menu .sub-menu a { display: block; padding: 10px 18px; font-size: 14px; color: var(--apn-ink); font-weight: 400; }
.apn-nav-menu .sub-menu a:hover { background: #f8f8f8; color: var(--apn-red); }
.apn-hamburger { display: none; background: none; border: none; padding: 12px; }
.apn-hamburger span { display: block; width: 26px; height: 3px; background: var(--apn-ink); margin: 5px 0; border-radius: 2px; transition: .25s; }
.apn-nav-cta { flex: 0 0 auto; }
.apn-live-badge {
    display: inline-flex; align-items: center; gap: 6px; background: var(--apn-red); color: #fff;
    font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .5px;
}
.apn-live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: apn-pulse 1.4s infinite; }

/* Mobile drawer nav */
.apn-mobile-drawer {
    position: fixed; top: 0; left: -320px; width: 300px; max-width: 85vw; height: 100vh;
    background: #fff; z-index: 99995; transition: left .3s ease; overflow-y: auto; box-shadow: var(--apn-shadow-lg);
}
.apn-mobile-drawer.apn-open { left: 0; }
.apn-mobile-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--apn-border); background: var(--apn-maroon); color: #fff; }
.apn-mobile-drawer-header button { background: none; border: none; color: #fff; font-size: 26px; }
.apn-mobile-drawer .apn-nav-menu { flex-direction: column; }
.apn-mobile-drawer .apn-nav-menu > li > a { border-bottom: 1px solid var(--apn-border); margin: 0; }
.apn-mobile-drawer .sub-menu { position: static; display: block; box-shadow: none; border: none; padding: 0 0 0 16px; }
.apn-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99994; opacity: 0; visibility: hidden; transition: .25s; }
.apn-drawer-overlay.apn-open { opacity: 1; visibility: visible; }

/* ============================================================
   6. BREAKING NEWS TICKER
   ============================================================ */
.apn-breaking { background: var(--apn-black); color: #fff; overflow: hidden; }
.apn-breaking .apn-container { display: flex; align-items: stretch; padding: 0 16px; }
.apn-breaking-label {
    flex: 0 0 auto; display: flex; align-items: center; gap: 8px; background: var(--apn-red);
    color: #fff; font-weight: 800; font-size: 14px; padding: 0 18px; min-height: var(--apn-ticker-height);
    clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); padding-right: 28px; z-index: 2;
}
.apn-breaking-label .apn-bolt { font-size: 16px; }
.apn-ticker-viewport { flex: 1 1 auto; overflow: hidden; position: relative; min-width: 0; }
.apn-ticker-track { display: flex; align-items: center; height: var(--apn-ticker-height); width: max-content; animation: apn-ticker var(--apn-ticker-speed, 45s) linear infinite; }
.apn-breaking:hover .apn-ticker-track { animation-play-state: paused; }
.apn-ticker-track a { color: #fff; font-size: 14px; padding: 0 8px; white-space: nowrap; }
.apn-ticker-track a:hover { color: var(--apn-gold); }
.apn-ticker-sep { color: var(--apn-red); font-weight: 700; padding: 0 4px; }
@keyframes apn-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   7. HERO SECTION
   ============================================================ */
.apn-hero { padding: 24px 0 8px; }
.apn-hero-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, 1fr); gap: 14px; min-height: 460px; }
.apn-hero-main { grid-row: 1 / 3; }
.apn-hero .apn-card { height: 100%; min-height: 0; }

/* ============================================================
   8. SECTION HEADERS (📰 style)
   ============================================================ */
.apn-section { padding: 26px 0 6px; }
.apn-section-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-bottom: 2px solid var(--apn-border); margin-bottom: 18px; padding-bottom: 10px;
}
.apn-section-title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 22px; }
.apn-section-title .apn-emoji { font-size: 24px; }
.apn-section-title .apn-cat-label {
    background: var(--apn-red); color: #fff; font-size: 15px; font-weight: 700;
    padding: 6px 16px; border-radius: 4px; line-height: 1.4;
}
.apn-section-title .apn-cat-label:hover { background: var(--apn-red-dark); color: #fff; }
.apn-view-all { font-size: 13px; font-weight: 700; color: var(--apn-grey); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.apn-view-all:hover { color: var(--apn-red); }

/* ============================================================
   9. CARDS — shared thumbnail handling (NEVER empty)
   ============================================================ */
.apn-card { background: #fff; border-radius: var(--apn-radius); overflow: hidden; box-shadow: var(--apn-shadow); transition: transform .2s ease, box-shadow .2s ease; position: relative; }
.apn-card:hover { transform: translateY(-3px); box-shadow: var(--apn-shadow-lg); }
.apn-card a.apn-card-link { display: block; color: inherit; height: 100%; }
/* Thumbnail wrapper: fixed aspect ratio, object-fit cover, gradient fallback */
.apn-thumb { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--apn-maroon) 0%, var(--apn-red-dark) 60%, var(--apn-red) 100%); }
.apn-thumb.ratio-16x9 { aspect-ratio: 16 / 9; }
.apn-thumb.ratio-4x3 { aspect-ratio: 4 / 3; }
.apn-thumb.ratio-1x1 { aspect-ratio: 1 / 1; }
.apn-thumb.ratio-3x2 { aspect-ratio: 3 / 2; }
.apn-thumb.ratio-190x100 { aspect-ratio: 1200 / 630; }
.apn-thumb.ratio-3x4 { aspect-ratio: 3 / 4; }
.apn-thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .35s ease; }
/* Web story cards: contain (portrait posters must not be cropped) */
.apn-video-strip .apn-thumb img { object-fit: contain; }
.apn-card:hover .apn-thumb img { transform: scale(1.05); }
/* Styled placeholder when a post has NO featured image — never an empty box */
.apn-thumb-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: rgba(255,255,255,.92); text-align: center; padding: 12px; }
.apn-thumb-placeholder .apn-watermark { font-size: 34px; font-weight: 800; letter-spacing: 2px; opacity: .9; line-height: 1; }
.apn-thumb-placeholder .apn-watermark-sub { font-size: 11px; opacity: .75; letter-spacing: 1px; }
.apn-thumb-placeholder::before {
    content: ""; position: absolute; inset: 0; opacity: .25;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.5), transparent 55%), radial-gradient(circle at 85% 80%, rgba(255,255,255,.35), transparent 50%);
}
.apn-cat-badge {
    position: absolute; top: 10px; left: 10px; z-index: 3; background: var(--apn-red); color: #fff;
    font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 3px; text-transform: none; line-height: 1.5;
}
.apn-cat-badge:hover { color: #fff; background: var(--apn-red-dark); }
.apn-card-body { padding: 14px 16px 16px; }
.apn-card-title { font-size: 16px; margin: 0 0 8px; line-height: 1.45; }
.apn-card-title a { color: var(--apn-ink); }
.apn-card-title a:hover { color: var(--apn-red); }
.apn-card-excerpt { font-size: 13.5px; color: var(--apn-grey); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.apn-card-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--apn-grey-light); }
.apn-card-meta .apn-meta-item { display: inline-flex; align-items: center; gap: 4px; }

/* Card: HERO (big) */
.apn-card-hero .apn-thumb { height: 100%; min-height: 380px; }
.apn-card-hero .apn-card-caption {
    position: absolute; inset: auto 0 0 0; padding: 60px 20px 18px; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,.85) 20%, rgba(0,0,0,0) 100%); color: #fff;
}
.apn-card-hero .apn-card-title { font-size: 26px; }
.apn-card-hero .apn-card-title a { color: #fff; }
.apn-card-hero .apn-card-title a:hover { color: var(--apn-gold); }
.apn-card-hero .apn-card-meta { color: rgba(255,255,255,.8); }

/* Card: STANDARD */
.apn-grid { display: grid; gap: 18px; }
.apn-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.apn-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.apn-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* Card: SMALL (horizontal) */
.apn-card-small { display: flex; gap: 14px; background: #fff; border-radius: var(--apn-radius); overflow: hidden; box-shadow: var(--apn-shadow); padding: 12px; align-items: center; }
.apn-card-small .apn-thumb { flex: 0 0 140px; width: 140px; border-radius: 6px; }
/* Small thumbs use 16:9 to avoid red bands (contain on square left dead space) */
.apn-card-small .apn-card-title { font-size: 14px; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.apn-list-small { display: flex; flex-direction: column; gap: 12px; }

/* Card: OVERLAY */
.apn-card-overlay .apn-thumb { height: 100%; min-height: 240px; }
.apn-card-overlay .apn-card-caption {
    position: absolute; inset: auto 0 0 0; padding: 70px 16px 16px; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.75) 45%, rgba(0,0,0,0) 100%); color: #fff;
}
.apn-card-overlay .apn-card-title { font-size: 17px; }
.apn-card-overlay .apn-card-title a { color: #fff; }
.apn-card-overlay .apn-card-title a:hover { color: var(--apn-gold); }

/* Card: STORY (vertical web story, clean — poster has its own title) */
.apn-card-story .apn-thumb { border-radius: var(--apn-radius); }
.apn-card-story .apn-thumb img { object-fit: cover; }
.apn-story-play {
    position: absolute; bottom: 12px; right: 12px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(217, 35, 35, .92); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; z-index: 2; pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    transition: transform .25s ease;
}
.apn-card-story:hover .apn-story-play { transform: scale(1.12); }

/* Card: HERO-SIDE (clean vertical for hero grid — thumb top, title below on white) */
.apn-card-hero-side { background: #fff; border-radius: var(--apn-radius); overflow: hidden; box-shadow: var(--apn-shadow); display: flex; flex-direction: column; height: 100%; }
.apn-card-hero-side .apn-thumb { border-radius: 0; }
.apn-card-hero-side .apn-card-body { padding: 12px 14px; flex: 1; }
.apn-card-hero-side .apn-card-title { font-size: 14px; line-height: 1.5; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.apn-card-hero-side .apn-card-title a { color: var(--apn-ink); }
.apn-card-hero-side .apn-card-meta { font-size: 12px; color: var(--apn-muted); }

/* Card: FEAT-H (featured horizontal — medium thumb left, content right) */
.apn-card-feat-h { display: flex; gap: 20px; background: #fff; border-radius: var(--apn-radius); overflow: hidden; box-shadow: var(--apn-shadow); padding: 18px; align-items: flex-start; }
.apn-card-feat-h .apn-card-thumb-link { flex: 0 0 42%; max-width: 42%; display: block; }
.apn-card-feat-h .apn-thumb { border-radius: calc(var(--apn-radius) - 4px); }
.apn-card-feat-h-body { flex: 1; min-width: 0; }
.apn-card-feat-h-body .apn-cat-badge { position: static; display: inline-block; margin-bottom: 10px; }
.apn-card-feat-h .apn-card-title { font-size: 21px; line-height: 1.45; margin: 0 0 10px; }
.apn-card-feat-h .apn-card-title a { color: var(--apn-ink); }
.apn-card-feat-h .apn-card-title a:hover { color: var(--apn-red); }
.apn-card-feat-h .apn-card-excerpt { color: var(--apn-muted); font-size: 14px; line-height: 1.6; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Category section: featured horizontal on top, small cards grid below */
.apn-cat-feat-wrap .apn-card-feat-h { margin-bottom: 18px; }
.apn-cat-small-grid { margin-top: 0; }

/* Card: LIST (numbered / text rows) */
.apn-card-list { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--apn-border); align-items: flex-start; }
.apn-card-list:last-child { border-bottom: none; }
.apn-card-list .apn-list-num {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--apn-red); color: #fff;
    font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
}
.apn-card-list .apn-card-title { font-size: 15px; margin: 0 0 4px; }

/* ============================================================
   10. LAYOUT: content + sidebar
   ============================================================ */
.apn-layout { display: grid; grid-template-columns: 1fr 320px; gap: 26px; padding: 26px 0 10px; align-items: start; }
.apn-layout.sidebar-left { grid-template-columns: 320px 1fr; }
.apn-layout.sidebar-left .apn-sidebar { order: -1; }
.apn-layout.no-sidebar { grid-template-columns: 1fr; }
.apn-layout.no-sidebar .apn-sidebar { display: none; }
.apn-main { min-width: 0; }
.apn-sidebar { min-width: 0; }
.apn-icon-rail { display: none; } /* optional left icon rail on very wide screens via body class */
body.apn-has-rail .apn-layout { grid-template-columns: 56px 1fr 320px; }
body.apn-has-rail .apn-icon-rail { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 120px; }
.apn-icon-rail a { width: 44px; height: 44px; border-radius: 10px; background: #fff; box-shadow: var(--apn-shadow); display: inline-flex; align-items: center; justify-content: center; font-size: 20px; color: var(--apn-grey); }
.apn-icon-rail a:hover { background: var(--apn-red); color: #fff; }

/* ============================================================
   11. SIDEBAR WIDGETS
   ============================================================ */
.apn-widget { background: #fff; border-radius: var(--apn-radius); box-shadow: var(--apn-shadow); margin-bottom: 22px; overflow: hidden; }
.apn-widget-title {
    font-size: 16px; margin: 0; padding: 12px 16px; border-bottom: 2px solid var(--apn-red);
    display: flex; align-items: center; gap: 8px;
}
.apn-widget-title::before { content: ""; width: 5px; height: 18px; background: var(--apn-red); border-radius: 2px; display: inline-block; }
.apn-widget-body { padding: 14px 16px 16px; }
.apn-widget ul { list-style: none; margin: 0; padding: 0; }
/* Trending tabs widget */
.apn-tabs { display: flex; border-bottom: 2px solid var(--apn-border); margin: 0 0 12px; }
.apn-tabs button { flex: 1; background: none; border: none; padding: 10px 4px; font-size: 13px; font-weight: 700; color: var(--apn-grey); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.apn-tabs button.apn-active { color: var(--apn-red); border-bottom-color: var(--apn-red); }
.apn-tab-panel { display: none; }
.apn-tab-panel.apn-active { display: block; }
/* Social counter */
.apn-social-counter { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.apn-social-counter a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--apn-radius); color: #fff; font-size: 13px; font-weight: 700; }
.apn-social-counter .apn-sc-fb { background: #1877F2; } .apn-social-counter .apn-sc-tw { background: #111; }
.apn-social-counter .apn-sc-yt { background: #FF0000; } .apn-social-counter .apn-sc-ig { background: linear-gradient(45deg,#F58529,#DD2A7B,#8134AF); }
.apn-social-counter a:hover { color: #fff; opacity: .9; }
/* Newsletter */
.apn-newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.apn-newsletter-form input[type="email"] { padding: 12px; border: 1px solid var(--apn-border); border-radius: var(--apn-radius); }
.apn-newsletter-form button { background: var(--apn-red); color: #fff; border: none; padding: 12px; border-radius: var(--apn-radius); font-weight: 700; }
.apn-newsletter-form button:hover { background: var(--apn-red-dark); }
.apn-privacy-note { font-size: 11.5px; color: var(--apn-grey-light); margin: 0; }

/* ============================================================
   12. AD SLOTS
   ============================================================ */
.apn-ad-slot { text-align: center; margin: 18px 0; overflow: hidden; }
.apn-ad-slot .apn-ad-label { display: block; font-size: 10px; letter-spacing: 2px; color: var(--apn-grey-light); text-transform: uppercase; margin-bottom: 6px; }
.apn-ad-slot img { margin: 0 auto; }
.apn-ad-leaderboard { min-height: 90px; display: flex; align-items: center; justify-content: center; background: #fafafa; border: 1px dashed var(--apn-border); border-radius: 4px; }

/* ============================================================
   13. SINGLE ARTICLE
   ============================================================ */
.apn-article { background: #fff; border-radius: var(--apn-radius); box-shadow: var(--apn-shadow); padding: 28px 30px; }
.apn-article-header { margin-bottom: 18px; }
.apn-article-title { font-size: 32px; line-height: 1.35; margin: 10px 0 14px; }
.apn-article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: var(--apn-grey); padding: 12px 0; border-top: 1px solid var(--apn-border); border-bottom: 1px solid var(--apn-border); margin-bottom: 18px; }
.apn-article-meta .apn-author-avatar { width: 36px; height: 36px; border-radius: 50%; }
.apn-article-meta .apn-by { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--apn-ink); }
.apn-meta-pill { display: inline-flex; align-items: center; gap: 5px; background: #f4f4f4; padding: 4px 10px; border-radius: 20px; }
.apn-featured-img { margin: 0 0 22px; border-radius: var(--apn-radius); overflow: hidden; }
.apn-featured-img .apn-thumb { border-radius: var(--apn-radius); }
.apn-featured-img figcaption { font-size: 12.5px; color: var(--apn-grey); padding: 8px 4px 0; }
.apn-article-content { font-size: 17px; line-height: 1.85; }
.apn-article-content h2 { font-size: 23px; margin: 1.4em 0 .7em; padding-left: 12px; border-left: 4px solid var(--apn-red); }
.apn-article-content h3 { font-size: 20px; margin: 1.3em 0 .6em; }
.apn-article-content img { border-radius: var(--apn-radius); margin: 1.2em 0; }
.apn-article-content blockquote { border-left: 4px solid var(--apn-gold); background: #fff8f0; padding: 14px 18px; margin: 1.2em 0; border-radius: 0 6px 6px 0; }
.apn-article-content a { font-weight: 600; }
.apn-article-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 15px; }
.apn-article-content th, .apn-article-content td { border: 1px solid var(--apn-border); padding: 10px 12px; text-align: left; }
.apn-article-content th { background: #f8f8f8; }
/* Share buttons */
.apn-share { display: flex; align-items: center; gap: 10px; margin: 22px 0; padding: 14px 0; border-top: 1px solid var(--apn-border); border-bottom: 1px solid var(--apn-border); }
.apn-share-label { font-weight: 700; font-size: 14px; }
.apn-share a { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.apn-share .apn-sh-fb { background: #1877F2; } .apn-share .apn-sh-tw { background: #111; }
.apn-share .apn-sh-wa { background: #25D366; } .apn-share .apn-sh-tg { background: #229ED9; }
.apn-share a:hover { color: #fff; transform: translateY(-2px); }
/* Tags */
.apn-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.apn-tags a { font-size: 13px; background: #f4f4f4; padding: 6px 14px; border-radius: 20px; color: var(--apn-grey-dark); }
.apn-tags a:hover { background: var(--apn-red); color: #fff; }
/* Author box */
.apn-author-box { display: flex; gap: 18px; background: #fafafa; border: 1px solid var(--apn-border); border-radius: var(--apn-radius); padding: 20px; margin: 24px 0; }
.apn-author-box img { width: 84px; height: 84px; border-radius: 50%; flex: 0 0 84px; }
.apn-author-box h4 { margin: 0 0 6px; font-size: 17px; }
.apn-author-box p { font-size: 14px; color: var(--apn-grey); margin: 0; }
/* Prev / Next */
.apn-post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.apn-post-nav a { background: #fff; border: 1px solid var(--apn-border); border-radius: var(--apn-radius); padding: 14px 16px; display: block; box-shadow: var(--apn-shadow); }
.apn-post-nav a:hover { border-color: var(--apn-red); }
.apn-post-nav .apn-nav-label { font-size: 12px; color: var(--apn-grey-light); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 4px; }
.apn-post-nav .apn-nav-title { font-size: 15px; font-weight: 700; color: var(--apn-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.apn-post-nav .apn-next { text-align: right; }
/* Related posts */
.apn-related { margin: 28px 0 0; }
.apn-related .apn-grid { margin-top: 4px; }
/* Comments */
.apn-comments { background: #fff; border-radius: var(--apn-radius); box-shadow: var(--apn-shadow); padding: 24px 26px; margin-top: 24px; }
.apn-comments .comment-list { list-style: none; margin: 0; }
.apn-comments .comment { border-bottom: 1px solid var(--apn-border); padding: 14px 0; }
.apn-comments .comment:last-child { border-bottom: none; }

/* ============================================================
   14. ARCHIVE / SEARCH / PAGE HEADERS
   ============================================================ */
.apn-archive-header { background: #fff; border-radius: var(--apn-radius); box-shadow: var(--apn-shadow); padding: 22px 26px; margin-bottom: 20px; border-left: 5px solid var(--apn-red); }
.apn-archive-header h1 { font-size: 26px; margin: 0 0 6px; }
.apn-archive-header .apn-archive-desc { color: var(--apn-grey); font-size: 14.5px; margin: 0; }
.apn-archive-header .apn-archive-count { font-size: 13px; color: var(--apn-grey-light); }
.apn-archive-featured { margin-bottom: 20px; }
.apn-no-results { background: #fff; border-radius: var(--apn-radius); box-shadow: var(--apn-shadow); padding: 40px 30px; text-align: center; }
.apn-no-results h2 { font-size: 24px; }
.apn-no-results form { max-width: 480px; margin: 18px auto 0; display: flex; }
.apn-no-results input[type="search"] { flex: 1; padding: 12px 16px; border: 1px solid var(--apn-border); border-radius: 6px 0 0 6px; }
.apn-no-results button { background: var(--apn-red); color: #fff; border: none; padding: 0 22px; border-radius: 0 6px 6px 0; font-weight: 700; }
.apn-search-term { background: #fff3e0; color: var(--apn-red-dark); padding: 2px 10px; border-radius: 4px; }

/* Breadcrumbs */
.apn-breadcrumbs { font-size: 13px; color: var(--apn-grey); margin-bottom: 14px; }
.apn-breadcrumbs a { color: var(--apn-grey); }
.apn-breadcrumbs a:hover { color: var(--apn-red); }
.apn-breadcrumbs .apn-sep { margin: 0 8px; color: var(--apn-grey-light); }
.apn-breadcrumbs .apn-current { color: var(--apn-ink); font-weight: 600; }

/* Pagination */
.apn-pagination { display: flex; justify-content: center; gap: 8px; margin: 28px 0 10px; flex-wrap: wrap; }
.apn-pagination .page-numbers { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--apn-border); border-radius: 6px; font-weight: 700; color: var(--apn-ink); padding: 0 12px; }
.apn-pagination .page-numbers:hover { border-color: var(--apn-red); color: var(--apn-red); }
.apn-pagination .page-numbers.current { background: var(--apn-red); border-color: var(--apn-red); color: #fff; }

/* ============================================================
   15. FOOTER
   ============================================================ */
.apn-footer { background: var(--apn-footer-bg); color: #ccc; margin-top: 40px; }
.apn-footer-top { padding: 44px 0 30px; }
.apn-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.apn-footer h3.apn-footer-title { color: #fff; font-size: 16px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--apn-red); display: inline-block; }
.apn-footer-about img { max-height: 60px; margin-bottom: 12px; }
.apn-footer-about p { font-size: 13.5px; color: #aaa; }
.apn-footer ul { list-style: none; margin: 0; }
.apn-footer ul li { margin-bottom: 2px; }
.apn-footer ul a { color: #aaa; font-size: 14px; padding: 5px 0; display: inline-block; }
.apn-footer ul a:hover { color: var(--apn-gold); padding-left: 4px; }
.apn-footer .apn-social-icons a { width: 36px; height: 36px; font-size: 16px; }
.apn-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 16px 0; font-size: 13px; color: #888; }
.apn-footer-bottom .apn-container { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.apn-footer-bottom a { color: #aaa; }
.apn-footer-bottom a:hover { color: var(--apn-gold); }
/* Back to top */
.apn-back-top {
    position: fixed; right: 22px; bottom: 22px; width: 46px; height: 46px; border-radius: 50%;
    background: var(--apn-red); color: #fff; border: none; font-size: 20px; z-index: 9000;
    box-shadow: var(--apn-shadow-lg); opacity: 0; visibility: hidden; transition: .25s;
    display: inline-flex; align-items: center; justify-content: center;
}
.apn-back-top.apn-show { opacity: 1; visibility: visible; }
.apn-back-top:hover { background: var(--apn-red-dark); }

/* ============================================================
   16. VIDEO / WEB-STORY STRIP
   ============================================================ */
.apn-video-strip { background: var(--apn-black); border-radius: var(--apn-radius); padding: 22px; margin: 10px 0; }
.apn-video-strip .apn-section-title { color: #fff; }
.apn-video-strip .apn-section-header { border-bottom-color: rgba(255,255,255,.15); }
.apn-video-strip .apn-view-all { color: #ccc; }
.apn-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(217,35,35,.92); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; z-index: 3; border: 3px solid rgba(255,255,255,.85); }

/* ============================================================
   17. RESPONSIVE BREAKPOINTS
   ============================================================ */
/* Laptop 992–1199 */
@media (max-width: 1199px) {
    .apn-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
    .apn-masthead .apn-container { gap: 14px; }
}
/* Tablet 768–991 */
@media (max-width: 991px) {
    .apn-masthead .apn-container { flex-wrap: wrap; }
    .apn-masthead-ad { order: 3; flex: 1 1 100%; }
    .apn-hero-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; min-height: 0; }
    .apn-hero-main { grid-row: auto; grid-column: 1 / -1; }
    .apn-hero-main .apn-thumb { min-height: 300px; }
    .apn-layout, .apn-layout.sidebar-left, body.apn-has-rail .apn-layout { grid-template-columns: 1fr; }
    .apn-layout.sidebar-left .apn-sidebar { order: 0; }
    .apn-icon-rail { display: none !important; }
    .apn-grid.cols-4, .apn-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
    .apn-footer-grid { grid-template-columns: 1fr 1fr; }
    .apn-article { padding: 22px; }
    .apn-article-title { font-size: 27px; }
}
/* Mobile <768 */
/* Mobile bottom nav — hidden on desktop, shown on mobile via media query */
.apn-mobile-nav { display: none; }

@media (max-width: 767px) {
    body { font-size: 15px; padding-bottom: 64px; }
    .apn-topbar .apn-topbar-links { display: none; }
    .apn-hamburger { display: block; }
    .apn-nav .apn-nav-menu { display: none; }
    .apn-nav .apn-container { justify-content: space-between; min-height: 52px; }
    .apn-logo img { max-height: 56px; }
    .apn-logo { max-width: 200px; }
    .apn-masthead-ad { display: none; } /* hide leaderboard on small phones; ad widget areas still render inline */
    .apn-breaking-label { font-size: 12px; padding: 0 12px; padding-right: 22px; }
    .apn-hero-grid { grid-template-columns: 1fr; }
    .apn-hero-main .apn-thumb { min-height: 240px; }
    .apn-card-hero .apn-card-title { font-size: 20px; }
    .apn-grid.cols-4, .apn-grid.cols-3, .apn-grid.cols-2 { grid-template-columns: 1fr; }
    .apn-section-title { font-size: 18px; }
    .apn-layout { gap: 18px; }
    .apn-article { padding: 16px; }
    .apn-article-title { font-size: 23px; }
    .apn-article-content { font-size: 16px; }
    .apn-post-nav { grid-template-columns: 1fr; }
    .apn-footer-grid { grid-template-columns: 1fr; }
    .apn-author-box { flex-direction: column; }
    .apn-card-small .apn-thumb { flex-basis: 120px; width: 120px; }
    .apn-search-overlay form { width: 92vw; }

    /* ============ NATIVE APP FEEL ============ */
    /* Bottom navigation bar */
    .apn-mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
        background: #fff; border-top: 1px solid var(--apn-border);
        box-shadow: 0 -2px 12px rgba(0,0,0,.08);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .apn-mobile-nav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
        padding: 8px 4px; color: var(--apn-muted); text-decoration: none;
        font-size: 11px; font-weight: 600; min-height: 48px; justify-content: center;
    }
    .apn-mobile-nav a .apn-mnav-icon { font-size: 22px; line-height: 1; }
    .apn-mobile-nav a.active, .apn-mobile-nav a:hover { color: var(--apn-red); }

    /* App-style sticky header */
    .apn-site-header { position: sticky; top: 0; z-index: 998; }

    /* Hero side cards: 2-col grid on mobile */
    .apn-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .apn-hero-main { grid-column: 1 / -1; }

    /* Featured horizontal: stack on mobile */
    .apn-card-feat-h { flex-direction: column; padding: 14px; gap: 14px; }
    .apn-card-feat-h .apn-card-thumb-link { flex: none; max-width: 100%; }
    .apn-card-feat-h .apn-card-title { font-size: 18px; }

    /* Web stories: horizontal swipe */
    .apn-video-strip .apn-grid.cols-3 {
        display: flex; overflow-x: auto; gap: 12px; padding-bottom: 8px;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .apn-video-strip .apn-grid.cols-3::-webkit-scrollbar { display: none; }
    .apn-video-strip .apn-card-story { flex: 0 0 160px; width: 160px; }

    /* Larger touch targets */
    .apn-card-title a { padding: 4px 0; display: inline-block; }
    .apn-view-all { padding: 10px 16px; min-height: 44px; display: inline-flex; align-items: center; }

    /* Back to top above bottom nav */
    .apn-back-top { bottom: 76px; }

    /* Hide desktop-only elements */
    .apn-sidebar { margin-top: 8px; }
}

/* ============================================================
   18. PRINT
   ============================================================ */
@media print {
    .apn-topbar, .apn-nav, .apn-breaking, .apn-sidebar, .apn-footer, .apn-share,
    .apn-ad-slot, .apn-back-top, .apn-search-overlay, .apn-mobile-drawer, .apn-related, .apn-comments { display: none !important; }
    body { background: #fff; font-size: 12pt; }
    .apn-article { box-shadow: none; padding: 0; }
    .apn-layout { display: block; }
    a { color: #000; text-decoration: none; }
}
