/* ═══════════════════════════════════════════════════════
   PRO ARTICLE LAYOUT — js/pro-article.js
   Opt-in per post/presence from the CMS. Flat surfaces,
   thin borders, no gradients or glows.
   ═══════════════════════════════════════════════════════ */
:root {
  --pro-dark: #0b1d26;
  --pro-on-dark: #ffffff;
  --pro-on-dark-muted: #c3d2d9;
  --pro-accent: #3cb9df;
  --pro-accent-ink: #147ca1;
  --pro-soft: #eef5f8;
  --pro-line: #d7e3e8;
  --pro-ink: #0b1d26;
  --pro-muted: #586a73;
  --pro-text: #243943;
}
html[data-theme='dark'] {
  --pro-dark: #0c1728;
  --pro-on-dark-muted: #bdd0e1;
  --pro-accent: #6fd0ec;
  --pro-accent-ink: #6fd0ec;
  --pro-soft: #0f1d31;
  --pro-line: #20324a;
  --pro-ink: #f8fbff;
  --pro-muted: #bdd0e1;
  --pro-text: #d6e1ed;
}

.pro-shell {
  width: min(1180px, calc(100% - 3rem));
  margin-inline: auto;
}

.pro-eyebrow {
  margin: 0 0 .9rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--pro-accent);
}

/* ─── HERO ───────────────────────────────────────── */
.pro-hero {
  background: var(--pro-dark);
  color: var(--pro-on-dark);
  padding: 8.5rem 0 4.5rem;
}
.pro-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 3.5rem;
  align-items: center;
}
.pro-hero--text .pro-hero-grid { grid-template-columns: minmax(0, 880px); }
.pro-breadcrumb {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 2.25rem;
  font-size: .85rem; color: var(--pro-on-dark-muted);
}
.pro-breadcrumb a { color: inherit; text-decoration: none; }
.pro-breadcrumb a:hover { color: var(--pro-on-dark); text-decoration: underline; }
.pro-title {
  margin: 0 0 1.5rem;
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: clamp(2.2rem, 4.4vw, 3.9rem); font-weight: 700;
  line-height: 1.08; letter-spacing: -.02em;
  color: inherit;
  text-wrap: balance;
}
.pro-lead {
  max-width: 40rem; margin: 0;
  font-size: clamp(1.05rem, 1.4vw, 1.25rem); line-height: 1.65;
  color: var(--pro-on-dark-muted);
}
.pro-hero-media img {
  display: block;
  width: 100%; height: auto; max-height: 560px;
  object-fit: contain;
  border-radius: 16px;
}

/* ─── NUMBER CARDS ───────────────────────────────── */
.pro-stats { padding-top: 3rem; }
.pro-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.pro-stat {
  padding: 1.5rem 1.4rem;
  background: var(--theme-surface);
  border: 1px solid var(--pro-line);
  border-radius: 14px;
}
.pro-stat-value {
  margin: 0;
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: clamp(1.7rem, 2.6vw, 2.1rem); font-weight: 700; line-height: 1.05;
  color: var(--pro-accent-ink);
}
.pro-stat-label {
  margin: .7rem 0 0;
  font-size: .9rem; line-height: 1.45;
  color: var(--pro-muted);
}

