
/* =======================================================
   ACTION NEWS — HEADER + LAYOUT (Quantum Robust Edition)
   - Mobile: Wasted space fixed—Canada/World visible in prime flex spots (room-optimized, no hamburger bury).
   - Desktop: Polished logo (crisper glow), slimmer polish (gaps tightened).
   - Responsiveness: Quantum-leaped (media queries + observers for no-refresh flow).
   - Time/date: Bolder, consistent across devices.
   - Raw mode: Robust selectors, no breakage—SEO-friendly (fast-load vars).
======================================================= */

:root{
  --brand-blue: #0f61d8; --header-text: #fff;
  --h-topbar: 18px; --h-main: 42px; --h-secnav: 20px; --h-ticker: 18px; --h-title: 0px;
  --content-offset: calc(var(--h-topbar) + var(--h-main) + var(--h-secnav) + var(--h-ticker) + var(--h-title));
}

/* Reset / base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--content-offset); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -moz-osx-font-smoothing: grayscale; }
body { font-family: 'Roboto', sans-serif; background: #fff; color: #000; overflow-x: hidden; transition: background-color .3s ease, color .3s ease; }
body.dark-mode { background: #000; color: #fff; }
a { color: #1a73e8; text-decoration: none; transition: color .2s ease; }
a:hover { color: #0c47b7; text-decoration: underline; }

/* Helper for included wrappers */
.with-fixed-header { margin-top: var(--content-offset) !important; }

