/* ============================================================================
   po-journal.css — Journal PrimeO
   A magazine, not a blog roll. Everything is scoped under .pj-* so it cannot
   collide with primeo-site / godmaster / wow layers.

   Design brief
   ------------
   No stock photography. Covers are typographic: a rail-tinted field, the mapped
   solution's product render used as a masked backdrop, and the readership rank
   set as a large numeral. The archive's real traffic (≈760k lifetime reads) is
   treated as the hero asset, because it is the most persuasive thing the Journal
   owns. Every card carries the Nexus it legitimately leads to — that is what
   turns an archive into a storefront.
   ========================================================================== */

:root {
  --pj-ink: #1d1d1f;
  --pj-soft: #6e6e73;
  --pj-hair: rgba(0, 0, 0, 0.09);
  --pj-mist: #f5f7fa;
  --pj-depth: #071018;
  --pj-signal: #0071e3;
  --pj-o: #80c083;
  --pj-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --pj-measure: 68ch;
  --pj-shell: 1120px;
}

.pj-shell {
  max-width: var(--pj-shell);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Masthead ─────────────────────────────────────────────────────────────── */

.pj-masthead {
  position: relative;
  overflow: hidden;
  color: #f5f8fc;
  background: var(--pj-depth);
  padding: clamp(64px, 11vh, 120px) 0 clamp(48px, 8vh, 80px);
}
.pj-masthead::before {
  /* Depth without an image: two soft fields, one signal, one brand-O green. */
  content: '';
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(ellipse 42% 34% at 18% 78%, rgba(0, 113, 227, 0.26), transparent 58%),
    radial-gradient(ellipse 38% 30% at 84% 14%, rgba(128, 192, 131, 0.16), transparent 54%);
  pointer-events: none;
}
.pj-masthead::after {
  /* Hairline grid — the only ornament, echoes the configurator schematics. */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 40%, #000 20%, transparent 78%);
  pointer-events: none;
}
.pj-masthead > * { position: relative; z-index: 1; }

.pj-eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pj-o);
}
.pj-masthead h1 {
  margin: 0 0 18px;
  max-width: 22ch;
  font-size: clamp(38px, 6.4vw, 76px);
  font-weight: 600;
  letter-spacing: -0.042em;
  line-height: 1.02;
  color: #fff;
}
.pj-masthead .pj-lede {
  margin: 0;
  max-width: 52ch;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.5;
  color: rgba(245, 248, 252, 0.74);
}
.pj-masthead .pj-lede a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, 0.4); }

/* Readership ledger — the archive's traffic, stated plainly. */
.pj-ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin: clamp(36px, 6vh, 56px) 0 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
}
.pj-ledger div {
  padding: 20px 22px;
  background: rgba(7, 16, 24, 0.55);
  backdrop-filter: blur(6px);
}
.pj-ledger dt,
.pj-ledger .pj-ledger-k {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 248, 252, 0.5);
}
.pj-ledger dd,
.pj-ledger .pj-ledger-v {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ── Rail filter (segmented control) ──────────────────────────────────────── */

.pj-rails {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--pj-hair);
}
.pj-rails-inner {
  display: flex;
  gap: 6px;
  align-items: center;
  max-width: var(--pj-shell);
  margin: 0 auto;
  padding: 12px 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pj-rails-inner::-webkit-scrollbar { display: none; }
.pj-rail-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  color: var(--pj-soft);
  background: transparent;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.pj-rail-btn:hover { color: var(--pj-ink); background: var(--pj-mist); }
.pj-rail-btn.is-on {
  color: #fff;
  background: var(--pj-ink);
  border-color: var(--pj-ink);
}
.pj-rail-count {
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
}
.pj-rails-spacer { margin-left: auto; }
.pj-sort {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--pj-soft);
  font-variant-numeric: tabular-nums;
}

/* ── Typographic cover ────────────────────────────────────────────────────── */

