/**
 * MEPTrax depth-page editorial composition — shared primitives.
 *
 * Atmosphere stays in meptrax-depth.css.
 * This file is composition only (reading rhythm / emphasis).
 *
 * Primitives:
 * 1. --reading
 * 2. --hero (compact depth entrance)
 * 3. --wide
 * 4. --pair
 * 5. --contrast
 * 6. --pull
 * 7. --sequence (reserved; panel grid like pair)
 *
 * First-pass usage: Operational Awareness only.
 *
 * @package MEPtrax
 */

:root {
  --meptrax-editorial-read: 42rem;
  --meptrax-editorial-wide: 52rem;
  --meptrax-editorial-pair: 60rem;
  --meptrax-editorial-panel-bg: #ffffff;
  --meptrax-editorial-panel-border: rgba(0, 31, 63, 0.1);
}

/* 1. Standard reading */
.meptrax-depth-section.meptrax-editorial--reading > *:not(.meptrax-depth-eyebrow):not(.meptrax-editorial__panels) {
  max-width: var(--meptrax-editorial-read);
}

/* 2. Compact depth hero */
.meptrax-depth-section.meptrax-editorial--hero {
  padding-top: clamp(2.75rem, 5vw, 3.6rem);
  padding-bottom: clamp(2.35rem, 4vw, 3.1rem);
}

.meptrax-depth-section.meptrax-editorial--hero > *:not(.meptrax-depth-eyebrow):not(.meptrax-editorial__panels) {
  max-width: min(48rem, 100%);
}

