/* 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: linear-gradient(rgba(15, 45, 123, 0.5), rgba(15, 45, 123, 0.5)), url('/images/header-bg.jpg') !important; background-size: cover, cover !important; background-position: center center, center center !important; background-repeat: no-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 (control: radio + :has() toggle between HQ / Local) --- */
.header-weather.control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    position: relative;
    z-index: 10;
    padding: 12px 20px 12px 0;
}
.weather-control-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.weather-control-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}
/* Both tabs: darker background; toggled tab highlights */
.weather-control-tab {
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: Gotham, sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2eb31a;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    box-sizing: border-box;
}
.weather-control-tab .weather-item {
    min-height: 0;
}
.weather-control-tab:hover {
    color: #2eb31a;
}
/* Toggled tab: highlight */
.control:has(#weather-location:checked) .weather-control-tab[for="weather-location"] {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.1);
    color: #2eb31a;
}
.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); }
.weather-zip-row { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.weather-zip-input { width: 4em; padding: 4px 6px; font-size: 0.75rem; border: 1px solid rgba(255,255,255,0.4); border-radius: 4px; background: rgba(0,0,0,0.2); color: #fff; }
.weather-zip-input::placeholder { color: rgba(255,255,255,0.5); }
.weather-zip-go { padding: 4px 10px; font-size: 0.7rem; border: 1px solid rgba(255,255,255,0.5); border-radius: 4px; background: rgba(255,255,255,0.15); color: #fff; cursor: pointer; }
.weather-zip-go:hover { background: rgba(255,255,255,0.25); }
.weather-geo-btn { margin-top: 6px; }
.weather-forecast-update { margin: 1rem 0 0; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.2); text-align: center; }
.weather-forecast-update-link { font-size: 0.85rem; color: rgba(255,255,255,0.8); background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline; }
.weather-forecast-update-link:hover { color: #fff; }

.weather-forecast-zip-block .weather-forecast-zip-hint {
    margin: 0 0 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.weather-zip-row--modal {
    justify-content: center;
    margin-top: 0;
    flex-wrap: wrap;
}
.weather-zip-input--modal {
    width: 5.5em;
    font-size: 0.85rem;
    padding: 6px 8px;
}
.weather-forecast-zip-block .weather-zip-go {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* Weather forecast popup (ticker weather click) */
.weather-forecast-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 45, 123, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.weather-forecast-overlay.weather-forecast-open {
    opacity: 1;
    visibility: visible;
}
.weather-forecast-box {
    background: #0F2D7B;
    color: #fff;
    border-radius: 12px;
    padding: 20px 24px 24px;
    max-width: 360px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.weather-forecast-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.weather-forecast-close:hover { background: rgba(255, 255, 255, 0.25); }
.weather-forecast-title {
    margin: 0 32px 16px 0;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25em;
}
.weather-forecast-title .weather-forecast-update-link-inline {
    font-size: 0.7em;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
}
.weather-forecast-title .weather-forecast-update-link-inline:hover {
    color: rgba(255, 255, 255, 0.95);
}
.weather-forecast-days { display: flex; flex-direction: column; gap: 10px; }
.weather-forecast-day {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.9rem;
}
.weather-forecast-day:last-child { border-bottom: none; }
.weather-forecast-dayname { width: 36px; flex-shrink: 0; font-weight: 600; }
.weather-forecast-icon { width: 24px; text-align: center; opacity: 0.95; }
.weather-forecast-icon--sun { color: #facc15; }
.weather-forecast-icon--cloud { color: #fb923c; }
.weather-forecast-icon--fog { color: #9ca3af; }
.weather-forecast-icon--rain { color: #38bdf8; }
.weather-forecast-icon--snow { color: #7dd3fc; }
.weather-forecast-icon--storm { color: #fbbf24; }
.weather-forecast-temps { margin-left: auto; font-weight: 500; }
.weather-forecast-loading,
.weather-forecast-error { margin: 0; font-size: 0.9rem; opacity: 0.9; }

.weather-forecast-extras {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.weather-forecast-today-label {
    margin: 0 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.85);
}
.weather-forecast-today-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 10px;
}
.weather-forecast-extra {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}
.weather-forecast-extra i { opacity: 0.9; }
.weather-forecast-radar-wrap {
    margin: 0;
    padding-top: 6px;
}
.weather-forecast-radar-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}
.weather-forecast-radar-link:hover { color: #fff; }
.weather-forecast-radar-cell {
    margin-top: 1rem;
}
.weather-forecast-radar-embed {
    margin: 10px 0 0;
    padding: 0;
}
.weather-forecast-radar-embed .weather-radar-loop {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}


/* --- 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;
    position: relative;
    z-index: 1200;
    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-current-label {
    margin-right: 6px;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}
.sector-dropdown-current-label:empty {
    margin-right: 0;
}
/* Sector satellite icon: concentric green pulse behind icon (same motion as MD brand ticker pulse) */
.sector-dropdown-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}
.sector-dropdown-pulse.loader {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 52px;
    height: 52px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
}
.sector-dropdown-pulse .circle {
    position: absolute;
    left: 50%;
    top: 50%;
    border-radius: 50%;
    animation-duration: 15s;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    transform: translate(-50%, -50%) scale(1);
    box-sizing: border-box;
}
.sector-dropdown-pulse .circle-1 {
    width: 36px;
    height: 36px;
    background: linear-gradient(109.8deg, rgba(52, 248, 35, 0.1855) 0%, rgba(68, 253, 38, 0.196) 100%);
    animation-name: md-ticker-brand-circle-1;
}
.sector-dropdown-pulse .circle-2 {
    width: 30px;
    height: 30px;
    background: linear-gradient(109.8deg, rgba(52, 248, 35, 0.22) 0%, rgba(68, 253, 38, 0.23) 100%);
    animation-name: md-ticker-brand-circle-2;
}
.sector-dropdown-pulse .circle-3 {
    width: 24px;
    height: 24px;
    background: linear-gradient(109.8deg, rgba(52, 248, 35, 0.265) 0%, rgba(68, 253, 38, 0.28) 100%);
    animation-name: md-ticker-brand-circle-3;
}
.sector-dropdown-pulse .circle-4 {
    width: 14px;
    height: 14px;
    background: linear-gradient(109.8deg, rgba(52, 248, 35, 0.265) 0%, rgba(68, 253, 38, 0.28) 100%);
    animation-name: md-ticker-brand-circle-4;
}
.sector-dropdown.open .sector-dropdown-pulse .circle {
    animation-play-state: paused;
}
/* Full-viewport blur and tap block behind sector menu when open — mobile only (see responsive.css) */
.sector-dropdown-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1199;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(15, 45, 123, 0.4);
    pointer-events: none;
}
body.sector-menu-open {
    overflow: hidden;
}
.sector-dropdown-icon {
    position: relative;
    z-index: 1;
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0.95;
    transition: transform 0.2s ease, opacity 0.2s ease;
    line-height: 1;
    font-weight: normal;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    user-select: none;
    -webkit-user-select: none;
    speak: never;
}
.sector-dropdown.open .sector-dropdown-icon {
    transform: scale(1.06);
    opacity: 1;
}
.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: 1201;
    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: 0;
    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);
}
/* Header at top of sector dropdown — match Command Deck zone header (font, weight, letter-spacing); color adapted for dark menu */
.sector-dropdown-header {
    margin: 0;
    padding: 10px 20px 8px;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    list-style: none;
    pointer-events: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-family: Gotham, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.sector-dropdown-option {
    position: relative;
    z-index: 1;
    padding: 0 20px;
}
li.sector-dropdown-option {
    font-size: 20px;
    padding: 20px 10px 20px 10px;
    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,
.sector-dropdown-header + .sector-dropdown-option {
    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;
}
/* Chip matching story-sector pill; full row keeps menu background */
.sector-dropdown-option-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    box-sizing: border-box;
    max-width: 100%;
    line-height: 1.2;
}
.sector-dropdown-option-text {
    display: inline-block;
}
.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-on-page rows: colored pill only; row uses normal menu bg + hover */
li.sector-dropdown-option.sector-dropdown-option--stories,
li.sector-dropdown-option.sector-dropdown-option--stories.active,
li.sector-dropdown-option.sector-dropdown-option--stories.active:hover {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
}
li.sector-dropdown-option.sector-dropdown-option--stories:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}
li.sector-dropdown-option.sector-dropdown-option--stories:hover .sector-dropdown-option-pill {
    filter: brightness(0.96);
}
li.sector-dropdown-option.sector-dropdown-option--stories.active {
    box-shadow: inset 4px 0 0 0 #2eb31a;
    font-weight: 600;
}
li.sector-dropdown-option.sector-dropdown-option--stories.active:hover {
    background: rgba(255, 255, 255, 0.1);
}
li.sector-dropdown-option.sector-dropdown-option--stories.active:hover .sector-dropdown-option-pill {
    filter: brightness(0.94);
}
.sector-dropdown-separator {
    display: none;
}
/* --- TICKER --- */
#news-ticker {
    display: flex;
    padding: 10px 40px 10px 40px;
    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;
}
/* Scroll-collapse (JS): short landscape uses same bridge as mobile; max-width 768 rules live in responsive.css */
#news-ticker.ticker-scrolled-hide {
    transform: translateY(-100%);
    /* Sticky + translate still hit-tests in the top band on some WebViews; let the page scroll underneath */
    pointer-events: none;
}
/* 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;
}
/* MD mark to the left of weather — visible after .header-outside scrolls past (body script adds .ticker-sticky) */
#news-ticker .ticker-md-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    border: 0;
    transition: max-width 0.28s ease, opacity 0.22s ease, margin 0.22s ease;
    pointer-events: none;
}
#news-ticker.ticker-sticky .ticker-md-brand {
    max-width: 40px;
    opacity: 1;
    margin-right: 0;
    margin-left: 10px;
    position: relative;
    overflow: visible;
}
/* Sticky MD icon: logo only (no green pulse rings behind it) */
#news-ticker.ticker-sticky .ticker-md-brand .ticker-md-brand-pulse.loader {
    display: none !important;
}
/* One pulse burst every 15s (sector dropdown radar); first 10% (~1.5s) mirrors former continuous 1.5s cycle */
@keyframes md-ticker-brand-circle-1 {
    0%, 10%, 100% { transform: translate(-50%, -50%) scale(1); }
    5% { transform: translate(-50%, -50%) scale(1.2); }
}
@keyframes md-ticker-brand-circle-2 {
    0%, 10%, 100% { transform: translate(-50%, -50%) scale(1); }
    5% { transform: translate(-50%, -50%) scale(1.2); }
}
@keyframes md-ticker-brand-circle-3 {
    0%, 10%, 100% { transform: translate(-50%, -50%) scale(1); }
    5% { transform: translate(-50%, -50%) scale(1.2); }
}
@keyframes md-ticker-brand-circle-4 {
    0%, 10%, 100% { transform: translate(-50%, -50%) scale(1); }
    5% { transform: translate(-50%, -50%) scale(1.2); }
}
#news-ticker .ticker-md-brand-img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
    #news-ticker .sector-dropdown .sector-dropdown-pulse .circle {
        animation: none;
        opacity: 0;
    }
}

