/* News V2 — single AI Market Insights post (/news/{slug}/).
   Colours, type scale and spacing follow helvoa-ai-market-insights.html; the mockup palette is
   scoped to .ami-page as --ami-* tokens. Header/footer/contact-fab are shared v2.
   The live ticker is the shared partial, restyled here to match the mockup's ticker strip. */

body.single-post{background:#0A1322;}
body.single-post .bg-wash,
body.single-post .bg-texture{display:none;}

.ami-page{
  --ami-ground:#0A1322;
  --ami-surface:#101C31;
  --ami-surface-2:#14223B;
  --ami-line:#1E2C47;
  --ami-text:#E9EDF4;
  --ami-body:#C7CFDD;
  --ami-muted:#8E9BB3;
  --ami-faint:#5D6B85;
  --ami-gold:#E3B549;
  --ami-gold-hi:#F4D06F;
  --ami-gold-lo:#B8862C;
  --ami-bull:#45E0A8;
  --ami-bear:#FF8B72;

  position:relative;z-index:2;
  background:var(--ami-ground);color:var(--ami-text);
  font-family:'Manrope',sans-serif;-webkit-font-smoothing:antialiased;
}
[dir="rtl"].ami-page{font-family:'IBM Plex Sans Arabic','Manrope',sans-serif;}

/* ── Top bar / breadcrumb ── */
.ami-topbar{border-bottom:1px solid var(--ami-line);background:var(--ami-surface);}
.ami-topbar-inner{
  max-width:1180px;margin:0 auto;padding:14px 28px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
.ami-crumb{font-size:12.5px;color:var(--ami-faint);}
.ami-crumb a{color:var(--ami-muted);}
.ami-crumb a:hover{color:var(--ami-gold-hi);}
.ami-crumb-sep{margin:0 6px;color:var(--ami-faint);}
.ami-crumb-current{color:var(--ami-text);}

/* Long post titles: keep the crumb on one line, ellipsis on the current item */
.ami-crumb{display:flex;align-items:center;min-width:0;max-width:100%;white-space:nowrap;}
.ami-crumb a,.ami-crumb-sep{flex-shrink:0;}
.ami-crumb-current{min-width:0;overflow:hidden;text-overflow:ellipsis;}

/* ── Ticker strip (shared live ticker, mockup look) ── */
.ami-page > .ticker{background:var(--ami-surface-2);border-bottom:1px solid var(--ami-line);}
.ami-page > .ticker .ticker-inner{padding:10px 0;}
.ami-page > .ticker .ticker-track{gap:20px;padding-right:20px;}
.ami-page > .ticker .tick{gap:6px;font-family:'IBM Plex Mono',monospace;font-size:12.5px;}
.ami-page > .ticker .sym{color:var(--ami-muted);font-weight:600;}
.ami-page > .ticker .val{color:var(--ami-text);min-width:0;}
.ami-page > .ticker .chg{padding:1px 7px;border-radius:100px;min-width:0;}
.ami-page > .ticker .chg.up{color:var(--ami-bull);background:rgba(69,224,168,0.12);}
.ami-page > .ticker .chg.down{color:var(--ami-bear);background:rgba(255,139,114,0.12);}

/* Numbers and times stay left-to-right inside Arabic text */
.ami-num{unicode-bidi:isolate;font-family:'IBM Plex Mono',monospace;}

/* ── Article shell ── */
.ami-article{max-width:720px;margin:0 auto;padding:44px 28px 64px;}
.ami-eyebrow{
  font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--ami-gold);margin-bottom:14px;
}
.ami-title{
  font-family:'Space Grotesk',sans-serif;font-size:clamp(28px,4vw,38px);line-height:1.18;
  font-weight:700;margin:0 0 16px;color:var(--ami-text);
}
.ami-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;color:var(--ami-faint);margin-bottom:22px;}
.ami-meta-dot{width:3px;height:3px;border-radius:50%;background:var(--ami-faint);}
.ami-badge{
  display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--ami-gold-hi);
  background:rgba(227,181,73,0.1);border:1px solid rgba(227,181,73,0.25);padding:3px 10px;border-radius:100px;
}

.ami-note{
  font-size:12.5px;color:var(--ami-faint);background:var(--ami-surface);border:1px solid var(--ami-line);
  border-radius:12px;padding:12px 16px;margin-bottom:30px;line-height:1.6;
}

