/* ============================================================
   Glucerna (page-only)
   Scope: body.case-glucerna
   Depends on: case-system.css + style_organized.css
   ============================================================ */

body.case-glucerna{
  --ink: #022351;
  --ink-soft: rgba(2,35,81,.78);
  --rule: #eaeaea;

  --glucerna-navy: #022b36;
  --band: #f5f7f9;

  --note-accent:#0bbbd3;
  --note-fill:#e8f7fb;

  /* image crop defaults */
  --face-x: 52%;
  --face-y: 32%;
}

/* ------------------------------------------------------------
   HERO (your markup: .hero-split__text + .hero-split__media)
   ------------------------------------------------------------ */
body.case-glucerna .hero-split.case-glucerna{
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;

  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);

  min-height: clamp(520px, 60vh, 720px);
  gap: 0;
}

/* Text panel */
body.case-glucerna .hero-split__text{
  background: var(--glucerna-navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
  box-sizing: border-box;
}

body.case-glucerna .hero-split__text .inner{
  max-width: 720px;
  width: 100%;
}

body.case-glucerna .hero-split__text h1{
  font-family: "Barlow", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  color: #fff;
  margin: 0 0 14px;
  max-width: 22ch;
  text-wrap: balance;
}

body.case-glucerna .hero-split__text .note{
  color: rgba(255,255,255,.86);
  line-height: 1.45;
  max-width: 50ch;
  margin: 0;
}

/* Image panel */
body.case-glucerna .hero-split__media picture,
body.case-glucerna .hero-split__media img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: var(--face-x) var(--face-y);
}

/* show manual break only on wide screens */
body.case-glucerna .desk-break{ display: none; }
@media (min-width: 980px){
  body.case-glucerna .desk-break{ display: block; }
}

/* Tablet stack */
@media (max-width: 1024px){
  body.case-glucerna .hero-split.case-glucerna{
    grid-template-columns: 1fr;
    min-height: 0;
  }
  body.case-glucerna .hero-split__media{ aspect-ratio: 16 / 10; }
}

/* Mobile 50/50 vertical split */
@media (max-width: 640px){
  body.case-glucerna .hero-split.case-glucerna{
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100svh;
    overflow: clip;
  }
  body.case-glucerna .hero-split__text{
    flex: 0 0 50dvh;
    padding: 24px;
  }
  body.case-glucerna .hero-split__media{
    flex: 1 0 50dvh;
    overflow: hidden;
  }
  body.case-glucerna{ --face-y: 28%; }
}
@media (max-width: 480px){
  body.case-glucerna{ --face-y: 22%; }
}

/* ------------------------------------------------------------
   3-column section grid (your markup: .case-sections.three-column)
   ------------------------------------------------------------ */
body.case-glucerna .case-sections.three-column{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
}
@media (max-width: 1024px){
  body.case-glucerna .case-sections.three-column{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  body.case-glucerna .case-sections.three-column{
    grid-template-columns: 1fr;
  }
}

/* Role note (uses your existing classes) */
body.case-glucerna .role-note{
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--note-fill);
  border-left: 4px solid var(--note-accent);
  border-radius: 12px;
}
body.case-glucerna .role-note .role-icon{
  width: 20px;
  height: 20px;
  color: var(--note-accent);
}

/* ------------------------------------------------------------
   New Glucerna modules in your PHP
   - .cs-band (Test and Learn)
   - .cs-section--numbers (By The Numbers)
   - .cs-band--learned (What We Learned)
   ------------------------------------------------------------ */

