/* RAGE X — Critical CSS Fixes v27.7.0
 * File: ragex-fixes.css (was: ragex-v26.css — renamed v27.7 for clarity)
 * Enqueued at priority 99 — final cascade authority after all other sheets.
 * Contains: header/nav layout rules, container fixes, hero text overrides,
 *           visual upgrades, light-mode parity, and component fixes.
 */

/* ═══════════════════════════════════════
   DESKTOP HEADER (min-width: 901px)
   Layout: [LOGO] ---spacer--- [LIVE] [SEARCH] [THEME]
   ═══════════════════════════════════════ */
@media (min-width:901px) {
  .site-header {
    background: var(--header-bg);
    border-bottom: none !important;
    height: var(--header-h, 56px);
    min-height: var(--header-h, 56px);
    max-height: var(--header-h, 56px);
    overflow: visible;
    box-shadow: none;
  }

  .header-inner {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 16px;
    height: 100%;
    max-width: var(--container-xl, 1200px);
    margin: 0 auto;
    padding: 0 32px;
  }

  /* Hamburger: hidden on desktop */
  .header-toggle { display: none !important; }

  /* Logo */
  .site-logo { flex-shrink: 0; }
  .site-logo a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
  .site-logo__name { font-size: 28px; }

  /* Spacer */
  .header-spacer { flex: 1; display: block !important; min-width: 20px; }

  /* Controls wrapper */
  .header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
  }

  /* Hide mobile search toggle on desktop */
  .header-search-toggle { display: none !important; }

  /* Desktop search visible */
  .header-search--desktop { display: block !important; }

  /* LIVE badge */
  .header-live { display: flex !important; }

  /* Theme toggle */
  .theme-toggle { flex-shrink: 0; }
  .theme-toggle__btn { width: 28px; height: 28px; }

  /* Nav bar — flush under header */
  .nav-primary {
    margin-top: 0 !important;
    border-top: 1px solid var(--border);
    border-bottom: 2px solid var(--rage-red, #9A0000);
    height: var(--nav-h, 40px) !important;
    min-height: var(--nav-h, 40px);
    box-shadow: none;
    overflow: visible;
  }
  .nav-primary__wrap {
    max-width: var(--container-xl, 1200px);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    overflow: visible;
  }
  .nav-primary__menu > li > a {
    padding: 0 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    /* v27.1: explicit height (not min-height) prevents font-swap reflow */
    height: var(--nav-h, 40px) !important;
    min-height: var(--nav-h, 40px);
    overflow: hidden;
  }
  .nav-primary__menu > li.menu-item-has-children > a::after {
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-top: 3.5px solid currentColor;
    margin-left: 5px;
    opacity: .35;
  }
  .nav-primary__menu > li.menu-item-has-children:hover > a::after { opacity: .8; }
}


/* ═══════════════════════════════════════
   MOBILE HEADER (max-width: 900px)
   Layout: [☰] [--- LOGO centered ---] [🔍 🌙☀️]
   ═══════════════════════════════════════ */
@media (max-width:900px) {
  .site-header {
    border-bottom: none !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    box-shadow: none !important;
  }

  .header-inner {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    height: 56px;
    padding: 0 12px !important;
    gap: 10px !important;
  }

  /* Hamburger — left */
  .header-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    order: 0;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius, 2px);
    padding: 0;
  }

  /* Logo — centered via flex:1 */
  .site-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    order: 1;
    min-width: 0;
  }
  .site-logo a { display: flex; align-items: center; justify-content: center; }
  .site-logo__img { height: 36px; max-height: 36px; }
  .site-logo__name { font-size: 22px; }
  .site-logo__tagline { display: none; }

  /* Spacer — hidden on mobile */
  .header-spacer { display: none !important; }

  /* Controls wrapper — right side */
  .header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    order: 2;
  }

  /* Hide desktop-only items */
  .header-live { display: none !important; }
  .header-search--desktop { display: none !important; }

  /* Show mobile search toggle */
  .header-search-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius, 2px);
    color: var(--text-s);
    padding: 0;
    flex-shrink: 0;
  }

  /* Theme toggle — compact */
  .theme-toggle {
    display: flex;
    padding: 2px;
    gap: 0;
    border-radius: 16px;
  }
  .theme-toggle__btn { width: 26px; height: 26px; font-size: 11px; }

  /* Nav — collapses to mobile menu */
  .nav-primary {
    margin-top: 0 !important;
    border-top: 1px solid var(--border);
  }
}