/* ─── BODY ───────────────────────────────────────── */
.pro-content { padding: 3.5rem 0 5rem; }
.pro-back {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: .95rem; font-weight: 600;
  color: var(--pro-accent-ink); text-decoration: none;
}
.pro-back:hover { text-decoration: underline; }
.article-body.pro-body {
  font-size: 1.125rem; line-height: 1.85;
  color: var(--pro-text);
}
/* main.css turns .article-body into a card in dark mode; the PRO body stays flat */
html[data-theme='dark'] .article-body.pro-body {
  background: transparent !important;
  box-shadow: none;
  color: var(--pro-text) !important;
}
/* Text keeps a readable measure; large and full images use the whole width */
.article-body.pro-body > :not(.cms-image) { max-width: 820px; margin-left: auto; margin-right: auto; }
.article-body.pro-body > .cms-image--large,
.article-body.pro-body > .cms-image--full { max-width: 100%; }
.article-body.pro-body .cms-image img { border-radius: 16px; }
.article-body.pro-body > p:first-child {
  font-size: 1.3rem; line-height: 1.6; font-weight: 600;
  color: var(--pro-ink);
}
.article-body.pro-body h2 {
  margin-top: 3.5rem; margin-bottom: 1.1rem;
  font-size: clamp(1.6rem, 2.6vw, 2rem); line-height: 1.2;
  color: var(--pro-ink);
}
.article-body.pro-body h3 { color: var(--pro-ink); }
.article-body.pro-body a { color: var(--pro-accent-ink); }
html .article-body.pro-body blockquote {
  margin-top: 2.5rem; margin-bottom: 2.5rem;
  padding: 1.75rem 2rem;
  background: var(--pro-soft) !important;
  border-left: 4px solid var(--pro-accent);
  border-radius: 0 12px 12px 0;
  font-size: 1.3rem; font-style: normal; font-weight: 600; line-height: 1.55;
  color: var(--pro-ink) !important;
}
.article-body.pro-body blockquote p:last-child { margin-bottom: 0; }

/* ─── PROFILE CARD ───────────────────────────────── */
.pro-profile {
  max-width: 820px;
  margin: 4rem auto 0;
  padding: 2.25rem;
  background: var(--pro-dark);
  color: var(--pro-on-dark);
  border-radius: 20px;
}
html[data-theme='dark'] .pro-profile { border: 1px solid var(--pro-line); }
.pro-profile-head {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.75rem; align-items: center;
  margin-bottom: 1.75rem;
}
.pro-profile-head--text { grid-template-columns: minmax(0, 1fr); }
.pro-profile-photo {
  display: block;
  width: 150px; aspect-ratio: 4 / 5;
  object-fit: cover; object-position: center 25%;
  border-radius: 12px;
}
.pro-profile-name {
  margin: 0 0 .4rem;
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: clamp(1.6rem, 2.6vw, 2rem); font-weight: 700; line-height: 1.15;
  color: var(--pro-on-dark);
}
.pro-profile-role { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--pro-accent); }
.pro-profile-text p {
  margin: 0 0 1.2rem;
  font-size: 1.02rem; line-height: 1.8;
  color: var(--pro-on-dark-muted);
}
.pro-profile-text:empty { display: none; }
.pro-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .75rem;
  margin: 1.75rem 0;
}
.pro-metrics:last-child { margin-bottom: 0; }
.pro-metric {
  padding: 1.1rem 1.2rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
}
.pro-metric-value {
  margin: 0;
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: 1.6rem; font-weight: 700; line-height: 1.1;
  color: var(--pro-accent);
}
.pro-metric-label {
  margin: .5rem 0 0;
  font-size: .85rem; line-height: 1.45;
  color: var(--pro-on-dark-muted);
}

/* ─── PHOTOS ─────────────────────────────────────── */
.pro-gallery {
  padding: 5rem 0;
  background: var(--pro-soft);
}
.pro-gallery .pro-eyebrow { color: var(--pro-accent-ink); }
.pro-gallery-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 1rem 2rem;
  margin-bottom: 2rem;
}
.pro-gallery-title {
  margin: 0;
  font-family: 'Space Grotesk', 'Space Grotesk Fallback', sans-serif;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 700; line-height: 1.1;
  color: var(--pro-ink);
}
.pro-gallery-subtitle { max-width: 28rem; margin: 0; color: var(--pro-muted); }
.pro-gallery-grid {
  margin: 0; padding: 0; list-style: none;
  columns: 3; column-gap: 1rem;
}
.pro-gallery-grid li { break-inside: avoid; margin-bottom: 1rem; }
.pro-gallery-item {
  display: block;
  width: 100%; padding: 0;
  background: var(--pro-line);
  border: 0; border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
}
.pro-gallery-item img { display: block; width: 100%; height: auto; transition: opacity .25s ease; }
.pro-gallery-item:hover img { opacity: .9; }
.pro-gallery-item:focus-visible { outline: 3px solid var(--pro-accent-ink); outline-offset: 3px; }