/* Ticker weather: all viewports — left until MD icon (.ticker-sticky), then centered; 14px loc/temp in bar */
#news-ticker .header-weather.control {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 0;
    margin-right: auto;
    justify-content: flex-start;
}
#news-ticker.ticker-sticky .header-weather.control {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}
#news-ticker .weather-temp,
#news-ticker .weather-loc {
    font-size: 14px;
    line-height: 1.05;
}
#news-ticker .weather-info {
    text-align: left;
    align-items: flex-start;
}
#news-ticker .weather-chiclet {
    justify-content: flex-start;
}
#news-ticker .weather-control-tabs {
    justify-content: flex-start;
}
#news-ticker.ticker-sticky .weather-info {
    text-align: center;
    align-items: center;
}
#news-ticker.ticker-sticky .weather-chiclet {
    justify-content: center;
}
#news-ticker.ticker-sticky .weather-control-tabs {
    justify-content: center;
}

#news-ticker .ticker-content {
    display: none; /* news removed from ticker */
}
#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) */
/* Last-updated strip: mobile-only (shown in responsive.css); mirrors header stoplight */
#news-ticker .ticker-last-updated {
    display: none;
}
#news-ticker .ticker-last-updated-inner {
    width: 100%;
    box-sizing: border-box;
}

#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 !important;
    margin-bottom: 8px;
}
/* Headline section with story image as background: image fills section, text container has white panel */
.headline-section.headline-section-has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 280px;
}
.headline-section.headline-section-has-image .story-image-container {
    display: none;
}
.headline-section .headline .story-text-container {
    background: #fff;
    padding: 16px 20px;
    margin-top: 0;
    position: relative;
    z-index: 2;
    border-radius: 4px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.08);
}
.headline-section.headline-section-has-image .headline .story-text-container {
    margin-top: 24px;
}

.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 {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 400;
    opacity: 0.7;
}
.story-reading-time i {
    font-size: 0.7em;
    opacity: 0.9;
}
.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 columns + merged trench wire-cards --- */
/* Merged trench: strip default .wire-card shell so neumorphic lives on .story-item */
body.view-cards .container.trench-merged-layout .wire-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
/* 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,
body.view-cards .container.trench-merged-layout .wire-card .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 .right-column .story-item {
    background: #e4e4e4;
}
body.view-cards .left-column .story-item:hover,
body.view-cards .center-column .story-item:hover,
body.view-cards .right-column .story-item:hover,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .story-item::after,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .story-item a {
    font-size: 20px !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,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.view-cards .container.trench-merged-layout .wire-card .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,
body.dark-mode.view-cards .container.trench-merged-layout .wire-card .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 .container.trench-merged-layout .wire-card .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,
body.dark-mode.view-cards .container.trench-merged-layout .wire-card .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,
body.dark-mode.view-cards .container.trench-merged-layout .wire-card .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,
body.dark-mode.view-cards .container.trench-merged-layout .wire-card .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: 20px;
    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; }
}

/* --- FOOTER REVEAL (scroll past stories + four-pack: scale “card”, deck/footer below — CodePen KdKoKQ style) --- */
.md-footer-reveal-wrapper {
    position: relative;
    z-index: 2;
    transform-origin: center bottom;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

body.md-footer-reveal-tight .md-footer-reveal-wrapper {
    transform: translateY(-48px) scale(0.92);
    cursor: pointer;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .md-footer-reveal-wrapper {
        transition: opacity 0.35s ease;
    }
    body.md-footer-reveal-tight .md-footer-reveal-wrapper {
        transform: none;
        opacity: 0.97;
    }
}

/* Full-bleed dark stripe (same edge-to-edge treatment as About / page.php) */
.md-footer-reveal-below {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    position: relative;
    z-index: 1;
    background-color: #0B2364;
    box-sizing: border-box;
}

/* Extended footer (reference: multi-column + contact icons + social; light text on #0B2364) */
.md-footer-extended {
    padding: 2.5rem 1.25rem 2rem;
    color: rgba(255, 255, 255, 0.92);
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 22px;
}

.md-footer-ext-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 1.25rem;
}

.md-footer-ext-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.md-footer-ext-logo {
    display: block;
    flex-shrink: 0;
    border-radius: 8px;
}

.md-footer-ext-wordmark {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    text-transform: uppercase;
    font-family: 'Gotham', sans-serif;
}