.pj-cover {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: var(--pj-depth);
  isolation: isolate;
}
.pj-cover::before {
  /* Directional scrim: the tint pools in the bottom-left corner where the rank
     numeral and chip live, and clears off the product on the right. */
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 68% 62% at 8% 104%, color-mix(in srgb, var(--pj-tint) 58%, transparent), transparent 66%),
    linear-gradient(104deg, rgba(7, 16, 24, 0.82) 0%, rgba(7, 16, 24, 0.34) 46%, rgba(7, 16, 24, 0) 88%);
  mix-blend-mode: multiply;
}
.pj-cover::after {
  /* Top scrim so the rail tag stays legible on light renders. */
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 42%;
  z-index: 1;
  background: linear-gradient(180deg, rgba(7, 16, 24, 0.5), transparent);
  pointer-events: none;
}
.pj-cover img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pj-pos, 64% 46%);
  transform: scale(1.01);
  filter: contrast(1.04) saturate(1.02);
  transition: transform 1.1s var(--pj-ease);
}
.pj-cover-rank {
  /* Sits in the tinted corner, so it reads on both dark and bright renders. */
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: -0.26em;
  margin: 0;
  font-size: clamp(72px, 12vw, 150px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.8;
  color: rgba(255, 255, 255, 0.2);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.pj-cover-tag {
  position: absolute;
  z-index: 3;
  left: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
}
.pj-cover-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pj-tint);
}

/* ── Lead story ───────────────────────────────────────────────────────────── */

.pj-lead {
  padding: clamp(48px, 8vh, 84px) 0 clamp(32px, 5vh, 52px);
}
.pj-lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.pj-lead-card .pj-cover {
  aspect-ratio: 4 / 3;
  min-height: 300px;
}
.pj-lead-card:hover .pj-cover img { transform: scale(1.05); }
.pj-lead-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pj-signal);
}
.pj-lead-copy h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.6vw, 46px);
  font-weight: 600;
  letter-spacing: -0.038em;
  line-height: 1.07;
  color: var(--pj-ink);
}
.pj-lead-copy .pj-angle {
  margin: 0 0 22px;
  max-width: 44ch;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.5;
  color: var(--pj-soft);
}

/* ── Meta strip (minutes · reads · comments) ──────────────────────────────── */

.pj-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin: 0;
  font-size: 13px;
  color: var(--pj-soft);
  font-variant-numeric: tabular-nums;
}
.pj-meta span { display: inline-flex; align-items: center; gap: 6px; }
.pj-meta .pj-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.45; }
.pj-meta strong { color: var(--pj-ink); font-weight: 600; }

/* Solution chip — the commercial hinge of every card. */
.pj-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 14px 8px 12px;
  border: 1px solid var(--pj-hair);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 550;
  color: var(--pj-ink);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--pj-ease);
}
.pj-chip::after { content: '›'; opacity: 0.5; }
.pj-chip-k {
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pj-soft);
}
a:hover > .pj-chip,
a:hover .pj-chip {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.12);
  transform: translateY(-1px);
}

/* ── Grid of stories ──────────────────────────────────────────────────────── */

.pj-grid-section { padding: 0 0 clamp(56px, 9vh, 96px); }
.pj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: clamp(28px, 3vw, 40px) clamp(24px, 2.6vw, 34px);
}
.pj-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.pj-card .pj-cover {
  aspect-ratio: 16 / 10;
  margin-bottom: 18px;
}
.pj-card:hover .pj-cover img { transform: scale(1.06); }
.pj-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.024em;
  line-height: 1.2;
  color: var(--pj-ink);
}
.pj-card:hover h3 { color: var(--pj-signal); }
.pj-card .pj-angle {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.48;
  color: var(--pj-soft);
}
.pj-card[hidden] { display: none; }

/* ── New-writing rails (the 3 native PrimeO papers) ──────────────────────── */