.meptrax-depth-eyebrow {
  margin: 0 auto 0.85rem;
  max-width: min(48rem, 100%);
  color: var(--meptrax-orange, #ff9f00);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
}

.meptrax-depth-section.meptrax-editorial--hero .wp-block-heading:first-of-type {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 0.85rem;
  color: var(--meptrax-navy, #001f3f);
}

.meptrax-depth-section.meptrax-editorial--hero .wp-block-heading:nth-of-type(2) {
  font-size: clamp(1.12rem, 2.1vw, 1.35rem);
  font-weight: 650;
  line-height: 1.3;
  color: var(--meptrax-navy, #001f3f);
  margin-top: 0.15rem;
}

.meptrax-depth-section.meptrax-editorial--hero p {
  font-size: 1.05rem;
  line-height: 1.65;
}

/* 3. Wider emphasis */
.meptrax-depth-section.meptrax-editorial--wide > *:not(.meptrax-editorial__panels) {
  max-width: var(--meptrax-editorial-wide);
}

/* 4–6. Pair / contrast / sequence panels
   Default grid stretch would equalize row-mate heights — we do NOT want that.
   Aligned tops; each column/panel is content-height only. */
.meptrax-editorial__panels {
  display: grid;
  gap: 1.15rem;
  max-width: var(--meptrax-editorial-pair) !important;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
  align-items: start;
}

.meptrax-editorial--pair > .meptrax-editorial__panels,
.meptrax-editorial__panels--pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

/*
 * Pass 3: contrast as ONE asymmetric lesson composition.
 * Left = compact proposition (~32%); right = larger lesson (~68%).
 * Content-height only — no full-height shared "card" (that leaves an empty left void).
 * Shared atmosphere + top alignment + restrained divider gap imply one unit.
 */
.meptrax-editorial--contrast > .meptrax-editorial__panels {
  grid-template-columns: minmax(0, 0.32fr) minmax(0, 0.68fr);
  align-items: start;
  gap: 1.25rem;
  max-width: min(64rem, 100%) !important;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.meptrax-editorial--contrast .meptrax-editorial__panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 31, 63, 0.08);
  border-radius: 10px;
  box-shadow: none;
  height: auto;
  align-self: start;
  padding: 1.25rem 1.3rem 1.35rem;
}

/* Compact first proposition — denser, stronger, short by design */
.meptrax-editorial--contrast .meptrax-editorial__panel:first-child {
  border-left: 3px solid rgba(0, 31, 63, 0.45);
  border-right: 1px solid rgba(0, 31, 63, 0.08);
  background: rgba(255, 255, 255, 0.94);
  padding: 1.2rem 1.15rem 1.25rem;
}

.meptrax-editorial--contrast .meptrax-editorial__panel:first-child .wp-block-heading:first-child {
  font-size: clamp(1.12rem, 1.9vw, 1.32rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Larger explanatory lesson (width + content carry the weight) */
.meptrax-editorial--contrast .meptrax-editorial__panel:last-child {
  padding: 1.3rem 1.5rem 1.55rem;
  background: rgba(255, 255, 255, 0.9);
}

.meptrax-editorial--sequence > .meptrax-editorial__panels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: min(64rem, 100%) !important;
  align-items: start;
}

/* Nested pair panels inside a pull chapter (e.g. expect/actual) */
.meptrax-depth-section .meptrax-editorial__panels--pair {
  max-width: var(--meptrax-editorial-pair) !important;
  margin-top: 1.15rem;
  margin-bottom: 0.35rem;
}

/* EXPECTED — to — ACTUAL (preserves intermediate "to" in the pair) */
.meptrax-editorial__panels--pair-process {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  column-gap: 0.65rem;
}

.meptrax-editorial-process__pair-to {
  align-self: center;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 0 0.15rem;
  max-width: 3.5rem;
}

.meptrax-editorial-process__pair-to p {
  margin: 0 !important;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.meptrax-editorial__panel {
  box-sizing: border-box;
  background: var(--meptrax-editorial-panel-bg);
  border: 1px solid var(--meptrax-editorial-panel-border);
  border-radius: 10px;
  padding: 1.2rem 1.3rem 1.35rem;
  box-shadow: 0 1px 2px rgba(0, 31, 63, 0.04);
  min-width: 0;
  height: auto;
  align-self: start;
}

.meptrax-editorial__panel > * {
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.meptrax-editorial__panel .wp-block-heading:first-child,
.meptrax-editorial__panel p:first-child {
  margin-top: 0;
}

.meptrax-editorial__panel .wp-block-heading:first-child {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  font-weight: 750;
  line-height: 1.25;
}

.meptrax-editorial__panel p:last-child {
  margin-bottom: 0;
}

.meptrax-editorial__panel p strong {
  color: var(--meptrax-navy, #001f3f);
  font-size: 1.08rem;
  font-weight: 750;
}

/* contrast panel surfaces owned by Pass 3 asymmetric block above */

/* OA process sequence: editorial progression, not a flowchart */
.meptrax-editorial-process {
  max-width: var(--meptrax-editorial-pair);
  margin: 1.1rem auto 1.35rem;
  width: 100%;
}

.meptrax-editorial-process__link {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.2rem auto 0.35rem;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 12rem;
}

.meptrax-editorial-process__link p {
  margin: 0 !important;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.meptrax-editorial-process__arrow {
  display: block;
  text-align: center;
  color: rgba(0, 31, 63, 0.28);
  font-size: 1.15rem;
  line-height: 1;
  margin: 0.15rem 0 0.35rem;
  user-select: none;
}

.meptrax-editorial__panels--sequence-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  max-width: min(34rem, 100%) !important;
  margin-left: auto;
  margin-right: auto;
}

.meptrax-editorial__panels--sequence-flow .meptrax-editorial__panel {
  text-align: center;
  padding: 0.85rem 1rem;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.92);
}

/* Sequence stages: narrower centered measure (not full pair width) */
.meptrax-editorial-process > .meptrax-editorial__panel--stage {
  max-width: min(28rem, 100%);
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding: 0.9rem 1.1rem;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.94);
}

.meptrax-editorial__panel--dest {
  max-width: min(32rem, 100%);
  margin: 0.55rem auto 0;
  text-align: center;
  border-color: rgba(0, 31, 63, 0.18);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 31, 63, 0.06);
}

.meptrax-editorial__panel--dest .wp-block-heading {
  margin: 0 !important;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem) !important;
  font-weight: 800 !important;
  color: var(--meptrax-navy, #001f3f);
}

/* Desktop sequence rhythm: pair on top, then centered vertical chain */
@media (min-width: 769px) {
  .meptrax-editorial-process .meptrax-editorial__panels--pair {
    margin-bottom: 0.25rem;
  }
}

/* 5/6-class: pull statement (OA reveal h2) */
.meptrax-depth-section.meptrax-editorial--pull {
  padding-top: clamp(2.85rem, 4.5vw, 3.75rem);
  padding-bottom: clamp(2.85rem, 4.5vw, 3.75rem);
}

.meptrax-depth-section.meptrax-editorial--pull > *:not(.meptrax-editorial__panels) {
  max-width: min(42rem, 100%);
}

.meptrax-depth-section.meptrax-editorial--pull h2.wp-block-heading {
  font-size: clamp(1.45rem, 3.1vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--meptrax-navy, #001f3f);
  max-width: min(36rem, 100%);
  margin-top: 0.85rem;
  margin-bottom: 1.15rem;
}

/* Canvas horizontal inset lives on .meptrax-depth-section (shared depth.css).
   Editorial owns composition only — do not reintroduce asymmetric padding. */

/* Mobile: stack all pairs */
@media (max-width: 768px) {
  .meptrax-depth-section.meptrax-editorial--hero {
    padding-top: 2rem;
    padding-bottom: 1.75rem;
  }

  .meptrax-depth-section.meptrax-editorial--hero .wp-block-heading:first-of-type {
    font-size: clamp(1.45rem, 6.5vw, 1.85rem);
  }

  .meptrax-editorial--pair > .meptrax-editorial__panels,
  .meptrax-editorial--sequence > .meptrax-editorial__panels,
  .meptrax-editorial__panels--pair {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    align-items: stretch; /* single column; height-by-content still */
  }

  /* Contrast: stack as two related propositions, still one composition */
  .meptrax-editorial--contrast > .meptrax-editorial__panels {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .meptrax-editorial--contrast .meptrax-editorial__panel:first-child {
    border-left: 3px solid rgba(0, 31, 63, 0.45);
    border-right: 1px solid rgba(0, 31, 63, 0.08);
    border-bottom: none;
    padding: 1.1rem 1.1rem 1.15rem;
  }

  .meptrax-editorial--contrast .meptrax-editorial__panel:last-child {
    padding: 1.15rem 1.15rem 1.25rem;
  }

  /* Mobile: EXPECTED, to, ACTUAL as vertical progression */
  .meptrax-editorial__panels--pair-process {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .meptrax-editorial-process__pair-to {
    max-width: none;
    padding: 0.1rem 0;
  }

  .meptrax-editorial-process__link {
    margin: 0.15rem auto;
  }

  .meptrax-editorial__panels--sequence-flow {
    max-width: 100% !important;
  }

  .meptrax-editorial__panel {
    padding: 1rem 1.05rem 1.1rem;
  }

  .meptrax-depth-section.meptrax-editorial--pull {
    padding-top: 2.15rem;
    padding-bottom: 2.15rem;
  }

  body.meptrax-depth-page .meptrax-depth-section {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }
}