.md-footer-ext-tagline {
    margin: 0;
    max-width: 28rem;
    font-size: 22px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

.md-footer-ext-rule {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    margin: 0 0 1.75rem;
}

.md-footer-ext-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 2.5rem;
    margin-bottom: 1.75rem;
}

.md-footer-ext-heading {
    margin: 0 0 0.85rem;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.95);
}

.md-footer-ext-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.md-footer-ext-links li {
    margin-bottom: 0.55rem;
}

.md-footer-ext-links a {
    color: #fff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.md-footer-ext-links a:hover {
    color: #fff;
    text-decoration: underline;
    opacity: 0.92;
}

.md-footer-ext-contact {
    list-style: none;
    margin: 0;
    padding: 0;
}

.md-footer-ext-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
}

.md-footer-ext-contact a {
    color: #fff;
    text-decoration: none;
    word-break: break-word;
}

.md-footer-ext-contact a:hover {
    text-decoration: underline;
    color: #fff;
}

.md-footer-ext-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(82, 199, 58, 0.2);
    color: #7dd87a;
    font-size: 22px;
}

.md-footer-ext-col--aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.md-footer-ext-lang {
    margin-bottom: 1rem;
}

.md-footer-ext-lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    font-size: 22px;
    color: #fff;
}

.md-footer-ext-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}

.md-footer-ext-copy {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.55);
}

.md-footer-ext-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
}

.md-footer-ext-legal a {
    font-size: 22px;
    color: #fff;
    text-decoration: none;
}

.md-footer-ext-legal a:hover {
    color: #fff;
    text-decoration: underline;
    opacity: 0.92;
}

.md-footer-reveal-arrow {
    position: fixed;
    bottom: 50px;
    left: 50%;
    margin-left: -28px;
    width: 56px;
    height: 56px;
    padding: 0;
    z-index: 100;
    border: none;
    border-radius: 50%;
    background-color: #e53e3e;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.md-footer-reveal-arrow[hidden] {
    display: none !important;
}

/* Scroll cue disabled (keep button in DOM for a11y/JS; never show when visible) */
.md-footer-reveal-arrow:not([hidden]) {
    display: none !important;
}

/* --- 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: constant(safe-area-inset-top); /* Older iOS / iPadOS */
    padding-top: env(safe-area-inset-top); /* Dynamic Island, status bar (viewport-fit=cover) */
    font-family: 'Roboto Condensed', sans-serif;
    color: #000000;
    transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
}

/* Homepage: blueprint grid backdrop (standard index + index-boxed); grid shows behind content */
html:has(body.md-index-front),
html:has(body.md-index-boxed) {
    min-height: 100%;
    background-color: #0f2d7b; /* Fills safe-area / overscroll where body padding offsets content */
}
body.md-index-front,
body.md-index-boxed {
    margin: 0;
    min-height: 100%;
    background-color: #0f2d7b;
    background-image:
        linear-gradient(0deg,
            transparent 9%, rgba(255, 255, 255, 0.14) 10%, rgba(255, 255, 255, 0.14) 12%, transparent 13%,
            transparent 29%, rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0.07) 31%, transparent 32%,
            transparent 49%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.07) 51%, transparent 52%,
            transparent 69%, rgba(255, 255, 255, 0.07) 70%, rgba(255, 255, 255, 0.07) 71%, transparent 72%,
            transparent 89%, rgba(255, 255, 255, 0.07) 90%, rgba(255, 255, 255, 0.07) 91%, transparent 92%, transparent),
        linear-gradient(90deg,
            transparent 9%, rgba(255, 255, 255, 0.14) 10%, rgba(255, 255, 255, 0.14) 12%, transparent 13%,
            transparent 29%, rgba(255, 255, 255, 0.07) 30%, rgba(255, 255, 255, 0.07) 31%, transparent 32%,
            transparent 49%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.07) 51%, transparent 52%,
            transparent 69%, rgba(255, 255, 255, 0.07) 70%, rgba(255, 255, 255, 0.07) 71%, transparent 72%,
            transparent 89%, rgba(255, 255, 255, 0.07) 90%, rgba(255, 255, 255, 0.07) 91%, transparent 92%, transparent),
        linear-gradient(#0f2d7b, #0f2d7b);
    background-size: 50px 50px, 50px 50px, auto;
    background-attachment: fixed;
}

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) - story titles */
.left .story-item a {
    font-size: 20px;
}

/* 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: 20px;
}
/* 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; trench/column story links use 20px 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: 20px;
    }
}

.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"),
        linear-gradient(rgba(15, 45, 123, 0.5), rgba(15, 45, 123, 0.5)),
        url('/images/header-bg.jpg') !important;
    background-color: rgba(0, 40, 85, 0.9);
    background-blend-mode: darken, normal, normal;
    background-repeat: repeat, no-repeat, no-repeat;
    background-position: 0 0, center center, center center;
    background-size: auto, cover, cover;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    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-content {
    position: relative;
    z-index: 1;
    border-top: 0px double #fff;
    border-bottom: 0px double #fff;
    padding: 1em 0;
}

/* Animate.css (header entrance): wrappers get slideInDown / slideInUp so h1 keeps its text-fill animation */
.header .md-header-title-anim,
.header .md-header-tagline-anim {
    display: block;
    overflow: visible;
}
/* Same duration + no stagger so title and tagline finish together (Animate.css v4 vars, see animate.style) */
.header .md-header-title-anim.animate__animated,
.header .md-header-tagline-anim.animate__animated {
    --animate-duration: 0.85s;
    --animate-delay: 0s;
}

h1.desktop-title {
    margin-bottom: -30px !important;
}