.pro-lightbox {
  /* main.css resets margin to 0 on every element, which breaks the native
     <dialog> centering (it relies on margin: auto); restore it explicitly. */
  position: fixed; inset: 0; margin: auto;
  max-width: 94vw; max-height: 94vh;
  width: fit-content; height: fit-content;
  padding: 0; border: 0;
  background: transparent;
  overflow: visible;
}
.pro-lightbox::backdrop { background: rgba(3, 15, 21, .92); }
.pro-lightbox figure { margin: 0; }
.pro-lightbox img {
  display: block;
  width: auto; height: auto;
  max-width: min(1200px, 94vw); max-height: 84vh;
  margin: 0 auto;
  border-radius: 10px;
}
.pro-lightbox figcaption {
  margin-top: .75rem;
  font-size: .9rem; text-align: center;
  color: #dbe7ec;
}
.pro-lightbox-close {
  position: fixed; top: 1rem; right: 1rem;
  width: 2.75rem; height: 2.75rem;
  background: #fff; color: #0b1d26;
  border: 0; border-radius: 50%;
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
}
.pro-lightbox-nav {
  position: fixed; top: 50%;
  transform: translateY(-50%);
  width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  font-size: 1.75rem; line-height: 1;
  cursor: pointer;
}
.pro-lightbox-nav:hover { background: rgba(255, 255, 255, .2); }
.pro-lightbox-prev { left: 1rem; }
.pro-lightbox-next { right: 1rem; }
.pro-lightbox-count {
  position: fixed; bottom: 1rem; left: 50%;
  transform: translateX(-50%);
  font-size: .85rem;
  color: #dbe7ec;
}
/* ─── PRESENTATION (flip book, vendor/page-flip) ─── */
.pro-presentation {
  overflow: hidden;
  padding: 5rem 0;
  background: var(--pro-dark);
  color: var(--pro-on-dark);
}
.pro-presentation .pro-gallery-title { color: var(--pro-on-dark); }
.pro-presentation .pro-gallery-subtitle { color: var(--pro-on-dark-muted); }
.pro-book { --pro-book-ratio: 1.777; }
.pro-book-stage { border-radius: 6px; }
.pro-book-stage:focus-visible { outline: 3px solid var(--pro-accent); outline-offset: 6px; }
/* Width follows the viewport height too, so a whole page is always visible */
.pro-book-pages {
  width: min(100%, calc((100vh - 11rem) * var(--pro-book-ratio)));
  margin-inline: auto;
}
.pro-book-page { background: #fff; overflow: hidden; }
.pro-book-page img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
/* Until the library takes over (or if it fails) only the first page shows */
.pro-book:not(.is-ready) .pro-book-page:not(:first-child) { display: none; }
.pro-book:not(.is-ready) .pro-book-page img { height: auto; }
.pro-book.is-ready .pro-book-pages { filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); cursor: grab; }

