/* styles.css */
* { box-sizing: border-box; }

@font-face { font-family: 'FiveTwoFive'; src: url('/media/fonts/521.woff2') format('woff2'), url('/media/fonts/521.woff') format('woff'); font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/media/fonts/gotham-black-webfont.woff2') format('woff2'), url('/media/fonts/gothamblack.woff') format('woff'); font-weight: 900; font-display: swap; }

/* Section and content headers: Gotham */
h1, h2, h3, h4, h5, h6 { font-family: Gotham, sans-serif; }

/* --- HEADER STYLES --- */
.header { padding: 350px 50px 50px 50px !important; background-color: rgba(0, 40, 85, 0.8) !important; border-bottom: 5px solid #000; background-image: url('/images/header-bg-v3.jpg') !important; background-size: cover !important; background-position: center center !important; background-repeat: no-repeat !important; position: relative !important; }
.header::before { content: ''; position: absolute; inset: 0; background-color: rgba(0, 0, 0, 0.4) !important; z-index: 0; pointer-events: none; }
.header > *:not(.header-fog) { position: relative; z-index: 1; }
.header-outside { margin-top: -210px; }

/* --- RED STORY HIGHLIGHT --- */
.is-red-text {
    color: #ff5555 !important; /* Only color and font-weight for generic red text */
    font-weight: 300;
}

/* Specific styling for topleftcorner stories that are red or urgent */
.top-left .story-item a.topleft-styled-red {
    background-color: #081426; /* Dark background */
    display: block; /* Ensures block-level styling */
    padding: 10px; /* Internal padding */
    border-radius: 4px; /* Rounded corners */
    border-left: 3px solid #ff4444; /* Left border highlight */
    color: white !important; /* Default white text for topleft styled items */
    margin-top: 5px; /* Spacing from elements above */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Subtle shadow */
    width: fit-content; /* Adjusts width to content */
    max-width: 100%; /* Ensures it doesn\'t overflow */
}

.top-left .story-item a.topleft-styled-red:hover {
    background: none !important;
    text-decoration: none !important;
}
/* Ensure red text is red even with topleft-styled-red background */
.top-left .story-item a.topleft-styled-red.is-red-text {
    color: #ff5555 !important;
}

.is-red-text:hover {
    background: none !important;
    text-decoration: none !important;
}

/* --- SECTION DIVIDERS --- */
section {
    position: relative;
}
section:not(.last)::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.3) 20%, rgba(255,255,255,0.3) 80%, transparent 100%);
    margin: 40px 0;
    position: relative;
}
section:not(.last)::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.3) 20%, rgba(0,0,0,0.3) 80%, transparent 100%);
    margin: -41px 0 0 0;
    position: relative;
}
section.section-top::after,
section.section-top::before {
    margin-top: 20px;
    margin-bottom: 20px;
}
/* Remove dividers before section-stories (masonry) and before section-four-pack */
section.section-stories::after,
section.section-stories::before {
    display: none;
}

/* No background hover on story links anywhere */
.story-item a:hover,
.story-item.has-image a:hover,
.left-column a:hover,
.center-column a:hover,
.right-column a:hover,
.headline .story-item a:hover,
.headline .story-wrapper a:hover,
.in-focus-item a:hover,
.four-pack .story-item.pack-item a:hover,
.top-left .story-item a:hover {
    background: none !important;
    background-color: transparent !important;
}

/* --- SECTION DIVIDERS --- */
section {
    position: relative;
}
section:not(.last)::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.3) 20%, rgba(255,255,255,0.3) 80%, transparent 100%);
    margin: 40px 0;
    position: relative;
}
section:not(.last)::before {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent 0%, rgba(0,0,0,0.3) 20%, rgba(0,0,0,0.3) 80%, transparent 100%);
    margin: -41px 0 0 0;
    position: relative;
}
section.section-top::after,
section.section-top::before {
    margin-top: 20px;
    margin-bottom: 20px;
}
/* Remove dividers before section-stories (masonry) and before section-four-pack */
section.section-stories::after,
section.section-stories::before {
    display: none;
}

/* --- IN FOCUS (MOBILE ONLY) --- */
/* In Focus Section Styles */
.infocus-section {
    display: block;
}
.in-focus-header {
    font-family: Gotham, sans-serif;
}
.in-focus-subtext {
    padding: 10px 0 10px 0;
}
/* Hide In Focus toggle icon on desktop; show on mobile (responsive.css) */
@media (min-width: 769px) {
    .in-focus-header .in-focus-toggle-icon { display: none; }
}

.mobile-in-focus-section {
    display: block;
    background: #fffafa;
    border: 1px dotted #e53e3e;
    padding: 15px 20px;
    margin-bottom: 0px;
    border-radius: 5px;
}
/* Fine dotted divider between In Focus stories (desktop and mobile); distinct from column solid borders */
.in-focus-item {
    border-bottom: 1px dotted #bbb;
    padding-bottom: 10px;
    margin-bottom: 10px;
}
.in-focus-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.in-focus-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* --- WEATHER IN HEADER --- */
.header-weather {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 10;
    padding: 12px 20px 12px 0;
}
.weather-item {
    min-height: 36px;
}
.weather-chiclet { display: flex; align-items: center; gap: 8px; transition: transform 0.2s ease; cursor: pointer; }
.weather-chiclet:hover { transform: translateY(-2px); }

.weather-icon-box {
    width: 28px; height: 28px; border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 22px;
    background: none; /* Explicitly remove background */
    border: none; /* Explicitly remove border */
}

.weather-info { display: flex; flex-direction: column; line-height: 1; text-align: left; }
.weather-loc { font-size: 0.65rem; text-transform: uppercase; color: rgba(255,255,255,0.8); letter-spacing: 0.5px; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.weather-temp { font-size: 0.9rem; color: #fff; font-weight: bold; text-shadow: 0 1px 2px rgba(0,0,0,0.8); }

/* --- SECTOR DROPDOWN (original colors; military pulse icon; click open/close) --- */
.sector-dropdown {
    position: relative;
    z-index: 1100;
    flex-shrink: 0;
    align-self: center;
    font-family: Gotham, sans-serif;
    width: fit-content;
    max-width: 200px;
}
.sector-dropdown-trigger {
    outline: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    width: auto;
    border: 0px solid rgba(255, 255, 255, 0.35);
    border-radius: 4px;
    box-sizing: border-box;
    padding: 10px 12px;
    color: #2eb31a;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    box-shadow: none;
    background: transparent;
}
.sector-dropdown-trigger:hover {
    color: #2eb31a;
}
.sector-dropdown.open .sector-dropdown-trigger {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
}
.sector-dropdown-icon {
    font-size: 20px;
    opacity: 0.95;
    transition: transform 0.2s ease;
    border-radius: 100%;
    animation: sector-icon-ripple 0.6s linear infinite;
}
.sector-dropdown.open .sector-dropdown-icon {
    transform: rotate(180deg);
    animation: none;
}
@keyframes sector-icon-ripple {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.06),
                    0 0 0 8px rgba(255, 255, 255, 0.06),
                    0 0 0 16px rgba(255, 255, 255, 0.06),
                    0 0 0 24px rgba(255, 255, 255, 0.06);
    }
    100% {
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06),
                    0 0 0 16px rgba(255, 255, 255, 0.06),
                    0 0 0 24px rgba(255, 255, 255, 0.06),
                    0 0 0 32px rgba(255, 255, 255, 0);
    }
}
.sector-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    width: 100%;
    min-width: 180px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: inherit;
    background: #0F2D7B;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1200;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
.sector-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 12px;
    left: auto;
    margin-left: 0;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #0F2D7B;
    filter: drop-shadow(0 -1px 2px rgba(0, 0, 0, 0.15));
}
.sector-dropdown.open .sector-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(6px);
}
.sector-dropdown-option {
    position: relative;
    z-index: 1;
    padding: 0 20px;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 44px;
    box-sizing: border-box;
}
.sector-dropdown-option:first-child {
    border-radius: 4px 4px 0 0;
}
.sector-dropdown-option:last-child {
    border-radius: 0 0 4px 4px;
    border-bottom: 0;
}
.sector-dropdown-option-icon {
    width: 1em;
    text-align: center;
    opacity: 0.9;
    color: inherit;
}
.sector-dropdown-option:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #2eb31a;
}
.sector-dropdown-option.active {
    background: rgba(46, 179, 26, 0.35);
    color: #2eb31a;
    font-weight: 600;
}
.sector-dropdown-option.active:hover {
    background: rgba(46, 179, 26, 0.45);
    color: #2eb31a;
}
.sector-dropdown-separator {
    height: 1px;
    margin: 6px 12px;
    padding: 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    border-radius: 0;
    border-bottom: 0;
    min-height: 0;
}
/* --- TICKER --- */
#news-ticker {
    display: flex;
    padding: 10px 20px;
    font-size: 0.95rem; font-weight: 500; white-space: nowrap;
    overflow: visible; /* allow sector dropdown menu to extend below ticker */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 2000;
    position: sticky;
    top: 0;
    min-height: 40px; align-items: center; justify-content: space-between;
    width: 100%; max-width: 100vw;
    background: #0F2D7B;
    color: white;
}
/* Sector empty message: overlay on the ticker (sticky creates containing block for absolute) */
#news-ticker .sector-ticker-overlay-msg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: rgba(15, 45, 123, 0.97);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    z-index: 2050;
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
    transition: opacity 0.4s ease;
}
#news-ticker .sector-ticker-overlay-msg.sector-empty-fade {
    opacity: 0;
    pointer-events: none;
}
#news-ticker .ticker-content {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    overflow: hidden;
}
#news-ticker a { color: white; text-decoration: none; opacity: 1; display: block; overflow: hidden; text-overflow: ellipsis; max-width: 100%; transition: color 0.3s ease, opacity 1.1s ease-in-out; }
#news-ticker a:hover { opacity: 0.8; text-decoration: underline; }

/* Ticker alert: amber instead of red on blue for color-blind accessibility */
#news-ticker a.is-red-text { color: #fbbf24 !important; }
#news-ticker a.is-red-text:hover { color: #fcd34d !important; }

/* Haptics toggle (persistent) */
#news-ticker .haptic-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.95);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
#news-ticker .haptic-toggle-btn:active { opacity: 0.9; }
#news-ticker .haptic-toggle-btn.is-off {
    opacity: 0.6;
    background: rgba(255,255,255,0.06);
}
#news-ticker .haptic-toggle-btn.haptic-toggle-hidden {
    display: none !important;
}
#news-ticker .haptic-toggle-text { opacity: 0.9; }
#news-ticker .haptic-toggle-state {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.2);
    font-size: 0.75rem;
}

/* Tactical bar: BUNKER | ADA | RADAR | LATENCY - HIDDEN */
.tactical-bar {
    display: none !important;
}
.tactical-bar .tactical-sep { opacity: 0.5; user-select: none; }
.tactical-bar .tactical-label { opacity: 0.85; margin-right: 2px; }
.tactical-bar .tactical-item { white-space: nowrap; }

/* --- TOP CONTAINER --- */
.top-container {
    width: 100%;
    max-width: none;
    background: transparent;
    border-bottom: none;
    position: relative;
    z-index: 50;
}
.top-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0px 30px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    margin-top: 10px;
}
.top-left { flex: 1; text-align: left; }

/* --- HEADER & LAYOUT --- */
.desktop-title { display: block; }
.mobile-logo-container { display: none; }

/* --- HEADLINE (NOW INSIDE CENTER COLUMN) --- */
/* Paper-style front-page treatment: cream base + stronger newspaper texture + shadow */
.headline-section {
    --headline-paper: #f5f1eb;
    background-color: var(--headline-paper);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n2)' opacity='0.06'/%3E%3C/svg%3E"),
        linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 50%, rgba(0,0,0,0.03) 100%);
    background-blend-mode: multiply, multiply, normal;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
    border-radius: 5px;
    padding: 10px 10px 10px 10commpx !important;
    margin-bottom: 8px;
}
.headline {
    width: 100%;
    margin: 0 0 0px 0;
    padding: 0 0 0px 0;
    text-align: center;
    background-color: transparent;
}

.headline a {
    color: #000000;
    font-size: 55px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 900;
    line-height: 40px;
    text-transform: uppercase;
    text-wrap: balance;
    display: block;
    margin-bottom: 0px;
}

.headline .story-image-container {
    margin: 0 auto 20px auto !important;
    display: block !important;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    min-height: 180px;
    background: #0d2240;
    position: relative;
    z-index: 1;
    overflow: hidden;
}
.headline .story-sector-placeholder i {
    font-size: 3.5rem;
}

.headline .story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Vertical/face: crop keeps top */
    display: block;
}