.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,
.header .desktop-title {
    font-size: 90px;
    font-weight: bold;
    margin: 0px 0;
    text-transform: uppercase;
    font-family: 'Gotham', serif;
    letter-spacing: 0;
    /* Gradient fill uses background-clip: text — use drop-shadow (not text-shadow) for depth */
    /* CodePen DbwjOR: animated text fill – hue via --header-animation-hue (settings) */
    background: url(https://i.ibb.co/RDTnNrT/animated-text-fill.png) repeat-y;
    -webkit-filter: hue-rotate(var(--header-animation-hue, 200deg)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
    filter: hue-rotate(var(--header-animation-hue, 200deg)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: aitf 80s linear infinite;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

h1.desktop-title {
    margin-bottom: -30px !important;
}

/* When animation disabled via Settings → Header Animation */
body.header-animation-off .header .desktop-title,
body.header-animation-off .header h1 {
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #fff !important;
    color: #fff;
    animation: none !important;
    -webkit-filter: none !important;
    filter: none !important;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.35);
}

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

/* Franklin quote: desktop header only (above LAST UPDATED); image removed from deck */
.header .header-franklin-quote.md-header-quote-desktop {
    display: none;
}

@media (min-width: 769px) {
    .header .header-franklin-quote.md-header-quote-desktop {
        display: block;
        position: relative;
        z-index: 1;
        margin: 0 auto 10px;
        max-width: 44rem;
        padding: 0 16px;
        font-family: 'Roboto Condensed', sans-serif;
        font-style: italic;
        font-size: 1.05rem;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.72);
        text-align: center;
        line-height: 1.4;
        letter-spacing: 0.02em;
    }
}

.header .update-status-line {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.4em;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.header .update-status-line .update-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.header .update-badge {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 10px;
    border: 1px solid currentColor;
    animation: update-badge-blink 3s ease-in-out infinite;
}

@keyframes update-badge-blink {
    0%   { box-shadow: 0 0 10px currentColor; }
    50%  { box-shadow: 0 0 30px currentColor; }
    100% { box-shadow: 0 0 10px currentColor; }
}

.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: 28px;
    font-family: 'Roboto Condensed', sans-serif;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5em;
    font-style: normal;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.4em;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.35);
}

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

/* CodePen DbwjOR: animate background for text fill */
@keyframes aitf {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.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;
}

/* Grid: same column structure, headline in center with stories on either side */
.container.trench-merged-layout {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    grid-auto-flow: dense;
    align-items: start;
    gap: 8px;
    padding: 8px;
}
@media (min-width: 30em) {
    .container.trench-merged-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 60em) {
    .container.trench-merged-layout {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Desktop (not phone, not tablet): 4 columns */
@media (min-width: 1025px) {
    .container.trench-merged-layout {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (min-width: 80em) {
    .container.trench-merged-layout {
        grid-template-columns: repeat(4, 1fr);
    }
}

/*
 * Masonry packing: ragged column stacks (fewer “row holes”) while headline still spans center via grid placement.
 * Firefox: about:config layout.css.grid-template-masonry-value.enabled = true if needed.
 * Safari (experimental): enable CSS Masonry in Develop menu. Chromium: dense grid fallback until masonry ships.
 */
@media (min-width: 769px) {
    @supports (grid-template-rows: masonry) {
        .container.trench-merged-layout {
            grid-template-rows: masonry;
        }
    }
}

/* Headline in center with stories on either side */
.container.trench-merged-layout .headline-section {
    grid-column: 1 / -1;
    grid-row: auto;
    order: -1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
@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;
    }
}
@media (min-width: 80em) {
    .container.trench-merged-layout .headline-section {
        grid-column: 2 / 4;
        grid-row: 1 / span 2;
    }
}
@media (min-width: 100em) {
    .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;
}
.trench-merged {
    display: contents;
}
.trench-merged .wire-card,
.trench-merged .ad-slot {
    min-width: 0;
}

/* Masonry-style cards: height follows content */
.container.trench-merged-layout .wire-card {
    min-height: 0;
    height: auto;
    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: 0 1 auto; /* Shrink to content for masonry */
    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; }

/* No-stories overlay: brief centered modal when sector has no matches */
.sector-no-stories-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}
.sector-no-stories-overlay.sector-no-stories-overlay-visible {
    opacity: 1;
    pointer-events: auto;
}
.sector-no-stories-overlay.sector-no-stories-overlay-out {
    opacity: 0;
    pointer-events: none;
}
.sector-no-stories-overlay-text {
    padding: 20px 28px;
    font-family: Gotham, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: rgba(15, 45, 123, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    text-align: center;
}

/* 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; }
}

/* Kiosk mode: header title size (add body class "kiosk" when in kiosk) */
body.kiosk .header h1,
body.kiosk .header .desktop-title {
    font-size: 85px;
}

/* 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.headline-section-hidden { display: none !important; }
.wire-card.headline-card-hidden { display: none !important; }
.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: single column on small screens */
    .container.trench-merged-layout {
        grid-template-columns: 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: story titles in columns 1-3 */
    .left-column .story-item a,
    .center-column .story-item a,
    .right-column .story-item a {
        font-size: 20px;
    }
}

/* 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-family: 'Roboto Condensed', sans-serif;
    font-weight: 300;
    text-align: left;
}
.left-column .story-item a,
.center-column .story-item a,
.right-column .story-item a {
    font-size: 20px;
}
.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 .sector-dropdown-icon {
    color: #fff !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-section .headline .story-text-container {
    background: var(--panel) !important;
    box-shadow: var(--shadow);
}
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 .header .header-franklin-quote.md-header-quote-desktop {
    color: var(--muted) !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.4); /* match MD header overlay opacity */
    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;
    background: #0B2364 !important;
}
body.md-index-front #main-content.main-content-visible,
body.md-index-boxed #main-content.main-content-visible {
    background: transparent !important;
}
.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.4);
    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); }
}

/* --- Command Deck header dropdown (Figma-style, mobile) --- */
body.deck-index #deck-main-wrap .crate-scroll {
    padding: 0px 60px 24px 0px;
}
.deck-header-wrap { position: relative; }
.deck-menu-trigger {
    display: none; /* Shown on mobile via responsive.css */
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}
.deck-menu-trigger:hover { background: rgba(255,255,255,0.25); }
#deck-nav-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1001;
    background: #0F2D7B;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    overflow: hidden;
}
#deck-nav-dropdown[hidden] { display: none !important; }

/* Desktop specific rules to ensure menu is hidden */
@media (min-width: 769px) {
    .deck-menu-trigger { display: none !important; }
    .deck-nav-dropdown { display: none !important; }
}
.deck-dropdown-menu { padding: 0; }
.deck-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.deck-dropdown-list li { margin: 0; padding: 0; }
.deck-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.deck-dropdown-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.deck-dropdown-item.active { color: #52c73a; }
.deck-dropdown-item i, .deck-dropdown-item svg { flex-shrink: 0; width: 20px; text-align: center; }
.deck-dropdown-item.breaking { color: #e53e3e; }
.deck-dropdown-item.breaking:hover { background: rgba(229,62,62,0.15); }
.deck-dropdown-item.site-off-toggle.is-off { color: #e53e3e; }
.deck-dropdown-item.site-off-toggle.is-on { color: #52c73a; }

/* Static CMS pages (page.php) — letter-in-a-box on paper tone */
body.md-static-page-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #e8e4dc;
    background-image: linear-gradient(180deg, #dfe6f0 0%, #e8e4dc 28%, #ebe6dc 100%);
    color: #1a202c;
}

.md-page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.md-page-topbar {
    flex-shrink: 0;
    padding: 12px 20px;
    background: #0F2D7B;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.md-page-home-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.md-page-home-link img {
    border-radius: 8px;
    display: block;
}

.md-page-letter-main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 28px 18px 40px;
    box-sizing: border-box;
}

.md-page-letter {
    background: #fdfbf7;
    border: 1px solid rgba(15, 45, 123, 0.12);
    border-radius: 4px;
    padding: 2.25rem 2rem 2.5rem;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.85) inset,
        0 12px 40px rgba(15, 45, 123, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.06);
}

.md-page-letter-title {
    margin: 0 0 1.25rem;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #0F2D7B;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.md-page-letter-body {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.125rem;
    line-height: 1.65;
    color: #2d3748;
}

.md-page-letter-body p {
    margin: 0 0 1em;
}

.md-page-letter-body--content h1,
.md-page-letter-body--content h2,
.md-page-letter-body--content h3,
.md-page-letter-body--content h4 {
    font-family: 'Roboto Condensed', sans-serif;
    color: #0F2D7B;
    margin: 1.25em 0 0.5em;
    line-height: 1.25;
}

.md-page-letter-body--content h1:first-child,
.md-page-letter-body--content h2:first-child,
.md-page-letter-body--content h3:first-child {
    margin-top: 0;
}

.md-page-letter-body--content ul,
.md-page-letter-body--content ol {
    margin: 0 0 1em 1.25em;
    padding: 0;
}

.md-page-letter-body--content li {
    margin-bottom: 0.35em;
}

.md-page-letter-body--content a {
    color: #0F2D7B;
    text-decoration: underline;
}

.md-page-letter-body--content img {
    max-width: 100%;
    height: auto;
}

.md-page-letter-body--content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 0.95em;
}

.md-page-letter-body--content th,
.md-page-letter-body--content td {
    border: 1px solid rgba(15, 45, 123, 0.2);
    padding: 0.5em 0.65em;
}

.md-page-shell .md-footer-reveal-below {
    margin-top: auto;
}

/* Static sub-pages (page.php, contact.php): footer stripe edge-to-edge; main column stays narrow */
body.md-static-page-body .md-footer-reveal-below {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

body.md-static-page-body .md-footer-extended {
    padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
}

/* Tawk.to: hide floating launcher; chat opens from footer links / API (not used on contact.php — iframe there). */
button.tawk-custom-color.tawk-custom-border-color.tawk-outline.tawk-button {
    display: none;
}

span.tawk-badge.tawk-flex.tawk-flex-center.tawk-flex-middle.tawk-min-badge {
    display: none !important;
}

/* Contact page (contact.php) — inline chat + email */
.md-contact-email-line {
    margin: 0 0 1.25rem;
}

.md-contact-email-line .md-contact-methods-label {
    display: inline;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #718096;
    margin-right: 0.35rem;
}

.md-contact-live-chat-heading {
    margin: 1.75rem 0 0.35rem;
    font-size: clamp(1.15rem, 3vw, 1.35rem);
}

.md-contact-chat-intro {
    margin: 0 0 0.85rem;
    color: #4a5568;
    font-size: 1rem;
}

.md-contact-chat-frame {
    margin: 0 0 2rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 45, 123, 0.18);
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 45, 123, 0.08);
}

