/* ===========================================================
   PROGCESS PARTNERS · Newsletter shared stylesheet
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=DM+Sans:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --white: #FAFAF8;
  --off-white: #F2F1EE;
  --light-grey: #E5E3DF;
  --mid-grey: #9E9B95;
  --dark-grey: #3A3935;
  --black: #1A1917;
  --accent: #C8A96E;
  --accent-deep: #9F8550;
  --logo-navy: #0D1B2A;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--white);
  font-family: var(--sans);
  color: var(--dark-grey);
  -webkit-font-smoothing: antialiased;
  font-size: 18px;
  line-height: 1.6;
}

a { color: inherit; }

/* ===========================================================
   PAGE NAV
   =========================================================== */
.page-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,248,0.96);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--light-grey);
  padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.page-nav .brand-mark {
  display: flex; align-items: center; gap: 14px;
  background: var(--logo-navy); border-radius: 10px;
  padding: 6px 18px 6px 6px; text-decoration: none;
}
.page-nav .brand-mark img { width: 40px; height: 40px; border-radius: 6px; display: block; }
.page-nav .brand-mark .name {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  letter-spacing: 0.04em; color: #fff; line-height: 1;
}
.page-nav .brand-mark .name span { font-weight: 300; color: rgba(255,255,255,0.75); }
.page-nav .nav-links { display: flex; gap: 2rem; }
.page-nav .nav-links a {
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mid-grey);
  text-decoration: none; transition: color 0.2s;
}
.page-nav .nav-links a.active,
.page-nav .nav-links a:hover { color: var(--black); }

/* ===========================================================
   PAGE HEADER
   =========================================================== */
.page-header {
  max-width: 1200px; margin: 0 auto; padding: 6rem 2rem 4rem;
  border-bottom: 1px solid var(--light-grey);
}
.page-header .eyebrow {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 1.6rem; display: flex; align-items: center; gap: 0.8rem;
}
.page-header .eyebrow::before {
  content: ''; display: inline-block; width: 2rem; height: 1px; background: var(--accent);
}
.page-header h1 {
  font-family: var(--serif); font-size: clamp(2.6rem, 4.5vw, 4rem);
  font-weight: 300; line-height: 1.05; color: var(--black);
  letter-spacing: -0.01em; max-width: 880px;
}
.page-header h1 em { font-style: italic; color: var(--mid-grey); }

/* ===========================================================
   ISSUE INDEX (cards on home page)
   =========================================================== */
.issue-index {
  max-width: 1200px; margin: 0 auto; padding: 3rem 2rem 4rem;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.issue-card {
  border: 1px solid var(--light-grey); background: var(--white);
  padding: 2rem; transition: border-color 0.25s, transform 0.25s;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.issue-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.issue-card .tag {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.issue-card .title {
  font-family: var(--serif); font-size: 1.45rem; font-weight: 400;
  color: var(--black); line-height: 1.25; margin-bottom: 1rem;
}
.issue-card .summary {
  font-family: var(--sans); font-size: 0.92rem; color: var(--mid-grey);
  line-height: 1.5; margin-bottom: 1.4rem; flex: 1;
}
.issue-card .meta {
  font-size: 0.78rem; color: var(--mid-grey);
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1rem; border-top: 1px solid var(--light-grey);
}
.issue-card .arrow { font-family: var(--serif); color: var(--accent); font-size: 1.2rem; }
.issue-card .actions {
  display: flex; gap: 0.6rem; align-items: center;
  margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--light-grey);
}
.issue-card .read-link {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-deep);
  text-decoration: none;
}
.issue-card .read-link:hover { color: var(--accent); }
.issue-card .pdf-link {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--mid-grey);
  text-decoration: none; margin-left: auto;
}
.issue-card .pdf-link:hover { color: var(--accent-deep); }

/* ===========================================================
   ISSUE PAGE LAYOUT
   =========================================================== */
.issue {
  max-width: 1280px; margin: 0 auto; padding: 4rem 2rem 4rem;
}
.issue-header {
  display: grid; grid-template-columns: 1fr auto;
  gap: 2rem; align-items: end;
  border-bottom: 1px solid var(--light-grey);
  padding-bottom: 2rem; margin-bottom: 3rem;
}
.issue-header .label {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 1rem;
}
.issue-header h2 {
  font-family: var(--serif); font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 300; color: var(--black); line-height: 1.1;
  letter-spacing: -0.01em;
}
.issue-header h2 em { font-style: italic; color: var(--mid-grey); }
.issue-header .date-block {
  text-align: right; font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mid-grey); line-height: 1.6;
}

