/* ============================================================
   Narrative Industries — Homepage (Elementor adaptation)
   Scope: everything under .ni-page (set as CSS class on the
   page's Elementor post class or outermost container).
   Add to: wp-content/themes/narrative/style.css
   ============================================================ */

/* ---- Tokens (subset needed by this page) ------------------- */
.ni-page {
  --ni-mustard: #FFB819;
  --ni-mustard-600: #E6A30F;
  --ni-slate: #494949;
  --ni-ink: #2C2E33;
  --ni-teal: #0E6870;
  --ni-teal-600: #0A535A;
  --ni-claret: #611416;
  --ni-mist: #F4F4F4;
  --ni-paper: #F9F9F9;
  --ni-white: #FFFFFF;
  --ni-grey-900: #1C1D20;
  --ni-grey-700: #3D3F45;
  --ni-grey-500: #6B6C70;
  --ni-grey-300: #C2C3C8;
  --ni-grey-200: #E2E3E6;
  --text-strong: var(--ni-ink);
  --text-body: var(--ni-grey-700);
  --text-muted: var(--ni-grey-500);
  --text-on-dark-muted: rgba(255,255,255,.66);
  --border-subtle: var(--ni-grey-200);
  --font-display: "quattrocentro", "Georgia", "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-body: "Lato", system-ui, sans-serif;
  --tracking-caps: 0.12em;

  font-family: var(--font-body);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

.ni-page h1, .ni-page h2, .ni-page h3, .ni-page h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  color: var(--text-strong);
  margin: 0;
  text-wrap: balance;
}
.ni-page a { color: var(--ni-teal); text-decoration: none; }
.ni-page a:hover { color: var(--ni-teal-600); }

/* ---- Full-bleed image bands --------------------------------- */
.ni-page .ni-hero-img { width: 100%; }

/* ---- Eyebrow (apply .ni-eyebrow to a heading/text widget) -- */
.ni-page .ni-eyebrow,
.ni-page .ni-eyebrow .elementor-heading-title,
.ni-page .ni-eyebrow p {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--ni-teal);
  display: flex; align-items: center; gap: 12px;
}
.ni-page .ni-eyebrow .elementor-heading-title::before,
.ni-page .ni-eyebrow p::before {
  content: ""; width: 28px; height: 2px; background: currentColor;
}
.ni-page .ni-on-dark .ni-eyebrow .elementor-heading-title,
.ni-page .ni-on-dark .ni-eyebrow p { color: var(--ni-mustard); }

/* ---- Buttons (apply to the Button widget wrapper) ---------- */
.ni-page .ni-btn .elementor-button {
  font-family: var(--font-display); font-weight: 600;
  border-radius: 999px; padding: 16px 28px; font-size: 16px;
  transition: all .2s cubic-bezier(.2,0,.1,1);
}
.ni-page .ni-btn--primary .elementor-button {
  background: var(--ni-mustard); color: var(--ni-ink); border: 2px solid var(--ni-mustard);
}
.ni-page .ni-btn--primary .elementor-button:hover {
  background: var(--ni-mustard-600); border-color: var(--ni-mustard-600);
}
.ni-page .ni-btn--outline .elementor-button {
  background: transparent; color: var(--ni-ink); border: 2px solid var(--ni-grey-300);
}
.ni-page .ni-btn--outline .elementor-button:hover {
  background: var(--ni-ink); color: #fff; border-color: var(--ni-ink);
}
.ni-page .ni-btn--secondary .elementor-button {
  background: var(--ni-ink); color: #fff; border: 2px solid var(--ni-ink);
}
.ni-page .ni-btn--secondary .elementor-button:hover { background: var(--ni-grey-900); }