/* Small phones */
@media (max-width:480px) {
  .header-inner { padding: 0 8px !important; gap: 6px !important; }
  .header-toggle { width: 36px; height: 36px; }
  .site-logo__img { height: 30px; max-height: 30px; }
  .site-logo__name { font-size: 19px; }
  .header-search-toggle { width: 32px; height: 32px; }
  .theme-toggle__btn { width: 24px; height: 24px; font-size: 10px; }
}


/* ═══════════════════════════════════════
   LIGHT MODE HEADER
   ═══════════════════════════════════════ */
[data-theme="light"] .site-header { background: #fff !important; border-bottom: none !important; box-shadow: none !important; }
[data-theme="light"] .site-header.is-scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.08) !important; }
[data-theme="light"] .nav-primary { background: #fafafa !important; border-top: 1px solid rgba(0,0,0,.06) !important; border-bottom: 2px solid rgba(154,0,0,.7) !important; }


/* ═══════════════════════════════════════
   CONTAINER WIDTH
   ═══════════════════════════════════════ */
/* FIX-05 v27.7: Restored --container-xl to 1200px (master palette spec).
   Previous value of 1440px was overriding style.css :root (1200px) because
   this file loads at priority 99 — last. At 1440px the hero column exceeded
   the aspect-ratio+max-height cap, creating a black void, and all containers
   extended beyond the 1200px brand max-width. */
:root { --container-xl: 1200px; --container-md: 960px; }
.container--read { max-width: 960px !important; padding: 0 28px; box-sizing: border-box; margin-left: auto; margin-right: auto; }
@media(max-width:768px) { .container--read { padding: 0 18px; } }
@media(max-width:480px) { .container--read { padding: 0 14px; } }
.page-content, .page-content .article-body { max-width: 100%; }
.article-body { font-size: 17px; line-height: 1.85; }


/* ═══════════════════════════════════════
   HERO TEXT — ALWAYS WHITE OVER IMAGES
   ═══════════════════════════════════════ */
.hero-main__title, .hero-main__title a, .hero-main__excerpt, .hero-main__time,
.hero-main__meta, .hero-main__status, .hero-main__status--fresh, .hero-main__action { color: #fff !important; }
.hero-main__title a:hover { color: #ffcccc !important; }
.hero-main__title a { text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.hero-main__excerpt { text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero-main__overlay { background: linear-gradient(0deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.55) 35%, rgba(0,0,0,.15) 65%, transparent 100%) !important; }
.hero-side__title, .hero-side__title a, .hero-side__time, .hero-side__status { color: #fff !important; }
.hero-side__title a:hover { color: #ffcccc !important; }
.hero-side__title a { text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.hero-side__overlay { background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 60%, transparent 100%) !important; }
[data-theme="light"] .hero-main__title a, [data-theme="light"] .hero-main__excerpt, [data-theme="light"] .hero-side__title a { color: #fff !important; }


/* ═══════════════════════════════════════
   CSS ENTROPY CONSOLIDATION
   ═══════════════════════════════════════ */
.homepage-cat-section { padding: 22px; margin-bottom: 28px; background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--bg-s2); border: 1px solid var(--border); border-radius: 10px; }
@media(max-width:767px) { .homepage-cat-section { padding: 16px; margin-bottom: 20px; } }
.hero-main { min-height: 520px; border: 1px solid rgba(122,0,0,.25); box-shadow: 0 24px 80px rgba(0,0,0,.5); }
@media(max-width:900px) { .hero-main { min-height: 340px; } }
@media(max-width:600px) { .hero-main { min-height: 240px; } }
.hero-side__item { min-height: 170px; max-height: none; flex: 1; border: 1px solid rgba(122,0,0,.15); transition: border-color .2s, transform .2s; }
.hero-side__item:hover { border-color: var(--rage-red); transform: translateY(-1px); }


/* ═══════════════════════════════════════
   VISUAL UPGRADES
   ═══════════════════════════════════════ */
.live-wire__item { border-left: 3px solid transparent; padding-left: 16px; transition: background .12s, border-color .15s; }
.live-wire__item:hover { border-left-color: var(--rage-red); }
.hero-command__metric { position: relative; }
.hero-command__metric + .hero-command__metric::before { content: ''; position: absolute; left: -1px; top: 18%; height: 64%; width: 1px; background: var(--border-mid); }
.nd-lead { border-left: 3px solid var(--rage-red); }
.nd-commentary { border-top: 2px solid var(--intel-blue); }
.nd-carousel__slide { transition: opacity .5s ease; }
.nd-carousel__slide:not(.is-active) { opacity: 0; position: absolute; inset: 0; }
.tracker-node { transition: border-color .2s, box-shadow .2s, transform .18s; }
.tracker-node:hover { border-color: var(--rage-red); box-shadow: 0 0 24px rgba(154,0,0,.12), var(--shadow-card); transform: translateY(-2px); }
.tracker-node__headline { transition: color .15s; }
.tracker-node:hover .tracker-node__headline { color: var(--rage-red-light); }
.tracker-node__priority { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; background: rgba(154,0,0,.1); color: var(--rage-red-light); border: 1px solid rgba(154,0,0,.2); }
.tracker-node--intelligence .tracker-node__priority, .tracker-node--global .tracker-node__priority { background: rgba(27,54,93,.12); color: var(--intel-blue-light); border-color: rgba(27,54,93,.25); }
.tracker-node--technology .tracker-node__priority { background: rgba(204,170,0,.08); color: var(--tac-yellow); border-color: rgba(204,170,0,.2); }
.tracker-node__icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(154,0,0,.08); font-family: var(--font-display); font-size: 16px; font-weight: 800; color: var(--rage-red-light); flex-shrink: 0; }
.brief-item { transition: background .12s; border-radius: 6px; padding: 6px 4px; }
.brief-item:hover { background: var(--bg-s3); }
.brief-item__index { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--rage-red-dim); min-width: 32px; text-align: center; }
.cat-section-featured__img { transition: transform .4s ease; }
.cat-section-featured:hover .cat-section-featured__img { transform: scale(1.03); }
.cat-section-list__item { transition: background .12s; }
.cat-section-list__item:hover { background: var(--bg-s2); }
.trust-card { transition: border-color .2s, box-shadow .25s, transform .2s; }
.trust-card:hover { transform: translateY(-3px); border-color: var(--rage-red); box-shadow: 0 10px 32px rgba(154,0,0,.1), var(--shadow-card); }
.trust-conversion { border-top: 2px solid var(--rage-red); }
.article-card__img { transition: transform .4s ease; }
.article-card:hover .article-card__img { transform: scale(1.03); }
.article-card { transition: border-color .2s, box-shadow .2s, transform .2s; }
.article-card:hover { border-color: var(--rage-red); box-shadow: 0 6px 24px rgba(154,0,0,.08), var(--shadow-card); transform: translateY(-2px); }
@media(max-width:767px) { .article-card:hover { transform: none; } }
.intel-strip__item { position: relative; }
.intel-strip__item + .intel-strip__item::before { content: ''; position: absolute; left: 0; top: 22%; height: 56%; width: 1px; background: var(--border-mid); }
.alert-panel { border-top: 2px solid var(--rage-red); }
.widget-newsletter { border-top: 2px solid var(--intel-blue); }
.site-footer { border-top: 1px solid rgba(154,0,0,.2); }
.nl-input { border-radius: 6px 0 0 6px; }
.nl-submit { border-radius: 0 6px 6px 0; font-family: var(--font-display); letter-spacing: .1em; }
html { scroll-behavior: smooth; }
@media(prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 4px; }

/* Light mode upgrades */
[data-theme="light"] .homepage-cat-section { background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,246,246,.98)); border-color: rgba(0,0,0,.08); box-shadow: 0 8px 28px rgba(0,0,0,.05); }
[data-theme="light"] .hero-main { border-color: rgba(0,0,0,.1); box-shadow: 0 16px 48px rgba(0,0,0,.1); }
[data-theme="light"] .hero-side__item { border-color: rgba(0,0,0,.08); }
[data-theme="light"] .tracker-node:hover { box-shadow: 0 0 20px rgba(154,0,0,.06), var(--shadow-card); }
[data-theme="light"] .trust-card:hover { box-shadow: 0 10px 32px rgba(154,0,0,.05), var(--shadow-card); }
[data-theme="light"] .brief-item__index { color: var(--rage-red); }
[data-theme="light"] .article-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.08), var(--shadow-card); }


