/* ================================================
   DP-SECTIONS — Scoped styles for imported sections
   Fonts:  Cormorant Garamond + DM Sans (loaded globally via Google Fonts)
   Colors: #000000 | #FFFFFF | #92BA44  — matches main site palette
   All rules scoped under #dp-sections to avoid conflicts
================================================ */

/* Reveal: support both .visible (main.js adds this) and .is-visible (source uses this) */
.reveal.is-visible {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ── Root variables ─────────────────────────────────────────── */
#dp-sections {
  --font-title:      'Cormorant Garamond', Georgia, serif;
  --font-ui:         'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --bg-dark:         #000000;   /* pure black — matches main site */
  --green:           #92BA44;
  --black:           #000000;
  --white:           #ffffff;
  --line:            1px;
  --x:               3vw;
  /* Typography scale — aligned with main site */
  --h1-fluid:        clamp(4rem, 9vw, 10rem);
  --p-fluid:         clamp(1rem, 1.2vw, 1.125rem);
  --sec-h-fluid:     clamp(2.2rem, 4.5vw, 4.5rem);
  --sec-p-fluid:     clamp(0.95rem, 1.1vw, 1.1rem);
  /* Layout helpers */
  --img1-h-desktop:  68vh;
  --img1-h-mobile:   52vw;
  --img2-maxw:       1200px;
  --reveal-ease:     cubic-bezier(.19, 1, .22, 1);
}

/* ════════════════════════════════════════════════════════════
   DARK BAND  —  THE BOOK
════════════════════════════════════════════════════════════ */
#dp-sections .band {
  width: 100%;
  background: var(--bg-dark);
  color: var(--white);
  padding-top: calc(var(--x) * 1.5);
  padding-bottom: calc(var(--x) * 1.5);
}

#dp-sections .band-header {
  width: 100%;
  padding: 0 calc(var(--x) * 2) calc(var(--x) * 0.8);
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

#dp-sections .book-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green);
  user-select: none;
}

#dp-sections .book-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── BOOK HERO GRID ─────────────────────────────────────── */
#dp-sections .hero {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr var(--line) 1fr;
  align-items: stretch;
}

#dp-sections .hero-left {
  padding: calc(var(--x) * 2) var(--x) calc(var(--x) * 2) calc(var(--x) * 2);
  display: flex;
  align-items: center;
}

#dp-sections .hero-divider {
  width: var(--line);
  background: rgba(255, 255, 255, 0.1);
}

#dp-sections .hero-right {
  padding: calc(var(--x) * 2) calc(var(--x) * 2) calc(var(--x) * 2) var(--x);
  display: flex;
  align-items: center;
}

#dp-sections .hero-content { width: 100%; }

#dp-sections .book-img-01 {
  width: 100%;
  height: var(--img1-h-desktop);
  object-fit: contain;
  object-position: center;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
#dp-sections .float {
  animation: floaty 4.5s ease-in-out infinite;
  will-change: transform;
}

/* Title — Cormorant Garamond, elegant thin weight like main site h1 */
#dp-sections .hero-title {
  font-family: var(--font-title);
  font-size: var(--h1-fluid);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: calc(var(--x) * 0.8);
}
#dp-sections .hero-title span { display: block; }

#dp-sections .hero-text {
  font-family: var(--font-ui);
  font-size: var(--p-fluid);
  font-weight: 300;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: calc(var(--x) * 0.9);
  white-space: pre-line;
}

/* CTA — matches main site's .nav-cta-btn aesthetic */
#dp-sections .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2.25rem;
  background: var(--green);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.3s var(--reveal-ease);
}
#dp-sections .cta:hover { background: rgba(255, 255, 255, 0.12); }
#dp-sections .cta:active { transform: translateY(1px); }

/* ════════════════════════════════════════════════════════════
   WHITE SECTION  —  Book preview
════════════════════════════════════════════════════════════ */
#dp-sections .section-white {
  width: 100%;
  background: var(--white);
  color: var(--black);
  padding: calc(var(--x) * 2.5) calc(var(--x) * 2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#dp-sections .sec-title {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: var(--sec-h-fluid);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--x) * 0.8);
  color: #000;
}

#dp-sections .sec-text {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--sec-p-fluid);
  line-height: 1.75;
  max-width: 860px;
  margin-bottom: calc(var(--x) * 1.2);
  color: rgba(0, 0, 0, 0.6);
}

#dp-sections .sec-img-wrap { width: 100%; max-width: var(--img2-maxw); }
#dp-sections .book-img-02  { width: 100%; height: auto; }

/* ════════════════════════════════════════════════════════════
   SERVICES  —  accordion
════════════════════════════════════════════════════════════ */
#dp-sections .services-section {
  width: 100%;
  background: var(--white);
  color: var(--black);
  padding: var(--sec-pad, clamp(5rem, 10vw, 10rem)) 0;
}

