/* ============================================================
   ENERGX THEME — core stylesheet
   Dark-only · Hebrew/RTL · based on the Claude Design handoff tokens
   ============================================================ */

/* ---- Design tokens ---- */
:root {
  /* Surfaces */
  --bg:          #0A0E14;
  --s1:          #0F1419;
  --s2:          #161B22;
  --s3:          #1C232C;
  --border:      #1F2630;
  --border-soft: #161D26;
  --border-hi:   #2A3340;

  /* Text */
  --t1: #E6EDF3;
  --t2: #9BA8B6;
  --t3: #6B7785;
  --t4: #4A5462;

  /* Accent */
  --cyan:       #22D3EE;
  --cyan-h:     #67E8F9;
  --cyan-d:     #0891B2;
  --cyan-faint: rgba(34, 211, 238, 0.12);
  --steel:      #7C8FF0;

  /* Signal */
  --sig-crit: #FF3D5A;
  --sig-mid:  #FFB020;
  --sig-low:  #22C55E;
  --sig-info: #6B7785;

  /* Tier */
  --gold:       #FFD400;
  --gold-faint: rgba(255, 212, 0, 0.10);

  /* Fonts */
  --f-he:   'Heebo', system-ui, sans-serif;
  --f-en:   'Inter', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-chip:  2px;
  --r-card:  4px;
  --r-modal: 8px;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-6: 24px; --sp-8: 32px; --sp-12: 48px; --sp-16: 64px;

  --maxw: 1440px;
  --maxw-read: 860px;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html { color-scheme: dark; }

body.energx {
  margin: 0;
  font-family: var(--f-he);
  background: var(--bg);
  color: var(--t1);
  direction: rtl;
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "kern";
  -webkit-font-smoothing: antialiased;
}

.energx a { color: inherit; text-decoration: none; }
.energx img { max-width: 100%; height: auto; display: block; }

.mono { font-family: var(--f-mono); font-feature-settings: "tnum"; unicode-bidi: plaintext; }
.en   { font-family: var(--f-en); }
.ltr  { direction: ltr; unicode-bidi: isolate; }

.energx h1, .energx h2, .energx h3, .energx h4 {
  margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em;
}

.ex-wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.ex-section { padding-block: var(--sp-12); border-bottom: 1px solid var(--border); }

.ex-meta {
  font-family: var(--f-mono); font-size: 11px; color: var(--t3);
  letter-spacing: .04em; text-transform: uppercase;
}

/* ---- Brand ---- */
.ex-logo {
  font-family: var(--f-en); font-weight: 800; font-size: 22px;
  letter-spacing: -0.02em; color: var(--t1); direction: ltr;
  display: inline-flex; align-items: baseline;
}
.ex-logo b { color: var(--cyan); font-weight: 800; }

/* ---- Chips ---- */
.ex-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: var(--r-chip);
  border: 1px solid var(--border-hi); color: var(--t2);
  background: transparent;
}
.ex-chip--cyan { background: var(--cyan-faint); color: var(--cyan-h); border-color: rgba(34,211,238,0.35); }
.ex-chip--gold { background: var(--gold-faint); color: var(--gold); border-color: rgba(255,212,0,0.4); }
.ex-chip--crit { background: rgba(255,61,90,0.12); color: #FF7186; border-color: rgba(255,61,90,0.4); }
.ex-chip--mid  { background: rgba(255,176,32,0.12); color: #FFC659; border-color: rgba(255,176,32,0.4); }
.ex-chip--low  { background: rgba(34,197,94,0.12);  color: #4ADE80; border-color: rgba(34,197,94,0.4); }
.ex-chip--entity { background: var(--s2); color: var(--t1); border-color: var(--border-hi); text-transform: none; letter-spacing: 0; font-family: var(--f-he); font-size: 12px; }
.ex-chip--entity:hover { border-color: var(--cyan); color: var(--cyan-h); }

/* ---- Buttons ---- */
.ex-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 14px; border-radius: var(--r-card);
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s ease-out;
}
.ex-btn--primary { background: var(--cyan); color: #001318; }
.ex-btn--primary:hover { background: var(--cyan-h); }
.ex-btn--gold { background: var(--gold); color: #1a1500; }
.ex-btn--ghost { background: transparent; color: var(--t1); border-color: var(--border-hi); }
.ex-btn--ghost:hover { background: var(--s2); }
.ex-btn--link { color: var(--cyan); padding: 0; background: none; border: none; }

/* ---- Cards ---- */
.ex-card {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  transition: all .15s ease-out;
}
.ex-card:hover { background: var(--s2); border-color: var(--border-hi); }

/* ---- Live dot ---- */
.ex-live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--sig-crit); position: relative;
}
.ex-live-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--sig-crit); animation: ex-pulse 1.8s ease-out infinite;
}
@keyframes ex-pulse {
  0%   { transform: scale(.7); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ============================================================
   HEADER / TOP BAR
   ============================================================ */
.ex-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 50; }

.ex-topbar {
  height: 30px; display: flex; align-items: center;
  border-bottom: 1px solid var(--border-soft); padding-inline: 20px;
}
.ex-topbar__status { display: flex; align-items: center; gap: 12px; color: var(--t3); }
.ex-topbar__status .sep { width: 1px; height: 10px; background: var(--border); }
.ex-topbar__ticker { margin-inline-start: auto; display: flex; align-items: center; overflow: hidden; max-width: 60%; }
.ex-ticker-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding-inline: 16px; border-inline-start: 1px solid var(--border);
  direction: ltr; white-space: nowrap;
}

