/* ============================================================
   TITAN TECH — news_item cover orientation system
   Three cover+title treatments driven by image aspect ratio:
     landscape  (W/H > 1.2)   — full-bleed hero, title over image
     portrait   (W/H < 0.85)  — left-image / right-text split
     square     (0.85–1.2)    — centred 1:1 framed cover, title above
   Scoped under .na-article[data-na-orient="…"] (or [data-view]).
   Depends on tokens + base components from custom.css + article.css.
   ============================================================ */

/* ── Orientation visibility switch ──────────────────────────── */
.na-head { display: none; }
.na-article[data-view="landscape"] .na-head-landscape,
.na-article[data-view="portrait"]  .na-head-portrait,
.na-article[data-view="square"]    .na-head-square,
.na-article[data-view="nocover"]   .na-head-nocover { display: block; }

/* ── No-cover head (text-only header) ───────────────────────── */
.na-head-nocover .na-contain { padding-top: calc(var(--nav-h) + 52px); }
.na-head-nocover .na-breadcrumb { margin-bottom: 26px; }
.na-head-nocover .na-title { font-size: clamp(30px, 3.6vw, 52px); margin-bottom: 24px; max-width: 26ch; }
.na-head-nocover .na-sub { margin-bottom: 26px; }

/* ── Shared cover atoms ─────────────────────────────────────── */
.na-contain {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.na-breadcrumb {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--mono-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-2);
}
.na-breadcrumb a { color: var(--fg-2); transition: color 200ms var(--ease); }
.na-breadcrumb a:hover { color: var(--accent); }
.na-breadcrumb .sep { color: var(--fg-3); }
.na-breadcrumb .current {
  color: var(--fg-2); text-transform: none;
  max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.na-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}
.na-status .live-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(77,184,255,0.8);
  animation: live_pulse 2s ease-in-out infinite;
}

.na-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px dashed var(--accent);
  font-family: var(--font-mono);
  font-size: var(--mono-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(77,184,255,0.06);
  text-decoration: none;
  transition: background 200ms var(--ease), border-style 200ms var(--ease);
}
.na-category::before { content: ''; width: 6px; height: 6px; background: var(--accent); display: inline-block; }
.na-category:hover { border-style: solid; background: rgba(77,184,255,0.14); }

.na-title {
  font-family: var(--font-cjk);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.16;
  letter-spacing: -0.005em;
  color: var(--fg-1);
  margin: 0;
  text-wrap: balance;
}
.na-sub {
  font-family: var(--font-cjk);
  font-weight: 400;
  line-height: 1.7;
  color: var(--fg-2);
  margin: 0;
  max-width: 52ch;
}

/* ── Meta — uses theme .article-meta + .meta-item (bootstrap-icon + text) ── */
.na-meta-wrap .article-meta { margin: 0; }
.na-split-text .article-meta { width: 100%; margin-top: 2px; }
.na-head-square .article-meta { justify-content: center; max-width: 720px; margin: 0 auto 44px; }
.na-head-nocover .article-meta { margin: 0; }

/* ── Image frame (portrait + square) — blurred backdrop + contain ─ */
.na-frame {
  position: relative;
  overflow: hidden;
  background: #070f1d;
  border: 1px dashed var(--border);
}
.na-frame-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(34px) saturate(1.1) brightness(0.5);
  transform: scale(1.2);
  z-index: 0;
}
.na-frame-backdrop::after { content: ''; position: absolute; inset: 0; background: rgba(5,12,24,0.45); }
.na-frame img {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}


/* ============================================================
   LANDSCAPE — full-bleed hero, title overlaid on image
   ============================================================ */
.na-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: clamp(460px, 66vh, 700px);
  overflow: hidden;
  background-color: #04101f;
}
.na-hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  filter: saturate(0.9) brightness(0.74) contrast(1.05);
}
.na-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(5,12,24,0.30) 0%,
    rgba(5,12,24,0.16) 32%,
    rgba(5,12,24,0.68) 76%,
    rgba(5,12,24,0.96) 100%);
}
.na-hero-inner {
  position: relative; z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: calc(var(--nav-h) + 40px) var(--gutter) 52px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.na-hero-foot {
  position: relative;
  max-width: 60rem;
}
.na-head-landscape .na-title {
  font-size: clamp(30px, 4.4vw, 60px);
  margin-bottom: 18px;
  color: #fff;
  text-shadow: 0 2px 30px rgba(5,12,24,0.6);
}
.na-head-landscape .na-sub { color: var(--fg-1); }
.na-head-landscape .na-meta-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px var(--gutter) 0;
}