.headline .story-text-container {
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

/* Headline story link: space above so it doesn't overlap the image (only when image is present) */
.headline .story-item.has-image .story-text-container .story-link {
    margin-top: 0px;
}

/* Red light above headline image when breaking/alert is active — wide interactive strobe bar */
/* Positioned above image, extending up to overlap header */
.headline-red-light {
    width: 100%;
    text-align: center;
    margin-bottom: 0;
    margin-top: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transform: translateY(-80%);
    pointer-events: none;
}
.headline-red-light .headline-police-bar-wrap {
    pointer-events: auto;
    position: relative;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}
.headline-red-light .police-bar {
    width: 100%;
    max-width: 550px;
}
.headline .story-wrapper.story-item.has-image {
    position: relative;
}
.headline-police-light {
    display: inline-block;
    max-width: 80px;
    height: auto;
    vertical-align: middle;
}

/* Override Red Box Logic for Headline */
.headline .is-red-text,
.headline a.is-red-text {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #ff0000 !important;
    display: inline-block !important;
    box-shadow: none !important;
}

/* --- ALERT SYSTEMS --- */
.police-bar-container { position: absolute; left: 50%; transform: translateX(-50%); display: flex; justify-content: center; align-items: center; margin-top: -20px; }
.police-bar { width: 550px; height: 52px; background: #000; border: 2px solid #990000; border-radius: 4px; display: flex; justify-content: space-between; padding: 4px; box-shadow: 0 0 25px rgba(255, 0, 0, 0.5); }
.light-left, .light-right { width: 48%; height: 100%; border-radius: 2px; background: #ff0000; position: relative; }
@keyframes nukeStrobe {
    0% { background: #330000; box-shadow: none; opacity: 0.4; }
    40% { background: #ff0000; box-shadow: 0 0 15px #ff0000; opacity: 1; }
    50% { background: #ffcccc; box-shadow: 0 0 30px #ff0000; opacity: 1; }
    60% { background: #ff0000; box-shadow: 0 0 15px #ff0000; opacity: 1; }
    100% { background: #330000; box-shadow: none; opacity: 0.4; }
}
.light-left { animation: nukeStrobe 0.5s infinite alternate; }
.light-right { animation: nukeStrobe 0.5s infinite alternate-reverse; }

.siren-badge { display: inline-block; width: 10px; height: 10px; background-color: #ff0000; border-radius: 50%; box-shadow: 0 0 0 rgba(255, 0, 0, 0.7); animation: siren-pulse 1.5s infinite; margin-right: 6px; vertical-align: middle; position: relative; top: -2px; }
@keyframes siren-pulse { 0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 0, 0, 0); } 100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); } }

.system-alert {
    width: 100%;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: block;
}

/* Cleaned up legacy container rules */

/* --- CARD LAYOUT FOR STORY ITEMS --- */
.card {
    width: 100%;
    min-height: 254px;
    background: white;
    border-radius: 10px;
    transition: border-radius 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
    border: dashed #e4e4e4;
    padding: 10px;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    overflow: hidden;
}

/* No-image story cards: height follows content */
.card:has(.story-item.no-image) {
    min-height: 0;
}

/* --- AD SLOTS (AdSense placeholders; blend with card layout) --- */
/* Card used as ad slot: no story min-height, height conforms to ad unit */
.card.ad-slot {
    min-height: 0;
}
.ad-slot {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
}
.ad-slot--medium .ad-inner {
    height: 250px;
    min-height: 250px;
}
.ad-slot--large .ad-inner {
    height: 280px;
    min-height: 280px;
}
.ad-slot .ad-label {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.ad-slot .ad-inner {
    width: 100%;
    background: rgba(0,0,0,0.03);
    border-radius: 6px;
    position: relative;
}
.ad-slot .ad-inner::after {
    content: attr(data-size);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #999;
    font-family: 'Open Sans', sans-serif;
    letter-spacing: 0.02em;
}
/* Premium/WebView: hide all ad slots when body has class ad-free */
body.ad-free .ad-slot {
    display: none !important;
}

/* Story items inside cards should fill the card */
.card .story-item {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Card image container should fit within card */
.card .story-item .story-image-container {
    flex-shrink: 0;
    margin-bottom: 8px;
}

/* Card text container should flex to fill remaining space */
.card .story-item .story-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Card meta should be at bottom */
.card .story-item .story-meta {
    margin-top: auto;
    flex-shrink: 0;
}

/* --- STORY ITEM COMPONENTS --- */
.story-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 5px;
}
.story-sector-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}
.story-sector-placeholder i {
    font-size: 2.5rem;
    opacity: 0.9;
}
.story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Vertical/tall images: crop from top center */
    display: block;
    border-radius: 3px;
    box-shadow: none;
}
.story-text-container {
    width: 100%;
}
.story-item.has-image .story-text-container,
.story-item.has-image .story-text-container a {
    text-align: left;
}
.story-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    margin-top: 6px;
    padding: 10px;
    font-size: 0.75rem;
    font-family: Gotham, sans-serif;
    color: #fff;
    gap: 8px;
    background: #0F2D7B;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
    min-height: 0;
    overflow: visible;
}
.story-item.has-image .story-meta {
    margin-top: 8px;
}
.story-timestamp {
    font-weight: 400;
    opacity: 0.8;
}
.story-timer-leaving {
    color: #0d9488 !important;
    font-weight: 600;
}
.story-timestamp,
.story-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.story-timestamp i,
.story-source i {
    font-size: 0.7em;
    opacity: 0.9;
}
.story-source {
    font-weight: 500;
    opacity: 0.9;
}
.story-clicks {
    font-weight: 400;
    opacity: 0.7;
}
.story-reading-time {
    font-weight: 400;
    opacity: 0.7;
}
.story-sector {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.story-sector i {
    font-size: 0.65rem;
    opacity: 0.95;
}
/* In Focus metadata styling – same time/source bar as other columns */
.in-focus-item .story-meta {
    background: #0F2D7B;
    margin-top: 6px;
    padding: 10px;
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}
.in-focus-item .story-timestamp,
.in-focus-item .story-source {
    color: rgba(255, 255, 255, 0.9);
}
.in-focus-item .story-meta span:not(.story-timestamp):not(.story-source) {
    color: inherit;
}
/* Big Four metadata styling */
.four-pack .pack-item .story-meta {
    color: rgba(255, 255, 255, 0.65);
    margin-top: 4px;
}
.four-pack .pack-item .story-meta span {
    color: rgba(255, 255, 255, 0.65);
}
.story-archived-ago {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    opacity: 0.9;
}
.story-archived-ago i {
    font-size: 0.7em;
    opacity: 0.9;
}
/* Headline text centered on all devices (override has-image left for headline only) */
.headline .story-text-container,
.headline .story-text-container a,
.headline p,
.headline .story-wrapper.story-item a {
    text-align: center;
}
.headline .story-wrapper.story-item a {
    display: block;
}

/* Headline story item: no bottom margin/padding (override .story-item) */
.headline .story-wrapper.story-item,
.headline .story-item {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Headline story-meta: centered to match headline layout */
.headline .story-meta {
    justify-content: center;
}

.story-column {
    display: contents; /* Ensure grid layout works for nested columns on desktop */
}

/* UPDATED: Stories fit content, no stretch */
.story-item {
    margin-bottom: 15px !important;
    padding-bottom: 15px !important;
    max-width: 100% !important;
    width: 100% !important; /* Ensure story items take full width of their column */
    position: relative;
}

/* No borders/dividers between story items in columns 1-3 */
.left-column .story-item:not(:last-child),
.center-column .story-item:not(:last-child),
.right-column .story-item:not(:last-child) {
    padding-bottom: 20px;
}
.left-column .story-item:not(:last-child)::after,
.center-column .story-item:not(:last-child)::after,
.right-column .story-item:not(:last-child)::after,
.left-column .story-item:not(:last-child)::before,
.center-column .story-item:not(:last-child)::before,
.right-column .story-item:not(:last-child)::before {
    display: none;
}

/* Remove old borders */
.story-item.no-image {
    border-bottom: none;
    padding-bottom: 20px;
}
.story-item.no-image a {
    border-bottom: none;
    padding-bottom: 0px;
    margin-bottom: 5px !important;
}
.story-item.has-image {
    border-bottom: none;
    padding-bottom: 20px;
}
.story-item.has-image:has(+ .story-item) {
    border-bottom: none;
}
/* Visual Quota: micro-thumb (80x80) for topleftcorner first story only */
.story-item.micro-thumb-wrap { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.story-item.micro-thumb-wrap .story-text-container { flex: 1; min-width: 0; }
.story-image-container.micro-thumb { flex: 0 0 var(--micro-thumb-size, 80px); width: var(--micro-thumb-size, 80px); height: var(--micro-thumb-size, 80px) !important; max-width: var(--micro-thumb-size, 80px); margin-bottom: 0; }
.story-image-container.micro-thumb .story-image { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
/* No-image: text fills saved space (layout already full width) */
.story-item.no-image .story-text-container { width: 100%; }

/* --- CARD LAYOUT (Uiverse Sashank02 / new-warthog-10) for left/center/right column stories --- */
/* Cards fill column width (no max-width) so content uses the site area */
body.view-cards .left-column .story-item,
body.view-cards .center-column .story-item,
body.view-cards .right-column .story-item {
    padding: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 320px;
    border-radius: 20px;
    background: #e8e8e8;
    box-shadow: 5px 5px 6px #dadada, -5px -5px 6px #f6f6f6;
    transition: 0.4s;
    margin-bottom: 24px !important;
    border: none !important;
    overflow: hidden;
}
body.view-cards .left-column .story-item:hover,
body.view-cards .center-column .story-item:hover,
body.view-cards .right-column .story-item:hover {
    translate: 0 -10px;
}
body.view-cards .left-column .story-item::after,
body.view-cards .left-column .story-item::before,
body.view-cards .center-column .story-item::after,
body.view-cards .center-column .story-item::before,
body.view-cards .right-column .story-item::after,
body.view-cards .right-column .story-item::before {
    display: none !important;
}
/* Card image area (story image goes here) */
body.view-cards .left-column .story-item .story-image-container,
body.view-cards .center-column .story-item .story-image-container,
body.view-cards .right-column .story-item .story-image-container {
    min-height: 170px;
    border-radius: 15px;
    box-shadow: inset 8px 8px 10px #c3c3c3, inset -8px -8px 10px #cfcfcf;
    background-color: #c9c9c9;
    margin: 0 0 15px 0 !important;
    overflow: hidden;
}
body.view-cards .left-column .story-item .story-image,
body.view-cards .center-column .story-item .story-image,
body.view-cards .right-column .story-item .story-image {
    width: 100%;
    height: 100%;
    min-height: 170px;
    object-fit: cover;
    border-radius: 15px;
    display: block;
}
/* No-image: placeholder area with same neumorphic inset */
body.view-cards .left-column .story-item.no-image .story-text-container,
body.view-cards .center-column .story-item.no-image .story-text-container,
body.view-cards .right-column .story-item.no-image .story-text-container {
    position: relative;
}
body.view-cards .left-column .story-item.no-image .story-text-container::before,
body.view-cards .center-column .story-item.no-image .story-text-container::before,
body.view-cards .right-column .story-item.no-image .story-text-container::before {
    content: "";
    display: block;
    min-height: 170px;
    border-radius: 15px;
    box-shadow: inset 8px 8px 10px #c3c3c3, inset -8px -8px 10px #cfcfcf;
    background-color: #c9c9c9;
    margin-bottom: 15px;
}
/* Card title (story link) */
body.view-cards .left-column .story-item a,
body.view-cards .center-column .story-item a,
body.view-cards .right-column .story-item a {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2e54a7 !important;
    margin: 0 !important;
    display: block !important;
    text-decoration: none !important;
}
body.view-cards .left-column .story-item a:hover,
body.view-cards .center-column .story-item a:hover,
body.view-cards .right-column .story-item a:hover {
    background: none !important;
    text-decoration: underline !important;
}
body.view-cards .left-column .story-item a.is-red-text,
body.view-cards .center-column .story-item a.is-red-text,
body.view-cards .right-column .story-item a.is-red-text {
    color: #c53030 !important;
}
body.dark-mode.view-cards .left-column .story-item,
body.dark-mode.view-cards .center-column .story-item,
body.dark-mode.view-cards .right-column .story-item {
    background: var(--panel);
    box-shadow: var(--shadow);
}
body.dark-mode.view-cards .left-column .story-item .story-image-container,
body.dark-mode.view-cards .center-column .story-item .story-image-container,
body.dark-mode.view-cards .right-column .story-item .story-image-container,
body.dark-mode.view-cards .left-column .story-item.no-image .story-text-container::before,
body.dark-mode.view-cards .center-column .story-item.no-image .story-text-container::before,
body.dark-mode.view-cards .right-column .story-item.no-image .story-text-container::before {
    background-color: var(--panel);
    box-shadow: none;
}
body.dark-mode.view-cards .left-column .story-item a,
body.dark-mode.view-cards .center-column .story-item a,
body.dark-mode.view-cards .right-column .story-item a {
    color: var(--muted) !important;
}
body.dark-mode.view-cards .left-column .story-item a.is-red-text,
body.dark-mode.view-cards .center-column .story-item a.is-red-text,
body.dark-mode.view-cards .right-column .story-item a.is-red-text {
    color: var(--accent) !important;
}

/* --- FOUR-PACK (below columns: 4 tiles, max 5 stories each, first story micro-thumb only) --- */
.four-pack {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding: 0;
    background: #0F2D7B;
    box-sizing: border-box;
}
.pack-tile {
    padding: 12px;
    border-right: 5px dotted rgba(255, 255, 255) !important;
    min-width: 0;
    background: transparent;
    box-sizing: border-box;
}
.pack-tile:last-child { border-right: none !important; }
.pack-header {
    margin: 0 0 2px 0;
    padding: 6px 8px;
    font-family: Gotham, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background-color: rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
    user-select: none;
}
.pack-header-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}
.pack-section-icon {
    font-size: 0.9rem;
    opacity: 0.9;
}
.pack-toggle-icon {
    font-size: 0.85rem;
    opacity: 0.8;
    transition: transform 0.2s ease;
}
.pack-sub {
    margin: 0 0 10px 0;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.85);
    font-weight: 400;
}
.pack-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 5px;
}
/* Dotted dividers (like In Focus) only between real stories – not after last story, not on placeholders */
/* Only show dividers when there are actual stories (not just placeholders) */
.four-pack .story-item.pack-item {
    border: none;
    border-bottom: none;
    padding-bottom: 8px;
    margin-bottom: 0;
}
.four-pack .story-item.pack-item:has(+ .story-item.pack-item) {
    border-bottom: 1px dotted rgba(255,255,255,0.25);
    margin-bottom: 8px;
}
/* Hide bottom divider on last story (not placeholder) in each pack section */
.four-pack .story-item.pack-item:last-child,
.four-pack .story-item.pack-item:last-of-type {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}
/* Hide dividers if pack-list only has placeholders */
.pack-list:not(:has(.story-item.pack-item)) {
    border-bottom: none;
}
.four-pack .pack-placeholder {
    border-bottom: none;
    padding-bottom: 6px;
    margin-bottom: 0;
}
.four-pack .story-item.pack-item a {
    color: #fff !important;
    font-size: 18px;
    line-height: 1.3;
    text-decoration: none;
    font-weight: normal;
}
/* Force white text in big four - no red styling */
.four-pack .story-item.pack-item a.is-red-text {
    color: #fff !important;
}
.four-pack .story-item.pack-item a:hover { text-decoration: underline; }
.four-pack .story-item.pack-item.micro-thumb-wrap {
    --micro-thumb-size: 64px;
}
.pack-clicks {
    display: block;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.65);
    margin-top: 2px;
}
.pack-placeholder {
    padding: 6px 0;
    margin: 0;
    min-height: 1.3em;
    display: flex;
    align-items: center;
}
.pack-placeholder-text {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    font-style: italic;
    letter-spacing: 0.02em;
}
body.dark-mode .pack-placeholder-text { color: var(--muted); }
body.dark-mode .four-pack { background: var(--bg); border-top-color: var(--border); }
body.dark-mode .pack-tile { background: var(--panel); border-right: 1px solid var(--border); }
body.dark-mode .pack-tile:last-child { border-right: none; }
body.dark-mode .pack-header { color: var(--text); background-color: var(--panel); border-bottom-color: var(--accent); }
body.dark-mode .pack-sub { color: var(--muted); }
body.dark-mode .four-pack .story-item.pack-item a { color: var(--muted) !important; }
body.dark-mode .four-pack .story-item.pack-item a.is-red-text { color: var(--accent) !important; }
body.dark-mode .pack-clicks { color: var(--muted); }

/* Desktop: show section icons; hide only chevron (no open/close on desktop) */
@media (min-width: 769px) {
    .four-pack .pack-toggle-icon { display: none !important; }
    .four-pack .pack-header { cursor: default; }
}

/* --- THE DECK --- */
.the-deck { width: 100%; margin: 0px auto 0; padding: 0; background-color: #f0f4f8; border-top: 4px solid #15345B; padding-bottom: 40px; }
.deck-grid { display: grid; gap: 40px; padding-top: 40px; max-width: none; margin: 0 auto; padding-left: 15px; padding-right: 15px; }
/* Desktop: sources left (flexes to fill), contact + footer right (fixed width). More source columns on wide screens so content fills the area. */
@media (min-width: 769px) {
    .deck-grid { grid-template-columns: 1fr minmax(280px, 320px); align-items: start; }
    .deck-contact-footer { min-width: 0; }
    /* Sources area fills remaining width; links flow into multiple columns */
    .deck-sources-content { column-count: 3; column-gap: 24px; }
}
@media (min-width: 1100px) {
    .deck-sources-content { column-count: 4; column-gap: 28px; }
}
@media (min-width: 1400px) {
    .deck-sources-content { column-count: 5; column-gap: 28px; }
}
.deck-box { background: transparent; padding: 0; border: none; height: 100%; }
.deck-box h4 { margin: 0 0 15px 0; color: #15345B; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 800; border-bottom: 2px solid #ccc; padding-bottom: 5px; text-align:left; }
.deck-sources-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; border-bottom: 2px solid #ccc; padding-bottom: 5px; }
.deck-sources-header h4 { margin: 0; border-bottom: none; padding-bottom: 0; flex: 1; min-width: 0; font-family: Gotham, sans-serif; }
@media (min-width: 769px) {
    .the-deck .deck-chevron { display: none !important; }
}
.deck-sources-filters { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.deck-filter-btn { background: transparent; border: 1px solid #ccc; color: #15345B; padding: 4px 10px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; border-radius: 3px; }
.deck-filter-btn:hover { background: #e8eef4; border-color: #15345B; }
.deck-filter-btn.active { background: #15345B; color: #fff; border-color: #15345B; }
.deck-flow-list { column-count: 1; column-gap: 40px; text-align: left; }
.deck-sources-content { column-count: 3; column-gap: 24px; }
.deck-link { display: block; margin-bottom: 10px; color: #15345B; text-decoration: none; font-size: 0.95rem; font-weight: 500; break-inside: avoid; }
.deck-link:hover { color: #0d2240; text-decoration: underline; }
.deck-link i { width: 24px; text-align: center; color: #000; margin-right: 5px; font-size: 0.9rem; }
.submission-type-btn { transition: all 0.2s ease; }
.submission-type-btn.active { background: #e53e3e !important; color: white !important; }
.submission-type-btn:not(.active):hover { background: rgba(229, 62, 62, 0.1) !important; }
.tip-textarea { width: 100%; height: 80px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; margin-bottom: 10px; font-family: inherit; font-size: 0.9rem; resize: none; background: #fff; }
.tip-btn { background: #15345B; color: white; border: none; padding: 10px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; font-size: 0.8rem; width: 100%; }
body.view-newspaper .the-deck { border-top: 4px double #000; background: transparent; }
body.view-newspaper .deck-box h4 { font-family: 'OldNewspaperTypes', serif; color: #000; border-bottom: 1px solid #000; }
body.view-newspaper .tip-textarea { background: transparent; border: 1px solid #000; border-radius: 0; color: #000; }
body.view-newspaper .tip-btn { background: #000; border-radius: 0; }

/* --- FOOTER (FIXED) --- */
.footer-franklin-wrapper {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 140px;
}
.site-footer {
    color: white;
    position: relative;
    padding-top: 95px;
    padding-bottom: calc(60px + env(safe-area-inset-bottom)); /* Desktop: half of previous; mobile overrides in responsive.css */
    text-align: center;
    border-top: 0px solid #000;
    margin-top: 0;
    overflow: hidden;
}

/* Footer below deck: 25% Franklin / 75% content, no extra top padding */
.site-footer-below-deck {
    padding-top: 20px;
    padding-bottom: 20px;
    text-align: left;
}
.footer-below-deck-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 1rem;
    max-width: 100%;
}
.footer-below-deck-franklin {
    flex: 0 0 25%;
    max-width: 25%;
}
.footer-below-deck-franklin .footer-franklin-img {
    width: 100%;
    max-width: 140px;
    height: auto;
    display: block;
}
.footer-below-deck-content {
    flex: 0 0 75%;
    max-width: 75%;
}
.site-footer-below-deck .footer-quote { margin: 0 auto 12px 0; max-width: none; }
.site-footer-below-deck .footer-links { margin-bottom: 8px; }
.site-footer-below-deck .footer-stats { margin-top: 8px; }
.site-footer-below-deck .footer-version { margin-top: 6px; }

/* Deck footer: dark text on light deck background */
.the-deck .site-footer-below-deck { color: #1a202c; }
.the-deck .site-footer-below-deck .footer-quote { color: #4a5568; }
.the-deck .site-footer-below-deck .footer-links a { color: #15345B; }
.the-deck .site-footer-below-deck .footer-stats,
.the-deck .site-footer-below-deck .footer-version { color: #718096; }

.footer-franklin-img { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); }
.footer-quote { max-width: 600px; margin: 100px auto 20px auto; color: #d1d1d1; font-style: italic; font-size: 0.95rem; position: relative; z-index: 2; }
.footer-branding { color: #8c7e68; font-size: 0.75rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 15px; position: relative; z-index: 2; }
.footer-links { position: relative; z-index: 2; }
.footer-links a { color: #8daecf; text-decoration: none; margin: 0 10px; }
.footer-stats { margin-top: 20px; font-family: monospace; font-size: 0.75rem; color: rgba(255,255,255,0.4); letter-spacing: 1px; position: relative; z-index: 2; }
.footer-version { margin-top: 10px; opacity: 0.3; font-size: 0.7rem; font-family: monospace; position: relative; z-index: 2; }
.mobile-static-container { display: none; }

/* --- FOOTER ASH ANIMATION (CSS Only) --- */
.footer-ash-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.ash-particle {
    position: absolute;
    bottom: 0;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle at 30% 30%, rgba(80, 80, 80, 0.9), rgba(40, 40, 40, 0.8));
    opacity: 0;
    animation: ashFloat 5.5s infinite ease-out;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.6), inset 0 0 2px rgba(255, 255, 255, 0.1);
    filter: blur(0.5px);
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
}

/* Jagged angular ash shapes - SLOWER SPEED */
.ash-particle:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
    animation-duration: 5s;
    width: 8px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    background: rgba(50, 50, 50, 0.85);
    --initial-rotation: 45deg;
}

.ash-particle:nth-child(2) {
    left: 10%;
    animation-delay: 0.2s;
    animation-duration: 5.5s;
    width: 6px;
    height: 10px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(70, 70, 70, 0.75);
    --initial-rotation: -30deg;
}

.ash-particle:nth-child(3) {
    left: 15%;
    animation-delay: 0.4s;
    animation-duration: 4.5s;
    width: 12px;
    height: 8px;
    border-radius: 40% 60% 30% 70% / 50% 50% 50% 50%;
    background: rgba(45, 45, 45, 0.9);
    --initial-rotation: 60deg;
}

.ash-particle:nth-child(4) {
    left: 20%;
    animation-delay: 0.6s;
    animation-duration: 5.25s;
    width: 6px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    background: rgba(55, 55, 55, 0.8);
    --initial-rotation: 15deg;
}

.ash-particle:nth-child(5) {
    left: 25%;
    animation-delay: 0.1s;
    animation-duration: 5.75s;
    width: 10px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(60, 60, 60, 0.85);
    --initial-rotation: -45deg;
}

.ash-particle:nth-child(6) {
    left: 30%;
    animation-delay: 0.5s;
    animation-duration: 3.5s;
    width: 8px;
    height: 8px;
    border-radius: 25% 75% 25% 75% / 75% 25% 75% 25%;
    background: rgba(65, 65, 65, 0.8);
    --initial-rotation: 75deg;
}

.ash-particle:nth-child(7) {
    left: 35%;
    animation-delay: 0.3s;
    animation-duration: 6s;
    width: 10px;
    height: 12px;
    border-radius: 0;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    background: rgba(50, 50, 50, 0.9);
    --initial-rotation: -60deg;
}

.ash-particle:nth-child(8) {
    left: 40%;
    animation-delay: 0.7s;
    animation-duration: 5.5s;
    width: 6px;
    height: 8px;
    border-radius: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    background: rgba(55, 55, 55, 0.75);
    --initial-rotation: 30deg;
}

.ash-particle:nth-child(9) {
    left: 45%;
    animation-delay: 0.25s;
    animation-duration: 3.75s;
    width: 8px;
    height: 10px;
    border-radius: 35% 65% 35% 65% / 65% 35% 65% 35%;
    background: rgba(60, 60, 60, 0.85);
    --initial-rotation: -75deg;
}

.ash-particle:nth-child(10) {
    left: 50%;
    animation-delay: 0.55s;
    animation-duration: 5.75s;
    width: 6px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    background: rgba(70, 70, 70, 0.8);
    --initial-rotation: 20deg;
}

.ash-particle:nth-child(11) {
    left: 55%;
    animation-delay: 0.15s;
    animation-duration: 6s;
    width: 10px;
    height: 8px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(50, 50, 50, 0.9);
    --initial-rotation: -50deg;
}

.ash-particle:nth-child(12) {
    left: 60%;
    animation-delay: 0.65s;
    animation-duration: 5s;
    width: 8px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    background: rgba(55, 55, 55, 0.8);
    --initial-rotation: 40deg;
}

.ash-particle:nth-child(13) {
    left: 65%;
    animation-delay: 0.35s;
    animation-duration: 5.5s;
    width: 6px;
    height: 10px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(65, 65, 65, 0.85);
    --initial-rotation: -25deg;
}

.ash-particle:nth-child(14) {
    left: 70%;
    animation-delay: 0.6s;
    animation-duration: 5.25s;
    width: 8px;
    height: 8px;
    border-radius: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    background: rgba(60, 60, 60, 0.8);
    --initial-rotation: 55deg;
}

.ash-particle:nth-child(15) {
    left: 75%;
    animation-delay: 0.2s;
    animation-duration: 6s;
    width: 10px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(50, 50, 50, 0.85);
    --initial-rotation: -40deg;
}

.ash-particle:nth-child(16) {
    left: 8%;
    animation-delay: 0.45s;
    animation-duration: 5.5s;
    width: 7px;
    height: 9px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(55, 55, 55, 0.85);
    --initial-rotation: 50deg;
}

.ash-particle:nth-child(17) {
    left: 18%;
    animation-delay: 0.1s;
    animation-duration: 5s;
    width: 9px;
    height: 7px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(65, 65, 65, 0.8);
    --initial-rotation: -35deg;
}

.ash-particle:nth-child(18) {
    left: 28%;
    animation-delay: 0.5s;
    animation-duration: 5.75s;
    width: 7px;
    height: 11px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(50, 50, 50, 0.9);
    --initial-rotation: 65deg;
}

.ash-particle:nth-child(19) {
    left: 38%;
    animation-delay: 0.3s;
    animation-duration: 5.25s;
    width: 8px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%);
    background: rgba(60, 60, 60, 0.85);
    --initial-rotation: 25deg;
}

.ash-particle:nth-child(20) {
    left: 48%;
    animation-delay: 0.6s;
    animation-duration: 6s;
    width: 9px;
    height: 7px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(55, 55, 55, 0.8);
    --initial-rotation: -55deg;
}

.ash-particle:nth-child(21) {
    left: 58%;
    animation-delay: 0.15s;
    animation-duration: 5s;
    width: 7px;
    height: 9px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(70, 70, 70, 0.85);
    --initial-rotation: 80deg;
}

.ash-particle:nth-child(22) {
    left: 68%;
    animation-delay: 0.4s;
    animation-duration: 5.75s;
    width: 11px;
    height: 8px;
    border-radius: 0;
    clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
    background: rgba(50, 50, 50, 0.9);
    --initial-rotation: -65deg;
}

.ash-particle:nth-child(23) {
    left: 78%;
    animation-delay: 0.7s;
    animation-duration: 5.5s;
    width: 6px;
    height: 10px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(60, 60, 60, 0.8);
    --initial-rotation: 35deg;
}

.ash-particle:nth-child(24) {
    left: 12%;
    animation-delay: 0.25s;
    animation-duration: 5.25s;
    width: 8px;
    height: 11px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(55, 55, 55, 0.85);
    --initial-rotation: -70deg;
}

.ash-particle:nth-child(25) {
    left: 22%;
    animation-delay: 0.55s;
    animation-duration: 6s;
    width: 7px;
    height: 7px;
    border-radius: 0;
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    background: rgba(65, 65, 65, 0.8);
    --initial-rotation: 30deg;
}

.ash-particle:nth-child(26) {
    left: 32%;
    animation-delay: 0.1s;
    animation-duration: 5s;
    width: 9px;
    height: 6px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(50, 50, 50, 0.9);
    --initial-rotation: -45deg;
}

.ash-particle:nth-child(27) {
    left: 42%;
    animation-delay: 0.65s;
    animation-duration: 5.75s;
    width: 8px;
    height: 9px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(60, 60, 60, 0.85);
    --initial-rotation: 45deg;
}

.ash-particle:nth-child(28) {
    left: 52%;
    animation-delay: 0.35s;
    animation-duration: 5.5s;
    width: 7px;
    height: 11px;
    border-radius: 0;
    clip-path: polygon(20% 0%, 80% 0%, 100% 20%, 100% 80%, 80% 100%, 20% 100%, 0% 80%, 0% 20%);
    background: rgba(55, 55, 55, 0.8);
    --initial-rotation: -30deg;
}

.ash-particle:nth-child(29) {
    left: 62%;
    animation-delay: 0.5s;
    animation-duration: 5.25s;
    width: 9px;
    height: 7px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(70, 70, 70, 0.85);
    --initial-rotation: 60deg;
}

.ash-particle:nth-child(30) {
    left: 72%;
    animation-delay: 0.2s;
    animation-duration: 6s;
    width: 10px;
    height: 8px;
    border-radius: 0;
    clip-path: polygon(15% 0%, 85% 0%, 100% 15%, 100% 85%, 85% 100%, 15% 100%, 0% 85%, 0% 15%);
    background: rgba(50, 50, 50, 0.9);
    --initial-rotation: -50deg;
}

@keyframes ashFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(var(--initial-rotation, 0deg));
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    50% {
        transform: translateY(-50vh) translateX(calc(var(--ash-drift, 0px) + 20px)) rotate(calc(var(--initial-rotation, 0deg) + 180deg));
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100vh) translateX(calc(var(--ash-drift, 0px) + 40px)) rotate(calc(var(--initial-rotation, 0deg) + 360deg));
        opacity: 0;
    }
}

/* Add slight horizontal drift variation */
.ash-particle:nth-child(odd) {
    --ash-drift: 15px;
}

.ash-particle:nth-child(even) {
    --ash-drift: -15px;
}

/* --- TOP 5 STORIES CSS --- */
.top5-section { margin: 30px 0; width: 100%; border-top: 2px solid #eee; padding-top: 20px; }
.top5-header { font-family: 'Gotham', sans-serif; text-align: left; font-size: 1.2rem; color: #15345B; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 1px; }
.top5-stories-container { display: flex; flex-direction: column; gap: 10px; }
.top5-story-item { display: flex; flex-direction: row; align-items: center; gap: 12px; background: transparent; border: none; box-shadow: none; padding: 0; text-align: left; border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }
.top5-story-item:last-child { border-bottom: none; }
.top5-story-item .story-image-container { flex: 0 0 80px; width: 80px; height: 50px; overflow: hidden; border-radius: 3px; }
.top5-story-item .story-image { width: 100%; height: 100%; object-fit: cover; }
.top5-story-item a { text-decoration: none; color: #333; font-weight: bold; display: flex; flex-direction: column; flex: 1; }
.top5-story-item a:hover { text-decoration: underline; }
.top5-story-title { font-size: 0.95rem; line-height: 1.2; margin-bottom: 2px; display: block; }
.top5-story-clicks { font-size: 0.75rem; color: #999; display: block; margin-top: 0; }

/* --- LEAVING SOON --- */
.leaving-soon-section { margin: 30px 0; width: 100%; border-top: 2px solid #e53e3e; padding-top: 20px; }
.leaving-soon-header { font-family: 'Gotham', sans-serif; text-align: left; font-size: 1.2rem; color: #c53030; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.leaving-soon-subtext { font-size: 0.8rem; color: #718096; margin-bottom: 12px; }
.leaving-soon-list { display: flex; flex-direction: column; gap: 10px; }
.leaving-soon-item { border-bottom: 1px solid #f0f0f0; padding-bottom: 10px; }
.leaving-soon-item:last-child { border-bottom: none; }
.leaving-soon-item a { text-decoration: none; color: #333; }
.leaving-soon-item a:hover { text-decoration: underline; }
.leaving-soon-item .story-image-container { flex: 0 0 80px; width: 80px; height: 50px; overflow: hidden; border-radius: 3px; }
.leaving-soon-item .story-image { width: 100%; height: 100%; object-fit: cover; }

/* Ensure columns stack in app when cycled */
.left, .center, .right {
    width: 100%; /* Full width when solo */
    display: block; /* Default, overridden by JS */
}

/* Existing Font Face (Preserved for Title) */
@font-face {
    font-family: 'GeorgiaPro';
    src: url('media/fonts/GeorgiaPro-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* New Font Face for OldNewspaperTypes */
@font-face {
    font-family: 'OldNewspaperTypes';
    src: url('media/fonts/OldNewspaperTypes.woff2') format('woff2'),
        url('media/fonts/OldNewspaperTypes.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

/* Base Styles with Open Sans as Default */
body {
    background: #0F2D7B;
    margin: 0;
    padding: 0;
    padding-top: env(safe-area-inset-top); /* Adjust for dynamic island/status bar */
    font-family: 'Roboto Condensed', sans-serif;
    color: #000000;
    transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
}

a {
    color: #000000;
    text-decoration: underline;
    font-family: 'Roboto Condensed', sans-serif;
    transition: color 0.3s ease;
}

.headline p {
    margin-bottom: 15px;
}

a:visited {
    color: #000000;
}

/* Italics Class for Stories */
.italic-story {
    font-style: italic;
}

/* Ensure sections are stacked correctly with display: block */
.header-outside, .header, .headline, .container {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Preserve .top-left as a block container with Open Sans */
.top-left {
    display: block !important;
    width: 100%;
    line-height: 10px;
    box-sizing: border-box;
    padding: 5px;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
    overflow: visible;
}

/* Existing Layout and Frontend-Specific Styles */
.top-container {
    width: 100%;
    padding-bottom: 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background-color: transparent;
    transition: background-color 0.5s ease-in-out;
}

.top-content {
    display: flex;
    width: 100%;
}

.top-left {
    flex: 1;
    padding: 5px;
}

.top-toggle {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 5px;
    min-width: 60px;
}

.web-version {
    padding: 10px 5px;
    text-align: left;
    display: none;
    font-family: 'Open Sans', sans-serif;
    flex: 0 0 auto;
}

.web-version a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.web-version span {
    margin-right: 5px;
    font-weight: 700;
}

.mobile-only {
    display: block;
    font-family: 'Open Sans', sans-serif;
}

.ad-slot {
    width: 100%;
    text-align: center;
    margin: 10px 0;
    font-family: 'Open Sans', sans-serif;
}

.ad-top img, .ad-bottom img {
    width: 728px;
    height: 90px;
}

.ad-middle {
    margin: 10px 0;
    font-family: 'Open Sans', sans-serif;
}

.ad-middle .ad-link {
    display: block;
    text-decoration: none;
    color: #000000;
    font-family: 'Gotham';
    font-weight: 900;
}

.ad-middle .ad-image {
    width: 300px;
    height: 100px;
}

.ad-middle .ad-text {
    display: block;
    font-size: 14px;
    padding: 5px 0;
    font-family: 'Open Sans', sans-serif;
}

.urgent-indicator {
    text-align: center;
    margin: 10px 0;
    padding: 5px 0;
    font-family: 'Open Sans', sans-serif;
}

.urgent-indicator img {
    display: inline-block;
    vertical-align: middle;
    max-width: 50px;
    height: auto;
}

/* Blue Section (Left Column) - Smaller Titles */
.left .story-item a {
    font-size: 18px;
}

/* Pink Section (Right Column) - Layout & Separator */
.right {
    border-top: 4px solid #15345B; /* Section Separator */
    padding-top: 20px;
}

.right .story-item:first-child .story-image-container {
    display: none !important; /* Hide first thumbnail in right column */
}

.story-item a {
    text-wrap: pretty; /* Avoid early wrap; balance made titles wrap too soon */
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
}
/* All story titles/links: Roboto Condensed */
.story-item a,
.in-focus-item a,
.top-left .story-item a,
.headline .story-wrapper.story-item a,
.four-pack .story-item.pack-item a {
    font-family: 'Roboto Condensed', sans-serif;
}

/* Headline keeps its size; all other story links use 18px above */
.headline-section .headline a,
.headline-section .headline .story-item a,
.headline-section .headline .story-wrapper.story-item a {
    font-size: 40px !important;
}

/* Desktop: infocus story links */
@media (min-width: 769px) {
    .in-focus-item a {
        font-size: 18px;
    }
}

.header-outside {
    width: 100%;
    overflow-x: hidden;
}

.header {
    text-align: center;
    padding: 150px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='nh'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.08' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23nh)' opacity='0.08'/%3E%3C/svg%3E"),
        url('/images/header-bg-v3.jpg');
    background-color: rgba(0, 40, 85, 0.9);
    background-blend-mode: exclusion, normal;
    background-repeat: repeat, no-repeat;
    background-position: 0 0, center center;
    background-size: auto, cover;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #CCCCCC;
    color: #fff;
    transition: background-color 0.5s ease-in-out, border-color 0.5s ease-in-out;
}
.header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4); /* 0.6 transparency = 0.4 opacity overlay */
    z-index: 0;
    pointer-events: none;
}
.header > *:not(.header-fog) {
    position: relative;
    z-index: 1;
}

/* Smoke/fog overlay (Three.js) – absolute so it gets header size; over bg, under content */
.header-fog {
    position: absolute !important;
    inset: 0;
    z-index: 0.5;
    pointer-events: none;
    display: block !important;
    visibility: visible !important;
}
.header-fog canvas {
    display: block;
    width: 100%;
    height: 100%;
}
/* Desktop: ensure fog is visible and above header overlay */
@media (min-width: 769px) {
    .header-fog {
        z-index: 0.5;
        opacity: 1;
    }
}
.header .update-status,
.header h1,
.header .desktop-title,
.header .mobile-logo-container,
.header .tagline,
.header::before,
.header::after {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 90px;
    font-weight: bold;
    margin: 0px 0;
    text-transform: uppercase;
    font-family: 'Gotham', serif;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.75);
}

.update-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 0px;
}

.update-badge {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.date-time {
    display: block;
    font-size: 20px;
    font-family: 'Roboto Condensed', sans-serif;
    color: #fff;
    width: fit-content;
    margin: 0;
    padding: 0;
}

.header::before {
    content: '';
    display: block;
    width: 100%;
    height: 0px;
    background: #fff;
    margin: 0 auto 10px;
    transition: background-color 0.5s ease-in-out;
}

.header::after {
    content: '';
    display: block;
    width: 100%;
    height: 0px;
    background: #fff;
    margin: 10px auto 0;
    transition: background-color 0.5s ease-in-out;
}

.header .tagline {
    display: block;
    font-size: 44px;
    font-family: 'Roboto Condensed', sans-serif;
    color: #fff;
    margin-top: -25px;
    font-style: italic;
    font-weight: 300;
    text-shadow: 0 3px 12px rgba(0,0,0,0.6), 0 1px 2px rgba(0,0,0,0.75);
}

.header img {
    max-width: 300px;
    width: 100%;
}

.top-left img {
    float: left;
    margin-right: 5px;
    max-width: 200px;
}

/* --- MAIN STORY GRID (25% - 50% - 25%); sector-console overlays above content --- */
.container {
    width: 100%;
    margin: 0;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0;
    padding: 0;
    /* Newspaper paper background across all columns */
    background-color: #f5f1eb;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='nc'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23nc)' opacity='0.08'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='nc2'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.03' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23nc2)' opacity='0.05'/%3E%3C/svg%3E"),
        linear-gradient(180deg, rgba(255,255,255,0.4) 0%, transparent 50%, rgba(0,0,0,0.02) 100%);
    background-blend-mode: multiply, multiply, normal;
    transition: background-color 0.5s ease-in-out;
    font-family: 'Roboto Condensed', sans-serif;
    box-sizing: border-box;
    align-items: start;
}

/* Merged trench: headline center, two stories on left and two on right */
.container.trench-merged-layout {
    grid-template-columns: 1fr;
    grid-auto-rows: 280px;
    gap: 20px;
    padding: 10px;
    align-items: stretch;
}
@media (min-width: 30em) {
    .container.trench-merged-layout {
        grid-template-columns: 1fr 1fr;
    }
}
@media (min-width: 60em) {
    .container.trench-merged-layout {
        grid-template-columns: repeat(4, 1fr);
    }
}
.container.trench-merged-layout .headline-section {
    grid-column: 1 / -1;
    grid-row: auto;
    order: -1; /* Top of mobile below header; cards flow after */
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible; /* allow police light (negative margin) to show */
}
@media (min-width: 30em) {
    .container.trench-merged-layout .headline-section {
        grid-column: 1 / span 2;
        grid-row: 1 / span 2;
    }
}
@media (min-width: 60em) {
    .container.trench-merged-layout .headline-section {
        grid-column: 2 / 4;
        grid-row: 1 / span 2;
    }
}
.container.trench-merged-layout .headline-section .headline {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible; /* allow police light above image */
}
/* Stories and ads participate in same grid and flow around headline */
.trench-merged {
    display: contents;
}
.trench-merged .wire-card,
.trench-merged .ad-slot {
    min-width: 0;
}

/* Kanban-style cards in merged trench: compact, fill gaps, no empty space */
.container.trench-merged-layout .wire-card {
    min-height: 0;
    height: 100%;
    margin-bottom: 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.container.trench-merged-layout .wire-card .story-item {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.container.trench-merged-layout .wire-card .story-item .story-text-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
/* No-image cards: no placeholder space, compact padding */
.container.trench-merged-layout .wire-card:has(.story-item.no-image) {
    padding: 8px 12px;
}
.container.trench-merged-layout .wire-card:has(.story-item.no-image) .story-item {
    padding-bottom: 0;
}
.container.trench-merged-layout .wire-card:has(.story-item.no-image) .story-meta {
    margin-top: 6px;
    padding: 6px 8px;
}
.container.trench-merged-layout .wire-card .story-item .story-image-container {
    margin-bottom: 6px;
}
.container.trench-merged-layout .wire-card .story-item .story-meta {
    padding: 6px 8px;
    margin-top: 6px;
    flex-shrink: 0;
    overflow: visible;
}

/* --- SECTOR CONSOLE: horizontal bar between header and stories, sticky --- */
#sector-console {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #0F2D7B;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 100;
    box-sizing: border-box;
}
#sector-console .console-toggle {
    padding: 6px 8px;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
}
#sector-console .sector-console-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
#sector-console .console-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: transparent;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 6px;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
#sector-console .console-btn:hover { border-color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.08); }
#sector-console .console-btn.active { background: #22c55e; border-color: #22c55e; color: #000; }
.sector-console-empty-msg {
    margin-left: auto;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.25);
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
}
#sector-console.collapsed .sector-console-empty-msg { display: none !important; }
#sector-console.collapsed .console-btn-text { display: none; }
#sector-console.collapsed .console-btn::after { content: attr(data-short); display: inline; }
#sector-console.collapsed .console-btn { padding: 8px 10px; min-width: 32px; }
#sector-console.collapsed .sector-console-buttons { gap: 4px; }

/* Ghost-sort visuals */
/* In-focus (red) stories show in columns; hide-on-mobile no longer used */
.wire-card.ghost-signal { opacity: 0.2; filter: grayscale(80%); pointer-events: none; transition: all 0.5s ease; }
.wire-card.active-signal { opacity: 1; filter: none; transition: all 0.5s ease; }
.wire-card.sector-match {
    box-shadow: 0 0 0 2px rgba(46, 179, 26, 0.6), 0 0 16px rgba(46, 179, 26, 0.25);
    transition: box-shadow 0.35s ease;
}

/* Card wrappers fill column so carded stories use full site area */
.left-column .card.wire-card,
.center-column .card.wire-card,
.right-column .card.wire-card,
.center-col-left .card.wire-card,
.center-col-right .card.wire-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Live refresh: gentle glimmer when content updates (no full reload) */
/* Smooth real-time refresh for kiosk mode: fade out → swap → fade in */
#stories-container.content-refreshing {
    transition: opacity 0.3s ease-in-out;
}
#stories-container.content-refreshing.fade-out {
    opacity: 0.3;
}
#stories-container.content-refreshing.fade-in {
    opacity: 1;
    animation: refreshGlimmer 0.4s ease-out;
}
@keyframes refreshGlimmer {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* Gradient divider styles - horizontal dividers */
.divider {
    display: none; /* Hide div lines across site */
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.divider.light {
    background: #fff;
    background: -webkit-linear-gradient(left, rgb(90,90,90) 0%, rgb(255,255,255) 50%, rgb(90,90,90) 100%);
    background: linear-gradient(to right, rgb(90,90,90) 0%, rgb(255,255,255) 50%, rgb(90,90,90) 100%);
}

.divider.light:before {
    position: relative;
    float: left;
    background: linear-gradient(to right, rgba(100, 100, 100, 0), rgba(100, 100, 100, 1) 50%);
    margin-top: 2px;
    width: 50%;
    height: .5px;
    content: "";
    display: block;
}

.divider.light:after {
    position: relative;
    float: right;
    background: linear-gradient(to left, rgba(100, 100, 100, 0), rgba(100, 100, 100, 1) 50%);
    margin-top: 2px;
    width: 50%;
    height: .5px;
    content: "";
    display: block;
}

.divider:before {
    position: relative;
    float: left;
    background: linear-gradient(to right, rgba(200, 200, 200, 0), rgba(200, 200, 200, 1) 50%);
    margin-top: 2px;
    width: 50%;
    height: .5px;
    content: "";
    display: block;
}

.divider:after {
    position: relative;
    float: right;
    background: linear-gradient(to left, rgba(200, 200, 200, 0), rgba(200, 200, 200, 1) 50%);
    margin-top: 2px;
    width: 50%;
    height: .5px;
    content: "";
    display: block;
}

/* Desktop Wrapper Layout (console overlays; trenches 1–3) */
.left-col-wrapper { 
    grid-column: 1; 
    position: relative;
    border-right: none;
}

.left-col-wrapper::after {
    display: none; /* Hide div lines across site */
}

.center-col-wrapper { grid-column: 2; }
.right-column { 
    grid-column: 3; 
    position: relative;
    border-left: none;
}

.right-column::before {
    display: none; /* Hide div lines across site */
}

.headline-section { border-bottom: none; }
.headline-section, .left-column, .center-column, .right-column {
    padding: 10px;
    box-sizing: border-box;
    width: 100%;
}

/* Center: two columns under headline on desktop */
.center-two-col-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}
.center-col-left, .center-col-right {
    min-width: 0;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr 1fr;
    }
    .desktop-col-wrapper { display: contents; } /* Flatten wrappers for tablet/mobile ordering */
    
    .headline-section { grid-column: 1 / span 2; order: 1; border-right: none; }
    .center-column { grid-column: 2; order: 2; border-right: none; }
    .center-two-col-wrapper { display: block; }
    .right-column { 
        grid-column: 1; 
        order: 3; 
        border-left: none; 
        border-right: none; 
        border-top: none;
        position: relative;
    }
    .right-column::after {
        display: none; /* Hide div lines across site */
    }
    .left-column { 
        grid-column: 2; 
        order: 4; 
        border-right: none; 
        border-top: none;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
    /* Trench merged layout: keep 2 cols so alternating 2col/1col works (headline 1col, story1+2 2col, story3 1col, …) */
    .container.trench-merged-layout {
        grid-template-columns: 1fr 1fr !important;
    }
    .desktop-col-wrapper { display: contents; }
    
    .headline-section, .left-column, .center-column, .right-column {
        grid-column: 1 !important;
        border-right: none !important;
        border-left: none !important;
        border-top: none !important;
        border-bottom: none !important; /* Hide div lines across site */
        padding: 10px !important;
    }

    /* Mobile order: 1. Headline, 2. Left, 3. Center, 4. Right */
    .headline-section { order: 1; }
    .left-column { order: 2; }
    .center-column { order: 3; }
    .center-two-col-wrapper { display: block; }
    .right-column { order: 4; }
    
    /* Mobile font size for columns 1-3 */
    .left-column a, .center-column a, .right-column a {
        font-size: 18px;
    }
}

/* Clean up old column rules */
.left, .center, .right { display: contents; } 
.story-column { display: contents; }

/* Old column logic replaced by .container grid layout */
.left-column p, .center-column p, .right-column p {
    padding: 5px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 300;
}

.left-column a, .center-column a, .right-column a {
    color: #000000;
    font-size: 18px;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 300;
    text-align: left;
}
.left-column, .center-column, .right-column {
    text-align: left;
}

/* Static Links Inside Columns */
.static-left, .static-center, .static-right {
    font-size: 11px;
    line-height: 1.2;
    box-sizing: border-box;
    padding: 0px; /* Updated: No padding */
    width: 100%;
    font-family: 'Roboto Condensed', sans-serif;
}

.static-left a, .static-center a, .static-right a {
    color: #000000;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 11px;
    white-space: nowrap;
    display: block;
}

/* Remove borders from static sections since they’re inside columns */
.static-left {
    border-right: none;
}

.static-center {
    border-right: none;
}

.static-right {
    border-left: none;
}

/* Static Wrapper for Mobile Toggle */
.static-wrapper {
    width: 100%;
}

.static-toggle-label {
    display: none; /* Hidden by default, shown on mobile */
    cursor: pointer;
    padding: 10px;
    background: #f0f0f0;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    color: #000000;
}

.top-headline {
    font-size: 48px;
    line-height: 1.1;
    margin: 10px 0;
    letter-spacing: -1px;
    font-family: 'Open Sans', sans-serif;
}

.top-headline a {
    color: #000000;
    font-size: 48px;
    font-family: 'Open Sans', sans-serif;
    font-weight: 400;
    text-decoration: underline;
    text-transform: uppercase;
}

.urgent::before {
    content: url('police_light.gif');
    margin-right: 5px;
    vertical-align: middle;
}

p {
    margin: 5px 0;
    font-family: 'Open Sans', sans-serif;
}

/* Static Below Section (Kept Separate) */
.static-below {
    width: 100%;
    margin-top: 20px;
    font-family: 'Open Sans', sans-serif;
}

.static-below h3 {
    text-align: center;
    font-family: 'Open Sans', sans-serif;
}

.static-below p {
    padding: 5px;
}

/* Remove .static-container since it’s no longer used */
.static-container {
    display: none;
}

img {
    display: block;
    margin-bottom: 5px;
    max-width: 100%;
}

/* Urgent Notice and Red Police Light */
.urgent-notice {
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.redpolicelight {
    margin: auto;
    display: block;
}

/* Story Divider */
.story-divider {
    border: 0;
    height: 1px;
    background: #ccc;
    margin: 10px 0;
    transition: background-color 0.5s ease-in-out;
}

/* Theme Toggle Switch Styles */
.theme-toggle-checkbox {
    display: none;
}

.theme-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
}

.toggle-handle {
    position: relative;
    width: 60px;
    height: 25px; /* Updated: Smaller height */
    background-color: #f5e8c7;
    border-radius: 15px;
    padding: 2px;
    transition: background-color 0.3s ease;
    overflow: hidden;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

.toggle-handle i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 1;
}

.toggle-handle .fa-sun {
    left: 4px;
    color: #FFA500;
    padding: 5px; /* Updated: Added padding */
}

.toggle-handle .fa-moon {
    right: 4px;
    color: #fff;
    opacity: 0;
    padding: 5px; /* Updated: Added padding */
}

.theme-toggle-checkbox:checked + .theme-toggle-label .toggle-handle {
    background-color: #2c3e50;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .toggle-handle .fa-sun {
    transform: translateY(-50%) translateX(-20px);
    opacity: 0;
}

.theme-toggle-checkbox:checked + .theme-toggle-label .toggle-handle .fa-moon {
    transform: translateY(-50%) translateX(20px);
    opacity: 1;
    color: #6495ED;
}
/* Highlight active column with fade-out animation */
.active-column {
    border: 2px solid #ff0000;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    animation: fadeOutHighlight 3s forwards;
}

@keyframes fadeOutHighlight {
    0% {
        border-color: #ff0000;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    }
    100% {
        border-color: transparent;
        box-shadow: none;
    }
}

/* Ensure columns are scrollable and visible */
.left, .center, .right {
    display: block !important; /* Override any JS hiding */
}

.right img {
width: 70% !important;
}
.center img {
    width: 70% !important;
}
.left img {
    width: 70% !important;
}

/* Mobile adjustments */

/* Admin-Specific Light and Elegant Styles */
body.admin {
    font-family: 'Open Sans', sans-serif;
    background-color: transparent;
    color: #000000;
    padding: 20px;
}

body.admin h1 {
    text-align: center;
    background: linear-gradient(to right, #FFFFFF, #F5F5F5);
    color: #000000;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 24px;
    font-family: 'GeorgiaPro', serif;
}

body.admin .container {
    display: flex;
    gap: 20px;
    font-family: 'Open Sans', sans-serif;
}

body.admin .extra-area, body.admin .layout {
    display: flex;
    margin: 20px 0;
    background: #FAFAFA;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 15px;
    font-family: 'Open Sans', sans-serif;
}

body.admin .column {
    width: 33%;
    padding: 15px;
    margin: 0;
    border: none;
    border-right: 1px solid #E5E5E5;
    box-sizing: border-box;
    font-family: 'Open Sans', sans-serif;
}

body.admin .column:last-child {
    border-right: none;
}

body.admin ul {
    list-style: none;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
}

body.admin li.story {
    background: #FFFFFF;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.2s ease;
    font-family: 'Open Sans', sans-serif;
}

body.admin li.story:hover {
    background: #F5F5F5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.admin li.story img {
    max-width: 100%;
    border-radius: 3px;
    margin-bottom: 5px;
}

body.admin li.story .title-text {
    cursor: pointer;
    color: #000000;
    font-family: 'Open Sans', sans-serif;
    font-weight: 700;
    text-decoration: underline;
}

body.admin li.story .title-input {
    width: 100%;
    padding: 5px;
    margin-top: 5px;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    background: #FFFFFF;
    color: #000000;
    font-family: 'Open Sans', sans-serif;
}

body.admin li.story form {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-family: 'Open Sans', sans-serif;
}

body.admin li.story select, body.admin li.story input[type="text"], body.admin li.story input[type="file"] {
    padding: 5px;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    background: #FFFFFF;
    color: #000000;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

body.admin li.story button {
    padding: 5px 10px;
    background: #F5F5F5;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

body.admin li.story button:hover {
    background: #E5E5E5;
}

body.admin li.story .urgent {
    color: red;
    margin-left: 5px;
    font-family: 'Open Sans', sans-serif;
}

body.admin .static-link {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
    font-family: 'Open Sans', sans-serif;
}

body.admin .static-link input {
    flex: 1;
    padding: 5px;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    background: #FFFFFF;
    color: #000000;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

body.admin .static-link button {
    padding: 5px 10px;
    background: #F5F5F5;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

body.admin .static-link button:hover {
    background: #E5E5E5;
}

body.admin #storyForm ul {
    background: #FAFAFA;
    padding: 15px;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    font-family: 'Open Sans', sans-serif;
}

body.admin #storyForm li {
    padding: 10px;
    border-bottom: 1px solid #E5E5E5;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-family: 'Open Sans', sans-serif;
}

body.admin #storyForm button {
    padding: 5px 10px;
    background: #F5F5F5;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

body.admin #storyForm button:hover {
    background: #E5E5E5;
}

body.admin button {
    padding: 5px 10px;
    background: #F5F5F5;
    border: 1px solid #CCCCCC;
    border-radius: 3px;
    color: #000000;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
}

body.admin button:hover {
    background: #E5E5E5;
}

/* Checkbox Styles for Admin */
body.admin input[type="checkbox"]:checked + label {
    color: red;
}

body.admin input[type="checkbox"]:not(:checked) + label {
    color: black;
}

/* Admin-specific styles */
.mass-add-toggle {
    cursor: pointer;
    color: #007bff;
    margin-bottom: 10px;
}

.mass-add-form {
    display: none;
    margin-bottom: 15px;
}

.static-link-item {
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ccc;
}

.edit-form {
    display: none;
    margin-top: 5px;
}

/* Color-coded FA icons */
.fa-save { color: #28a745; }
.fa-trash { color: #dc3545; }
.fa-plus { color: #007bff; }
.fa-minus { color: #007bff; }
.fa-edit { color: #ffc107; }
.fa-sync-alt { color: #17a2b8; }
.fa-check { color: #28a745; }
.fa-times { color: #dc3545; }
.fa-arrow-up, .fa-arrow-down { color: #6c757d; }
.fa-fill-drip { color: #dc3545; }
.fa-grip-lines { color: #6c757d; }
.fa-italic { color: #6c757d; }
.fa-exclamation-triangle { color: #dc3545; }
.fa-sun { color: #FFA500; }
.fa-moon { color: #6495ED; }

/* Hover effects for FA icons */
.fa-save:hover, .fa-check:hover { color: #218838; }
.fa-trash:hover, .fa-times:hover { color: #c82333; }
.fa-plus:hover, .fa-minus:hover { color: #0056b3; }
.fa-edit:hover { color: #e0a800; }
.fa-sync-alt:hover { color: #138496; }
.fa-arrow-up:hover, .fa-arrow-down:hover { color: #5a6268; }
.fa-fill-drip:hover { color: #c82333; }
.fa-grip-lines:hover { color: #5a6268; }
.fa-italic:hover { color: #5a6268; }
.fa-exclamation-triangle:hover { color: #c82333; }
.fa-sun:hover { color: #FF8C00; }
.fa-moon:hover { color: #4169E1; }

/* Button and label styling */
button i, label i {
    margin-right: 5px;
}

/* Night Watch: CSS variables (toggled with body.dark-mode + html.night-watch) */
html.night-watch {
    color-scheme: dark;
    --bg: #000000;
    --panel: rgba(255, 255, 255, 0.06);
    --text: rgba(255, 70, 70, 0.95);
    --muted: rgba(255, 70, 70, 0.68);
    --border: rgba(255, 70, 70, 0.22);
    --accent: #ff2a2a;
    --shadow: 0 18px 60px rgba(255, 0, 0, 0.06);
    --radius: 10px;
    --ui-dim: 0.85;
    --glow: 1;
}

body.dark-mode {
    background-color: var(--bg) !important;
    color: var(--text) !important;
    filter: brightness(var(--ui-dim));
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode p,
body.dark-mode span,
body.dark-mode div,
body.dark-mode label,
body.dark-mode strong,
body.dark-mode em,
body.dark-mode li {
    color: var(--text) !important;
}

body.dark-mode a {
    color: var(--muted) !important;
    text-decoration: underline !important;
}

body.dark-mode a:visited {
    color: var(--muted) !important;
    opacity: 0.9;
}

body.dark-mode .headline a,
body.dark-mode .top-left a,
body.dark-mode .left a,
body.dark-mode .center a,
body.dark-mode .right a,
body.dark-mode .static-left a,
body.dark-mode .static-center a,
body.dark-mode .static-right a,
body.dark-mode .top-headline a {
    color: var(--muted) !important;
    text-decoration: underline !important;
}

body.dark-mode [style*="color: red"],
body.dark-mode .urgent,
body.dark-mode .is-red-text {
    color: var(--accent) !important;
}
body.dark-mode #news-ticker {
    background: var(--bg) !important;
    color: var(--text);
}
body.dark-mode #news-ticker a,
body.dark-mode #news-ticker .sector-dropdown-trigger {
    color: var(--muted) !important;
}
body.dark-mode #news-ticker a.is-red-text {
    color: var(--accent) !important;
}

body.dark-mode .web-version a,
body.dark-mode .web-version span,
body.dark-mode .web-version .fa-desktop {
    color: var(--text) !important;
}

body.dark-mode .top-container,
body.dark-mode .container {
    background-color: var(--bg) !important;
}
body.dark-mode section.section-stories {
    background-color: var(--bg);
}

body.dark-mode .headline-section {
    --headline-paper: var(--bg);
    background-color: var(--panel) !important;
    background-image: none;
    box-shadow: var(--shadow);
    border: 1px solid var(--border) !important;
}
body.dark-mode .headline {
    background: transparent !important;
    border-bottom: none !important;
}

body.dark-mode .header {
    background-color: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
}

body.dark-mode .header::before,
body.dark-mode .header::after {
    background: var(--border) !important;
}

body.dark-mode .left,
body.dark-mode .center,
body.dark-mode .right {
    border-color: var(--border) !important;
}

body.dark-mode .story-divider {
    background: var(--border) !important;
}

body.dark-mode .ad-middle .ad-link {
    color: var(--muted) !important;
}

body.dark-mode .card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel);
    box-shadow: var(--shadow);
    padding: 18px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(14px);
    transition: background-color 240ms ease, border-color 240ms ease;
}

html.night-watch .card::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 50% 30%, rgba(255, 0, 0, 0.10), rgba(0, 0, 0, 0.92) 60%, rgba(0, 0, 0, 1) 78%);
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.55;
}

body.dark-mode .story-meta {
    background: #151617;
}

/* Admin Dark Mode Styles */
body.admin.dark-mode {
    background-color: #1a1a1a !important;
    color: #ffffff !important;
}

body.admin.dark-mode h1 {
    background: linear-gradient(to right, #1a1a1a, #333333) !important;
    color: #ffffff !important;
}

body.admin.dark-mode .extra-area, body.admin.dark-mode .layout, body.admin.dark-mode #storyForm ul {
    background: #333333 !important;
    border: 1px solid #555555 !important;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1) !important;
}

body.admin.dark-mode .column {
    border-right: 1px solid #555555 !important;
}

body.admin.dark-mode li.story {
    background: #2a2a2a !important;
    border: 1px solid #555555 !important;
    box-shadow: 0 1px 2px rgba(255, 255, 255, 0.05) !important;
}

body.admin.dark-mode li.story:hover {
    background: #444444 !important;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.1) !important;
}

body.admin.dark-mode .title-input,
body.admin.dark-mode select,
body.admin.dark-mode input[type="text"],
body.admin.dark-mode input[type="file"],
body.admin.dark-mode .static-link input,
body.admin.dark-mode textarea { /* Added textarea */
    background: #333333 !important;
    color: #ffffff !important;
    border: 1px solid #555555 !important;
}

body.admin.dark-mode button {
    background: #444444 !important;
    color: #ffffff !important;
    border: 1px solid #555555 !important;
}

body.admin.dark-mode button:hover {
    background: #555555 !important;
}

body.admin.dark-mode .title-text {
    color: #66b0ff !important;
}

body.admin.dark-mode .mass-add-toggle {
    color: #66b0ff !important;
}

body.admin.dark-mode .static-link-item {
    border-color: #555555 !important;
}

body.dark-mode .theme-toggle-label {
    color: var(--text) !important;
}

body.dark-mode .toggle-handle {
    background-color: var(--panel) !important;
    border: 1px solid var(--border) !important;
}

body.dark-mode .toggle-handle .fa-sun {
    color: var(--accent) !important;
}

body.dark-mode .toggle-handle .fa-moon {
    color: var(--muted) !important;
}

body.dark-mode .mobile-in-focus-section {
    background: var(--panel) !important;
    border: 2px solid var(--accent) !important;
}

body.dark-mode .in-focus-header {
    color: var(--text) !important;
    border-bottom: 1px solid var(--border) !important;
}

body.dark-mode .in-focus-subtext {
    color: var(--muted) !important;
}

body.dark-mode .in-focus-item {
    border-bottom: 1px dotted var(--accent) !important;
}

body.dark-mode .in-focus-item a {
    color: var(--text) !important;
}

body.dark-mode .top5-section {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
}

body.dark-mode .top5-header {
    color: var(--text) !important;
}

body.dark-mode .top5-story-item {
    background: var(--panel) !important;
    box-shadow: var(--shadow) !important;
    border-top: 3px solid var(--accent) !important;
}

body.dark-mode .leaving-soon-section {
    border-top-color: var(--accent) !important;
}

body.dark-mode .leaving-soon-header {
    color: var(--accent) !important;
}

body.dark-mode .leaving-soon-subtext {
    color: var(--muted) !important;
}

body.dark-mode .leaving-soon-item {
    border-bottom-color: var(--border) !important;
}

body.dark-mode .leaving-soon-item a,
body.dark-mode .top5-story-item a {
    color: var(--muted) !important;
}

body.dark-mode .top5-story-clicks {
    color: var(--muted) !important;
}

body.dark-mode .the-deck {
    background-color: var(--bg) !important;
    border-top: 4px solid var(--border) !important;
}

body.dark-mode .deck-box h4 {
    color: var(--text) !important;
    border-bottom: 2px solid var(--border) !important;
}

body.dark-mode .deck-link {
    color: var(--muted) !important;
}

body.dark-mode .deck-link i {
    color: var(--muted) !important;
}

body.dark-mode .tip-textarea {
    background: var(--panel) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

body.dark-mode .tip-btn {
    background: var(--panel) !important;
    color: var(--text) !important;
    border: 1px solid var(--accent) !important;
}

body.dark-mode .site-footer {
    background-color: var(--bg) !important;
    border-top: 3px solid var(--border) !important;
    color: var(--text) !important;
}

body.dark-mode .footer-quote,
body.dark-mode .footer-branding,
body.dark-mode .footer-stats,
body.dark-mode .footer-version {
    color: var(--muted) !important;
}

body.dark-mode .footer-links a {
    color: var(--muted) !important;
}

body.dark-mode .story-item:has(+ .story-item) {
    border-bottom: 1px solid var(--border) !important;
}

/* Story items with images: layout kept, vignette (blur) disabled on all images */
.left .story-item.has-image,
.left-column .story-item.has-image,
.center .story-item.has-image,
.center-column .story-item.has-image,
.right .story-item.has-image,
.right-column .story-item.has-image {
    position: relative;
    overflow: hidden;
    padding: 0px;
    border-radius: 0px;
    background-color: transparent;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Vignette disabled: no blurred ::before on any story image */
.left .story-item.has-image::before,
.left-column .story-item.has-image::before,
.center .story-item.has-image::before,
.center-column .story-item.has-image::before,
.right .story-item.has-image::before,
.right-column .story-item.has-image::before {
    display: none !important;
}

.left .story-item.has-image .story-image,
.left-column .story-item.has-image .story-image,
.center .story-item.has-image .story-image,
.center-column .story-item.has-image .story-image,
.right .story-item.has-image .story-image,
.right-column .story-item.has-image .story-image {
    position: relative;
    z-index: 1;
    border-radius: 4px;
    box-shadow: none;
    transition: transform 0.2s ease;
}

.left .story-item.has-image:hover .story-image,
.left-column .story-item.has-image:hover .story-image,
.center .story-item.has-image:hover .story-image,
.center-column .story-item.has-image:hover .story-image,
.right .story-item.has-image:hover .story-image,
.right-column .story-item.has-image:hover .story-image {
    transform: scale(1.01);
}

.left .story-item.has-image a,
.left-column .story-item.has-image a,
.center .story-item.has-image a,
.center-column .story-item.has-image a,
.right .story-item.has-image a,
.right-column .story-item.has-image a {
    position: relative;
    z-index: 1;
    color: #15345B;
    text-shadow: none;
}

/* Dark mode: no background on story items with images */
body.dark-mode .left .story-item.has-image,
body.dark-mode .left-column .story-item.has-image,
body.dark-mode .center .story-item.has-image,
body.dark-mode .center-column .story-item.has-image,
body.dark-mode .right .story-item.has-image,
body.dark-mode .right-column .story-item.has-image {
    background-color: transparent;
}

/* Night mode: images BW + transparent red tint overlay */
body.dark-mode .story-image,
body.dark-mode .headline .story-image,
body.dark-mode .story-image-container img {
    filter: grayscale(100%);
}
body.dark-mode .story-image-container,
body.dark-mode .headline .story-image-container {
    position: relative;
}
body.dark-mode .story-image-container::after,
body.dark-mode .headline .story-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(255, 70, 70, 0.22);
    pointer-events: none;
    border-radius: 3px;
}

body.dark-mode .left .story-item.has-image a,
body.dark-mode .left-column .story-item.has-image a,
body.dark-mode .center .story-item.has-image a,
body.dark-mode .center-column .story-item.has-image a,
body.dark-mode .right .story-item.has-image a,
body.dark-mode .right-column .story-item.has-image a {
    color: var(--text);
    text-shadow: var(--shadow);
}
/* Remove border-bottom for .top-left .story-item specifically */
.top-left .story-item {
    border-bottom: none !important;
    padding-bottom: 0 !important; /* Adjust padding if needed */
    margin-bottom: 0 !important;
}

div#stories-container {
    background: #fff;
}

/* Vignette disabled globally: plain image containers */
.vignette-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-bottom: 5px;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 4px;
}

.vignette-background {
    display: none !important; /* Vignette blur disabled */
}

.vignette-image {
    display: block;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: none;
    position: relative;
}
/* Google Translate Minimalist Styling */
.goog-te-banner-frame, 
.goog-te-balloon-frame,
.goog-te-gadget-icon,
.goog-te-gadget span,
.goog-te-gadget .goog-te-combo + div {
    display: none !important;
}

.goog-te-gadget {
    font-size: 0 !important;
    color: transparent !important;
}

.goog-te-combo {
    background-color: #1a202c !important;
    color: #48bb78 !important;
    border: 1px solid #000 !important;
    padding: 5px !important;
    font-family: 'Share Tech Mono', monospace !important;
    border-radius: 4px;
    outline: none;
}

body {
    top: 0 !important;
    position: static !important;
}

.goog-te-menu-value {
    display: none !important;
}

/* Hide the "Powered by Google" text */
.goog-logo-link {
    display: none !important;
}
.goog-te-gadget {
    height: 0;
}

/* Additional Google Translate Cleanup */
iframe.skiptranslate {
    display: none !important;
}

#goog-gt-tt, .goog-te-balloon-frame {
    display: none !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

/* Nuclear Google Translate Bar Removal */
html {
    top: 0 !important;
}

.goog-te-banner, .goog-te-banner-frame, .goog-te-gadget-icon {
    display: none !important;
}

.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
}

/* Target specific Google Translate obfuscated classes */
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf-ti6hGc {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- KIOSK MODE (1080×1920 vertical screen) --- */
@media (max-width: 1080px) and (min-height: 1900px) {
    .header h1 {
        font-size: 90px;
        font-weight: bold;
        margin: 0 0 25px 0;
        line-height: 75px;
        text-transform: uppercase;
        font-family: 'Gotham', serif;
        text-shadow: 0 3px 12px rgba(0, 0, 0, 0.6), 0 1px 2px rgba(0, 0, 0, 0.75);
    }
}

/* --- Scroll cycle overlay: preloader animation (spinning rings + MD icon) --- */
.scroll-cycle-logo-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 45, 123, 0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease-out;
}
.scroll-cycle-logo-overlay-visible {
    opacity: 1;
}
.scroll-cycle-logo-overlay .scroll-cycle-overlay-inner {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-cycle-logo-overlay .md-preloader-spinner,
.scroll-cycle-logo-overlay .md-preloader-spinner-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}
.scroll-cycle-logo-overlay .md-preloader-spinner {
    border-top-color: rgba(255, 255, 255, 0.9);
    border-right-color: rgba(255, 255, 255, 0.25);
    animation: md-preloader-spin 0.9s linear infinite;
}
.scroll-cycle-logo-overlay .md-preloader-spinner-inner {
    width: 84%;
    height: 84%;
    border-top-color: #2eb31a;
    border-left-color: rgba(46, 179, 26, 0.35);
    animation: md-preloader-spin 1.2s linear infinite reverse;
}
.scroll-cycle-logo-overlay .md-preloader-logo {
    position: relative;
    z-index: 2;
    width: 56px;
    height: 56px;
    padding: 8px;
    box-sizing: content-box;
    object-fit: contain;
    opacity: 0.95;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

/* --- Page preloader (optional; MD icon center + spinning ring, CodePen-style) --- */
#main-content {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}
#main-content.main-content-visible {
    opacity: 1;
}
.md-preloader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(15, 45, 123, 0.92);
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    pointer-events: auto;
}
.md-preloader.md-preloader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.md-preloader-inner {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.md-preloader-spinner,
.md-preloader-spinner-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
}
.md-preloader-spinner {
    border-top-color: rgba(255, 255, 255, 0.9);
    border-right-color: rgba(255, 255, 255, 0.25);
    animation: md-preloader-spin 0.9s linear infinite;
}
.md-preloader-spinner-inner {
    width: 84%;
    height: 84%;
    border-top-color: #2eb31a;
    border-left-color: rgba(46, 179, 26, 0.35);
    animation: md-preloader-spin 1.2s linear infinite reverse;
}
.md-preloader-logo {
    position: relative;
    z-index: 2;
    width: 56px;
    height: 56px;
    padding: 8px;
    box-sizing: content-box;
    object-fit: contain;
    opacity: 0.95;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}
@keyframes md-preloader-spin {
    to { transform: rotate(360deg); }
}

/* newspaper.css */
/* -------------------------------------------------------------------------
   FILE: newspaper.css
   THEME: 1920s-50s West Virginia Broadsheet
   ------------------------------------------------------------------------- */

/* --- SCOPED TO .view-newspaper CLASS --- */
body.view-newspaper {
    background-color: #fdf6e3; /* Aged Paper Color */
    color: #1a1a1a; /* Ink Black */
    font-family: 'OldNewspaperTypes', serif; /* YOUR FONT */
}

/* --- MASTHEAD (THE BRAND) --- */
body.view-newspaper .header-outside {
    background: transparent;
    border-bottom: 3px double #000;
    margin-bottom: 20px;
    padding: 20px 0;
}

body.view-newspaper .header {
    font-family: 'OldNewspaperTypes', serif; /* Consistent Font */
    text-align: center;
    color: #000;
    padding: 10px 0 !important;
}

body.view-newspaper .header h1 {
    font-size: 4.5rem;
    margin: 0;
    line-height: 1;
    font-weight: normal;
    letter-spacing: 2px;
    text-transform: uppercase; /* Often looks better for mastheads in this font */
}

body.view-newspaper .tagline {
    font-family: 'OldNewspaperTypes', serif;
    font-style: italic;
    font-size: 1.1rem;
    margin-top: 10px;
    display: block;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    padding: 5px 0;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* --- DATE LINE / EAR --- */
body.view-newspaper .date-time {
    font-family: 'OldNewspaperTypes', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

/* --- HEADLINE SECTION (The "Screamer") --- */
body.view-newspaper .headline {
    text-align: center;
    border-bottom: 4px solid #000;
    margin-bottom: 25px;
    padding: 20px 0;
}

body.view-newspaper .headline .story-wrapper {
    margin-bottom: 25px;
}

body.view-newspaper .headline a {
    font-family: 'OldNewspaperTypes', serif;
    font-size: 3.2rem; /* Adjusted for impact */
    font-weight: bold;
    text-transform: uppercase;
    line-height: 0.9;
    color: #000 !important;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

body.view-newspaper .headline img {
    filter: grayscale(100%) contrast(120%) sepia(20%);
    border: 1px solid #000;
    box-shadow: none;
    margin-top: 10px;
}

/* --- TOP LEFT (The "Ear") --- */
body.view-newspaper .top-left {
    border-right: 1px solid #000;
    padding-right: 15px;
    margin-right: 15px;
}

/* --- COLUMN LAYOUT (Vertical Rules) --- */
body.view-newspaper .container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    max-width: none;
    margin: 0;
}

@media (max-width: 768px) {
    body.view-newspaper .container {
        grid-template-columns: 1fr;
    }
}

body.view-newspaper .container > div {
    padding: 0 15px;
    border-right: 1px solid #000;
}

body.view-newspaper .container > div:last-child {
    border-right: none;
}

/* --- STORIES --- */
body.view-newspaper .story-item {
    border-bottom: 1px solid #000;
    margin-bottom: 15px;
    padding-bottom: 15px;
}

body.view-newspaper .story-item a {
    font-family: 'OldNewspaperTypes', serif;
    font-size: 1.4rem;
    font-weight: bold;
    color: #000 !important;
    text-decoration: none;
    line-height: 1.1;
    display: block;
    text-align: left; /* Better readability than justify for web */
}

body.view-newspaper .story-item p {
    font-size: 1rem;
    line-height: 1.4;
    margin-top: 5px;
    color: #333;
}

/* --- IMAGES (Vintage Filter) --- */
body.view-newspaper img {
    filter: grayscale(100%) contrast(110%);
    border-radius: 0 !important;
    border: 1px solid #333;
    margin-bottom: 8px;
    width: 100% !important;
}

/* --- TICKER HIDE --- */
body.view-newspaper #news-ticker {
    background: #000;
    border-bottom: 1px solid #fff;
    font-family: 'Courier New', monospace; 
}

/* --- FOOTER --- */
body.view-newspaper footer {
    background: #fdf6e3 !important;
    color: #000 !important;
    border-top: 4px double #000 !important;
}
body.view-newspaper footer a { color: #000 !important; text-decoration: underline; }
body.view-newspaper .footer-branding { font-family: 'OldNewspaperTypes', serif; font-size: 1.5rem; }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 768px) {
    body.view-newspaper .header h1 { font-size: 3rem; }
    body.view-newspaper .container { display: block; }
    body.view-newspaper .container > div { border-right: none; border-bottom: 1px solid #000; padding: 20px 0; }
    body.view-newspaper .headline a { font-size: 2.2rem; }
}
/* responsive.css */
/* App download promo: mobile only (JS adds .app-download-visible when OS + URL match) */
.app-download-promo { display: none !important; }
@media (max-width: 768px) {
    .app-download-promo.app-download-visible { display: block !important; }
    .app-download-promo .app-download-link {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 14px 20px;
        margin: 0 16px 16px;
        background: #1e3a5f;
        color: #fff;
        text-decoration: none;
        border-radius: 8px;
        font-weight: 600;
        font-size: 1rem;
        border: 1px solid rgba(255,255,255,0.2);
        box-sizing: border-box;
    }
    .app-download-promo .app-download-link .app-download-icon { font-size: 1.2rem; }
    .app-download-promo .app-download-link:active { opacity: 0.9; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .header h1 {
        font-size: 60px !important;
        line-height: 80px !important;
        word-wrap: break-word;
        white-space: normal;
    }
}

@media (max-width: 768px) {
    #sector-console { padding: 8px 12px; gap: 6px; }
    #sector-console .console-btn { padding: 6px 10px; font-size: 0.75rem; }
    #sector-console .sector-console-buttons { gap: 4px; }
    body {
        padding-top: 0;
        background-color: #0F2D7B; /* The desired background color for the safe area */
    }

    /* Remove divider line above header (between top stories and header) */
    section.section-top::before,
    section.section-top::after {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
    }

    .site-footer {
        padding-bottom: calc(120px + env(safe-area-inset-bottom)); /* Clear of fixed bottom menu */
    }
    .site-footer-below-deck {
        padding-bottom: 20px;
    }
    /* Keep 25% / 75% column sizes on mobile (no stacking) */

    .header-outside {
        margin-top: 0 !important; /* Override negative margin causing overlap */
    }

    .header {
        background-color: #0F2D7B; /* Ensure solid background color */
    }

    .header .desktop-title { display: block !important; }

    .police-bar {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    /* In-focus stories visible everywhere; hide-on-mobile no longer used */
    /* Center column uses grid below; avoid setting display: block so grid applies */
    #col-center {
        visibility: visible !important;
    }
    .center-two-col-wrapper { display: block !important; }
    .center-col-left,
    .center-col-right { display: block !important; }

    /* Mobile columns: 2-col grid. Layout driven by server: .mobile-full, .mobile-left, .mobile-right (see getMobileGridClass in index.php). */
    .left-column,
    .right-column {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
    }
    .center-column {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
    }
    .center-two-col-wrapper,
    .center-col-left,
    .center-col-right {
        display: contents !important;
    }
    /* Server-set classes: first/last card full width, pairs in left/right columns */
    .left-column .card.wire-card.mobile-full,
    .right-column .card.wire-card.mobile-full,
    .center-column .card.wire-card.mobile-full {
        grid-column: 1 / -1 !important;
    }
    .left-column .card.wire-card.mobile-left,
    .right-column .card.wire-card.mobile-left,
    .center-column .card.wire-card.mobile-left {
        grid-column: 1 !important;
    }
    .left-column .card.wire-card.mobile-right,
    .right-column .card.wire-card.mobile-right,
    .center-column .card.wire-card.mobile-right {
        grid-column: 2 !important;
    }
    /* Ads in column grids span full width */
    .left-column > .ad-slot,
    .center-column .ad-slot,
    .right-column > .ad-slot {
        grid-column: 1 / -1 !important;
    }
    /* Site-wide: last tile/card full width in other 2-col grids (four-pack, etc.) */
    .four-pack .pack-tile:last-child {
        grid-column: 1 / -1 !important;
    }
    .last-child-full-width > *:last-child {
        grid-column: 1 / -1 !important;
    }

    .headline-section, .left-column, .center-column, .right-column {
        border-bottom: 0px solid #ccc !important;
    }

    .leaving-soon-section { width: 100%; box-sizing: border-box; margin: 20px 0; }
    .leaving-soon-item a { word-wrap: break-word; overflow-wrap: break-word; }

    /* Four-pack: 1 column on mobile */
    .four-pack {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .pack-tile {
        border-right: none;
        border-left: none;
        border-bottom: 1px solid #ccc;
        padding: 12px 10px;
    }
    .pack-tile:last-child {
        border-bottom: none;
    }
    /* Remove 2-col specific borders */
    .pack-tile:nth-child(odd),
    .pack-tile:nth-child(even) {
        border-right: none !important;
    }
    .pack-tile:nth-child(n+3) {
        border-bottom: 1px solid #ccc;
    }
    /* Mobile: Collapsible pack sections */
    .pack-header {
        cursor: pointer;
    }
    .pack-header-icons {
        display: flex !important;
    }
    .pack-tile.collapsed .pack-list {
        display: none;
    }
    .pack-toggle-icon {
        display: inline-block !important;
        margin-left: auto;
    }
    .four-pack .story-item.pack-item.micro-thumb-wrap { --micro-thumb-size: 56px; }

    a.topleft-styled-red {
        line-height: 18px;
    }

    .top-content .top-left {
        padding: 0px 10px;
    }

    .header h1 {
        font-size: 44px;
        font-weight: 600;
        margin: 10px 0;
        text-transform: uppercase;
        font-family: 'Gotham', serif;
        line-height: 36px;
    }

    .header {
        padding: 300px 10px 20px 10px !important;
    }

    .header .tagline {
        display: block;
        font-size: 22px;
        font-family: 'Roboto Condensed', sans-serif;
        color: #fff;
        margin-top: -10px;
        border-top: solid 0px;
    }

    .headline .story-image {
        max-width: 100% !important;
    }

    .headline {
        padding: 0;
    }

    .headline a {
        font-size: 24px;
        font-family: 'FiveTwoFive';
    }

    .headline p {
        margin-bottom: 15px;
        line-height: 22px;
        font-family: 'FiveTwoFive';
        text-align: center !important;
    }

    .headline .story-text-container,
    .headline .story-text-container a {
        text-align: center !important;
    }

    .headline .story-item {
        margin-bottom: 0px !important;
        padding-bottom: 0px !important;
    }

    .top-container {
        display: none !important; /* Hide top section on mobile */
    }

    /* --- VOX-STYLE HORIZONTAL FLIP --- */
    /* Card layout on mobile */
    .card {
        width: 100% !important;
        min-height: auto !important;
        margin-bottom: 15px !important;
    }

    .ad-slot {
        width: 100% !important;
        margin-bottom: 15px !important;
    }
    /* Same placeholder text as desktop: "Ad" label + size in .ad-inner */
    .ad-slot .ad-label {
        font-size: 10px;
        color: #999;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .ad-slot .ad-inner::after {
        font-size: 11px;
        color: #999;
    }
    .ad-slot--medium .ad-inner { height: 250px; min-height: 250px; }
    .ad-slot--large .ad-inner { height: 280px; min-height: 280px; }

    .story-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        gap: 15px !important;
        padding-bottom: 15px !important;
        margin-bottom: 0 !important;
        border-bottom: none !important;
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Mobile: stories without an image — story link then story info (stacked) */
    .story-item:not(.has-image) {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    .story-item:not(.has-image) > a {
        display: block !important;
    }
    .story-item:not(.has-image) > .story-meta {
        margin-top: 0 !important;
        padding-top: 2px !important;
    }

    /* Mobile: stories WITH image — image row 1, story row 2, info row 3 (all 100% width) */
    .story-item.has-image {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    .story-item.has-image .story-image-container {
        flex: none !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0 !important;
        display: block !important;
        aspect-ratio: 16 / 9 !important;
        overflow: hidden !important;
    }
    .story-item.has-image .story-text-container {
        flex: none !important;
        width: 100% !important;
    }
    .story-item.has-image .story-meta {
        width: 100% !important;
        margin-top: 0 !important;
    }

    /* Story meta: stack vertically (1, 2, 3) full width on mobile for left/center/right column stories */
    .left-column .story-meta,
    .center-column .story-meta,
    .right-column .story-meta {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        width: 100% !important;
    }
    .left-column .story-meta > span,
    .center-column .story-meta > span,
    .right-column .story-meta > span {
        display: block !important;
        width: 100% !important;
    }

    /* Single-column (full-width) stories on mobile: time and source next to each other */
    .left-column .story-item:first-child .story-meta,
    .right-column .story-item:first-child .story-meta,
    .center-column .story-item:first-of-type .story-meta,
    .left-column .story-item:only-child .story-meta,
    .right-column .story-item:only-child .story-meta,
    .center-column .story-item:only-child .story-meta,
    .left-column .story-item.no-image:not(:has(+ .story-item.no-image)) .story-meta,
    .right-column .story-item.no-image:not(:has(+ .story-item.no-image)) .story-meta,
    .center-column .story-item.no-image:not(:has(+ .story-item.no-image)) .story-meta,
    .left-column .story-item.has-image:nth-child(3n+1) .story-meta,
    .right-column .story-item.has-image:nth-child(3n+1) .story-meta,
    .center-column .story-item.has-image:nth-child(3n+1) .story-meta,
    .left-column .story-item:last-child:nth-child(odd) .story-meta,
    .right-column .story-item:last-child:nth-child(odd) .story-meta,
    .center-column .story-item:last-child:nth-child(odd) .story-meta,
    .left-column .story-item:last-child:nth-child(even) .story-meta,
    .right-column .story-item:last-child:nth-child(even) .story-meta,
    .center-column .story-item:last-child:nth-child(even) .story-meta,
    .left-column > .card:last-child .story-meta,
    .right-column > .card:last-child .story-meta,
    .center-col-left .card:last-child .story-meta,
    .center-col-right .card:last-child .story-meta {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap !important;
    }
    .left-column .story-item:first-child .story-meta > span,
    .right-column .story-item:first-child .story-meta > span,
    .center-column .story-item:first-of-type .story-meta > span,
    .left-column .story-item:only-child .story-meta > span,
    .right-column .story-item:only-child .story-meta > span,
    .center-column .story-item:only-child .story-meta > span,
    .left-column .story-item.no-image:not(:has(+ .story-item.no-image)) .story-meta > span,
    .right-column .story-item.no-image:not(:has(+ .story-item.no-image)) .story-meta > span,
    .center-column .story-item.no-image:not(:has(+ .story-item.no-image)) .story-meta > span,
    .left-column .story-item.has-image:nth-child(3n+1) .story-meta > span,
    .right-column .story-item.has-image:nth-child(3n+1) .story-meta > span,
    .center-column .story-item.has-image:nth-child(3n+1) .story-meta > span,
    .left-column .story-item:last-child:nth-child(odd) .story-meta > span,
    .right-column .story-item:last-child:nth-child(odd) .story-meta > span,
    .center-column .story-item:last-child:nth-child(odd) .story-meta > span,
    .left-column .story-item:last-child:nth-child(even) .story-meta > span,
    .right-column .story-item:last-child:nth-child(even) .story-meta > span,
    .center-column .story-item:last-child:nth-child(even) .story-meta > span,
    .left-column > .card:last-child .story-meta > span,
    .right-column > .card:last-child .story-meta > span,
    .center-col-left .card:last-child .story-meta > span,
    .center-col-right .card:last-child .story-meta > span {
        display: inline-flex !important;
        width: auto !important;
    }

    .story-image-container .story-image,
    .story-item.has-image .story-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: top center !important;
    }

    .story-text-container {
        flex: 1 !important;
        min-width: 0;
    }

    .story-item a {
        display: block !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* Featured (Headline): image on top, story directly below */
    .headline .story-wrapper.story-item {
        flex-direction: column !important;
        gap: 0 !important;
        padding: 0 !important;
        align-items: stretch !important;
    }

    .top5-story-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin-bottom: 10px !important;
        text-align: left !important;
    }

    .top5-story-item .story-image-container {
        flex: 0 0 80px !important;
        width: 80px !important;
        max-width: 80px !important;
        margin-bottom: 0 !important;
    }

    .top5-story-item .top5-story-title {
        font-size: 0.9rem !important;
    }

    .headline .story-image-container {
        margin: 0 auto 0 auto !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        padding: 0;
    }

    .headline .story-image-container img.story-image,
    .headline .story-image {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: top center !important;
        display: block !important;
    }

    .headline .story-text-container {
        width: 100% !important;
        padding-top: 8px !important;
        margin-top: 0 !important;
    }

    .headline .story-wrapper.story-item.has-image .story-text-container {
        order: 2;
    }

    .headline .story-wrapper.story-item.has-image .story-image-container {
        order: 1;
    }

    .headline .story-meta {
        justify-content: center !important;
    }

    /* Headline div expands to content height on mobile (override trench flex) */
    .headline-section {
        height: auto !important;
        min-height: 0 !important;
    }
    .headline-section .headline,
    .container.trench-merged-layout .headline-section .headline {
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* Grid row 1 (headline) sizes to content so it pushes stories down; no fixed 280px overlap */
    .container.trench-merged-layout {
        grid-template-columns: 1fr 1fr !important;
        grid-auto-rows: auto !important;
        gap: 5px !important;
    }
    /* Headline section: single full-width column (override .headline-section { grid-column: 1 } from styles.css) */
    .container.trench-merged-layout .headline-section {
        grid-column: 1 / -1 !important;
    }
    /* Trench items: 3rd, 6th, 9th… (story3, story6, story9…) full width — cards live inside .trench-merged so use its nth-child */
    .container.trench-merged-layout .trench-merged > *:nth-child(3n) {
        grid-column: 1 / -1 !important;
    }

    /* Two-col and single-col story cards: story meta always stacked (3 rows, single column), one row for meta block */
    .container.trench-merged-layout .wire-card .story-meta {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 2px !important;
        margin-top: 6px !important;
        padding: 6px 8px !important;
        width: 100% !important;
        min-height: 0;
    }
    .container.trench-merged-layout .wire-card .story-meta > span {
        display: block !important;
        width: 100% !important;
    }

    /* Story info on its own line, centered and spread evenly (mobile) */
    .story-meta {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-evenly !important;
        align-items: center !important;
        width: 100% !important;
        margin-top: 6px;
        padding-top: 4px;
        text-align: center;
        overflow: visible !important;
        min-height: 0;
    }

    .headline a {
        font-size: 36px !important;
        line-height: 40px !important;
    }

    .top-container {
        display: none !important; /* Hide top section on mobile */
    }

    #news-ticker {
        display: flex; /* Show on mobile */
        flex-direction: row;
        flex-wrap: wrap;
        background: #0F2D7B;
        color: white;
        text-align: center;
        padding: calc(10px + env(safe-area-inset-top)) 10px 10px 10px;
        font-size: 0.95rem;
        font-weight: 500;
        white-space: normal; /* Allow text to wrap */
        overflow: visible; /* let sector dropdown menu extend over content below */
        text-overflow: ellipsis; /* Add ellipsis for overflow */
        line-height: 1.2; /* Adjust line height for two lines */
        max-height: calc(100px + env(safe-area-inset-top)); /* Increased height for weather */
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        z-index: 2000;
        position: sticky; /* Sticky on mobile for testing (iOS/Android) */
        top: 0;
        min-height: 60px;
        align-items: center;
        justify-content: center;
        align-content: center;
        max-width: 100vw;
        gap: 8px;
        transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    }
    #news-ticker.ticker-scrolled-hide {
        transform: translateY(-100%);
    }

    #news-ticker .ticker-content {
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: 100%;
        min-height: 2.4em;
        flex: 1 1 100%;
        order: 1;
        overflow: hidden;
        visibility: visible !important;
    }
    #news-ticker .tactical-bar {
        width: 100%;
        order: 2;
    }
    #news-ticker .header-weather {
        order: 3;
        flex: 1 1 auto;
        min-width: 0;
        margin-right: auto;
        gap: 15px;
        margin-top: 0;
        justify-content: flex-start;
    }
    #news-ticker .sector-dropdown {
        order: 4;
        width: auto;
        max-width: none;
        margin-top: 0;
        align-self: center;
        z-index: 2100;
        box-sizing: border-box;
    }
    #news-ticker .ticker-content a {
        display: block !important;
        visibility: visible !important;
        opacity: 1;
    }
    .sector-dropdown-trigger {
        width: auto;
        min-width: 0;
        padding: 10px 12px;
        justify-content: center;
        box-sizing: border-box;
    }
    #news-ticker .haptic-toggle-btn {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    .sector-dropdown-menu {
        right: 0;
        left: auto;
        width: max-content;
        min-width: 220px;
        max-width: calc(100vw - 40px);
        transform: translateY(-6px);
        z-index: 2200;
    }
    .sector-dropdown.open .sector-dropdown-menu {
        transform: translateY(6px);
    }
    .sector-dropdown-menu::before {
        right: 12px;
        left: auto;
        margin-left: 0;
    }

    /* Hide ad-slot placeholders between stories on mobile (removes blank divs) */
    #col-left .ad-slot,
    .center-col-left .ad-slot,
    .center-col-right .ad-slot,
    #col-right .ad-slot {
        display: none !important;
    }
}

/* Mobile and Tablet Overrides */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr 1fr;
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) { .deck-grid { grid-template-columns: 2fr 1fr; } .deck-sources-content { display: block !important; } .deck-chevron { display: none; } .deck-box.collapsible-mobile h4 { cursor: default; } }

/* Vert tablet / portrait: one column, Submit Tips above WV Sources, footer below WV sources */
@media (orientation: portrait) {
    .deck-grid { grid-template-columns: 1fr; gap: 20px; }
    .deck-contact-footer { order: 1; }
    #deck-sources-box { order: 2; }
    .site-footer-below-deck { order: 3; }
}

@media (max-width: 768px) {
    .deck-grid { grid-template-columns: 1fr; gap: 20px; }
    .deck-contact-footer { order: 1; }
    #deck-sources-box { order: 2; }
    .site-footer-below-deck { order: 3; }
    .deck-box.collapsible-mobile { width: 100%; box-sizing: border-box; }
    .deck-box.collapsible-mobile .deck-sources-header { width: 100%; box-sizing: border-box; }
    .deck-sources-content { display: none; margin-top: 15px; column-count: 1; column-gap: 16px; width: 100%; box-sizing: border-box; }
    .deck-box.collapsible-mobile.open .deck-sources-content { column-count: 1; display: block !important; width: 100%; }
    .deck-box.collapsible-mobile h4 { cursor: pointer; display: flex; justify-content: space-between; align-items: center; margin-bottom: 0; border-bottom: none; }
    .deck-box.collapsible-mobile.open h4 { border-bottom: 1px solid #ccc; margin-bottom: 15px; }
    .deck-sources-filters { display: none !important; }
    .deck-box.collapsible-mobile.open .deck-sources-filters {
        display: flex !important;
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex-wrap: wrap;
        margin-top: 8px;
    }
}

/* Four-pack: one column on mobile (portrait) to match main mobile layout */
@media (orientation: portrait) {
    .four-pack { grid-template-columns: 1fr; }
    .pack-tile { border-right: none !important; border-left: none !important; border-bottom: 1px solid #ccc !important; }
    .pack-tile:last-child { border-bottom: none !important; }
    .pack-tile:nth-child(n+3) { border-bottom: 1px solid #ccc; }
    .pack-tile:nth-child(even) { border-left: none !important; }
}

/* Four-pack: one column on narrow mobile */
@media (max-width: 480px) {
    .four-pack { grid-template-columns: 1fr; }
    .pack-tile { border-right: none !important; border-left: none !important; border-bottom: 1px solid #ccc !important; }
    .pack-tile:last-child { border-bottom: none !important; }
    .pack-tile:nth-child(n+3) { border-bottom: 1px solid #ccc; }
    .pack-tile:nth-child(even) { border-left: none !important; }
    /* Ensure icons are visible on narrow mobile */
    .pack-header-icons {
        display: flex !important;
    }
    .pack-section-icon {
        font-size: 1rem;
    }
    .pack-toggle-icon {
        font-size: 0.9rem;
    }
}

@keyframes fadeOutHighlight {
    0% {
        border-color: #ff0000;
        box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    }
    100% {
        border-color: transparent;
        box-shadow: none;
    }
}

@media only screen and (max-width: 767px) {
    .update-status {
        margin-bottom: 5px;
        gap: 4px;
    }
    .update-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
    .date-time {
        font-size: 14px;
        color: #fff;
        margin-bottom: 10px;
        line-height: 1.4;
        text-align: center;
    }
}
/* Aggressively hide Google Translate loading/floating elements on mobile */
@media (max-width: 768px) {
    #goog-gt-tt, 
    .goog-te-balloon-frame, 
    .goog-te-spinner-pos, 
    .goog-te-spinner,
    .goog-te-gadget-icon,
    img[src*="translate_24dp.png"],
    img[src*="google_logo"],
    .skiptranslate,
    iframe.skiptranslate {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* --- Archive page (md-entry/archive.php) — mobile --- */
@media (max-width: 768px) {
    body.archive-page {
        padding: calc(12px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)) 12px;
        min-width: 0;
    }
    body.archive-page .archive-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }
    body.archive-page .archive-header h1 {
        font-size: 1.1rem;
        text-align: center;
    }
    body.archive-page .back-link {
        justify-content: center;
        padding: 10px 14px;
    }
    body.archive-page .month-tabs {
        gap: 10px;
        margin-bottom: 16px;
    }
    body.archive-page .month-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Card layout for stories table */
    body.archive-page .stories-table,
    body.archive-page .stories-table thead,
    body.archive-page .stories-table tbody tr,
    body.archive-page .stories-table tbody td {
        display: block;
    }
    body.archive-page .stories-table thead {
        display: none;
    }
    body.archive-page .stories-table tbody tr {
        border: 1px solid #4a5568;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 12px;
        background: #2d3748;
    }
    body.archive-page .stories-table tbody td {
        padding: 6px 0;
        border-bottom: none;
        max-width: none;
    }
    body.archive-page .stories-table tbody td:last-child {
        padding-top: 10px;
        border-top: 1px solid rgba(74, 85, 104, 0.5);
        margin-top: 4px;
    }
    body.archive-page .stories-table tbody td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #a0aec0;
        font-size: 0.8rem;
    }
    body.archive-page .stories-table .title {
        font-weight: 500;
        padding-bottom: 8px;
    }
    body.archive-page .stories-table .title::before {
        display: block;
        margin-bottom: 2px;
    }
    body.archive-page .empty {
        padding: 16px 12px;
    }
    body.archive-page .archive-search-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    body.archive-page .archive-search-wrap .search-icon-wrap {
        min-width: 0;
    }
    body.archive-page .archive-search-wrap input {
        min-width: 0;
        min-height: 44px;
        box-sizing: border-box;
    }
}