.ami-body .ami-lead{font-size:18px;line-height:1.6;color:var(--ami-text);font-weight:500;margin:0 0 8px;}
.ami-body h2{font-family:'Space Grotesk',sans-serif;font-size:21px;font-weight:700;color:var(--ami-text);margin:38px 0 14px;}
.ami-body p{font-size:15.5px;line-height:1.75;color:var(--ami-body);margin:0 0 16px;}

/* ── What to watch ── */
.ami-body .ami-watch-tz{font-size:12px;color:var(--ami-faint);margin:0 0 10px;}
.ami-watch{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:10px;}
.ami-watch-item{
  display:flex;gap:12px;align-items:baseline;padding:12px 14px;
  background:var(--ami-surface);border:1px solid var(--ami-line);border-radius:10px;
}
.ami-watch-time{font-family:'IBM Plex Mono',monospace;font-size:12px;color:var(--ami-gold-hi);flex-shrink:0;min-width:64px;}
.ami-watch-text{font-size:14.5px;color:var(--ami-body);line-height:1.5;}
.ami-watch-text b{color:var(--ami-text);}
.ami-body .ami-watch-cal{font-size:12.5px;color:var(--ami-faint);margin:0 0 16px;}
.ami-watch-cal a{color:var(--ami-gold-hi);font-weight:600;border-bottom:1px solid rgba(227,181,73,0.35);}
.ami-watch-cal a:hover{color:var(--ami-gold);}

/* ── In Focus ── */
.ami-focus{
  background:linear-gradient(180deg,rgba(227,181,73,0.06),rgba(227,181,73,0.02));
  border:1px solid rgba(227,181,73,0.22);border-radius:14px;padding:20px 22px;margin:8px 0 16px;
}
.ami-focus h3{
  font-family:'Space Grotesk',sans-serif;font-size:14px;color:var(--ami-gold-hi);
  margin:0 0 10px;text-transform:uppercase;letter-spacing:.05em;
}
.ami-body .ami-focus p{margin:0;font-size:15px;line-height:1.7;color:var(--ami-body);}

/* ── Closing disclaimer ── */
.ami-body .ami-disclaimer{
  border:1px dashed rgba(227,181,73,0.4);border-radius:12px;padding:16px 18px;margin:36px 0 14px;
  font-size:12.5px;color:var(--ami-faint);line-height:1.6;
}
.ami-disclaimer b{color:var(--ami-muted);}