.ex-nav {
  height: 64px; display: flex; align-items: center; gap: 32px; padding-inline: 20px;
}
.ex-nav__brand { display: flex; align-items: baseline; gap: 14px; }
.ex-nav__map {
  font-family: var(--f-mono); font-size: 11px; color: var(--cyan);
  letter-spacing: .12em; border: 1px solid rgba(34,211,238,0.4);
  padding: 4px 10px; border-radius: 2px; display: inline-flex; align-items: center; gap: 6px;
}
.ex-nav__menu { display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--t2); font-weight: 500; list-style: none; margin: 0; padding: 0; }
.ex-nav__menu a:hover { color: var(--cyan-h); }
.ex-nav__right { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.ex-search-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 11px;
  background: var(--s2); border: 1px solid var(--border); border-radius: 4px;
  color: var(--t3); cursor: pointer; font-family: var(--f-he); font-size: 12px;
}
.ex-search-btn kbd {
  margin-inline-start: 12px; font-family: var(--f-mono); font-size: 10px; color: var(--t4);
  border: 1px solid var(--border-hi); padding: 1px 5px; border-radius: 2px;
}

/* ============================================================
   HERO
   ============================================================ */
.ex-hero { display: grid; grid-template-columns: 1.45fr 1fr; gap: 32px; padding-block: var(--sp-8); align-items: stretch; }
.ex-hero__kpis { position: absolute; inset-block-end: 16px; inset-inline: 16px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; z-index: 2; }
.ex-kpi {
  background: rgba(15,20,25,0.85); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 14px;
}
.ex-kpi__val { font-family: var(--f-mono); font-size: 24px; font-weight: 600; color: var(--t1); }

.ex-hero__lead { display: flex; flex-direction: column; justify-content: center; }
.ex-hero__lead h1 { font-size: 40px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; margin-block: 14px; }
.ex-hero__lead .lede { font-size: 18px; color: var(--t2); line-height: 1.6; }