/* ---- Hero --------------------------------------------------- */
.ni-page .ni-hero { padding-top: clamp(56px,8vw,120px); overflow: hidden; }
.ni-page .ni-hero-h1 .elementor-heading-title {
  font-size: clamp(56px,11.5vw,168px); line-height: .92; letter-spacing: -0.03em;
}
.ni-page .ni-hero-h1 em { font-style: normal; color: var(--ni-teal); }
.ni-page .ni-hero-lede, .ni-page .ni-hero-lede p {
  font-size: clamp(19px,1.6vw,24px); line-height: 1.5; font-weight: 300;
  color: var(--text-strong); max-width: 600px;
}
.ni-page .ni-hero-lede strong { font-weight: 600; }
.ni-page .ni-hero-meta p {
  display: flex; gap: 16px; align-items: center; font-size: 13px;
  color: var(--text-muted); font-family: var(--font-display); font-weight: 600;
  letter-spacing: var(--tracking-caps); text-transform: uppercase;
}
.ni-page .ni-hero-meta span::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 999px;
  background: var(--ni-mustard); margin-right: 10px; vertical-align: 1px;
}
.ni-page .ni-hero-img img { width: 100%; aspect-ratio: 21/9; object-fit: cover; object-position: center 60%; }
.ni-page .ni-caption p {
  color: #fff; font-size: 13px; letter-spacing: .04em;
  display: flex; gap: 16px; align-items: center;
}
.ni-page .ni-caption p::before { content: ""; width: 40px; height: 1px; background: var(--ni-mustard); }

/* ---- Clients band ------------------------------------------ */
.ni-page .ni-clients { border-bottom: 1px solid var(--border-subtle); }
.ni-page .ni-clients-note p { font-size: 14px; color: var(--text-muted); max-width: 280px; line-height: 1.5; }
.ni-page .ni-clients-list p {
  display: flex; flex-wrap: wrap; gap: 12px 36px; justify-content: flex-end;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(16px,1.4vw,21px); color: var(--ni-grey-500); letter-spacing: -.01em;
}
.ni-page .ni-clients-list span { white-space: nowrap; }

/* ---- Pillars (What we do) ----------------------------------- */
.ni-page .ni-pillars { background: var(--ni-mist); }
.ni-page .ni-pillars-h2 .elementor-heading-title { font-size: clamp(36px,5vw,72px); letter-spacing: -.025em; }
.ni-page .ni-pillar {
  display: grid !important;
  grid-template-columns: 80px minmax(0,1.1fr) minmax(0,1fr) minmax(0,.9fr);
  gap: clamp(20px,3vw,48px);
  padding: clamp(36px,4vw,56px) 0;
  border-bottom: 1px solid var(--ni-grey-300);
  align-items: start;
}
.ni-page .ni-pillar-first { border-top: 1px solid var(--ni-grey-300); }
.ni-page .ni-num p { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--text-muted); padding-top: 10px; }
.ni-page .ni-pillar-h3 .elementor-heading-title { font-size: clamp(28px,3vw,44px); letter-spacing: -.02em; }
.ni-page .ni-pillar-h3 span { display: block; color: var(--ni-teal); }
.ni-page .ni-stat p {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(56px,7vw,112px); line-height: .9; letter-spacing: -.04em;
  color: var(--ni-ink); margin-top: 20px;
}
.ni-page .ni-stat small {
  display: block; font-family: var(--font-body); font-weight: 400; font-size: 15px;
  letter-spacing: 0; color: var(--text-body); margin-top: 12px; max-width: 260px; line-height: 1.5;
}
.ni-page .ni-pillar-body p { font-size: 17px; line-height: 1.65; }
.ni-page .ni-pillar-body p + p { margin-top: 16px; font-weight: 600; color: var(--text-strong); }
.ni-page .ni-pill-links p { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ni-page .ni-pill-links a {
  font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--text-strong);
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px;
  border: 2px solid var(--ni-grey-300); border-radius: 999px;
  transition: all .2s cubic-bezier(.2,0,.1,1); min-height: 44px;
}
.ni-page .ni-pill-links a:hover { background: var(--ni-ink); border-color: var(--ni-ink); color: #fff; }
.ni-page .ni-pill-links a::after { content: "→"; }

/* ---- Photo strip -------------------------------------------- */
.ni-page .ni-strip { background: var(--ni-mist); }
.ni-page .ni-strip img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; }