/* Back link */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mid-grey); text-decoration: none;
  margin-bottom: 1.8rem; transition: color 0.2s;
}
.back-link:hover { color: var(--accent-deep); }

/* ===========================================================
   CAROUSEL — bigger frame than before
   =========================================================== */
.carousel { position: relative; margin-bottom: 3rem; }
.carousel-frame {
  aspect-ratio: 1 / 1; width: 100%; max-width: 1080px;
  margin: 0 auto; background: var(--off-white);
  overflow: hidden; position: relative;
  border: 1px solid var(--light-grey);
}
.slide-track {
  display: flex; height: 100%;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide-track > .slide-wrap { height: 100%; flex-shrink: 0; }
.slide {
  width: 1080px; height: 1080px; transform-origin: top left;
  position: relative; overflow: hidden; background: var(--white);
}
.slide-wrap { position: relative; overflow: hidden; }

/* Default in-frame scaling — frame can grow up to 1080px so the slides render at full size on big screens */
.slide-wrap .slide {
  transform: scale(1);
  width: 100%; height: 100%;
}
@media (max-width: 1100px) {
  .slide-wrap .slide {
    /* Convert 100vw → unitless ratio via the (100vw/1px)/1080 trick so calc()
       resolves to a valid number for scale(). The earlier 100vw/1080 produced
       a vw-unit value, which is invalid for scale() and was silently dropped
       by every browser — leaving slides un-scaled at 1080px wide. */
    transform: scale(calc((100vw / 1px) / 1080 * 0.94));
    transform-origin: top left;
    width: 1080px; height: 1080px;
  }
  /* In RTL (Arabic), the 1080px-wide slide is laid out from the right edge of
     the carousel frame. Anchor the scale transform to the top-right so the
     scaled content sits flush against the right side of the visible frame
     instead of overflowing into negative-x space off the left of the screen. */
  html[dir="rtl"] .slide-wrap .slide {
    transform-origin: top right;
  }
}

/* Carousel toolbar — pager + fullscreen button */
.carousel-controls {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1080px; margin: 1.2rem auto 0;
  flex-wrap: wrap; gap: 1rem;
}
.carousel-controls .pager { display: flex; gap: 0.5rem; }
.carousel-controls .pager .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--light-grey); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-controls .pager .dot.active {
  background: var(--accent); transform: scale(1.3);
}
.carousel-btn {
  background: none; border: 1px solid var(--light-grey);
  width: 44px; height: 44px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dark-grey); transition: border-color 0.2s, color 0.2s;
  font-family: var(--serif); font-size: 1.4rem;
}
.carousel-btn:hover { border-color: var(--accent); color: var(--accent); }
.carousel-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.slide-counter {
  font-family: var(--mono); font-size: 0.72rem;
  letter-spacing: 0.15em; color: var(--mid-grey);
}

/* "View full size" button */
.fullscreen-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--logo-navy); border: 1px solid var(--logo-navy);
  color: var(--white); padding: 0.55rem 1.1rem;
  font-family: var(--sans); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.fullscreen-btn:hover { background: var(--accent); border-color: var(--accent); color: var(--black); }
.fullscreen-btn svg { width: 14px; height: 14px; }

/* Hint label above the carousel */
.carousel-hint {
  text-align: center; font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mid-grey); margin-bottom: 1rem;
}
.carousel-hint .open-link {
  color: var(--accent-deep); cursor: pointer; text-decoration: none;
  border-bottom: 1px solid var(--accent);
}
.carousel-hint .open-link:hover { color: var(--accent); }