#dp-sections .services-section > .services-top,
#dp-sections .services-section > .services-list {
  max-width: var(--max-w, 1400px);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--pad, clamp(1.5rem, 4vw, 4rem));
  padding-right: var(--pad, clamp(1.5rem, 4vw, 4rem));
}

#dp-sections .services-top {
  margin-bottom: 1.5rem;
}

#dp-sections .services-list    { width: 100%; }
#dp-sections .service-item     { border-top: 1px solid rgba(0, 0, 0, 0.1); }
#dp-sections .service-item-last { border-bottom: 1px solid rgba(0, 0, 0, 0.1); }

#dp-sections .service-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: calc(var(--x) * 0.85) 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

/* Service title — Cormorant Garamond, same scale as main site h2 */
#dp-sections .service-title {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: clamp(2.5rem, 5.5vw, 6rem);
  letter-spacing: -0.02em;
  line-height: 1.0;
  color: #000;
  transition: color 0.2s ease;
}

/* Service icon — inline SVG + cross rotation */
#dp-sections .service-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.3);
  transition: transform 0.3s var(--reveal-ease), color 0.2s ease;
}

#dp-sections .service-row:hover           .service-title,
#dp-sections .service-row:focus-visible   .service-title { color: var(--green); }
#dp-sections .service-row:hover           .service-icon,
#dp-sections .service-row:focus-visible   .service-icon  { color: var(--green); }

#dp-sections .service-row[aria-expanded="true"] .service-title { color: var(--green); }
#dp-sections .service-row[aria-expanded="true"] .service-icon  {
  color: var(--green);
  transform: rotate(45deg);
}

#dp-sections .service-panel {
  font-family: var(--font-ui);
  font-weight: 300;
  color: rgba(0, 0, 0, 0.55);
  line-height: 1.8;
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  padding-bottom: calc(var(--x) * 1.2);
  max-width: 820px;
}

/* ════════════════════════════════════════════════════════════
   INSIGHTS  —  header + carousels
════════════════════════════════════════════════════════════ */
#dp-sections .insights-section {
  width: 100%;
  background: var(--white);
  color: #000;
  padding: var(--sec-pad, clamp(5rem, 10vw, 10rem)) 0;
}

#dp-sections .insights-top {
  max-width: var(--max-w, 1400px);
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--pad, clamp(1.5rem, 4vw, 4rem));
  margin-bottom: 1.5rem;
}

#dp-sections .insights-header {
  padding: calc(var(--x) * 1.8) calc(var(--x) * 2) calc(var(--x) * 1.5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#dp-sections .insights-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: calc(var(--x) * 0.8);
}

#dp-sections .insights-title {
  font-family: var(--font-title);
  font-weight: 300;
  font-size: var(--sec-h-fluid);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--x) * 0.6);
  color: #000;
}

#dp-sections .insights-sub {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: var(--sec-p-fluid);
  line-height: 1.75;
  max-width: 720px;
  color: rgba(0, 0, 0, 0.5);
  white-space: pre-line;
}

/* Dark-context variant — used on insights.html (dark page bg) */
#dp-sections .insights-header.on-dark { background: #000; }
#dp-sections .insights-header.on-dark .insights-title { color: var(--white); }
#dp-sections .insights-header.on-dark .insights-sub   { color: rgba(255, 255, 255, 0.5); }
#dp-sections .insights-header.on-dark .insights-icon  { filter: brightness(0) invert(1); }

/* ── Carousel ─────────────────────────────────────────────── */
#dp-sections .insights-band {
  position: relative;
  width: 100%;
  background: var(--bg-dark);
  padding: calc(var(--x) * 2) 0;
  overflow: hidden;
}

#dp-sections .carousel-viewport { width: 100%; overflow: hidden; }

#dp-sections .carousel-track {
  display: flex;
  gap: 16px;
  padding-left: calc(var(--x) * 2);
  padding-right: calc(var(--x) * 2);
  will-change: transform;
  transition: transform 520ms var(--reveal-ease);
}
@media (prefers-reduced-motion: reduce) {
  #dp-sections .carousel-track { transition: none !important; }
}

#dp-sections .carousel-slide {
  flex: 0 0 clamp(300px, 38vw, 700px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
#dp-sections .carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#dp-sections .yt-clickable { cursor: pointer; }

/* Carousel buttons — circular, matches main site aesthetic */
#dp-sections .carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 20;
  transition: border-color 0.25s ease, color 0.25s ease;
}
#dp-sections .carousel-btn:hover,
#dp-sections .carousel-btn:focus-visible {
  border-color: var(--green);
  color: var(--green);
  outline: none;
}
#dp-sections .carousel-btn.prev { left:  calc(var(--x) * 2); }
#dp-sections .carousel-btn.next { right: calc(var(--x) * 2); }
#dp-sections .carousel-btn svg  { pointer-events: none; }