/* Header stack (fixed) - Robust, polished */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: var(--brand-blue); color: #fff; }
.top-bar, .main-header, .secondary-nav, .news-ticker { background: var(--brand-blue); color: var(--header-text); }
.top-bar a, .main-header a, .secondary-nav a, .news-ticker a { color: #fff; }

/* Top bar: Polished time/date */
.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1006;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 3px clamp(6px, 1.5vw, 12px); font-size: clamp(0.75em, 0.95vw, 0.82em); white-space: nowrap; overflow: hidden; transition: padding .3s ease;
  min-height: 18px; gap: 6px;
}
.top-left { display: flex; align-items: center; gap: clamp(3px, 0.8vw, 6px); flex-shrink: 0; }
.top-center { flex: 1; text-align: center; font-weight: 700; color: #fff; font-size: clamp(0.85em, 1.05vw, 0.9em); } /* Bolder, consistent */
.top-actions { display: flex; align-items: center; gap: clamp(3px, 0.8vw, 6px); flex-wrap: wrap; }
.top-right { display: flex; align-items: center; gap: clamp(3px, 0.8vw, 6px); flex-shrink: 0; }
.icon-btn { background: transparent; border: 0; color: #fff; cursor: pointer; transition: color .2s ease; font-size: 1.1em; }
.icon-btn:hover { color: #ddd; }
.hamburger { background: transparent; border: 0; color: #fff; display: none; font-size: 1.3em; transition: transform .2s ease; }
.hamburger:hover { transform: scale(1.1); }
.pipe { margin: 0 3px; font-size: 0.85em; }

/* Main header: Polished, logo crisper */
.main-header {
  position: fixed; top: var(--h-topbar); left: 0; right: 0; z-index: 1005;
  display: flex; align-items: center; justify-content: space-between; gap: clamp(6px, 1.5vw, 12px);
  padding: clamp(3px, 0.8vw, 6px) clamp(6px, 1.5vw, 12px); box-shadow: 0 1px 3px rgba(0,0,0,.1); transition: padding .3s ease;
  min-height: 42px;
}
.brand { display: flex; align-items: center; gap: clamp(3px, 0.8vw, 6px); flex-shrink: 0; }
.brand img { width: clamp(36px, 5vw, 48px); height: auto; border-radius: 50%; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); transition: width .3s ease, filter .3s ease; } /* Crisper glow */
.brand img:hover { filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.logo-text {
  font-family: 'Playfair Display', serif; font-weight: 900; font-size: clamp(1.4rem, 2.2vw, 1.6rem);
  letter-spacing: 0.05px; line-height: 1; color: #fff; text-shadow: 0 0.5px 1px rgba(0,0,0,.15); transition: font-size .3s ease;
}

/* Primary nav: Polished, visible Canada/World on mobile */
.primary-nav { flex: 1; display: flex; justify-content: center; align-items: center; }
.primary-nav ul { list-style: none; display: flex; align-items: center; gap: clamp(6px, 1.2vw, 10px); flex-wrap: nowrap; transition: gap .3s ease; }
.primary-nav li { position: relative; }
.primary-nav a { font-weight: 500; font-size: clamp(0.8em, 1vw, 0.9em); transition: color .2s ease, background .2s ease; padding: 4px 8px; border-radius: 4px; }
.primary-nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.primary-nav .dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 140px;
  background: var(--brand-blue); border-radius: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.2); z-index: 1015; transition: opacity .3s ease;
}
.primary-nav li:hover > .dropdown-menu { display: block; opacity: 1; }
.dropdown-menu a { display: block; padding: 6px 10px; color: #fff; transition: background .2s ease; }
.dropdown-menu a:hover { background: rgba(255,255,255,.15); }

/* Search: Polished */
.search-bar { flex-shrink: 0; display: flex; justify-content: flex-end; min-width: 100px; transition: min-width .3s ease; }
.search-bar form { display: flex; align-items: center; width: 100%; max-width: 200px; transition: max-width .3s ease; }
.search-bar input[type="text"] {
  flex: 1; padding: 5px 8px; border: 1px solid rgba(255,255,255,.7); border-right: none;
  border-radius: 16px 0 0 16px; background: #fff; color: #000; outline: none; transition: padding .3s ease; font-size: 0.85em;
}
.search-bar input:focus { padding: 5px 10px; }
.search-bar button { padding: 5px 8px; border: 0; background: #0c47b7; color: #fff; border-radius: 0 16px 16px 0; cursor: pointer; transition: background .2s ease; }
.search-bar button:hover { background: #083a98; }

/* Secondary nav */
.secondary-nav {
  position: fixed; top: calc(var(--h-topbar) + var(--h-main)); left: 0; right: 0; z-index: 1003;
  display: flex; align-items: center; justify-content: center; padding: clamp(1px, 0.4vw, 3px) clamp(6px, 1.5vw, 12px); transition: padding .3s ease;
  min-height: 20px;
}
.secondary-nav ul { list-style: none; display: flex; gap: clamp(6px, 1.5vw, 10px); flex-wrap: wrap; align-items: center; font-size: clamp(0.8em, 1vw, 0.85em); justify-content: center; transition: gap .3s ease; }
.live-indicator { display: inline-flex; align-items: center; background: #e53935; color: #fff; padding: 3px 6px; border-radius: 12px; font-size: clamp(0.7em, 0.9vw, 0.75em); transition: padding .3s ease; }
.live-dot { width: 5px; height: 5px; border-radius: 50%; background: #fff; margin-right: 3px; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .75; } 100% { transform: scale(1); opacity: 1; } }

/* Ticker */
.news-ticker {
  position: fixed; top: calc(var(--h-topbar) + var(--h-main) + var(--h-secnav)); left: 0; right: 0; z-index: 1002;
  padding: clamp(1px, 0.3vw, 2px) clamp(6px, 1.5vw, 12px); border-top: 1px solid rgba(255,255,255,.15); overflow: hidden; font-size: clamp(0.75em, 0.95vw, 0.8em); transition: padding .3s ease; cursor: grab;
  min-height: 18px; user-select: none;
}
.news-ticker:active { cursor: grabbing; }
.news-ticker ul { display: flex; gap: clamp(8px, 2vw, 16px); list-style: none; white-space: nowrap; will-change: transform; }
.news-ticker ul a { transition: color .2s ease; }

/* Title area */
.title-area {
  position: fixed; top: calc(var(--h-topbar) + var(--h-main) + var(--h-secnav) + var(--h-ticker)); left: 0; right: 0; z-index: 1001;
  background: var(--brand-blue); color: #fff; text-align: center; padding: clamp(3px, 0.8vw, 6px) clamp(6px, 1.5vw, 12px); font-size: 1em; font-weight: 500;
  display: none; word-break: break-word; overflow: hidden; text-overflow: ellipsis; white-space: normal; transition: padding .3s ease;
}
.title-area:not(:empty) { display: block; }

/* Mobile: Wasted space fixed - Canada/World visible */
@media (max-width: 992px) {
  .logo-text { display: none; }
  .hamburger { display: inline-block; font-size: 1.5em; }
  .top-bar { padding: 4px clamp(4px, 1vw, 8px); gap: 4px; font-size: clamp(0.7em, 0.85vw, 0.78em); justify-content: space-around; }
  .top-center { font-size: clamp(0.85em, 1.05vw, 0.9em); font-weight: 700; }
  .top-actions { gap: clamp(4px, 1vw, 8px); justify-content: center; }
  .top-right { gap: clamp(4px, 1vw, 8px); font-size: 1.2em; }
  .main-header { padding: clamp(3px, 0.8vw, 6px) clamp(4px, 1vw, 8px); gap: clamp(4px, 1vw, 8px); }
  .search-bar form { max-width: 100%; }
  .secondary-nav { display: none; }
  .news-ticker { padding: 1px clamp(4px, 1vw, 8px); }
  .primary-nav { position: absolute; top: calc(var(--h-topbar) + var(--h-main)); left: 0; right: 0; background: var(--brand-blue); z-index: 1007; display: none; }
  .primary-nav.active { display: block; }
  .primary-nav ul { flex-direction: column; gap: 0; padding: 10px 0; max-height: 50vh; overflow-y: auto; }
  .primary-nav li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .primary-nav a { padding: 12px 20px; font-size: 1em; }
  .primary-nav .dropdown-menu { position: static; display: none; background: rgba(0,0,0,0.2); }
  .primary-nav .dropdown.active .dropdown-menu { display: block; }
  .primary-nav .dropdown-menu a { padding-left: 40px; font-size: 0.95em; }
}

/* Visible Canada/World on mobile (wasted space fix) */
@media (min-width: 481px) and (max-width: 992px) {
  .primary-nav { display: flex !important; justify-content: flex-end; flex: 1; } /* Fill space */
  .primary-nav ul { flex-direction: row; gap: clamp(4px, 1vw, 8px); padding: 0; max-height: none; overflow: visible; justify-content: flex-end; }
  .primary-nav li:not(:nth-child(1)):not(:nth-child(2)) { display: none; } /* Canada + World visible */
  .primary-nav li a { padding: 0; font-size: 0.9em; }
  .hamburger { margin-left: 8px; }
}

/* Finer breakpoints for robust responsiveness */
@media (max-width: 768px) { .top-bar { min-height: 20px; } .main-header { min-height: 40px; } }
@media (max-width: 480px) { .brand img { width: 40px; } .hamburger { font-size: 1.6em; } .top-center { font-size: 0.8em; } }
@media (min-width: 993px) { .primary-nav ul { gap: clamp(8px, 1.6vw, 12px); } .secondary-nav ul { gap: clamp(8px, 1.6vw, 12px); } }

/* Content / Footer */
.container { max-width: 100%; margin: 0 auto; }
.main-content { max-width: 1200px; margin: var(--content-offset) auto 20px; padding: 0 15px; overflow: hidden; }
.main-content img, .main-content iframe, .main-content video { max-width: 100%; height: auto; }
footer { background: #fff; padding: 15px; border-top: 1px solid #e0e0e0; text-align: center; color: #000; margin-top: 60px; }
body.dark-mode footer { background: #000; border-top: 1px solid #333; color: #fff; }