/* ============================================================
   PORTRAIT — left image / right text split
   ============================================================ */
.na-head-portrait .na-contain { padding-top: calc(var(--nav-h) + 44px); }
.na-head-portrait .na-breadcrumb { margin-bottom: 28px; }
.na-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 52px;
  align-items: center;
  padding-bottom: 8px;
}
.na-frame-portrait { aspect-ratio: 3 / 4; }
.na-split-text { display: flex; flex-direction: column; }
.na-split-text .na-status { margin-bottom: 18px; }
.na-split-text .na-category { align-self: flex-start; margin-bottom: 22px; }
.na-split-text .na-title {
  font-size: clamp(28px, 3vw, 46px);
  margin-bottom: 20px;
}
.na-split-text .na-sub { margin-bottom: 28px; }

/* ============================================================
   SQUARE — centred 1:1 framed cover, title above
   ============================================================ */
.na-head-square .na-contain {
  padding-top: calc(var(--nav-h) + 52px);
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.na-head-square .na-breadcrumb { justify-content: center; margin-bottom: 22px; }
.na-head-square .na-status { margin-bottom: 18px; }
.na-head-square .na-category { margin-bottom: 22px; }
.na-head-square .na-title {
  font-size: clamp(28px, 3.4vw, 52px);
  max-width: 22ch;
  margin-bottom: 20px;
}
.na-head-square .na-sub { margin: 0 auto 30px; text-align: center; }
.na-head-square .na-meta-center { margin-bottom: 44px; }
.na-frame-square {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}

/* ============================================================
   COMPARE VIEW — all three heads stacked, labelled
   ============================================================ */
.na-article[data-view="all"] .na-head { display: block; }
.na-article[data-view="all"] .article-shell { display: none; }
.na-head-tag { display: none; }
.na-article[data-view="all"] .na-head-tag {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.na-article[data-view="all"] .na-head {
  padding-bottom: 72px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.na-article[data-view="all"] .na-head:last-of-type { border-bottom: 0; }
/* in compare mode every head needs top breathing room (hero handles its own) */
.na-article[data-view="all"] .na-head-portrait .na-contain,
.na-article[data-view="all"] .na-head-square .na-contain { padding-top: 36px; }
.na-article[data-view="all"] .na-head-landscape { padding-bottom: 56px; }
.na-article[data-view="all"] .na-head-tag-after { margin-top: 28px; }

.na-tag-index {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--bg);
  background: var(--accent);
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.na-tag-name {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--fg-1);
}
.na-tag-rule { flex: 1; height: 1px; background: var(--border); }
.na-tag-trigger {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-2);
}

/* ============================================================
   ORIENTATION SWITCHER — fixed bottom-centre segmented control
   ============================================================ */
.na-switch {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex; align-items: center; gap: 4px;
  background: rgba(14,29,51,0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 5px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.na-switch-label {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-3);
  padding: 0 10px 0 8px;
}
.na-switch button {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-2);
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 13px;
  cursor: pointer;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
  white-space: nowrap;
}
.na-switch button:hover { color: var(--fg-1); background: rgba(77,184,255,0.06); }
.na-switch button.is-active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .na-split { grid-template-columns: 1fr; gap: 28px; }
  .na-frame-portrait { aspect-ratio: 4 / 5; max-width: 440px; }
  .na-split-text .na-category { align-self: center; }
  .na-split-text { text-align: center; align-items: center; }
  .na-meta-stack { width: 100%; max-width: 440px; }
  .na-head-square .na-title { font-size: clamp(26px, 6vw, 40px); }
}
@media (max-width: 640px) {
  .na-contain { padding-left: 18px; padding-right: 18px; }
  .na-hero { height: clamp(380px, 56vh, 520px); }
  .na-head-landscape .na-title { font-size: clamp(26px, 8vw, 40px); }
  .na-hero-foot { padding-left: 20px; }
  .na-meta-row { gap: 4px 0; }
  .na-meta-row > div { padding: 6px 14px; border-right: 0; }
  .na-meta-row > div:first-child { padding-left: 14px; }
  .na-switch { bottom: 12px; gap: 2px; padding: 4px; flex-wrap: wrap; max-width: 94vw; justify-content: center; }
  .na-switch button { padding: 7px 10px; font-size: 10px; }
  .na-switch-label { display: none; }
  .na-frame-square { max-width: 100%; }
}