/* ═══════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════ */
.rx-about__quote { margin: 28px 0; padding: 20px 24px; border-left: 3px solid var(--rage-red); background: var(--bg-s2); border-radius: 0 8px 8px 0; font-family: var(--font-serif); font-style: italic; color: var(--text-s); line-height: 1.7; }
.rx-about__quote p { margin: 0 0 10px; }
.rx-about__quote cite { display: block; font-style: normal; font-family: var(--font-display); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--rage-red); margin-top: 8px; }


/* ═══════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════ */
.rx-contact { padding-bottom: 60px; }
.rx-contact__hero { padding: 48px 0 32px; text-align: center; }
.rx-contact__title { font-family: var(--font-display); font-size: clamp(28px,5vw,42px); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; margin: 0 0 8px; }
.rx-contact__subtitle { font-size: 15px; color: var(--text-s); margin: 0 0 28px; }
.rx-contact__stats { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; }
.rx-contact__stat-val { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--rage-red); line-height: 1.1; }
.rx-contact__stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-s); margin-top: 4px; }
.rx-contact__section { margin-top: 40px; }
.rx-contact__h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.rx-contact__platforms { display: grid; gap: 8px; }
.rx-contact__platform { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--bg-s2); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text-p); transition: border-color .2s, transform .15s; }
.rx-contact__platform:hover { border-color: var(--rage-red); transform: translateX(4px); }
.rx-contact__platform-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.rx-contact__platform-info { flex: 1; min-width: 0; }
.rx-contact__platform-name { display: block; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.rx-contact__platform-desc { display: block; font-size: 12px; color: var(--text-s); margin-top: 2px; }
.rx-contact__platform-badge { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--rage-red); background: var(--alert-bg); padding: 3px 10px; border-radius: 4px; flex-shrink: 0; }
.rx-contact__grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 32px; }
@media(max-width:767px) { .rx-contact__grid { grid-template-columns: 1fr; } }
.rx-contact__info { display: flex; flex-direction: column; gap: 12px; }
.rx-contact__info-item { padding: 16px 18px; background: var(--bg-s2); border: 1px solid var(--border); border-radius: 8px; }
.rx-contact__info-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-m); margin-bottom: 4px; font-family: var(--font-mono); }
.rx-contact__info-val { font-size: 15px; color: var(--text-p); text-decoration: none; }
a.rx-contact__info-val:hover { color: var(--rage-red); }
.rx-contact__form { display: flex; flex-direction: column; gap: 16px; }
.rx-contact__label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-s); margin-bottom: 6px; font-family: var(--font-display); }
.rx-contact__input,.rx-contact__select,.rx-contact__textarea { width: 100%; padding: 12px 14px; font-size: 14px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 6px; color: var(--input-c); transition: border-color .2s, box-shadow .2s; }
.rx-contact__input:focus,.rx-contact__select:focus,.rx-contact__textarea:focus { outline: none; border-color: var(--rage-red); box-shadow: 0 0 0 3px rgba(154,0,0,.1); }
.rx-contact__select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.rx-contact__textarea { resize: vertical; min-height: 100px; }
.rx-contact__submit { align-self: flex-start; padding: 12px 36px; font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: var(--rage-red); color: #fff; border: none; border-radius: 6px; cursor: pointer; transition: background .2s; }
.rx-contact__submit:hover { background: var(--rage-red-light); }
.rx-contact__ecosystem { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 12px; }
.rx-contact__eco-card { display: block; padding: 18px 20px; background: var(--bg-s2); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text-p); transition: border-color .2s, transform .15s; }
.rx-contact__eco-card:hover { border-color: var(--rage-red); transform: translateY(-2px); }
.rx-contact__eco-name { font-family: var(--font-display); font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.rx-contact__eco-desc { font-size: 12px; color: var(--text-s); }