.md-contact-chat-iframe {
    display: block;
    width: 100%;
    height: min(72vh, 580px);
    min-height: 400px;
    border: 0;
    background: #f7fafc;
}

.md-contact-chat-fallback {
    margin: -1.25rem 0 2rem;
    font-size: 0.9rem;
    color: #718096;
}

.md-contact-chat-fallback a {
    color: #0F2D7B;
}

/* 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) {
    html:has(body.md-index-front),
    html:has(body.md-index-boxed) {
        background-color: #0F2D7B;
    }
    /* Tablet (portrait + landscape): add extra top breathing room above ticker */
    #news-ticker {
        padding: 30px 40px 10px 40px;
        box-sizing: border-box;
        background: #0F2D7B;
    }
    .header h1,
    .header .desktop-title {
        font-size: 60px !important;
        line-height: 80px !important;
        word-wrap: break-word;
        white-space: normal;
    }
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .header {
        padding: 150px 50px 50px 50px !important;
    }
    .sector-dropdown-menu {
        width: 380px !important;
        max-width: 380px !important;
        min-width: 380px !important;
        box-sizing: border-box !important;
    }
    .sector-dropdown-header {
        font-size: 14px !important;
    }
    .sector-dropdown-trigger {
        font-size: 14px !important;
    }
    li.sector-dropdown-option {
        font-size: 14px !important;
    }
}