/* ===========================================================
   FULLSCREEN LIGHTBOX
   =========================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(13, 27, 42, 0.96);
  display: none; align-items: center; justify-content: center;
  padding: 0;
  animation: lb-in 0.25s ease;
}
.lightbox.active { display: flex; }
@keyframes lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.lightbox-close {
  position: absolute; top: 24px; right: 24px; z-index: 1010;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2);
  color: var(--white); width: 48px; height: 48px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.6rem; line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}
.lightbox-close:hover { background: var(--accent); border-color: var(--accent); color: var(--black); }
.lightbox-counter {
  position: absolute; top: 32px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.6); z-index: 1010;
}
.lightbox-stage {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 20px;
}
.lightbox-slide-host {
  width: min(90vh, 90vw); height: min(90vh, 90vw);
  max-width: 1080px; max-height: 1080px;
  position: relative; background: var(--white);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}
/* The slide cloned into the lightbox renders at full 1080×1080 then is scaled to fit */
.lightbox-slide-host .slide {
  width: 1080px; height: 1080px;
  transform-origin: top left;
}
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 1010;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25);
  color: var(--white); width: 56px; height: 56px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.8rem; line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover, .lightbox-next:hover {
  background: var(--accent); border-color: var(--accent); color: var(--black);
}
.lightbox-prev:disabled, .lightbox-next:disabled { opacity: 0.3; cursor: not-allowed; }
@media (max-width: 768px) {
  .lightbox-prev { left: 8px; width: 44px; height: 44px; font-size: 1.4rem; }
  .lightbox-next { right: 8px; width: 44px; height: 44px; font-size: 1.4rem; }
  .lightbox-stage { padding: 70px 12px; }
}

body.lightbox-open { overflow: hidden; }

/* ===========================================================
   POST-TEXT (the LinkedIn version)
   =========================================================== */
.post-text {
  max-width: 720px; margin: 3rem auto 0;
  padding: 2.5rem; background: var(--off-white);
  border-left: 2px solid var(--accent);
}
.post-text p {
  font-family: var(--serif); font-size: 1.1rem; font-weight: 400;
  line-height: 1.65; color: var(--dark-grey); margin-bottom: 1rem;
}
.post-text p:last-of-type { margin-bottom: 0; }

/* ===========================================================
   ACTION BAR (download / share)
   =========================================================== */
.action-bar {
  max-width: 1080px; margin: 2rem auto 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.8rem;
  padding: 1.2rem 1.4rem; background: var(--off-white);
  border: 1px solid var(--light-grey);
}
.action-bar .label {
  font-family: var(--mono); font-size: 0.65rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--mid-grey);
}
.action-bar .pdf-buttons {
  display: inline-flex; gap: 0.6rem; flex-wrap: wrap;
}
.download-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--accent);
  color: var(--accent-deep); padding: 0.75rem 1.4rem;
  font-family: var(--sans); font-size: 0.74rem;
  font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.download-btn:hover { background: var(--accent); color: var(--white); }
.download-btn:disabled { opacity: 0.5; cursor: wait; }
.download-btn svg { width: 14px; height: 14px; }

/* Share button — same shape as download, but filled accent so it reads as a
   distinct action ("share" feels stronger than "download" on mobile). */
.share-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); border: 1px solid var(--accent);
  color: var(--white); padding: 0.75rem 1.4rem;
  font-family: var(--sans); font-size: 0.74rem;
  font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; text-decoration: none;
  transition: background 0.2s, color 0.2s, opacity 0.2s;
}
.share-btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.share-btn:disabled { opacity: 0.5; cursor: wait; }
.share-btn svg { width: 14px; height: 14px; }