.pro-book-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin-top: 1.75rem;
}
.pro-book-spacer { flex: 1; }
.pro-book-count {
  min-width: 5.5rem; margin: 0; text-align: center;
  font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--pro-on-dark-muted);
}
.pro-book-btn, .pro-book-action {
  border: 1px solid rgba(255, 255, 255, .28);
  background: transparent; color: var(--pro-on-dark);
  font: inherit; cursor: pointer; text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.pro-book-btn {
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  font-size: 1.5rem; line-height: 1;
}
.pro-book-action { padding: .65rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 600; }
.pro-book-btn:hover:not(:disabled), .pro-book-action:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.pro-book-btn:disabled { opacity: .35; cursor: default; }
.pro-book-btn:focus-visible, .pro-book-action:focus-visible { outline: 3px solid var(--pro-accent); outline-offset: 3px; }

.pro-book:fullscreen {
  display: flex; flex-direction: column; justify-content: center;
  padding: 1.5rem; background: #05101a;
}
.pro-book:fullscreen .pro-book-pages { width: min(100%, calc((100vh - 8rem) * var(--pro-book-ratio))); }
.pro-book:fullscreen .pro-book-bar { margin-top: 1.25rem; }

/* ─── FILES ──────────────────────────────────────── */
.pro-files { padding: 5rem 0; }
.pro-files .pro-eyebrow { color: var(--pro-accent-ink); }
.pro-files-list {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem;
}
.pro-file {
  display: flex; align-items: center; gap: 1rem;
  height: 100%; padding: 1rem 1.15rem;
  border: 1px solid var(--pro-line); border-radius: 10px;
  color: var(--pro-ink); text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
}
.pro-file:hover { border-color: var(--pro-accent-ink); background: var(--pro-soft); }
.pro-file:focus-visible { outline: 3px solid var(--pro-accent-ink); outline-offset: 3px; }
.pro-file-icon {
  --file: #5b6b76;
  position: relative; flex: none; width: 2.5rem; height: 3rem;
}
.pro-file-icon svg { display: block; width: 100%; height: 100%; fill: var(--file); }
.pro-file-icon .pro-file-fold { fill: rgba(255, 255, 255, .4); }
.pro-file-icon span {
  position: absolute; inset: auto 0 .5rem; text-align: center;
  font-size: .62rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff;
}
.pro-file-icon--pdf { --file: #c8372d; }
.pro-file-icon--doc { --file: #2b63c4; }
.pro-file-icon--sheet { --file: #1e7e45; }
.pro-file-icon--slides { --file: #c9561b; }
.pro-file-icon--image { --file: #0f8a8a; }
.pro-file-icon--video { --file: #6d44c2; }
.pro-file-icon--audio { --file: #b0347f; }
.pro-file-icon--archive { --file: #8a6a1c; }
.pro-file-icon--cad { --file: #33566b; }
.pro-file-text { display: grid; gap: .2rem; min-width: 0; flex: 1; }
.pro-file-name { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pro-file-meta { font-size: .82rem; color: var(--pro-muted); }
.pro-file-get { flex: none; font-size: 1.15rem; color: var(--pro-accent-ink); }

@media (max-width: 560px) {
  .pro-presentation, .pro-files { padding: 3.5rem 0; }
  .pro-book-spacer { flex-basis: 100%; height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pro-book-btn, .pro-book-action, .pro-file { transition: none; }
}

@media (max-width: 640px) {
  .pro-lightbox-nav { width: 2.5rem; height: 2.5rem; font-size: 1.4rem; }
  .pro-lightbox-prev { left: .5rem; }
  .pro-lightbox-next { right: .5rem; }
}

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .pro-hero { padding: 7rem 0 3rem; }
  .pro-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 2.25rem; }
  .pro-gallery-grid { columns: 2; }
}
@media (max-width: 560px) {
  .pro-shell { width: calc(100% - 2.5rem); }
  .pro-stats { padding-top: 2rem; }
  .pro-stats-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .pro-stat { padding: 1.1rem 1rem; }
  .pro-content { padding: 2.5rem 0 4rem; }
  .article-body.pro-body { font-size: 1.05rem; }
  .article-body.pro-body > p:first-child { font-size: 1.15rem; }
  html .article-body.pro-body blockquote { padding: 1.25rem 1.25rem; font-size: 1.12rem; }
  .pro-profile { padding: 1.5rem; }
  .pro-profile-head { grid-template-columns: minmax(0, 1fr); }
  .pro-profile-photo { width: 100%; max-width: 280px; }
  .pro-gallery { padding: 3.5rem 0; }
  .pro-gallery-grid { columns: 1; }
}