@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; }
    /* Match body/ticker: padding is in #news-ticker; html must paint notch/status strip */
    html:has(body.md-index-front),
    html:has(body.md-index-boxed) {
        background-color: #0F2D7B;
    }
    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; }

    /* Last updated: ticker strip only on mobile; keep header line for tablet/desktop (769px+) */
    .header .update-status {
        display: none !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 .update-status-line {
        font-size: 12px;
        letter-spacing: 0.2em;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    .header .update-status-line .update-sep {
        display: none;
    }
    .header .update-status-line .update-top {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .header .tagline {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }
    .header .tagline-line1,
    .header .tagline-line2 {
        display: block;
    }

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

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

    .header .tagline {
        display: block;
        font-size: 20px;
        font-family: 'Roboto Condensed', sans-serif;
        color:rgb(214 255 165 / 55%);
        margin-top: 40px;
        letter-spacing: 0.3em;
        line-height: 20px;
        font-weight: 500;
    }

    .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: 0 !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;
    }

    /* Mobile: single-column trench (full-width cards only; two-col broke small screens) */
    .container.trench-merged-layout {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .container.trench-merged-layout .headline-section {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
    .container.trench-merged-layout .trench-merged > .ad-slot,
    .container.trench-merged-layout .trench-merged > .wire-card {
        grid-column: 1 / -1 !important;
    }

    /* Single-col mobile: image on top, title, then story meta (stacked) */
    .container.trench-merged-layout .wire-card .story-item.has-image {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .container.trench-merged-layout .wire-card .story-item.has-image .story-image-container {
        width: 100% !important;
        flex: none !important;
        aspect-ratio: 16 / 9 !important;
        max-width: none !important;
    }
    .container.trench-merged-layout .wire-card .story-item.no-image {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Mobile: entire card tappable, green overlay on tap (MD green #52c73a) */
    .container.trench-merged-layout .wire-card,
    .headline {
        position: relative !important;
    }
    .card-tap-link {
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        z-index: 2 !important;
    }
    .card-tap-link::after {
        content: '' !important;
        position: absolute !important;
        inset: 0 !important;
        background: rgba(82, 199, 58, 0.25) !important;
        opacity: 0 !important;
        transition: opacity 0.12s ease !important;
        pointer-events: none !important;
    }
    /* Only show overlay when JS adds .card-tap-active (after deliberate press), not on :active so scroll-over doesn’t light it up */
    .card-tap-link.card-tap-active::after {
        opacity: 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;
        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;
        overflow: visible;
        text-overflow: ellipsis;
        line-height: 1.2;
        max-height: none;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        z-index: 2000;
        position: sticky;
        top: 0;
        min-height: 60px;
        align-items: center;
        justify-content: flex-start;
        align-content: flex-start;
        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%);
        pointer-events: none;
    }

    #news-ticker .ticker-content {
        display: none !important; /* news removed from ticker */
    }
    #news-ticker .tactical-bar {
        width: 100%;
        flex: 0 0 100%;
        order: 2;
    }
    /* MD icon when .ticker-sticky: same row as weather + sector */
    #news-ticker .ticker-md-brand {
        order: 3;
        flex: 0 0 auto;
    }
    /* Weather left, sector right (one row after tactical) */
    #news-ticker .header-weather.control {
        order: 4;
        gap: 10px 15px;
        margin-top: 0;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0;
        padding-right: 0;
        flex: 0 0 auto;
        justify-content: flex-start;
    }
    #news-ticker.ticker-sticky .header-weather.control {
        justify-content: center;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    #news-ticker .sector-dropdown {
        order: 5;
        width: auto;
        max-width: none;
        margin-top: 0;
        margin-left: auto !important;
        margin-right: 0 !important;
        align-self: center;
        z-index: 2100;
        box-sizing: border-box;
        flex: 0 0 auto;
    }
    /* Last updated: full-width row below weather/sector row + haptics */
    #news-ticker .ticker-last-updated {
        display: flex;
        order: 7;
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
        justify-content: flex-start;
        align-items: center;
        margin: 0;
        padding: 6px 6px 4px;
        box-sizing: border-box;
    }
    #news-ticker .ticker-last-updated-inner {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        box-sizing: border-box;
    }
    #news-ticker .ticker-update-line {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
        font-family: 'Roboto Condensed', sans-serif;
        font-size: 0.7rem;
        font-weight: 500;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.72);
    }
    #news-ticker .ticker-update-badge {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
        border: 1px solid rgba(255, 255, 255, 0.35);
    }
    #news-ticker .ticker-update-date {
        letter-spacing: 0.06em;
        font-variant-numeric: tabular-nums;
        color: rgba(255, 255, 255, 0.88);
    }
    /* Mobile ticker weather: larger text/icon, no tab chrome */
    #news-ticker .ticker-md-brand-img {
        width: 50px !important;
        height: 50px !important;
    }
    /* Sector satellite pulse: sizes on mobile */
    #news-ticker .sector-dropdown .sector-dropdown-pulse.loader {
        width: 58px !important;
        height: 58px !important;
    }
    #news-ticker .sector-dropdown .sector-dropdown-pulse .circle-1 {
        width: 40px !important;
        height: 40px !important;
    }
    #news-ticker .sector-dropdown .sector-dropdown-pulse .circle-2 {
        width: 34px !important;
        height: 34px !important;
    }
    #news-ticker .sector-dropdown .sector-dropdown-pulse .circle-3 {
        width: 28px !important;
        height: 28px !important;
    }
    #news-ticker .sector-dropdown .sector-dropdown-pulse .circle-4 {
        width: 16px !important;
        height: 16px !important;
    }
    #news-ticker .weather-control-tab {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }
    #news-ticker .weather-control-tab:hover,
    #news-ticker .weather-control-tab:focus-visible,
    #news-ticker .weather-control-tab .weather-item:hover {
        background: transparent !important;
        color: #52c73a !important; /* MD green highlight */
    }
    #news-ticker .weather-icon-box,
    #news-ticker .weather-icon-box i,
    #news-ticker .weather-item i {
        font-size: 18px !important;
        line-height: 1 !important;
    }
    #news-ticker .weather-temp,
    #news-ticker .weather-loc {
        font-size: 12px !important;
        line-height: 1.05 !important;
    }
    .sector-dropdown-trigger {
        width: auto;
        min-width: 0;
        padding: 10px 12px;
        justify-content: center;
        box-sizing: border-box;
        z-index: 2200;
    }
    #news-ticker .haptic-toggle-btn {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        box-sizing: border-box;
        order: 6;
        flex: 0 0 100%;
    }
    ul#sector-dropdown-menu {
        padding-bottom: 10px;
    }
    .sector-dropdown-menu {
        position: fixed;
        left: 10px;
        right: 10px;
        width: auto;
        min-width: 0;
        max-width: none;
        top: calc(64px + env(safe-area-inset-top, 0px));
        margin-top: 4px;
        transform: translateY(-6px);
        z-index: 2201;
        box-sizing: border-box;
        padding-left: 10px;
        padding-right: 10px;
        font-size: 18px;
    }
    .sector-dropdown.open .sector-dropdown-menu {
        transform: translateY(6px);
    }
    .sector-dropdown.open .sector-dropdown-backdrop {
        display: block;
        pointer-events: auto;
        z-index: 2199;
    }
    .sector-dropdown-menu::before {
        right: 12px;
        left: auto;
        margin-left: 0;
    }
    li.sector-dropdown-option {
        font-size: 14px;
    }

    /* Weather forecast overlay: tappable update location in title on mobile */
    .weather-forecast-box {
        padding-bottom: 24px;
    }
    .weather-forecast-box .weather-forecast-title .weather-forecast-update-link-inline {
        padding: 8px 4px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        color: rgba(255, 255, 255, 0.9);
    }

    /* 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;
    }
}

/* Tablet (769–1024px): 3-column trench; do not apply below 769px so phones stay single-column */
@media (min-width: 769px) and (max-width: 1024px) {
    .container.trench-merged-layout {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .four-pack {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .four-pack .pack-toggle-icon {
        display: inline-block !important;
    }
    .four-pack .pack-header {
        cursor: pointer;
    }
}

/* Mobile landscape: 3 cols — headline left, two stories to its right. Match by width (e.g. 667px) OR by short height (e.g. iPhone 12 Pro 844×390) */
@media ((max-width: 768px) and (orientation: landscape)) , ((orientation: landscape) and (max-height: 500px)) {
    html, body {
        overflow-x: hidden !important;
    }
    /* iOS landscape: sector menu must paint above header when open (stacking context fix) */
    body.sector-menu-open #news-ticker {
        z-index: 2147483647 !important;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    .header {
        padding: 115px 50px 50px 50px !important;
    }
    .header .tagline {
        display: block !important;
        font-size: 22px !important;
        margin-top: 20px !important;
    }
    .container.trench-merged-layout {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .container.trench-merged-layout .headline-section {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
    }
    .container.trench-merged-layout .trench-merged > .ad-slot,
    .container.trench-merged-layout .trench-merged > .wire-card {
        grid-column: 1 / -1 !important;
    }
    /* Headline same size as other stories in landscape */
    .headline a,
    .headline-section .headline a,
    .container.trench-merged-layout .headline-section .headline a {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
        text-transform: none !important;
    }
    .headline-section .headline,
    .container.trench-merged-layout .headline-section .headline {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        text-align: left !important;
    }
    .headline-section .headline .story-text-container,
    .headline-section .headline .story-text-container a {
        text-align: left !important;
    }
    .headline .story-image-container img.story-image,
    .headline .story-image {
        max-height: 120px !important;
        width: auto !important;
        object-fit: cover !important;
    }
    .headline .story-wrapper.story-item.has-image .story-image-container {
        flex: none !important;
        max-height: 120px !important;
    }

    /* Ticker: sector left, weather right; last-updated full width below */
    #news-ticker {
        flex-wrap: wrap !important;
        max-height: none !important;
        min-height: 48px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        gap: 10px 14px !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
        min-width: 0 !important;
    }
    #news-ticker .ticker-last-updated {
        display: flex !important;
        order: 10 !important;
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        padding: 6px 6px 4px !important;
        margin: 0 !important;
    }
    #news-ticker .ticker-last-updated-inner {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }
    #news-ticker .ticker-update-line {
        justify-content: flex-start !important;
    }
    #news-ticker .tactical-bar {
        width: auto !important;
        order: 3 !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    #news-ticker .ticker-md-brand {
        order: 0 !important;
    }
    /* Weather left of sector (same row when space allows) */
    #news-ticker .header-weather.control {
        order: 1 !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        justify-content: flex-start !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    #news-ticker .sector-dropdown {
        order: 2 !important;
        flex: 0 0 auto !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    #news-ticker.ticker-sticky .header-weather.control {
        justify-content: center !important;
    }
    #news-ticker .ticker-md-brand-img {
        width: 50px !important;
        height: 50px !important;
    }
    #news-ticker .sector-dropdown-trigger {
        width: auto !important;
    }
    #news-ticker .haptic-toggle-btn {
        width: auto !important;
        max-width: none !important;
        order: 4 !important;
        flex-shrink: 0 !important;
    }
    .sector-dropdown-menu {
        position: fixed !important;
        top: calc(64px + env(safe-area-inset-top, 0px) + 48px) !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: 84% !important;
        max-width: 84% !important;
        min-width: 260px !important;
        margin-top: 4px !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0 !important;
        box-sizing: border-box !important;
        z-index: 100003 !important;
    }
    .sector-dropdown.open .sector-dropdown-menu {
        z-index: 100003 !important;
        transform: translate(-50%, 6px) !important;
        margin-top: -40px !important;
    }
    .sector-dropdown.open .sector-dropdown-backdrop {
        z-index: 100002 !important;
    }
    .sector-dropdown-header {
        grid-column: 1 / -1 !important;
    }
    li.sector-dropdown-option {
        grid-column: span 1 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        border-radius: 0 !important;
    }
    .sector-dropdown-option:nth-child(2),
    .sector-dropdown-option:nth-child(3) {
        border-top: none !important;
    }

    /* Weather overlay: stretch to fill available width in landscape */
    .weather-forecast-box {
        width: -webkit-fill-available !important;
        width: stretch !important;
        max-width: 100% !important;
        max-height: 85vh !important;
    }
    #weather-forecast-content {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 1rem 1.5rem !important;
        align-items: start !important;
    }
    .weather-forecast-box .weather-forecast-title {
        grid-column: 1 / -1 !important;
    }
    .weather-forecast-box .weather-forecast-days {
        grid-column: 1 !important;
    }
    .weather-forecast-box .weather-forecast-extras {
        grid-column: 2 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-left: 1rem !important;
    }
    .weather-forecast-box .weather-forecast-radar-cell {
        grid-column: 3 !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-left: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-left: 1rem !important;
    }
    .weather-forecast-box .weather-forecast-radar-cell .weather-forecast-radar-embed {
        margin-top: 0 !important;
    }
    .weather-forecast-box .weather-forecast-zip-block {
        grid-column: 1 / -1 !important;
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.2) !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; }
}