/* ---- Routes (dark band) ------------------------------------- */
.ni-page .ni-routes { background: var(--ni-ink); }
.ni-page .ni-routes-h2 .elementor-heading-title { color: #fff; font-size: clamp(40px,6vw,96px); letter-spacing: -.03em; }
.ni-page .ni-routes-h2 em { font-style: normal; color: var(--ni-mustard); }
.ni-page .ni-route {
  background: var(--ni-ink); padding: clamp(28px,3vw,44px);
  min-height: 360px; transition: background .2s;
  outline: 1px solid var(--ni-grey-700);
}
.ni-page .ni-route:hover { background: var(--ni-grey-900); }
.ni-page .ni-route-k p {
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--ni-mustard);
}
.ni-page .ni-route-h3 .elementor-heading-title { color: #fff; font-size: clamp(28px,2.6vw,38px); letter-spacing: -.02em; }
.ni-page .ni-route p.ni-route-body { color: var(--text-on-dark-muted); font-size: 16.5px; line-height: 1.6; }
.ni-page .ni-route-link a { color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 16px; display: inline-flex; gap: 10px; align-items: center; min-height: 44px; }
.ni-page .ni-route-link a::after { content: "→"; color: var(--ni-mustard); transition: transform .2s; }
.ni-page .ni-route-link a:hover::after { transform: translateX(6px); }

/* ---- Results ------------------------------------------------ */
.ni-page .ni-results-h2 .elementor-heading-title { font-size: clamp(40px,5.5vw,80px); letter-spacing: -.03em; }
.ni-page .ni-result {
  display: grid !important; grid-template-columns: minmax(150px,.5fr) minmax(0,1fr);
  gap: 24px; padding: clamp(28px,3vw,40px) 0;
  border-top: 1px solid var(--ni-grey-300); align-items: start;
}
.ni-page .ni-result-last { border-bottom: 1px solid var(--ni-grey-300); }
.ni-page .ni-big p {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(56px,6.5vw,104px); line-height: .85; letter-spacing: -.045em; color: var(--ni-teal);
}
.ni-page .ni-big--ink p { color: var(--ni-ink); }
.ni-page .ni-result-copy p { font-size: 17px; line-height: 1.6; }
.ni-page .ni-result-copy b, .ni-page .ni-result-copy strong { color: var(--text-strong); font-weight: 600; }

/* ---- AI band (mustard) -------------------------------------- */
.ni-page .ni-ai { background: var(--ni-mustard); }
.ni-page .ni-ai .ni-eyebrow .elementor-heading-title, .ni-page .ni-ai .ni-eyebrow p { color: var(--ni-ink); }
.ni-page .ni-ai-h2 .elementor-heading-title { font-size: clamp(36px,5vw,72px); letter-spacing: -.03em; color: var(--ni-ink); }
.ni-page .ni-ai p { color: var(--ni-ink); }
.ni-page .ni-ai-lede p { font-size: 18px; line-height: 1.6; max-width: 560px; }
.ni-page .ni-ai-stats {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--ni-ink);
  padding: 0;
}
.ni-page .ni-ai-stats > .e-con, .ni-page .ni-ai-stat { width: 100% !important; min-width: 0; }
.ni-page .ni-ai-stat { background: var(--ni-mustard); padding: 28px 28px 32px; }
@media (max-width: 760px) { .ni-page .ni-ai-stats { grid-template-columns: 1fr; } }
.ni-page .ni-ai-stat .ni-ai-num p {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(56px,6vw,96px); line-height: .9; letter-spacing: -.04em; color: var(--ni-ink);
}
.ni-page .ni-ai-stat .ni-ai-label p { margin-top: 12px; font-size: 15px; line-height: 1.5; color: var(--ni-ink); }