body.case-glucerna .cs-wrap{
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

/* Bands */
body.case-glucerna .cs-band{
  padding: clamp(2rem, 1.4rem + 2vw, 3.25rem) 0;
  background: var(--band);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

body.case-glucerna .cs-band__head{
  display: grid;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

body.case-glucerna .cs-h2{
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: clamp(1.25rem, 1.1rem + 1vw, 1.7rem);
  margin: 0;
  color: var(--ink);
}

body.case-glucerna .cs-lede{
  margin: 0;
  max-width: 70ch;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* Test cards */
body.case-glucerna .tl-cards{
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 980px){
  body.case-glucerna .tl-cards{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 680px){
  body.case-glucerna .tl-cards{
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

body.case-glucerna .tl-card{
  background: #fff;
  border: 1px solid rgba(2,35,81,.10);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  display: grid;
  grid-template-rows: auto 1fr;
}

body.case-glucerna .tl-card__media{
  height: clamp(220px, 18vw, 320px);
  overflow: hidden;
}
@media (max-width: 680px){
  body.case-glucerna .tl-card__media{
    height: clamp(220px, 55vw, 300px);
  }
}

body.case-glucerna .tl-card__media img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.case-glucerna .tl-card--focus-top .tl-card__media img{
  object-position: center top;
}

body.case-glucerna .tl-card__body{
  padding: 1rem 1rem 1.15rem;
}
body.case-glucerna .tl-card__kicker{
  margin: 0 0 .35rem;
  font-weight: 800;
  font-size: .82rem;
  opacity: .65;
  text-transform: uppercase;
  letter-spacing: .06em;
}
body.case-glucerna .tl-card__title{
  margin: 0 0 .4rem;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #0f172a;
}
body.case-glucerna .tl-card__copy{
  margin: 0;
  color: #334155;
  line-height: 1.55;
  font-size: .98rem;
}

/* Numbers tiles (your markup: .metric-grid + .metric-tile) */
body.case-glucerna .cs-section{
  padding: clamp(2rem, 1.4rem + 2vw, 3.25rem) 0;
  background: #fff;
}

body.case-glucerna .metric-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 980px){
  body.case-glucerna .metric-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  body.case-glucerna .metric-grid{
    grid-template-columns: 1fr;
  }
}

body.case-glucerna .metric-tile{
  background: #fff;
  border: 1px solid rgba(2,35,81,.10);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  padding: 1rem;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.case-glucerna .metric-tile__value{
  font-weight: 900;
  letter-spacing: .01em;
  font-size: clamp(1.4rem, 1.2rem + 1.3vw, 2.2rem);
  line-height: 1.05;
  color: var(--ink);
}
body.case-glucerna .metric-tile__label{
  margin-top: .35rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

body.case-glucerna .cs-footnote{
  margin-top: .85rem;
  font-size: .82rem;
  color: #64748b;
}

/* Learned band */
body.case-glucerna .cs-band--learned{
  background: #0b1220;
  color: #fff;
  border-top: 0;
  border-bottom: 0;
}
body.case-glucerna .cs-band--learned .cs-h2{ color: #fff; }
body.case-glucerna .cs-band--learned .cs-lede{ color: rgba(255,255,255,.86); }

body.case-glucerna .learned-split{
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px){
  body.case-glucerna .learned-split{
    grid-template-columns: 1fr;
  }
}

body.case-glucerna .learned-list{
  margin: 1rem 0 0;
  padding-left: 1.1rem;
}
body.case-glucerna .learned-list li{
  margin: .55rem 0;
  color: rgba(255,255,255,.88);
}

body.case-glucerna .learned-quote{
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  padding: 1.25rem;
  background: rgba(255,255,255,.06);
}
body.case-glucerna .learned-quote__text{
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}

/* ------------------------------------------------------------
   Guardrails: prevent shared hero/frame styles from other pages
   (only matters if a global/other case adds borders/overlays)
   ------------------------------------------------------------ */
body.case-glucerna .hero-split,
body.case-glucerna .hero-split__text,
body.case-glucerna .hero-split__media{
  border: 0;
  box-shadow: none;
  background-image: none;
}

body.case-glucerna .hero-split::before,
body.case-glucerna .hero-split::after,
body.case-glucerna .hero-split__text::before,
body.case-glucerna .hero-split__text::after,
body.case-glucerna .hero-split__media::before,
body.case-glucerna .hero-split__media::after{
  content: none;
}
/* ============================================================
   Glucerna - small fixes merged from stage (safe overrides)
   Put this at the END of css/glucerna.css
   ============================================================ */

/* 1) Prevent the 3-up cards from tucking into the hero */
body.case-glucerna .hero-split.case-glucerna{
  margin-bottom: clamp(12px, 2vw, 20px);
}

body.case-glucerna .case-sections.three-column{
  margin-top: 28px;
  position: relative;
  z-index: 2;
}

/* If any global CSS is forcing overlap via z-index */
body.case-glucerna .hero-split.case-glucerna{
  position: relative;
  z-index: 1;
}

/* 2) Give the 3-up cards the same “card” treatment as your system */
body.case-glucerna .case-sections.three-column > .case-section{
  margin: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(16,28,36,.08);
  padding: clamp(18px, 2.2vw, 26px);
  box-sizing: border-box;
}

/* 3) Style your actual case nav markup (.case-study-navigation + .nav-link) */
body.case-glucerna .case-nav{
  background: #fff;
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0;
}

body.case-glucerna .case-study-navigation{
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

body.case-glucerna .case-study-navigation .nav-link{
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  padding: .6rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(2,35,81,.12);
  background: #fff;
}

body.case-glucerna .case-study-navigation .nav-link:hover{
  border-color: rgba(2,35,81,.28);
}

@media (max-width: 900px){
  body.case-glucerna .case-study-navigation{
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ================================
   Case study nav (Glucerna)
   Forces 2-up buttons on mobile
   ================================ */

body.case-glucerna .case-nav{
  background:#fff;
  border-top:1px solid var(--rule, #eaeaea);
  padding: 1.25rem 0;
}

body.case-glucerna .case-nav .case-study-navigation{
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;

  /* This is the whole fix */
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

body.case-glucerna .case-nav .case-study-navigation .nav-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;

  /* If your global button styles already handle these, you can remove */
  padding: 12px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

/* Left aligns, right aligns, keeps the vibe */
body.case-glucerna .case-nav .case-study-navigation .nav-link.prev{
  justify-content: flex-start;
}
body.case-glucerna .case-nav .case-study-navigation .nav-link.next{
  justify-content: flex-end;
}

/* If text gets tight on very small screens */
@media (max-width: 380px){
  body.case-glucerna .case-nav .case-study-navigation .nav-link{
    padding: 10px 12px;
    font-size: .95rem;
  }
}