@media (max-width: 768px) {
    .deck-grid { grid-template-columns: 1fr; gap: 20px; }
    .deck-contact-footer { order: 1; }
    #deck-sources-box { order: 2; }
    .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;
    }
    .header .update-status-line {
        font-size: 11px;
        letter-spacing: 0.2em;
    }
}
/* 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;
    }
}

/* --- Command Deck: scroll containment (wire + board scroll inside viewport) --- */
/* Only apply fixed viewport/overflow when .workspace exists (index); subpages scroll normally */
body.deck-index > .deck-nav-wrapper {
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin-top: -22px !important;
}
body:has(#deck-main-wrap .workspace) {
    height: 100vh;
    min-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body:has(#deck-main-wrap):not(:has(.workspace)) {
    overflow-y: auto;
}
#deck-main-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
body:has(#deck-main-wrap .workspace) #deck-main-wrap {
    overflow: hidden;
}
#deck-main-wrap .workspace {
    min-height: 0;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}
#deck-main-wrap .board {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}
#deck-main-wrap .crate {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
#deck-main-wrap .workspace.hsplit > .crate {
    flex: 0 1 450px;
    max-width: 100%;
    min-width: 0;
}
#deck-main-wrap .crate-scroll {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

/* Trench + Wire: constrain to pane width (no overflow) */
#deck-main-wrap .board .board-grid--stack,
#deck-main-wrap .board-zone--trench,
#deck-main-wrap .board .story-list--grid,
#deck-main-wrap .board .story-list--grid .story {
    min-width: 0;
    max-width: 100%;
}
#deck-main-wrap #wire-list-ul,
#deck-main-wrap .crate-scroll .story,
#deck-main-wrap .crate .story {
    min-width: 0;
    max-width: 90%;
    overflow-wrap: break-word;
}
#deck-main-wrap .crate .story-inner,
#deck-main-wrap .crate .story-content {
    min-width: 0;
}
/* Crate story card: image floated left, title wraps around it; then story-meta and toolbar below */
#deck-main-wrap .crate .story-inner {
    display: block !important;
    min-width: 0;
    direction: ltr;
}
#deck-main-wrap .crate .story-card-image {
    float: left;
    min-width: 0;
    margin: 0 10px 6px 0;
}
#deck-main-wrap .crate .story-card-image .vignette-image-wrapper {
    display: block;
}
#deck-main-wrap .crate .story-content {
    flex: none !important;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: visible;
}
#deck-main-wrap .crate .story-content .title-input {
    margin-bottom: 0;
    min-height: 1.4em;
    height: auto;
}
#deck-main-wrap .crate .story-card-middle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    clear: left;
}
#deck-main-wrap .crate .story-meta {
    min-width: 0;
}

/* Board (Command Deck): same story card layout as Wire - image float, title wraps, then meta and toolbar */
#deck-main-wrap .board .story-inner,
#deck-main-wrap .board .story-content {
    min-width: 0;
}
#deck-main-wrap .board .story-inner {
    display: block !important;
    min-width: 0;
    direction: ltr;
}
#deck-main-wrap .board .story-card-image {
    float: left;
    min-width: 0;
    margin: 0 10px 6px 0;
}
#deck-main-wrap .board .story-card-image .vignette-image-wrapper {
    display: block;
}
#deck-main-wrap .board .story-content {
    flex: none !important;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    overflow-y: visible;
}
#deck-main-wrap .board .story-content .title-input {
    margin-bottom: 0;
    min-height: 1.4em;
    height: auto;
}
#deck-main-wrap .board .story-card-middle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    clear: left;
}
#deck-main-wrap .board .story-meta {
    min-width: 0;
}

/* First card in trench (headline) — distinct background */
#deck-main-wrap .board .story.is-headline-card {
    background: #dbeafe;
    border-left-color: #2563eb;
}

/* --- Command Deck dropdown menu base styles (index.php loads responsive.css, not styles.css) --- */
.deck-header-wrap {
    position: relative; /* so #deck-nav-dropdown positions below header */
}
/* Backdrop is for old hamburger nav; hide everywhere so it never covers deck content */
.deck-nav-backdrop {
    display: none !important;
}
#deck-nav-dropdown[hidden] {
    display: none !important;
}

#deck-nav-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1100;
    background: #0F2D7B;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.28);
    overflow: hidden;
    overflow-x: hidden;
    box-sizing: border-box;
}

.deck-dropdown-menu {
    padding: 0;
    overflow-x: hidden;
}

.deck-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.deck-dropdown-list li {
    margin: 0;
    padding: 0;
}

.deck-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    text-align: left;
    text-decoration: none;
    color: #e2e8f0;
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease;
}

.deck-dropdown-item span {
    min-width: 0;
}

.deck-dropdown-item:hover,
.deck-dropdown-item:focus {
    background: rgba(255,255,255,0.10);
    color: #fff;
}

.deck-dropdown-item.active {
    color: #52c73a;
}

.deck-dropdown-item i,
.deck-dropdown-item svg {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.deck-dropdown-item.breaking {
    color: #ff8a8a;
}

.deck-dropdown-item.site-off-toggle.is-off {
    color: #ff8a8a;
}

.deck-dropdown-item.site-off-toggle.is-on {
    color: #52c73a;
}

@media (min-width: 901px) {
    .deck-menu-trigger,
    #deck-nav-dropdown {
        display: none !important;
    }
    /* Override index.php inline .workspace.hsplit > .board/crate { height: auto } so panes are constrained and scroll */
    #deck-main-wrap .workspace.hsplit > .board {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow-y: auto !important;
        padding: 0px 20px 0px 20px;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
    }
    #deck-main-wrap .workspace.hsplit > .crate {
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 0px 10px 0px 10px;
    }
    #deck-main-wrap .crate-scroll {
        min-height: 0 !important;
        flex: 1 1 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
    }
}

/* Show mobile menu bar up to 900px so it's visible in devtools (responsive mode) */
@media (max-width: 900px) {
    .deck-menu-bar {
        display: flex !important;
    }
    .deck-menu-trigger {
        display: flex !important;
    }
    #deck-nav-dropdown[hidden] {
        display: none !important;
    }
}

/* --- Command Deck: mobile nav dropdown (replaces hamburger, Figma-style) --- */
@media (max-width: 768px) {
    .deck-nav-mobile-trigger,
    .deck-side-nav,
    .deck-nav-backdrop {
        display: none !important;
    }
    .deck-main-wrap { margin-left: 0 !important; }
    /* Command deck bar (title + menu) stays at top of board — no scroll needed to reach Menu */
    #deck-main-wrap .board .deck-header-wrap {
        position: sticky !important;
        top: 0 !important;
        z-index: 101 !important;
        background: #0F2D7B !important;
        flex-shrink: 0;
    }
    /* Menu button in its own bar: 100% width, right below CD text (no separate sticky needed) */
    .deck-menu-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end;
        align-items: center;
        width: 100%;
        background: transparent;
        padding: 6px 10px;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    .deck-menu-trigger {
        display: flex !important;
        flex-shrink: 0;
        white-space: nowrap;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
        background: rgba(255,255,255,0.15);
        color: #fff;
        border: 1px solid rgba(255,255,255,0.3);
        border-radius: 6px;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
    }
    /* Dropdown menu: horizontal row of items (wrap if needed) */
    #deck-nav-dropdown .deck-dropdown-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 6px 10px;
        padding: 8px;
    }
    #deck-nav-dropdown .deck-dropdown-list li {
        list-style: none;
        margin: 0;
    }
    #deck-nav-dropdown .deck-dropdown-item {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        white-space: nowrap;
    }
    #deck-nav-dropdown {
        width: 100%;
        max-width: 100%;
        left: 0;
        right: 0;
        top: calc(100% + 4px);
        border-radius: 0 0 10px 10px;
        max-height: min(70vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Trench (deck): responsive grid — 2 cols on small mobile, 1 on very narrow */
    #deck-main-wrap .board .story-list--grid,
    #deck-main-wrap .board-zone--trench .story-list--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* Mobile workspace: CD on top, Wire on bottom, slim draggable splitter */
    #deck-main-wrap .workspace.vsplit > .board {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    #deck-main-wrap .workspace.vsplit > .workspace-splitter {
        flex: 0 0 8px !important;
        height: 8px !important;
        min-height: 8px !important;
        cursor: row-resize;
        background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.08) 40%, rgba(0,0,0,0.12) 50%, rgba(0,0,0,0.08) 60%, transparent 100%);
        touch-action: none;
    }
    #deck-main-wrap .workspace.vsplit > .workspace-splitter::after {
        content: '';
        position: absolute;
        left: 20%;
        right: 20%;
        top: 50%;
        transform: translateY(-50%);
        height: 2px;
        background: rgba(0,0,0,0.2);
        border-radius: 2px;
    }
    #deck-main-wrap .workspace.vsplit > .crate {
        min-height: 120px !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    #deck-main-wrap .workspace.vsplit > .crate.wire-panel-off {
        flex: 0 0 0 !important;
        min-height: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        border: none !important;
        padding: 0 !important;
    }
    #deck-main-wrap .workspace.vsplit > .workspace-splitter:has(+ .crate.wire-panel-off) {
        display: none !important;
    }
    #deck-main-wrap .workspace.vsplit .crate-scroll {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .metal-btn-wire-toggle span,
    .metal-btn-wire-toggle #wire-toggle-label { display: none !important; }
}