/* Tiny progress indicator for PDF generation */
.pdf-progress {
  display: none;
  font-family: var(--mono); font-size: 0.65rem;
  color: var(--accent-deep); letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pdf-progress.active { display: inline-flex; align-items: center; gap: 8px; }
.pdf-progress::before {
  content: ''; display: inline-block; width: 10px; height: 10px;
  border: 2px solid var(--light-grey); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================================
   PAGE FOOTER
   =========================================================== */
.page-footer {
  background: var(--black); color: rgba(255,255,255,0.75);
  padding: 4rem 2rem 3rem; margin-top: 6rem;
}
.page-footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 3rem; align-items: center;
}
.page-footer .brand-mark {
  display: flex; align-items: center; gap: 14px;
  background: var(--logo-navy); border-radius: 10px; padding: 6px 18px 6px 6px;
}
.page-footer .brand-mark img { width: 40px; height: 40px; border-radius: 6px; }
.page-footer .brand-mark .name {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  letter-spacing: 0.04em; color: #fff; line-height: 1;
}
.page-footer .brand-mark .name span { font-weight: 300; color: rgba(255,255,255,0.75); }
.page-footer .footer-text { font-family: var(--sans); font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.page-footer .footer-cta {
  font-family: var(--sans); font-size: 0.78rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  text-decoration: none; border: 1px solid var(--accent);
  padding: 0.9rem 1.6rem; transition: background 0.2s, color 0.2s;
}
.page-footer .footer-cta:hover { background: var(--accent); color: var(--black); }

/* ===========================================================
   SLIDE INTERNALS — shared across all slide types
   =========================================================== */
.slide.bg-paper { background: var(--white); }
.slide.bg-dark { background: var(--black); color: var(--white); }
.slide.bg-soft { background: var(--off-white); }

.slide-content {
  position: absolute; inset: 0;
  padding: 64px 76px;
  display: flex; flex-direction: column; z-index: 3;
}

.slide-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--light-grey);
  padding-bottom: 18px; margin-bottom: 40px;
}
.slide.bg-dark .slide-header { border-bottom-color: rgba(255,255,255,0.18); }

.slide-logo {
  display: flex; align-items: center; gap: 12px;
  background: var(--logo-navy); border-radius: 10px;
  padding: 6px 18px 6px 6px;
}
.slide-logo img { width: 40px; height: 40px; border-radius: 6px; display: block; }
.slide-logo .wordmark { line-height: 1; }
.slide-logo .wordmark .name {
  font-family: var(--serif); font-size: 1.15rem; font-weight: 600;
  letter-spacing: 0.04em; color: #fff; display: block;
}
.slide-logo .wordmark .name span { font-weight: 300; color: rgba(255,255,255,0.75); }

.slide-meta {
  font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--mid-grey); text-align: right; line-height: 1.7;
}
.slide.bg-dark .slide-meta { color: rgba(255,255,255,0.55); }

.slide-eyebrow {
  font-family: var(--sans); font-size: 0.72rem;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 22px;
  display: flex; align-items: center; gap: 0.7rem;
}
.slide-eyebrow::before {
  content: ''; display: inline-block; width: 1.5rem; height: 1px; background: var(--accent);
}

.slide-h1 {
  font-family: var(--serif); font-weight: 300;
  font-size: 4.2rem; line-height: 1; letter-spacing: -0.02em;
  color: var(--black); margin-bottom: 28px;
}
.slide-h1 em { font-style: italic; color: var(--mid-grey); font-weight: 400; }

.slide-h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: 2.6rem; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--black); margin-bottom: 24px;
}
.slide-h2 em { font-style: italic; color: var(--accent-deep); }

.slide-h2-italic {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: 2.1rem; line-height: 1.1; letter-spacing: -0.01em;
  color: var(--black); margin-bottom: 14px;
}

.slide-sub {
  font-family: var(--sans); font-weight: 300; font-size: 0.92rem;
  color: var(--mid-grey); margin-bottom: 26px; line-height: 1.55;
}

.slide-body {
  font-family: var(--serif); font-weight: 400; font-size: 1.1rem;
  line-height: 1.55; color: var(--dark-grey);
}
.slide-body em { color: var(--accent-deep); font-style: italic; }
.slide-body p + p { margin-top: 14px; }

.slide.bg-dark .slide-h1, .slide.bg-dark .slide-h2 { color: var(--white); }
.slide.bg-dark .slide-h1 em { color: var(--accent); }
.slide.bg-dark .slide-h2 em { color: var(--accent); }
.slide.bg-dark .slide-body { color: rgba(255,255,255,0.78); }

/* Stats strip */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 32px; border-top: 1px solid var(--light-grey); padding-top: 24px;
}
.stat { padding-right: 22px; border-right: 1px solid var(--light-grey); }
.stat:last-child { border-right: none; padding-right: 0; }
.stat .v {
  font-family: var(--serif); font-weight: 400; font-size: 2.4rem;
  line-height: 1; letter-spacing: -0.02em; color: var(--black); margin-bottom: 8px;
}
.stat .v sup { font-size: 1.1rem; color: var(--accent); margin-left: 2px; }
.stat .l {
  font-family: var(--sans); font-size: 0.7rem; color: var(--mid-grey);
  line-height: 1.4; letter-spacing: 0.04em;
}