.pj-native {
  background: var(--pj-mist);
  border-top: 1px solid var(--pj-hair);
  padding: clamp(56px, 9vh, 96px) 0;
}
.pj-section-head { margin-bottom: clamp(28px, 4vh, 44px); }
.pj-section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 600;
  letter-spacing: -0.034em;
  line-height: 1.1;
  color: var(--pj-ink);
}
.pj-section-head p {
  margin: 0;
  max-width: 56ch;
  font-size: 17px;
  line-height: 1.5;
  color: var(--pj-soft);
}
.pj-native-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.pj-native-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px 24px 24px;
  background: #fff;
  border: 1px solid var(--pj-hair);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--pj-ease), box-shadow 0.3s var(--pj-ease), border-color 0.2s;
}
.pj-native-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.08);
}
.pj-native-card .pj-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pj-signal);
}
.pj-native-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--pj-ink);
}
.pj-native-card p:not(.pj-kicker) {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pj-soft);
}
.pj-native-card .pj-more {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 560;
  color: var(--pj-signal);
}

/* ── Article page ─────────────────────────────────────────────────────────── */

.pj-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: transparent;
}
.pj-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pj-signal), var(--pj-o));
  transition: width 0.1s linear;
}

.pj-article { padding: 0 0 clamp(56px, 9vh, 96px); }
.pj-loading { padding: 120px 24px; text-align: center; color: var(--pj-soft); }

.pj-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--pj-depth);
  padding: clamp(56px, 9vh, 104px) 0 clamp(40px, 6vh, 64px);
}
.pj-hero::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 60% 50% at 16% 100%, color-mix(in srgb, var(--pj-tint) 46%, transparent), transparent 60%),
    radial-gradient(ellipse 40% 34% at 88% 8%, rgba(0, 113, 227, 0.2), transparent 56%);
  pointer-events: none;
}
.pj-hero > * { position: relative; z-index: 1; }
.pj-back {
  display: inline-block;
  margin: 0 0 24px;
  font-size: 14px;
  font-weight: 550;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}
.pj-back:hover { color: #fff; }
.pj-hero h1 {
  margin: 0 0 18px;
  max-width: 26ch;
  font-size: clamp(32px, 5.2vw, 62px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.04;
  color: #fff;
}
.pj-hero .pj-angle {
  margin: 0 0 26px;
  max-width: 48ch;
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.5;
  color: rgba(245, 248, 252, 0.76);
}
.pj-hero .pj-meta { color: rgba(245, 248, 252, 0.6); }
.pj-hero .pj-meta strong { color: #fff; }

/* Standing editorial note (France 3 archive, heritage copy…) */
.pj-note {
  max-width: var(--pj-measure);
  margin: clamp(32px, 5vh, 48px) auto 0;
  padding: 16px 20px;
  border-left: 3px solid var(--pj-tint, var(--pj-signal));
  border-radius: 0 10px 10px 0;
  background: var(--pj-mist);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--pj-soft);
}

/* Body: one measure, real typographic rhythm. */
.pj-body {
  max-width: var(--pj-measure);
  margin: clamp(40px, 6vh, 64px) auto 0;
  padding: 0 24px;
  font-size: 18px;
  line-height: 1.68;
  color: #2b2b2f;
}
.pj-body > *:first-child { margin-top: 0; }
.pj-body p { margin: 0 0 1.35em; }
.pj-body h2 {
  margin: 2.2em 0 0.7em;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.2;
  color: var(--pj-ink);
}
.pj-body h3 {
  margin: 1.9em 0 0.6em;
  font-size: clamp(19px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--pj-ink);
}
.pj-body h2 + h3 { margin-top: 0.9em; }
.pj-body strong { color: var(--pj-ink); font-weight: 600; }
.pj-body em { color: #3a3a3f; }
.pj-body a { color: var(--pj-signal); text-decoration: none; border-bottom: 1px solid rgba(0, 113, 227, 0.3); }
.pj-body a:hover { border-bottom-color: var(--pj-signal); }
.pj-body ul,
.pj-body ol { margin: 0 0 1.35em; padding-left: 1.4em; }
.pj-body li { margin: 0 0 0.5em; }
.pj-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 1.6em 0; }
.pj-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--pj-hair); }
.pj-body [align="center"] { text-align: center; }
/* Legacy Smart Blog bodies open on a heading — keep the drop cap off those. */
.pj-body > p:first-of-type::first-letter {
  float: left;
  margin: 0.02em 0.08em 0 0;
  font-size: 3.1em;
  font-weight: 600;
  line-height: 0.84;
  color: var(--pj-ink);
}