/* Trench: 1 column on very narrow viewports */
@media (max-width: 480px) {
    #deck-main-wrap .board .story-list--grid,
    #deck-main-wrap .board-zone--trench .story-list--grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px !important;
    }
}

/* Command Deck: landscape mobile (iOS) — fit full width, no horizontal cutoff */
@media (orientation: landscape) and (max-height: 500px) {
    body.deck-index .deck-side-nav {
        display: none !important;
    }
    body.deck-index #deck-main-wrap {
        max-width: 100% !important;
        min-width: 0 !important;
    }
    body.deck-index .deck-main-wrap {
        margin-left: 0 !important;
    }
    #deck-main-wrap .workspace {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    #deck-main-wrap .workspace.hsplit > .crate {
        min-width: 100px !important;
        max-width: 45vw !important;
        width: 40vw !important;
    }
    #deck-main-wrap .workspace.hsplit > .board {
        min-width: 0 !important;
    }
}

/* --- Command Deck: The Wire — responsive (md-entry/index.php) --- */
@media (max-width: 1024px) {
    #theWire .deck-header {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        margin-left: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    #theWire .deck-header > div:first-of-type {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }
    #theWire .deck-header #wire-search {
        flex: 1 1 180px;
        min-width: 100px;
        margin-left: 0 !important;
        box-sizing: border-box;
    }
    #theWire .deck-header > div:last-of-type {
        flex: 1 1 100%;
        display: flex !important;
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-left: 0 !important;
        gap: 6px;
    }
    #theWire .deck-header .btn-ops,
    #theWire .deck-header .btn-wipe,
    #theWire .deck-header .btn-veto,
    #theWire .deck-header .metal-btn {
        font-size: 0.75rem !important;
        padding: 6px 8px !important;
    }
}

@media (max-width: 768px) {
    #theWire .deck-header {
        padding: 8px 10px !important;
        gap: 10px;
    }
    #theWire .deck-header .deck-title { font-size: 1rem !important; }
    #theWire .deck-header #wire-search {
        flex: 1 1 100%;
        min-width: 0;
        min-height: 38px;
    }
    #theWire .crate-scroll {
        padding: 10px !important;
    }
    #theWire #wire-list-ul {
        min-width: 0;
        overflow-x: hidden;
    }
    #theWire .story {
        padding: 8px !important;
        margin-bottom: 10px;
    }
    #theWire .story-inner { gap: 8px; }
    #theWire .preview-thumb { max-width: 52px; height: 52px; }
    #theWire .story-meta { flex-wrap: wrap; gap: 4px; }
    #theWire .story .toolbar {
        flex-wrap: wrap;
        gap: 6px;
    }
    #theWire .icon-btn {
        min-width: 36px;
        min-height: 36px;
        padding: 6px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    #theWire #filter-manager > div {
        flex-direction: column !important;
    }
    #theWire #filter-manager > div > div {
        min-width: 0 !important;
    }
}

@media (max-width: 390px) {
    #theWire .deck-header > div:first-of-type {
        flex: 1 1 100%;
    }
    #theWire .deck-header .deck-title { font-size: 0.95rem !important; }
    #theWire .deck-header > div:last-of-type {
        justify-content: center;
    }
    .workspace.hsplit > #theWire.crate {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    #theWire .crate-scroll { padding: 8px !important; }
    #theWire .story { padding: 6px !important; }
    #theWire .bulk-check-wrapper { width: 40px; }
}

/* Footer reveal (CodePen-style): full-width deck strip on narrow screens; arrow clears home indicator */
@media (max-width: 768px) {
    .md-footer-reveal-wrapper {
        border-radius: 0 0 10px 10px;
    }
    body.md-footer-reveal-tight .md-footer-reveal-wrapper {
        transform: translateY(-32px) scale(0.94);
    }
    .md-footer-reveal-below {
        width: 100%;
        max-width: none;
    }

    .md-footer-extended {
        padding: 1.75rem 1rem 1.5rem;
    }
    body.md-static-page-body .md-footer-extended {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }
    .md-footer-ext-top {
        flex-direction: column;
        align-items: flex-start;
    }
    .md-footer-ext-tagline {
        max-width: none;
    }
    .md-footer-ext-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    .md-footer-ext-col--aside {
        grid-column: 1 / -1;
        align-items: flex-start;
        text-align: left;
    }
    .md-footer-ext-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .md-footer-ext-grid {
        grid-template-columns: 1fr;
    }
}

/* Sector menu open: raise ticker stacking so fixed menu paints above header on real devices */
body.sector-menu-open #news-ticker {
    z-index: 999999 !important;
}

/* Static CMS page (page.php): mobile safe area + undo global body blue background */
@media (max-width: 768px) {
    body.md-static-page-body {
        padding-top: constant(safe-area-inset-top);
        padding-top: env(safe-area-inset-top);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        background-color: #e8e4dc;
        background-image: linear-gradient(180deg, #dfe6f0 0%, #e8e4dc 28%, #ebe6dc 100%);
    }

    .md-page-topbar {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .md-page-letter-main {
        padding-left: max(14px, calc(14px + env(safe-area-inset-left)));
        padding-right: max(14px, calc(14px + env(safe-area-inset-right)));
    }

    .md-page-letter {
        padding: 1.5rem 1.1rem 1.75rem;
    }

    /* Full-bleed footer: cancel body horizontal inset for the dark strip only */
    body.md-static-page-body .md-footer-reveal-below {
        margin-left: calc(-1 * env(safe-area-inset-left, 0px));
        margin-right: calc(-1 * env(safe-area-inset-right, 0px));
        width: calc(100% + env(safe-area-inset-left, 0px) + env(safe-area-inset-right, 0px));
        max-width: none;
    }

    .md-contact-chat-iframe {
        min-height: 340px;
        height: min(58vh, 520px);
    }
}

/* Boxed homepage (index-boxed.php): mobile shell, pulse density, in-focus above tap layer */
@media (max-width: 768px) {
    body.md-index-boxed .md-boxed-shell {
        padding: 16px 14px 20px;
        border-radius: 12px;
    }

    body.md-index-boxed .md-boxed-pulse-inner {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    /* Same stacking intent as trench cards: .card-tap-link is z-index 2 in this breakpoint */
    body.md-index-boxed .md-boxed-infocus-inner {
        position: relative;
        z-index: 3;
    }
}

@media (max-width: 390px) {
    body.md-index-boxed .md-boxed-shell {
        padding-left: 12px;
        padding-right: 12px;
    }
}