/* Chart panel */
.chart-panel {
  background: var(--off-white); border: 1px solid var(--light-grey);
  padding: 28px; display: flex; flex-direction: column;
  height: 100%; position: relative;
}
.chart-panel::before {
  content: "FIG."; position: absolute; top: 12px; right: 16px;
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.22em; color: var(--mid-grey);
}
.chart-title {
  font-family: var(--serif); font-weight: 500; font-size: 1.08rem;
  color: var(--black); margin-bottom: 4px;
}
.chart-sub {
  font-family: var(--sans); font-size: 0.7rem; color: var(--mid-grey); margin-bottom: 18px;
}
.chart-svg { flex: 1; width: 100%; height: auto; }
.chart-legend {
  display: flex; gap: 16px; margin-top: 12px;
  font-family: var(--mono); font-size: 0.6rem;
  color: var(--mid-grey); letter-spacing: 0.05em;
}
.chart-legend .leg-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; margin-right: 6px; vertical-align: middle;
}

/* Insight rows (3-flag slides) */
.insight {
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 14px; align-items: start;
  padding: 18px 0; border-top: 1px solid var(--light-grey);
}
.insight:last-child { border-bottom: 1px solid var(--light-grey); }
.insight .num {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  font-size: 1.7rem; color: var(--accent); line-height: 1;
}
.insight .text {
  font-family: var(--serif); font-weight: 400; font-size: 1.02rem;
  line-height: 1.45; color: var(--dark-grey);
}
.insight .text strong {
  font-weight: 500; color: var(--black);
  background: linear-gradient(transparent 60%, rgba(200,169,110,0.25) 60%);
  padding: 0 2px;
}
.insight .pill {
  font-family: var(--mono); font-size: 0.58rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent-deep); border: 1px solid var(--accent);
  padding: 5px 11px; border-radius: 100px;
  white-space: nowrap; margin-top: 4px;
}

/* CTA slide signature */
.signature-row {
  margin-top: auto; padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.2);
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px; align-items: end; position: relative; z-index: 3;
}
.signature { display: flex; align-items: center; gap: 16px; }
.sig-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--white); color: var(--black);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 500; font-size: 1.4rem;
  flex-shrink: 0; border: 1px solid var(--accent);
}
.signature .name {
  font-family: var(--serif); font-size: 1.55rem; font-weight: 400;
  color: var(--white); line-height: 1; margin-bottom: 8px; letter-spacing: -0.01em;
}
.signature .title-meta {
  font-family: var(--sans); font-size: 0.74rem;
  color: rgba(255,255,255,0.7); line-height: 1.65; font-weight: 300;
}
.signature .title-meta a {
  color: rgba(255,255,255,0.9); text-decoration: none;
  border-bottom: 1px solid rgba(200,169,110,0.5);
}

.cta-pill {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--black);
  padding: 16px 26px; font-family: var(--sans);
  font-size: 0.74rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  white-space: nowrap; text-decoration: none;
  transition: background 0.2s;
}
.cta-pill:hover { background: var(--accent-deep); }
.cta-pill .arrow { font-family: var(--serif); font-size: 1.05rem; text-transform: none; }

.slide.bg-dark .grid-bg {
  position: absolute; inset: 0; z-index: 1; opacity: 0.04;
  background-image:
    linear-gradient(var(--white) 1px, transparent 1px),
    linear-gradient(90deg, var(--white) 1px, transparent 1px);
  background-size: 60px 60px;
}
.slide.bg-dark .accent-glow {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(ellipse at 75% 15%, rgba(200,169,110,0.18) 0%, transparent 55%),
    radial-gradient(circle at 5% 95%, rgba(200,169,110,0.08) 0%, transparent 55%);
}

/* ===========================================================
   PDF RENDER MODE — when html2pdf.js renders the slides offscreen
   =========================================================== */