/* Solution block — where the archive becomes commerce. */
.pj-solution {
  max-width: 900px;
  margin: clamp(48px, 7vh, 80px) auto 0;
  padding: 0 24px;
}
.pj-solution-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--pj-hair);
  border-radius: 20px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.35s var(--pj-ease), border-color 0.25s;
}
.pj-solution-card:hover {
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.1);
}
.pj-solution-copy { padding: clamp(28px, 4vw, 40px); }
.pj-solution-copy .pj-kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pj-signal);
}
.pj-solution-copy h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--pj-ink);
}
.pj-solution-copy p {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--pj-soft);
}
.pj-solution-visual {
  position: relative;
  min-height: 220px;
  background: var(--pj-mist);
}
.pj-solution-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Comments ─────────────────────────────────────────────────────────────── */

.pj-comments {
  max-width: var(--pj-measure);
  margin: clamp(48px, 7vh, 80px) auto 0;
  padding: 0 24px;
}
.pj-comments h2 {
  margin: 0 0 8px;
  font-size: clamp(22px, 2.4vw, 27px);
  font-weight: 600;
  letter-spacing: -0.028em;
  color: var(--pj-ink);
}
.pj-comments-note {
  margin: 0 0 28px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--pj-soft);
}
.pj-comment {
  padding: 20px 0;
  border-top: 1px solid var(--pj-hair);
}
.pj-comment-reply {
  margin-left: clamp(16px, 4vw, 40px);
  padding-left: 20px;
  border-left: 2px solid var(--pj-hair);
  border-top: 0;
}
.pj-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 8px;
}
.pj-comment-name { font-size: 15px; font-weight: 600; color: var(--pj-ink); }
.pj-comment-sub { font-size: 13px; color: var(--pj-soft); font-variant-numeric: tabular-nums; }
.pj-comment-body {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #3a3a3f;
  white-space: pre-line;
}

/* ── Read next ────────────────────────────────────────────────────────────── */

.pj-next {
  margin-top: clamp(56px, 9vh, 96px);
  padding: clamp(48px, 7vh, 80px) 0 0;
  border-top: 1px solid var(--pj-hair);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .pj-lead-card,
  .pj-solution-card { grid-template-columns: 1fr; }
  .pj-lead-card .pj-cover { min-height: 220px; aspect-ratio: 16 / 10; }
  .pj-solution-visual { min-height: 200px; order: -1; }
}
@media (max-width: 560px) {
  .pj-body { font-size: 17px; }
  .pj-body > p:first-of-type::first-letter { font-size: 2.6em; }
  .pj-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .pj-cover img,
  .pj-native-card,
  .pj-chip,
  .pj-progress span { transition: none; }
}

/* ── Dark theme (po-theme.js sets data-theme) ─────────────────────────────── */

[data-theme='dark'] .pj-card h3,
[data-theme='dark'] .pj-lead-copy h2,
[data-theme='dark'] .pj-section-head h2,
[data-theme='dark'] .pj-comments h2,
[data-theme='dark'] .pj-native-card h3,
[data-theme='dark'] .pj-solution-copy h2 { color: #f5f5f7; }
[data-theme='dark'] .pj-body { color: #d2d2d7; }
[data-theme='dark'] .pj-body h2,
[data-theme='dark'] .pj-body h3,
[data-theme='dark'] .pj-body strong { color: #f5f5f7; }
[data-theme='dark'] .pj-native,
[data-theme='dark'] .pj-note { background: #14161a; }
[data-theme='dark'] .pj-native-card,
[data-theme='dark'] .pj-solution-card,
[data-theme='dark'] .pj-chip { background: #1c1f24; border-color: rgba(255, 255, 255, 0.12); }
[data-theme='dark'] .pj-rails { background: rgba(20, 22, 26, 0.84); border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .pj-rail-btn.is-on { background: #f5f5f7; color: #1d1d1f; border-color: #f5f5f7; }