/* ---- Hero globe (orthographic SVG) ---- */
.ex-globe {
  position: relative; min-height: 520px;
  border: 1px solid var(--border); border-radius: var(--r-card);
  background: radial-gradient(ellipse at 60% 45%, #0c1722 0%, #0a121a 55%, #070a10 100%);
  overflow: hidden;
  display: grid; place-items: center;
}
.ex-globe__svg { width: 86%; max-width: 460px; height: auto; }
.ex-globe__markers { position: absolute; inset: 0; pointer-events: none; }
.ex-globe-marker {
  position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%);
  pointer-events: auto;
}
.ex-globe-marker__dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--bg);
  border: 1.5px solid var(--c); box-shadow: 0 0 10px 1px var(--c);
}
.ex-globe-marker__ring {
  position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid var(--c);
  animation: ex-pulse 1.8s ease-out infinite; opacity: .8;
}
.ex-globe-marker__label {
  position: absolute; inset-inline-start: 14px; inset-block-start: -3px; white-space: nowrap;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .06em; color: var(--t2);
  text-shadow: 0 0 6px #070a10, 0 0 6px #070a10;
}
.ex-globe__label { position: absolute; inset-block-start: 16px; inset-inline-start: 16px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.ex-globe__open { position: absolute; inset-block-start: 16px; inset-inline-end: 16px; font-size: 11px; color: var(--cyan); letter-spacing: .08em; z-index: 2; }
.ex-byline { display: flex; align-items: center; gap: 10px; margin-block: 18px; }
.ex-byline__av { width: 36px; height: 36px; border-radius: 50%; background: var(--s2); border: 1px solid var(--border-hi); }

/* ============================================================
   LIVE STRIP
   ============================================================ */
.ex-livestrip { background: var(--s1); border-bottom: 2px solid var(--cyan); }
.ex-livestrip__inner { display: grid; grid-template-columns: auto repeat(6, 1fr); gap: 0; }
.ex-livestrip__label { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-inline-end: 1px solid var(--border); }
.ex-livestrip__item { padding: 14px 16px; border-inline-end: 1px solid var(--border); }
.ex-livestrip__item:last-child { border-inline-end: none; }
.ex-livestrip__item .h { font-size: 13px; color: var(--t1); line-height: 1.4; margin-top: 6px; }

/* ============================================================
   MARKETS GRID
   ============================================================ */
.ex-markets { border: 1px solid var(--border); border-radius: var(--r-card); display: grid; grid-template-columns: repeat(4, 1fr); }
.ex-mkt {
  padding: 16px; border-inline-start: 1px solid var(--border); border-bottom: 1px solid var(--border);
  direction: ltr; text-align: left;
}
.ex-mkt:nth-child(4n) { border-inline-start: none; }
.ex-mkt:nth-child(n+5) { /* second row keeps top border via bottom of first */ }
.ex-mkt__sym { font-family: var(--f-mono); font-size: 11px; color: var(--t3); letter-spacing: .06em; }
.ex-mkt__name { font-family: var(--f-he); font-size: 12px; color: var(--t2); direction: rtl; }
.ex-mkt__val { font-family: var(--f-mono); font-size: 28px; font-weight: 600; color: var(--t1); margin-block: 4px; }
.ex-mkt__delta { font-family: var(--f-mono); font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.ex-up { color: var(--sig-low); }
.ex-dn { color: var(--sig-crit); }

/* ============================================================
   CHOKEPOINTS TABLE
   ============================================================ */
.ex-cptable { border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.ex-cprow {
  display: grid; grid-template-columns: 2fr 1.2fr 1fr 2fr 1.2fr auto;
  align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.ex-cprow:last-child { border-bottom: none; }
.ex-cprow:hover { background: var(--s1); }
.ex-cp-name { font-weight: 700; }
.ex-cp-name span { font-family: var(--f-mono); font-size: 11px; color: var(--t3); display: block; }
.ex-status { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; }
.ex-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.ex-riskbar { height: 4px; background: var(--s3); border-radius: 2px; overflow: hidden; }
.ex-riskbar > i { display: block; height: 100%; }

/* ============================================================
   GENERIC GRIDS / CARDS (category, why-it-matters, maps)
   ============================================================ */
.ex-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.ex-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ex-grid-cat { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 0; }

.ex-wim { min-height: 200px; padding: 18px; display: flex; flex-direction: column; }
.ex-wim__tag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--cyan); }
.ex-wim h3 { font-size: 17px; margin-block: 10px 8px; }
.ex-wim p { font-size: 13px; color: var(--t2); flex: 1; }
.ex-wim__foot { font-family: var(--f-mono); font-size: 11px; color: var(--t3); display: flex; justify-content: space-between; align-items: center; }

/* ============================================================
   SECTION HEAD
   ============================================================ */
.ex-sechead { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.ex-sechead__kicker { font-family: var(--f-mono); font-size: 11px; color: var(--cyan); letter-spacing: .14em; margin-bottom: 6px; }
.ex-sechead h2 { font-size: 22px; }
.ex-sechead__action { font-family: var(--f-mono); font-size: 11px; color: var(--t2); letter-spacing: .08em; display: inline-flex; align-items: center; gap: 6px; }

/* ============================================================
   DUAL CTA
   ============================================================ */
.ex-cta-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ex-cta { background: var(--s1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; }
.ex-cta--news { border-top: 2px solid var(--cyan); }
.ex-cta--prem { border-top: 2px solid var(--gold); }
.ex-cta ul { list-style: none; padding: 0; margin: 16px 0; }
.ex-cta li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--t2); margin-bottom: 8px; }
.ex-cta li svg { color: var(--sig-low); flex-shrink: 0; }
.ex-cta__form { display: flex; gap: 8px; margin-top: 16px; }
.ex-cta__form input {
  flex: 1; background: var(--s2); border: 1px solid var(--border-hi); border-radius: var(--r-card);
  color: var(--t1); padding: 10px 12px; font-family: var(--f-he); font-size: 14px;
}
.ex-cta__form input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }

/* ============================================================
   PAYWALL (brief)
   ============================================================ */
.ex-paywall { position: relative; margin-top: -120px; padding-top: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg) 110px); }
.ex-gate { border-radius: var(--r-card); padding: 28px; background: var(--s1); text-align: center; }
.ex-gate--soft { border-top: 2px solid var(--cyan); }
.ex-gate--hard { border-top: 2px solid var(--gold); }
.ex-gate h3 { font-size: 22px; margin-bottom: 10px; }
.ex-gate p { color: var(--t2); margin-bottom: 18px; }

/* ============================================================
   ARTICLE / BRIEF BODY
   ============================================================ */