/* ════════════════════════════════════════════════════════════
   YOUTUBE MODAL  —  global (not scoped to #dp-sections)
════════════════════════════════════════════════════════════ */
.yt-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.yt-modal.is-open { display: block; }

.yt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.yt-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 960px);
  aspect-ratio: 16 / 9;
  background: #000;
}

.yt-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  font-size: 1.75rem;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s;
  font-family: 'DM Sans', sans-serif;
}
.yt-close:hover { color: #fff; }

.yt-frame          { width: 100%; height: 100%; }
.yt-frame iframe   { width: 100%; height: 100%; border: 0; display: block; }
body.no-scroll     { overflow: hidden; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  #dp-sections .hero               { grid-template-columns: 1fr; }
  #dp-sections .hero-divider       { display: none; }
  #dp-sections .hero-left          { padding: var(--x) var(--x) calc(var(--x) * 0.5); }
  #dp-sections .hero-right         { padding: calc(var(--x) * 0.5) var(--x) var(--x); align-items: flex-start; }
}

@media (max-width: 768px) {
  #dp-sections .band-header        { padding: 0 var(--x) calc(var(--x) * 0.6); }
  #dp-sections .hero-title         { font-size: clamp(3rem, 14vw, 5rem); }
  #dp-sections .book-img-01        { height: var(--img1-h-mobile); }
  #dp-sections .cta                { width: 100%; justify-content: center; }
  #dp-sections .section-white      { padding: calc(var(--x) * 1.8) var(--x); }
  #dp-sections .services-section   { padding: clamp(3rem, 6vw, 5rem) 0; }
  #dp-sections .service-title      { font-size: clamp(2rem, 8vw, 3.5rem); }
  #dp-sections .service-icon       { width: 22px; height: 22px; }
  #dp-sections .insights-section   { padding: clamp(3rem, 6vw, 5rem) 0; }
  #dp-sections .insights-header    { padding: calc(var(--x) * 1.5) var(--x) var(--x); }
  #dp-sections .insights-band      { padding: calc(var(--x) * 1.5) 0; }
  #dp-sections .carousel-track     { padding-left: var(--x); padding-right: var(--x); gap: 10px; }
  #dp-sections .carousel-slide     { flex-basis: 82vw; }
  #dp-sections .carousel-btn       { width: 40px; height: 40px; }
  #dp-sections .carousel-btn.prev  { left: var(--x); }
  #dp-sections .carousel-btn.next  { right: var(--x); }
}

@media (prefers-reduced-motion: reduce) {
  #dp-sections .float { animation: none; }
  #dp-sections .cta   { transition: none; }
}

/* ════════════════════════════════════════════════════════════
   MEDIUM JOURNAL SLIDES — overlay with title + date
════════════════════════════════════════════════════════════ */
#dp-sections .medium-slide {
  position: relative;
  cursor: pointer;
}
#dp-sections .medium-slide img {
  transition: transform 0.5s ease;
}
#dp-sections .medium-slide:hover img {
  transform: scale(1.04);
}

#dp-sections .medium-slide__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.15) 55%, transparent 100%);
  pointer-events: none;
  transition: background 0.35s ease;
}
#dp-sections .medium-slide:hover .medium-slide__overlay {
  background: linear-gradient(0deg, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.25) 60%, transparent 100%);
}

#dp-sections .medium-slide__date {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.35rem;
}

#dp-sections .medium-slide__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
  font-weight: 400;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ════════════════════════════════════════════════════════════
   MEDIUM ARTICLE PREVIEW MODAL
════════════════════════════════════════════════════════════ */
.medium-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.medium-modal.is-open { display: block; }

.medium-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}

.medium-modal__dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 680px);
  max-height: 85vh;
  background: #111;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.medium-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0,0,0,0.5);
  border: 0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
  font-family: 'DM Sans', sans-serif;
}
.medium-modal__close:hover {
  color: #fff;
  background: rgba(0,0,0,0.8);
}

.medium-modal__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.medium-modal__body {
  padding: 2rem 2rem 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.medium-modal__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 400;
  line-height: 1.25;
  color: #fff;
  margin: 0 0 0.75rem;
}

.medium-modal__meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.25rem;
}

.medium-modal__desc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
  margin-bottom: 2rem;
}

.medium-modal__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.medium-modal__link:hover {
  border-color: var(--green, #c8e84e);
  color: var(--green, #c8e84e);
}
.medium-modal__link svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}
.medium-modal__link:hover svg {
  transform: translateX(3px);
}

@media (max-width: 768px) {
  .medium-modal__dialog { width: 96vw; max-height: 90vh; }
  .medium-modal__body   { padding: 1.5rem; }
  #dp-sections .medium-slide__overlay { padding: 1rem; }
  #dp-sections .medium-slide__title   { font-size: 1rem; }
}