/* ---- Final CTA (photo, dark overlay) ------------------------ */
.ni-page .ni-final { position: relative; min-height: 80vh; display: flex; align-items: center; }
.ni-page .ni-final::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28,29,32,.85), rgba(28,29,32,.35));
  z-index: 0;
}
.ni-page .ni-final > .e-con-inner, .ni-page .ni-final > div { position: relative; z-index: 1; }
.ni-page .ni-final-h2 .elementor-heading-title { color: #fff; font-size: clamp(48px,9vw,148px); letter-spacing: -.035em; line-height: .9; }
.ni-page .ni-final-h2 em { font-style: normal; color: var(--ni-mustard); }
.ni-page .ni-final-lede p { font-size: clamp(18px,1.6vw,23px); line-height: 1.5; max-width: 560px; color: #fff; font-weight: 300; }

/* ---- Loop card titles: linked titles keep the display weight ----
   Elementor's global link typography overrides heading styles once the
   title becomes an <a>; force it back to the card style. */
.ni-page .elementor-widget-theme-post-title .elementor-heading-title a {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  color: inherit;
  text-decoration: none;
}
.ni-page .elementor-widget-theme-post-title .elementor-heading-title a:hover {
  color: var(--ni-ink);
}

/* ---- Inner-page type scale (full-treatment pages) ------------ */
.ni-page .ni-h1 .elementor-heading-title {
  font-size: clamp(48px, 8vw, 128px); line-height: .95; letter-spacing: -.028em;
}
.ni-page .ni-h1 em { font-style: normal; color: var(--ni-teal); }

/* Outline pill for dark or teal grounds */
.ni-page .ni-btn--outline-light .elementor-button {
  background: transparent; color: #F9F9F9; border: 2px solid rgba(255,255,255,.5);
}
.ni-page .ni-btn--outline-light .elementor-button:hover {
  background: #F9F9F9; color: var(--ni-ink); border-color: #F9F9F9;
}

/* Stat/quote blocks in splits: centre their content vertically */
.ni-page .ni-stat-block { justify-content: center; }
.ni-page .ni-h2 .elementor-heading-title {
  font-size: clamp(32px, 4vw, 56px); letter-spacing: -.02em;
}
.ni-page .ni-on-dark .ni-h2 .elementor-heading-title { color: #F9F9F9; }
.ni-page .ni-h3 .elementor-heading-title {
  font-size: clamp(20px, 2vw, 26px); letter-spacing: -.01em;
}
.ni-page .ni-lede p {
  font-size: clamp(18px, 1.5vw, 22px); line-height: 1.55; font-weight: 300;
  color: var(--text-strong); max-width: 640px;
}

/* Hero H1s: line breaks are set manually — stop text-wrap:balance
   from redistributing them */
.ni-page .ni-hero-h1 .elementor-heading-title,
.ni-page .ni-h1 .elementor-heading-title { text-wrap: normal; }

/* ---- Inner wrap (apply .ni-wrap to each section's inner container) */
/* 1384 = 1320 content + 32px padding each side, so wrap content
   aligns exactly with boxed-1320 sections (padding sits outside
   the inner box in Elementor's boxed model). */
.e-con.ni-wrap, .elementor-element.ni-wrap, .ni-wrap {
  max-width: 1384px;
  width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ============================================================
   Site chrome — header & footer templates (outside .ni-page)
   ============================================================ */

/* ---- Header (.ni-nav on the header template's outer container) */
.ni-nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid #E2E3E6;
}
.ni-nav .ni-nav-row {
  min-height: 72px;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 24px;
}
/* Flex behaviour: logo and CTA keep their size, the menu takes what's left */
.ni-nav .ni-nav-logo { flex: 0 0 auto; width: auto; }
.ni-nav .elementor-widget-nav-menu { flex: 1 1 auto; min-width: 0; }
.ni-nav .elementor-widget-button, .ni-nav .ni-btn { flex: 0 0 auto; width: auto; }
.ni-nav .ni-btn .elementor-button {
  font-family: "League Spartan", "Lato", sans-serif; font-weight: 600;
  border-radius: 999px; font-size: 14px; padding: 10px 20px;
  background: #FFB819; color: #2C2E33; border: 2px solid #FFB819;
  white-space: nowrap;
}
.ni-nav .ni-btn .elementor-button:hover { background: #E6A30F; border-color: #E6A30F; }

/* ---- Footer (.ni-footer on the footer template's outer container) */
.ni-footer { font-family: "Lato", system-ui, sans-serif; color: rgba(255,255,255,.66); }
.ni-footer .ni-footer-brand {
  font-family: "League Spartan", "Lato", sans-serif; font-weight: 600;
  font-size: 20px; letter-spacing: .06em; color: #fff; margin: 0 0 20px;
}
.ni-footer .ni-footer-about p { font-size: 14.5px; line-height: 1.6; max-width: 320px; }
.ni-footer .ni-footer-h .elementor-heading-title {
  color: #fff; font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
  font-family: "League Spartan", "Lato", sans-serif; font-weight: 600;
}
.ni-footer .ni-footer-links p { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.ni-footer .ni-footer-links a { color: rgba(255,255,255,.66); font-size: 15px; text-decoration: none; }
.ni-footer .ni-footer-links a:hover { color: #fff; }
.ni-footer .ni-footer-bottom { border-top: 1px solid #3D3F45; }
.ni-footer .ni-footer-legal p { font-size: 13px; margin: 0; }
.ni-footer .ni-footer-legal a { color: rgba(255,255,255,.66); }
.ni-footer .ni-footer-legal a:hover { color: #fff; }

/* ---- Image placeholders (until photos are in the media library) */
.ni-page .ni-img-ph { background: var(--ni-ink); }
.ni-page .ni-img-ph--tall { min-height: clamp(280px, 42vw, 620px); }
.ni-page .ni-img-ph--strip { min-height: clamp(200px, 28vw, 380px); }

/* ---- Responsive --------------------------------------------- */
@media (max-width: 1000px) {
  .ni-page .ni-pillar { grid-template-columns: 48px minmax(0,1fr); }
  .ni-page .ni-pillar > :nth-child(3), .ni-page .ni-pillar > :nth-child(4) { grid-column: 2; }
}
@media (max-width: 760px) {
  .ni-page .ni-result { grid-template-columns: 1fr; gap: 8px; }
  .ni-page .ni-hero-img img { aspect-ratio: 4/3; }
  .ni-page .ni-final { min-height: 0; }
  .ni-page .ni-clients-list p { justify-content: flex-start; }

  /* Pillars collapse to a single column; number sits above the heading */
  .ni-page .ni-pillar { grid-template-columns: 1fr; gap: 12px; }
  .ni-page .ni-pillar > * { grid-column: 1 !important; }
  .ni-page .ni-num p { padding-top: 0; }

  /* Buttons: full-width, centred, no awkward wrapping */
  .ni-page .ni-btn { width: 100%; }
  .ni-page .ni-btn .elementor-button {
    display: flex; width: 100%; justify-content: center;
    padding: 14px 22px; text-align: center;
  }

  /* Uppercase meta rows: keep each item on one line */
  .ni-page .ni-hero-meta p { flex-wrap: wrap; row-gap: 8px; }
  .ni-page .ni-hero-meta span { white-space: nowrap; }
}

/* ---- Header squeeze zone: menu still visible but space is tight ---- */
@media (min-width: 1025px) and (max-width: 1200px) {
  .ni-nav .elementor-widget-nav-menu .elementor-item { font-size: 13px !important; }
  .ni-nav .ni-btn .elementor-button { padding: 8px 16px; font-size: 13px; }
}

/* ---- Header below the hamburger breakpoint: logo | burger | CTA, one line ---- */
@media (max-width: 1024px) {
  .ni-nav .ni-nav-row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    gap: 16px;
  }
  /* Menu widget shrinks to just the burger, pushed against the CTA.
     Elementor forces width:100% on widgets, so !important is required here.
     position:static lets the dropdown panel anchor to the header instead. */
  .ni-nav .elementor-widget-nav-menu {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: max-content;
    margin-left: auto;
    position: static !important;
  }
  .ni-nav .ni-nav-row, .ni-nav .e-con-inner { position: static !important; }
  /* Elementor leaves the closed dropdown panel in normal flow at full width,
     which pushed the burger and CTA off-screen. Take it out of the flow and
     pin it under the header (.ni-nav is the positioned ancestor). */
  .ni-nav .elementor-nav-menu--dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    box-shadow: 0 12px 24px rgba(28,29,32,.08);
  }
}
@media (max-width: 900px) {
  .ni-nav .ni-nav-logo img {
    height: 20px;
    width: auto !important;
    max-width: none;
    object-fit: contain;
  }
  .ni-nav .ni-btn .elementor-button { padding: 8px 16px; font-size: 13px; }
}
/* ---- Small phones: shrink logo and CTA so one line always fits ---- */
@media (max-width: 480px) {
  .ni-nav .ni-nav-row { gap: 10px; }
  .ni-nav .ni-nav-logo img { height: 16px; }
  .ni-nav .ni-btn .elementor-button { padding: 7px 12px; font-size: 12px; }
  .ni-nav .elementor-menu-toggle { padding: 0.2em; }
}