.pdf-render-host {
  /* Render on-screen but invisible — html2canvas needs the element to be
     within viewport flow to capture reliably across browsers.
     opacity:0 + pointer-events:none + zero height container hides it from users. */
  position: fixed; left: 0; top: 0;
  width: 1080px;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.pdf-render-host .pdf-slide {
  width: 1080px; height: 1080px;
  page-break-inside: avoid; page-break-after: always;
  position: relative; overflow: hidden;
}
.pdf-render-host .pdf-slide:last-child { page-break-after: auto; }
.pdf-render-host .pdf-slide .slide {
  position: relative !important;
  width: 1080px; height: 1080px;
  transform: none !important;
}

/* PDF FONT BOOST — bump key text elements ~15-20% for readability when printed */
.pdf-render-host .slide-h1 { font-size: 4.8rem !important; line-height: 1.02 !important; }
.pdf-render-host .slide-h2 { font-size: 3rem !important; line-height: 1.12 !important; }
.pdf-render-host .slide-h2-italic { font-size: 2.4rem !important; }
.pdf-render-host .slide-eyebrow { font-size: 0.85rem !important; letter-spacing: 0.22em !important; }
.pdf-render-host .slide-sub { font-size: 1.05rem !important; line-height: 1.6 !important; }
.pdf-render-host .slide-body { font-size: 1.25rem !important; line-height: 1.55 !important; }
.pdf-render-host .insight .text { font-size: 1.18rem !important; line-height: 1.5 !important; }
.pdf-render-host .insight .num { font-size: 2rem !important; }
.pdf-render-host .insight .pill { font-size: 0.7rem !important; padding: 6px 13px !important; }
.pdf-render-host .stat .v { font-size: 2.7rem !important; }
.pdf-render-host .stat .l { font-size: 0.82rem !important; line-height: 1.45 !important; }
.pdf-render-host .chart-title { font-size: 1.25rem !important; }
.pdf-render-host .chart-sub { font-size: 0.82rem !important; }
.pdf-render-host .chart-legend { font-size: 0.72rem !important; }
.pdf-render-host .signature .name { font-size: 1.8rem !important; }
.pdf-render-host .signature .title-meta { font-size: 0.92rem !important; line-height: 1.7 !important; }
.pdf-render-host .signature .title-meta span { font-size: 0.85rem !important; }
.pdf-render-host .signature .title-meta a { font-size: inherit !important; }
.pdf-render-host .slide-meta { font-size: 0.74rem !important; }
.pdf-render-host .slide-logo .wordmark .name { font-size: 1.3rem !important; }
.pdf-render-host .cta-pill { font-size: 0.86rem !important; padding: 18px 30px !important; }


/* ===========================================================
   INLINE LANGUAGE SWITCHER (newsletter pages)
   =========================================================== */
.lang-switcher-inline {
  display: inline-flex;
  gap: 0.4rem;
  margin-left: 1.6rem;
  padding-left: 1.6rem;
  border-left: 1px solid var(--light-grey);
  align-items: center;
}
.lang-switcher-inline .lang-link {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid-grey);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.lang-switcher-inline .lang-link:hover {
  color: var(--accent-deep);
  border-color: var(--light-grey);
}
.lang-switcher-inline .lang-link.active {
  color: var(--black);
  border-color: var(--accent);
}

/* ===========================================================
   RTL (Arabic) overrides for newsletter pages
   =========================================================== */
html[dir="rtl"] body { direction: rtl; text-align: right; }
html[dir="rtl"] .page-nav .nav-links { flex-direction: row-reverse; }
html[dir="rtl"] .lang-switcher-inline {
  margin-left: 0;
  margin-right: 1.6rem;
  padding-left: 0;
  padding-right: 1.6rem;
  border-left: none;
  border-right: 1px solid var(--light-grey);
}
html[dir="rtl"] .page-header .eyebrow::before { display: none; }
html[dir="rtl"] .page-header .eyebrow::after {
  content: '';
  display: inline-block;
  width: 2rem;
  height: 1px;
  background: var(--accent);
  margin-right: 0.8rem;
}
html[dir="rtl"] .issue-card .meta { flex-direction: row-reverse; }
html[dir="rtl"] .issue-card .actions { flex-direction: row-reverse; }
html[dir="rtl"] .issue-card .pdf-link { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .back-link { flex-direction: row-reverse; }
html[dir="rtl"] .slide-eyebrow::before { display: none; }
html[dir="rtl"] .slide-eyebrow::after {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  margin-right: 0.7rem;
}
html[dir="rtl"] .insight { grid-template-columns: auto 1fr 44px; }
html[dir="rtl"] .stat { padding-right: 0; padding-left: 22px; border-right: none; border-left: 1px solid var(--light-grey); }
html[dir="rtl"] .stat:last-child { border-left: none; padding-left: 0; }
html[dir="rtl"] .signature { flex-direction: row-reverse; }
html[dir="rtl"] .page-footer-inner { direction: rtl; }

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {
  .page-nav { padding: 0.8rem 1rem; }
  .lang-switcher-inline {
    margin-left: 1rem;
    padding-left: 1rem;
  }
  .lang-switcher-inline .lang-link {
    font-size: 0.62rem;
    padding: 0.3rem 0.45rem;
    letter-spacing: 0.1em;
  }

  .page-nav .brand-mark .name { font-size: 1rem; }
  .page-nav .nav-links { gap: 1.2rem; }
  .page-nav .nav-links a { font-size: 0.7rem; letter-spacing: 0.1em; }
  .page-header { padding: 4rem 1rem 3rem; }
  .issue { padding: 3rem 1rem 2rem; }
  .issue-header { grid-template-columns: 1fr; }
  .issue-header .date-block { text-align: left; }
  .post-text { padding: 1.5rem; }
  .page-footer-inner { grid-template-columns: 1fr; text-align: center; }
  .page-footer .brand-mark { margin: 0 auto; }
}

/* ===========================================================
   PRINT STYLES — fallback when html2pdf fails. User picks
   "Save as PDF" in their browser's print dialog and gets a
   clean output (no nav, no buttons, one slide per page).
   =========================================================== */
@media print {
  /* Hide everything that's not the slides */
  .page-nav,
  .page-footer,
  .pdf-progress,
  .download-btn,
  .share-btn,
  .download-row,
  .action-bar,
  .pager,
  .controls,
  .carousel-controls,
  [data-prev], [data-next],
  [data-fullscreen],
  .lightbox,
  .lightbox-overlay,
  #newsletter-lightbox,
  .back-link,
  .post-text,
  .lang-switcher-inline {
    display: none !important;
  }

  /* Reset body */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  /* Show all slides stacked, one per page */
  .carousel,
  [data-carousel] {
    overflow: visible !important;
  }
  [data-track] {
    transform: none !important;
    width: auto !important;
    display: block !important;
  }
  .slide-wrap {
    width: 100% !important;
    page-break-after: always;
    page-break-inside: avoid;
    display: block !important;
  }
  .slide-wrap:last-child { page-break-after: auto; }
  .slide {
    transform: none !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 90vh;
    box-shadow: none !important;
  }

  /* Make sure dark slides don't use up all toner */
  .slide.bg-dark {
    background: #1A1917 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Force background colours and images to print */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


/* ===========================================================
   MOBILE CAROUSEL UX — bigger hint, touch cues, minor polish
   =========================================================== */
@media (max-width: 768px) {
  /* The slide-track needs touch-action to let our JS take over horizontal pan
     while still letting vertical scroll bubble up to the page. */
  .carousel-frame,
  .slide-track {
    touch-action: pan-y pinch-zoom;
    -webkit-user-select: none;
    user-select: none;
  }

  /* Make the carousel hint clearly visible on mobile so users know they
     can swipe and tap to enlarge. */
  .carousel-hint {
    font-size: 0.78rem;
    color: var(--accent-deep);
    background: rgba(200, 169, 110, 0.08);
    padding: 0.7rem 1rem;
    border: 1px solid rgba(200, 169, 110, 0.3);
    margin-bottom: 0.8rem;
    border-radius: 2px;
  }
  .carousel-hint .open-link {
    color: var(--accent-deep);
    font-weight: 500;
  }

  /* Enlarge the carousel slightly on mobile by reducing wrapper padding */
  .carousel { margin-bottom: 1.5rem; }
  .carousel-frame { border-radius: 4px; }

  /* Make the bottom controls (pager + fullscreen) more thumb-friendly */
  .carousel-controls .pager .dot {
    width: 12px; height: 12px;
  }
  .carousel-controls .pager .dot.active {
    transform: scale(1.4);
  }

  /* Hide previous/next arrow buttons on mobile — swipe is the way */
  .carousel-btn { display: none; }

  /* Add a subtle "swipe" cue that animates the first time */
  .carousel-frame::after {
    content: '';
    position: absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    pointer-events: none;
  }
}