/* ── Glossary tooltip terms (added by js/news-v2-single.js) ── */
.gloss-term{border-bottom:1.5px dotted var(--ami-gold-lo);color:inherit;cursor:pointer;position:relative;--ami-tip-shift:0px;}
.gloss-term:hover,.gloss-term:focus-visible,.gloss-term.is-open{color:var(--ami-gold-hi);border-bottom-color:var(--ami-gold-hi);outline:none;}
.gloss-tip{
  position:absolute;left:50%;bottom:calc(100% + 8px);
  transform:translateX(calc(-50% + var(--ami-tip-shift))) translateY(4px);
  width:260px;max-width:80vw;background:#0D1424;border:1px solid rgba(227,181,73,0.3);border-radius:12px;
  padding:12px 14px;box-shadow:0 20px 40px rgba(0,0,0,0.5);
  opacity:0;visibility:hidden;
  /* Closing is delayed (~0.25s) so the pointer can cross from the word to the card; the card
     stays hit-testable until visibility flips, so re-entering it keeps it open. Same idea as the
     header dropdowns. Hidden state relies on visibility (not pointer-events) for hit-testing. */
  transition:opacity .14s ease .12s,transform .14s ease .12s,visibility 0s linear .26s;
  z-index:60;text-align:left;font-weight:400;
}
[dir="rtl"] .gloss-tip{text-align:right;}
.gloss-term:hover .gloss-tip,.gloss-term:focus-visible .gloss-tip,.gloss-term.is-open .gloss-tip,.gloss-term.is-hover .gloss-tip{
  opacity:1;visibility:visible;transform:translateX(calc(-50% + var(--ami-tip-shift))) translateY(0);
  transition:opacity .14s ease,transform .14s ease,visibility 0s;
}
.gloss-term.is-hover{color:var(--ami-gold-hi);border-bottom-color:var(--ami-gold-hi);}
/* Hovering another term hides the previous card at once (no closing delay / overlap) */
.gloss-term.is-dismissed:not(:hover) .gloss-tip{transition:none;}
/* Invisible bridge across the 8px gap between the word and the card */
.gloss-tip::before{content:'';position:absolute;left:0;right:0;top:100%;height:12px;}
.gloss-term.is-below .gloss-tip::before{top:auto;bottom:100%;}
.gloss-term.is-below .gloss-tip{bottom:auto;top:calc(100% + 8px);}
.gloss-tip-term{display:block;font-family:'Space Grotesk',sans-serif;font-size:13px;font-weight:700;color:var(--ami-gold-hi);margin-bottom:4px;}
.gloss-tip-latin{font-weight:400;color:var(--ami-muted);}
.gloss-tip-def{display:block;font-size:12.5px;line-height:1.5;color:var(--ami-muted);white-space:normal;}
.gloss-tip-cta{display:block;margin-top:8px;font-size:11px;font-weight:600;color:var(--ami-gold);}
.gloss-tip::after{
  content:'';position:absolute;top:100%;left:calc(50% - var(--ami-tip-shift));transform:translateX(-50%);
  border:6px solid transparent;border-top-color:#0D1424;
}
.gloss-term.is-below .gloss-tip::after{top:auto;bottom:100%;border-top-color:transparent;border-bottom-color:#0D1424;}
@media (prefers-reduced-motion: reduce){
  .gloss-tip{transition:opacity .01s linear .2s,visibility 0s linear .21s;}
  .gloss-term:hover .gloss-tip,.gloss-term:focus-visible .gloss-tip,.gloss-term.is-open .gloss-tip,.gloss-term.is-hover .gloss-tip{transition:none;}
}

/* ── Legacy posts (free-form editor content, shown until rewritten as a briefing) ── */
.ami-legacy h2{font-family:'Space Grotesk',sans-serif;font-size:21px;font-weight:700;color:var(--ami-text);margin:38px 0 14px;}
.ami-legacy h3{font-family:'Space Grotesk',sans-serif;font-size:17px;font-weight:700;color:var(--ami-text);margin:28px 0 12px;}
.ami-legacy h4,.ami-legacy h5,.ami-legacy h6{font-size:15.5px;font-weight:700;color:var(--ami-text);margin:22px 0 10px;}
.ami-legacy > :first-child{margin-top:0;}
.ami-legacy ul,.ami-legacy ol{margin:0 0 16px;padding-inline-start:22px;color:var(--ami-body);font-size:15.5px;line-height:1.75;}
.ami-legacy li{margin-bottom:6px;}
.ami-legacy li::marker{color:var(--ami-gold);}
.ami-legacy b,.ami-legacy strong{color:var(--ami-text);}
.ami-legacy a{color:var(--ami-gold-hi);border-bottom:1px solid rgba(227,181,73,0.35);}
.ami-legacy img{max-width:100%;height:auto;border-radius:12px;margin:8px 0 16px;}
.ami-legacy figure{margin:0 0 16px;}
.ami-legacy table{width:100%;border-collapse:collapse;margin:0 0 16px;font-size:14px;color:var(--ami-body);display:block;overflow-x:auto;}
.ami-legacy th,.ami-legacy td{border:1px solid var(--ami-line);padding:8px 10px;text-align:start;}
.ami-legacy th{color:var(--ami-text);background:var(--ami-surface);}
.ami-legacy blockquote{margin:0 0 16px;padding:14px 18px;border-inline-start:3px solid var(--ami-gold);background:var(--ami-surface);border-radius:8px;}

/* ── RTL typography ── */
[dir="rtl"] .ami-title,
[dir="rtl"] .ami-body h2,
[dir="rtl"] .ami-focus h3{font-family:'IBM Plex Sans Arabic','Space Grotesk',sans-serif;}

/* English article inside an Arabic page (post without its Arabic version): Latin typography,
   left-aligned tooltips — overrides the [dir="rtl"] rules inherited from .ami-page */
.ami-article[lang="en"]{font-family:'Manrope',sans-serif;}
.ami-article[lang="en"] .ami-title,
.ami-article[lang="en"] .ami-body h2,
.ami-article[lang="en"] .ami-focus h3{font-family:'Space Grotesk',sans-serif;}
.ami-article[lang="en"] .gloss-tip{text-align:left;}

@media (max-width:720px){
  .ami-article{padding:32px 18px 48px;}
  .ami-topbar-inner{padding:12px 18px;}
  .ami-title{font-size:26px;line-height:1.25;}
  .ami-body .ami-lead{font-size:16.5px;}
  .ami-body p,.ami-legacy ul,.ami-legacy ol{font-size:15px;}
  .ami-body h2,.ami-legacy h2{font-size:19px;margin-top:30px;}
  .ami-watch-item{flex-direction:column;gap:4px;}
  .ami-watch-time{min-width:0;}
  .ami-focus{padding:16px 16px;}
}