.ex-article { max-width: var(--maxw-read); margin-inline: auto; padding-block: var(--sp-8); }
.ex-article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ex-article h1 { font-size: 44px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.ex-article .standfirst { font-size: 20px; color: var(--t2); line-height: 1.55; margin-block: 16px; }
.ex-sources {
  background: var(--s1); border-inline-start: 2px solid var(--cyan);
  border-radius: var(--r-card); padding: 16px; margin-block: 24px;
}
.ex-sources__head { font-family: var(--f-mono); font-size: 11px; color: var(--t3); letter-spacing: .08em; margin-bottom: 10px; }
.ex-prose { font-size: 17px; line-height: 1.75; color: var(--t1); }
.ex-prose p { margin-block: 1em; }
.ex-prose h2 { font-size: 28px; margin-block: 1.2em .5em; }
.ex-prose h3 { font-size: 22px; margin-block: 1em .5em; }
.ex-entity-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 28px; padding-top: 20px; border-top: 1px solid var(--border); }

/* ============================================================
   FOOTER
   ============================================================ */
.ex-footer { background: var(--s1); border-top: 1px solid var(--border); }
.ex-footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 24px; padding-block: var(--sp-12); }
.ex-footer h4 { font-family: var(--f-mono); font-size: 11px; color: var(--t3); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.ex-footer ul { list-style: none; padding: 0; margin: 0; }
.ex-footer li { margin-bottom: 8px; }
.ex-footer a { color: var(--t2); font-size: 14px; }
.ex-footer a:hover { color: var(--cyan-h); }
.ex-footer__status { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--sig-low); border: 1px solid var(--border); border-radius: var(--r-chip); padding: 4px 10px; margin-top: 14px; }
.ex-footer__bar { border-top: 1px solid var(--border); padding-block: 16px; display: flex; justify-content: space-between; align-items: center; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .ex-hero { grid-template-columns: 1fr; }
  .ex-markets { grid-template-columns: repeat(2, 1fr); }
  .ex-grid-5 { grid-template-columns: repeat(2, 1fr); }
  .ex-grid-cat { grid-template-columns: 1fr 1fr; }
  .ex-footer__cols { grid-template-columns: 1fr 1fr; }
  .ex-livestrip__inner { grid-template-columns: 1fr; }
  .ex-livestrip__label { border-inline-end: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .ex-nav__menu { display: none; }
  .ex-hero__lead h1 { font-size: 28px; }
  .ex-article h1 { font-size: 28px; }
  .ex-markets { grid-template-columns: 1fr 1fr; }
  .ex-grid-3, .ex-grid-5, .ex-grid-cat, .ex-cta-dual { grid-template-columns: 1fr; }
  .ex-cprow { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ex-topbar__ticker { max-width: 50%; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .ex-live-dot::after { animation: none; }
  * { transition: none !important; }
}

/* ============================================================
   ⌘K COMMAND PALETTE
   ============================================================ */
.ex-cmdk { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: flex-start; justify-content: center; }
.ex-cmdk[hidden] { display: none; }
.ex-cmdk__backdrop { position: absolute; inset: 0; background: rgba(5,8,12,0.72); backdrop-filter: blur(3px); }
.ex-cmdk__panel {
  position: relative; margin-top: 12vh; width: min(620px, 92vw);
  background: var(--s1); border: 1px solid var(--border-hi); border-radius: var(--r-modal);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6); overflow: hidden;
}
.ex-cmdk__inputwrap { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); color: var(--t3); }
.ex-cmdk__input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--t1); font-family: var(--f-he); font-size: 16px;
}
.ex-cmdk__input::placeholder { color: var(--t4); }
.ex-cmdk__inputwrap kbd { font-family: var(--f-mono); font-size: 10px; color: var(--t4); border: 1px solid var(--border-hi); padding: 2px 6px; border-radius: 3px; }
.ex-cmdk__results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.ex-cmdk__item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-card); cursor: pointer;
}
.ex-cmdk__item:hover, .ex-cmdk__item.is-active { background: var(--s2); }
.ex-cmdk__item.is-active { outline: 1px solid var(--cyan); }
.ex-cmdk__title { font-size: 14px; color: var(--t1); }
.ex-cmdk__type { font-size: 10px; color: var(--cyan-h); background: var(--cyan-faint); border: 1px solid rgba(34,211,238,0.3); padding: 2px 8px; border-radius: 2px; letter-spacing: .06em; flex-shrink: 0; }
.ex-cmdk__empty { padding: 24px; text-align: center; color: var(--t3); font-size: 14px; }
.ex-cmdk__foot { display: flex; gap: 18px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 10px; color: var(--t4); }
@media (max-width: 640px) {
  .ex-cmdk__panel { margin-top: 6vh; }
  .ex-cmdk__foot { display: none; }
}
