/* ============================================
   CAMP THEME — Main Stylesheet
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Palette */
  --color-teal: #1A7A8A;
  --color-teal-dark: #145F6B;
  --color-orange: #D96B3F;
  --color-orange-dark: #C25A32;
  --color-cream: #E5D9C5;
  --color-cream-light: #F0EAD6;
  --color-white: #FFFFFF;
  --color-dark: #1A1A1A;
  --color-muted: #6B6B6B;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-gap: 64px;
  --container-padding: 20px;
  --card-radius: 16px;
  --btn-radius: 999px;

  /* Sizes */
  --container-max: 1200px;
}

@media (min-width: 768px) {
  :root {
    --section-gap: 96px;
    --container-padding: 40px;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  color: var(--color-dark);
  background: var(--color-cream);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 500px;
  overflow: hidden;
  background: var(--color-teal);
}

/* --- Mobile: full-screen media with overlay text --- */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__media img,
.hero__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video fades in over the cover image once loaded */
.hero__media video {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero__media video.is-ready {
  opacity: 1;
}

/* --- Ghost video cards: hide play overlay, autoplay --- */
.kg-video-card .kg-video-overlay {
  display: none;
}

/* Gradient overlay for text readability */
.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 68%,
    rgba(0, 0, 0, 0.16) 84%,
    rgba(0, 0, 0, 0.28) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--container-padding) 60px;
}

.hero__title {
  font-size: clamp(28px, 7vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-white);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  max-width: 600px;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  background: var(--color-orange);
  color: var(--color-white);
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--btn-radius);
  transition: background 0.2s ease, transform 0.15s ease;
  align-self: flex-start;
}

.hero__cta:hover {
  background: var(--color-orange-dark);
  transform: translateY(-1px);
}

.hero__cta:active {
  transform: translateY(0);
}

/* --- Desktop: split layout 50/50 --- */
@media (min-width: 768px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .hero__content {
    justify-content: center;
    padding: 60px;
    padding-left: max(40px, calc((100vw - var(--container-max)) / 2 + var(--container-padding)));
  background: transparent;
}

  .hero__media {
    position: relative;
    inset: auto;
    z-index: 1;
  }

  .hero__overlay {
    display: none;
  }

  .hero__title {
    font-size: clamp(36px, 4vw, 56px);
    margin-bottom: 32px;
  }

  .hero__cta {
    font-size: 18px;
    padding: 18px 36px;
  }
}

/* ============================================
   SECTION: WHERE & WHEN (cards)
   ============================================ */
.camps-section {
  background: var(--color-cream);
  padding: var(--section-gap) 0;
}

.camps-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 8px;
}

.camps-section__title {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 700;
  color: var(--color-dark);
  letter-spacing: -0.02em;
}

.camps-section__map-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  transition: color 0.2s ease;
}

.camps-section__map-link:hover {
  color: var(--color-orange);
}

/* Camps Subsections */
.camps-subsection {
  margin-bottom: 48px;
}

.camps-subsection:last-child {
  margin-bottom: 0;
}

.camps-subsection__header {
  margin-bottom: 20px;
}

.camps-subsection__title {
  font-size: clamp(18px, 4vw, 24px);
  font-weight: 700;
  color: var(--color-teal);
  margin: 0 0 4px 0;
}

.camps-subsection__desc {
  font-size: 14px;
  color: var(--color-muted);
  margin: 0;
  line-height: 1.4;
}

/* Races subsection — orange accent */
.camps-subsection--races .camps-subsection__title {
  color: var(--color-orange);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 768px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

/* ============================================
   CARDS CAROUSEL — horizontal scrollable rail
   ============================================ */
.cards-carousel {
  position: relative;
}

.cards-carousel .cards-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 12px var(--container-padding, 20px);
  margin-left: calc(-1 * var(--container-padding, 20px));
  margin-right: calc(-1 * var(--container-padding, 20px));
}

.cards-carousel .cards-grid::-webkit-scrollbar {
  display: none;
}

.cards-carousel .cards-grid .card {
  flex: 0 0 60vw;
  max-width: 280px;
  scroll-snap-align: start;
}

.cards-carousel__btn {
  display: none;
}

@media (min-width: 768px) {
  .cards-carousel .cards-grid {
    gap: 20px;
  }

  .cards-carousel .cards-grid .card {
    flex: 0 0 calc(25% - 15px);
    max-width: none;
  }

  .cards-carousel__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    color: var(--color-dark);
    transition: opacity 0.2s, background 0.2s;
  }

  .cards-carousel__btn:hover {
    background: #fff;
  }

  .cards-carousel__btn:disabled {
    opacity: 0.3;
    pointer-events: none;
  }

  .cards-carousel__btn svg {
    width: 20px;
    height: 20px;
  }

  .cards-carousel__btn--prev {
    left: -22px;
  }

  .cards-carousel__btn--next {
    right: -22px;
  }
}

/* ============================================
   CARD Component — ticket style
   ============================================ */
.card {
  --notch-size: 20px;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: visible;       /* notch circles must stick out */
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ─── Top part (photo area) — no padding, edge-to-edge ─── */
.card__top {
  position: relative;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
}

/* Dark gradient at bottom of image for title readability */
.card__top::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.15) 50%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.card__image-wrap {
  width: 100%;
  aspect-ratio: 3 / 5;
  overflow: hidden;
}

.card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card__image-wrap img {
  transform: scale(1.04);
}

/* Title overlaid on the image */
.card__title {
  position: absolute;
  bottom: 10px;
  left: 14px;
  right: 14px;
  z-index: 2;
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-white);
  letter-spacing: -0.01em;
  margin: 0;
}

/* ─── Ticket notch divider ─── */
.card__notch {
  position: relative;
  height: 0;
  z-index: 2;
}

/* Left cutout */
.card__notch::before {
  content: '';
  position: absolute;
  width: var(--notch-size);
  height: var(--notch-size);
  border-radius: 50%;
  background: var(--color-cream);
  top: calc(var(--notch-size) / -2);
  left: calc(var(--notch-size) / -2);
}

/* Right cutout */
.card__notch::after {
  content: '';
  position: absolute;
  width: var(--notch-size);
  height: var(--notch-size);
  border-radius: 50%;
  background: var(--color-cream);
  top: calc(var(--notch-size) / -2);
  right: calc(var(--notch-size) / -2);
}

/* Dashed line between notches */
.card__notch-line {
  display: block;
  position: absolute;
  top: -1px;
  left: calc(var(--notch-size) / 2 + 2px);
  right: calc(var(--notch-size) / 2 + 2px);
  border-top: 2px dashed rgba(0, 0, 0, 0.10);
  z-index: 1;
}

/* ─── Bottom part (text area) — white ─── */
.card__body {
  background: var(--color-white);
  padding: 14px 14px 20px;
  border-radius: 0 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card__excerpt {
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: opacity 0.15s ease;
}

.card__excerpt.is-parsed {
  opacity: 1;
}

/* When no pipe found, excerpt becomes card__desc directly */
.card__body > .card__desc {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.card__body > .card__desc.is-parsed {
  opacity: 1;
}

.card__date {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-dark);
  margin-top: 2px;
}

.card__desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-muted);
  margin: 0;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   GLOBE SECTION
   ============================================ */
.globe-section {
  background: var(--color-cream);
  padding: var(--section-gap) 0 0;
  overflow: hidden;
}

.globe-section__title {
  font-size: clamp(24px, 5vw, 40px);
  font-weight: 700;
  color: var(--color-dark);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

/* Clip container — mobile: top half of sphere; desktop: full sphere */
.globe-container {
  position: relative;
  width: 100%;
  height: 50vh;
  overflow: hidden;
}

@media (min-width: 768px) {
  .globe-container {
    height: auto;
    aspect-ratio: 16 / 10;
    max-height: 70vh;
  }
}

/* Canvas fills the visible clip area; JS draws the oversized sphere */
#globe-map {
  width: 100%;
  height: 100%;
  background: transparent;
}

.globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ─── Globe Inline Panel (post preview tooltip) ─── */
.globe-panel {
  position: absolute;
  width: 260px;
  background: var(--color-white);
  border-radius: 16px;
  overflow: visible;
  z-index: 20;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.globe-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Arrow pseudo-element */
.globe-panel::after,
.fortune-result::after {
  content: '';
  position: absolute;
  left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 8px solid transparent;
}

/* Arrow below tooltip (tooltip is ABOVE marker) */
.globe-panel.--above::after,
.fortune-result.--above::after {
  bottom: -16px;
  border-top-color: var(--color-white);
}

/* Arrow above tooltip (tooltip is BELOW marker) */
.globe-panel.--below::after,
.fortune-result.--below::after {
  top: -16px;
  border-bottom-color: var(--color-white);
}

.globe-panel__header {
  padding: 12px 16px;
}

.globe-panel__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-dark);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.globe-panel__back:hover {
  color: var(--color-orange);
}

.globe-panel__back svg {
  width: 18px;
  height: 18px;
}

.globe-panel__image {
  width: 100%;
  height: 100px;
  background-size: cover;
  background-position: center;
  background-color: var(--color-teal);
  border-radius: 16px 16px 0 0;
}

.globe-panel__body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.globe-panel__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-dark);
}

.globe-panel__excerpt {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.globe-panel__link {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-orange);
  transition: color 0.2s ease;
}

.globe-panel__link:hover {
  color: var(--color-orange-dark);
}

/* ─── Fortune Teller (intro + result card) ─── */
.fortune {
  margin-bottom: 28px;
}

.fortune__text {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-muted);
  max-width: 480px;
  margin-bottom: 20px;
}

.fortune__text + .fortune__text {
  margin-top: -8px;
}

.fortune__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  background: var(--color-orange);
  color: var(--color-white);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.fortune__btn:hover {
  background: var(--color-orange-dark);
  transform: translateY(-1px);
}

.fortune__btn:active {
  transform: translateY(0);
}

.fortune__btn.is-spinning {
  opacity: 0.6;
  pointer-events: none;
}

/* Fortune result tooltip — positioned near marker after spin */
.fortune-result {
  position: absolute;
  width: 240px;
  background: var(--color-white);
  border-radius: 16px;
  overflow: visible;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fortune-result.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.fortune-result__body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fortune-result__name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-dark);
}

.fortune-result__phrase {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-muted);
}

.fortune-result__retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 4px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 13px;
  font-weight: 700;
  color: var(--color-orange);
  background: none;
  border: 2px solid var(--color-orange);
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.fortune-result__retry:hover {
  background: var(--color-orange);
  color: var(--color-white);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-dark);
  color: var(--color-cream);
  padding: 40px 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.footer__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-cream);
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--color-orange);
}

.footer__copy {
  font-size: 13px;
  color: var(--color-muted);
}

/* ============================================
   POST PAGE
   ============================================ */
.post-split {
  display: flex;
  gap: 0;
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.post-split__media {
  position: sticky;
  top: 0;
  flex: 0 0 50%;
  min-width: 0;
  height: 100vh;
  min-height: 100vh;
  background: var(--color-dark);
  border-radius: 0;
  overflow: hidden;
}

.post-split__content {
  flex: 0 0 50%;
  min-width: 0;
  min-height: 100vh;
  padding: 24px var(--container-padding) 32px;
}

.post-split--single {
  display: block;
  width: 100%;
  margin: 0 auto;
  padding: var(--section-gap) var(--container-padding);
}

.post-split--single .post-split__content {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.post-split--single .post-split__media {
  display: none;
}

.post-split__content > .post-header {
  width: calc(100% + (2 * var(--container-padding)));
  margin: 0 calc(-1 * var(--container-padding)) 16px;
  padding: 0 var(--container-padding);
}

.post-split--single .post-header {
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-dark);
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--color-orange);
}

.back-link svg {
  width: 20px;
  height: 20px;
}

.post-content {
  max-width: 720px;
  padding: 0;
}

.post-content__title {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.post-content__meta {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 40px;
}

.post-content__arrival {
  display: none;
}

.post-content__arrival.is-parsed {
  display: block;
}

.post-content__body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-dark);
}

.post-content__body h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 48px 0 16px;
  letter-spacing: -0.01em;
}

.post-content__body h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 12px;
}

.post-content__body p {
  margin-bottom: 20px;
}

.post-content__body img {
  border-radius: var(--card-radius);
  margin: 32px 0;
}

.post-content__body a {
  color: var(--color-orange);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(217, 107, 63, 0.3);
  transition: text-decoration-color 0.2s ease;
}

.post-content__body a:hover {
  text-decoration-color: var(--color-orange);
}

.post-content__body blockquote {
  border-left: 4px solid var(--color-orange);
  padding-left: 20px;
  margin: 32px 0;
  font-style: italic;
  color: var(--color-muted);
}

.post-content__body ul,
.post-content__body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.post-content__body ul {
  list-style: disc;
}

.post-content__body ol {
  list-style: decimal;
}

.post-content__body li {
  margin-bottom: 8px;
}

.post-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.post-carousel__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
}

.post-carousel__slide {
  flex: 0 0 100%;
  height: 100%;
  position: relative;
}

.post-carousel__slide img,
.post-carousel__slide video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--color-dark);
}

/* Loading spinner for video slides */
.post-carousel__slide--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: carousel-spin 0.8s linear infinite;
  z-index: 10;
  pointer-events: none;
}

@keyframes carousel-spin {
  to { transform: rotate(360deg); }
}

.post-carousel__slide--hidden {
  display: none !important;
}

.post-carousel__bar--hidden {
  display: none !important;
}

.post-carousel__progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  padding: 0;
  pointer-events: none;
  z-index: 5;
}

.post-carousel__bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
}

.post-carousel__bar-fill {
  width: 0;
  height: 100%;
  background: var(--color-white);
  border-radius: inherit;
  transition: width linear;
}

.post-split__media img.post-media__feature {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-carousel__dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
}

.post-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transition: background 0.2s ease, transform 0.2s ease;
}

.post-carousel__dot.is-active {
  background: var(--color-white);
  transform: scale(1.05);
}

@media (max-width: 767px) {
  .post-split {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: var(--section-gap) var(--container-padding);
  }

  .post-split__media {
    position: relative;
    top: auto;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: 100vw;
    aspect-ratio: 1 / 1;
    border-radius: var(--card-radius);
    overflow: hidden;
  }

  .post-split__content {
    flex: 1 1 auto;
    width: 100%;
    min-height: auto;
    padding: var(--section-gap) var(--container-padding);
  }

  .post-split__content > .post-header {
    width: calc(100% + (4 * var(--container-padding)));
    margin-left: calc(-2 * var(--container-padding));
    margin-right: calc(-2 * var(--container-padding));
    padding-left: calc(2 * var(--container-padding));
    padding-right: calc(2 * var(--container-padding));
  }

  .post-split--single .post-header {
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
  }
}

/* ============================================
   GHOST KOENIG EDITOR — Content cards
   ============================================ */

/* --- Base card --- */
.kg-card {
  margin: 32px 0;
}

.kg-card figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 12px;
  line-height: 1.4;
}

/* --- Width variants --- */
.kg-width-wide {
  position: relative;
  width: 85vw;
  min-width: 100%;
  margin: 32px calc(50% - 42.5vw);
}

.kg-width-full {
  position: relative;
  width: 100vw;
  min-width: 100%;
  margin: 32px calc(50% - 50vw);
}

/* Keep full/wide cards inside post content column */
.post-template .post-content .kg-width-wide,
.post-template .post-content .kg-width-full {
  width: 100%;
  min-width: 0;
  margin: 32px 0;
}

/* Post content: make Ghost Header Card (split) look like mobile */
.post-template .post-content .kg-header-card.kg-v2.kg-layout-split .kg-header-card-content {
  grid-template-columns: 1fr;
}

.post-template .post-content .kg-header-card.kg-v2.kg-layout-split .kg-header-card-content .kg-header-card-image {
  height: auto;
  min-height: unset;
  aspect-ratio: 1 / 1;
}

.post-template .post-content .kg-header-card.kg-v2.kg-layout-split .kg-header-card-text {
  padding: min(6.4vmax, 120px) min(4vmax, 80px);
}

/* Gallery card — full panel width on both mobile and desktop */
.post-template .post-content .kg-gallery-card {
  width: calc(100% + 2 * var(--container-padding));
  margin-left: calc(-1 * var(--container-padding));
}

.post-template .post-content .kg-gallery-container {
  width: 100%;
  /* do NOT set on row/image — they use flex: 0 0 auto for horizontal strip */
}

.post-template .post-content .kg-gallery-row {
  width: auto !important;
  min-width: 0;
}

.post-template .post-content .kg-gallery-image {
  width: auto !important;
  min-width: 0;
}

.kg-width-wide img,
.kg-width-full img {
  width: 100%;
}

/* --- Image card --- */
.kg-image-card img {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
}

/* --- Video card (Ghost native uploader) --- */
.kg-video-card {
  position: relative;
}

.kg-video-card video {
  width: 100%;
  height: auto;
  border-radius: var(--card-radius);
  display: block;
}

.kg-video-container {
  position: relative;
  width: 100%;
}

.kg-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  cursor: pointer;
}

.kg-video-player-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kg-video-play-icon {
  width: 48px;
  height: 48px;
}

.kg-video-play-icon svg {
  width: 100%;
  height: 100%;
}

/* Ghost video player controls */
.kg-video-card input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  height: 4px;
  border-radius: 2px;
  cursor: pointer;
  flex: 1;
}

.kg-video-card input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* --- Embed card (YouTube, Vimeo, etc.) --- */
.kg-embed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kg-embed-card iframe {
  width: 100%;
  border: none;
  border-radius: var(--card-radius);
}

/* Responsive 16:9 wrapper for embeds without explicit height */
.kg-embed-card > div,
.kg-embed-card > figure {
  width: 100%;
}

.kg-embed-card iframe[src*="youtube"],
.kg-embed-card iframe[src*="vimeo"] {
  aspect-ratio: 16 / 9;
  height: auto;
}

/* --- Gallery card — horizontal scrollable strip --- */
.kg-gallery-card {
  position: relative;
  margin: 32px 0;
}

.kg-gallery-container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-y: hidden;
  height: 240px;
}

.kg-gallery-container::-webkit-scrollbar {
  display: none;
}

/* After JS flattening, images are direct children of container */
.kg-gallery-container > .kg-gallery-image {
  flex: 0 0 auto !important;
  height: 240px !important;
  margin: 0 !important;
  overflow: hidden;
}

.kg-gallery-container > .kg-gallery-image img {
  height: 240px !important;
  width: auto !important;
  max-width: none !important;
  display: block;
  border-radius: 0;
  margin: 0;
}


@media (max-width: 767px) {
  .post-template .post-content .kg-gallery-card {
    width: calc(100% + 4 * var(--container-padding));
    margin-left: calc(-2 * var(--container-padding));
  }
}

@media (min-width: 768px) {
  .kg-gallery-container {
    height: 320px;
  }
  .kg-gallery-container > .kg-gallery-image {
    height: 320px !important;
    margin: 0 !important;
  }
  .kg-gallery-container > .kg-gallery-image img {
    height: 320px !important;
  }
}

/* Gallery carousel arrow buttons */
.gallery-carousel__btn {
  display: none;
}

@media (min-width: 768px) {
  .gallery-carousel__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    color: var(--color-dark);
    transition: opacity 0.2s, background 0.2s;
  }
  .gallery-carousel__btn:hover { background: #fff; }
  .gallery-carousel__btn:disabled { opacity: 0.3; pointer-events: none; }
  .gallery-carousel__btn svg { width: 20px; height: 20px; }
  .gallery-carousel__btn--prev { left: 12px; }
  .gallery-carousel__btn--next { right: 12px; }
}

.post-template .post-content .kg-gallery-image img {
  cursor: zoom-in;
}

.post-template .post-content .kg-gallery-image img:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

/* Gallery lightbox */
body.lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 18, 0.82);
  backdrop-filter: blur(1px);
}

.gallery-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(94vw, 1400px);
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox__image {
  max-width: 100%;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
  background: #101217;
}

.gallery-lightbox__close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-white);
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.gallery-lightbox__close:hover {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.45);
}

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.gallery-lightbox__nav:hover {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.45);
}

.gallery-lightbox__nav:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.gallery-lightbox__nav svg {
  width: 22px;
  height: 22px;
}

.gallery-lightbox__nav--prev { left: 16px; }
.gallery-lightbox__nav--next { right: 16px; }

/* --- Bookmark card --- */
.kg-bookmark-card {
  width: 100%;
}

.kg-bookmark-container {
  display: flex;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--card-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
}

.kg-bookmark-container:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.kg-bookmark-content {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.kg-bookmark-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-bookmark-description {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-muted);
  margin-top: auto;
}

.kg-bookmark-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.kg-bookmark-author,
.kg-bookmark-publisher {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kg-bookmark-thumbnail {
  width: 200px;
  min-height: 100%;
  flex-shrink: 0;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

@media (max-width: 600px) {
  .kg-bookmark-container {
    flex-direction: column-reverse;
  }

  .kg-bookmark-thumbnail {
    width: 100%;
    height: 160px;
  }
}

/* --- Audio Card (Telegram voice message style) --- */

/* Outer wrapper: transparent column — avatar → name → capsule */
.kg-audio-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  position: relative;
}

/* Large avatar circle, sits above the capsule */
.kg-audio-thumbnail {
  display: block !important;
  width: 120px;
  height: 120px;
  min-width: 120px;
  border-radius: 50% !important;
  object-fit: cover;
  flex-shrink: 0;
  margin: 0 !important;
}

/* Hide Ghost's placeholder SVG (shown when no thumbnail uploaded) */
.kg-audio-thumbnail.placeholder {
  display: none !important;
}

/* Column that holds name + capsule */
.kg-audio-player-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Hide the audio element */
.kg-audio-player-container audio {
  display: none;
}

/* Name text — on page background, dark color */
.kg-audio-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-dark);
  margin: 0;
  line-height: 1.3;
}

/* THE dark capsule — play button + waveform + duration */
.kg-audio-player {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-teal-dark);
  border-radius: 24px;
  padding: 8px 10px 8px 8px;
  position: relative;
}

/* Waveform layers — shared base (positioned over the slider area) */
.kg-audio-player::before,
.kg-audio-player::after {
  content: '';
  position: absolute;
  left: 44px;
  right: 44px;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  pointer-events: none;
  background-size: auto 100%;
  background-repeat: repeat-x;
}

/* ::after — dim full waveform (unplayed state) */
.kg-audio-player::after {
  z-index: 0;
  background-image: var(--wf-dim, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='24' viewBox='0 0 192 24'%3E%3Crect fill='%23fff' opacity='0.35' x='0' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='4' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='8' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='12' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='16' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='20' y='8' width='2' height='8' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='24' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='28' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='32' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='36' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='40' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='44' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='48' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='52' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='56' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='60' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='64' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='68' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='72' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='76' y='4' width='2' height='16' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='80' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='84' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='88' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='92' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='96' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='100' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='104' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='108' y='8' width='2' height='8' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='112' y='4' width='2' height='16' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='116' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='120' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='124' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='128' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='132' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='136' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='140' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='144' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='148' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='152' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='156' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='160' y='4' width='2' height='16' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='164' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='168' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='172' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='176' y='8' width='2' height='8' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='180' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='184' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' opacity='0.35' x='188' y='3' width='2' height='18' rx='1'/%3E%3C/svg%3E"));
}

/* ::before — bright played portion, clipped left→right by --audio-progress */
.kg-audio-player::before {
  z-index: 1;
  -webkit-clip-path: inset(0 calc(100% - var(--audio-progress, 0%)) 0 0);
  clip-path: inset(0 calc(100% - var(--audio-progress, 0%)) 0 0);
  background-image: var(--wf-bright, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='24' viewBox='0 0 192 24'%3E%3Crect fill='%23fff' x='0' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='4' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' x='8' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' x='12' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' x='16' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' x='20' y='8' width='2' height='8' rx='1'/%3E%3Crect fill='%23fff' x='24' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' x='28' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='32' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' x='36' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' x='40' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' x='44' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' x='48' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' x='52' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' x='56' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' x='60' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='64' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' x='68' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' x='72' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' x='76' y='4' width='2' height='16' rx='1'/%3E%3Crect fill='%23fff' x='80' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' x='84' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' x='88' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='92' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' x='96' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' x='100' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' x='104' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' x='108' y='8' width='2' height='8' rx='1'/%3E%3Crect fill='%23fff' x='112' y='4' width='2' height='16' rx='1'/%3E%3Crect fill='%23fff' x='116' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' x='120' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='124' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' x='128' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' x='132' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' x='136' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' x='140' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' x='144' y='3' width='2' height='18' rx='1'/%3E%3Crect fill='%23fff' x='148' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='152' y='1' width='2' height='22' rx='1'/%3E%3Crect fill='%23fff' x='156' y='7' width='2' height='10' rx='1'/%3E%3Crect fill='%23fff' x='160' y='4' width='2' height='16' rx='1'/%3E%3Crect fill='%23fff' x='164' y='10' width='2' height='4' rx='1'/%3E%3Crect fill='%23fff' x='168' y='5' width='2' height='14' rx='1'/%3E%3Crect fill='%23fff' x='172' y='2' width='2' height='20' rx='1'/%3E%3Crect fill='%23fff' x='176' y='8' width='2' height='8' rx='1'/%3E%3Crect fill='%23fff' x='180' y='6' width='2' height='12' rx='1'/%3E%3Crect fill='%23fff' x='184' y='9' width='2' height='6' rx='1'/%3E%3Crect fill='%23fff' x='188' y='3' width='2' height='18' rx='1'/%3E%3C/svg%3E"));
}

/* Play/Pause button — compact circle */
.kg-audio-play-icon,
.kg-audio-pause-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
  order: 1;
}

.kg-audio-play-icon:hover,
.kg-audio-pause-icon:hover {
  background: rgba(255, 255, 255, 0.35);
}

.kg-audio-play-icon svg {
  width: 12px;
  height: 12px;
  fill: #fff;
  margin-left: 2px;
}

.kg-audio-pause-icon svg {
  width: 12px;
  height: 12px;
  fill: #fff;
}


/* Seek slider — fully transparent, no visible thumb; waveform is the only indicator */
.kg-audio-seek-slider {
  display: block !important;
  flex: 1;
  min-width: 0;
  height: 28px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  order: 2;
  background: transparent !important;
  accent-color: transparent;
  opacity: 0 !important;
  position: relative;
  z-index: 2;
}

.kg-audio-seek-slider::-webkit-slider-runnable-track {
  height: 28px;
  background: transparent !important;
}

.kg-audio-seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.kg-audio-seek-slider::-moz-range-track {
  height: 28px;
  background: transparent !important;
}

.kg-audio-seek-slider::-moz-range-thumb {
  width: 2px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.kg-audio-seek-slider::-moz-range-progress {
  background: transparent !important;
}

/* Duration — white text, right side of capsule */
.kg-audio-duration {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  order: 3;
  flex-shrink: 0;
}

/* Hide current-time, separator, volume, playback rate */
.kg-audio-current-time,
.kg-audio-time {
  display: none !important;
}

.kg-audio-mute-icon,
.kg-audio-unmute-icon,
.kg-audio-volume-slider,
.kg-audio-playback-rate {
  display: none !important;
}

/* --- Callout card --- */
.kg-callout-card {
  display: flex;
  gap: 12px;
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--color-cream-light);
}

.kg-callout-card-grey {
  background: #f1f1f1;
}

.kg-callout-card-white {
  background: var(--color-white);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.kg-callout-card-blue {
  background: #e8f0fe;
}

.kg-callout-card-green {
  background: #e6f4ea;
}

.kg-callout-card-yellow {
  background: #fef7e0;
}

.kg-callout-card-red {
  background: #fce8e6;
}

.kg-callout-card-pink {
  background: #fce4ec;
}

.kg-callout-card-purple {
  background: #f3e8fd;
}

.kg-callout-card-accent {
  background: var(--color-teal);
  color: var(--color-white);
}

.kg-callout-emoji {
  font-size: 20px;
  line-height: 1.4;
  flex-shrink: 0;
}

.kg-callout-text {
  font-size: 16px;
  line-height: 1.5;
}

/* --- CTA card --- */
.kg-cta-card {
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  border-radius: var(--card-radius);
  background: var(--color-cream);
}

.kg-cta-card.kg-cta-bg-grey,
.kg-cta-card.kg-cta-bg-white {
  background: var(--color-cream-light);
}

.kg-cta-card.kg-cta-bg-accent {
  background: var(--color-teal);
  color: var(--color-white);
}

.kg-cta-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kg-cta-content-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.kg-cta-text {
  flex: 1;
  min-width: 200px;
  font-size: 16px;
  line-height: 1.5;
}

.kg-cta-text p {
  margin: 0;
}

.kg-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--btn-radius);
  text-decoration: none;
  background: var(--color-orange);
  color: var(--color-white);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.kg-cta-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Accent background - invert button */
.kg-cta-card.kg-cta-bg-accent .kg-cta-button {
  background: var(--color-white);
  color: var(--color-teal);
}

/* --- Button card --- */
.kg-button-card {
  display: flex;
  justify-content: center;
}

.kg-button-card.kg-align-left {
  justify-content: flex-start;
}

.kg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--btn-radius);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.kg-btn:hover {
  opacity: 0.88;
}

.kg-btn-accent {
  background: var(--color-orange);
  color: var(--color-white);
}

/* --- Toggle card --- */
.kg-toggle-card {
  background: var(--color-cream-light);
  border-radius: var(--card-radius);
  padding: 0;
}

.kg-toggle-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 12px;
}

.kg-toggle-heading h4 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
}

.kg-toggle-card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.kg-toggle-content {
  padding: 0 20px 16px;
  font-size: 16px;
  line-height: 1.6;
}

/* --- File card --- */
.kg-file-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--card-radius);
}

.kg-file-card-container {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  width: 100%;
}

.kg-file-card-contents {
  flex: 1;
  min-width: 0;
}

.kg-file-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-dark);
}

.kg-file-card-caption {
  font-size: 14px;
  color: var(--color-muted);
  margin-top: 2px;
}

.kg-file-card-metadata {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 4px;
}

.kg-file-card-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* --- Header card --- */
.kg-header-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 32px;
  border-radius: var(--card-radius);
  min-height: 40vh;
}

.kg-header-card h2 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  margin-bottom: 16px;
}

.kg-header-card h3 {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 400;
  opacity: 0.8;
}

/* --- Product card --- */
.kg-product-card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--card-radius);
  padding: 24px;
}

.kg-product-card-image {
  width: 100%;
  border-radius: calc(var(--card-radius) / 2);
  margin-bottom: 16px;
}

.kg-product-card-title-container {
  margin-bottom: 12px;
}

.kg-product-card h4 {
  font-size: 20px;
  font-weight: 700;
}

.kg-product-card-description {
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-muted);
}

/* Horizontal rail for day product cards in posts */
.post-template .post-content .day-product-rail {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 32px 0;
  padding: 2px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-left: 2px;
  scroll-padding-right: 2px;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.post-template .post-content .day-product-rail::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.post-template .post-content .day-product-rail > .kg-product-card {
  flex: 0 0 clamp(280px, calc((100% - 16px) / 2), 460px);
  width: auto;
  max-width: none;
  min-width: 0;
  align-self: stretch;
  margin: 0;
  padding: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--color-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .post-template .post-content .day-product-rail {
    /* width and margin-left are set by JS (applyRailGeometry) based on actual DOM measurements */
    max-width: none; /* override base rule max-width: 100% so JS-set width takes effect */
    padding: 4px 0 4px var(--container-padding);
    scroll-snap-type: none;
    cursor: grab;
  }

  .post-template .post-content .day-product-rail::after {
    content: '';
    flex: 0 0 2px;
    min-width: 2px;
  }

  .post-template .post-content .day-product-rail.is-dragging {
    cursor: grabbing;
    user-select: none;
  }

  .post-template .post-content .day-product-rail > .kg-product-card {
    scroll-snap-align: none;
    /* Slightly wider than half the content area so the next card peeks from the right edge */
    flex: 0 0 clamp(280px, calc((100% - 16px) / 2 + 20px), 460px);
  }

  .post-template .post-content .day-product-rail > .kg-product-card {
    --day-card-height: 86vh;
    height: 86vh;
    max-height: 86vh;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: inherit;
    box-shadow: none;
    background: var(--color-white);
    overflow: hidden;
    isolation: isolate;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-image {
    flex: 0 0 calc(var(--day-card-height) * 0.5);
    width: 100%;
    height: calc(var(--day-card-height) * 0.5);
    min-height: 0;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px 6px;
    position: relative;
    z-index: 1;
    text-align: left !important;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left !important;
  }

  /* Normalize any inline formatting accidentally applied in the Ghost editor */
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title strong,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title b,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title em,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container h4 strong,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container h4 b {
    font-weight: inherit;
    font-style: inherit;
    font-size: inherit;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description {
    flex: 1 1 auto;
    position: relative;
    margin: 0;
    padding: 0 14px 14px;
    min-height: 0;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-muted);
    z-index: 1;
  }

  /* Reset Ghost defaults that can overlap text in Safari */
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol {
    margin: 0;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p + p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p + ul,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p + ol,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul + p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol + p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul + ul,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol + ol,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul + ol,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol + ul {
    margin-top: 0.75em;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p:first-of-type {
    margin-top: 0;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description::after {
    content: none;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description > *:first-child {
    margin-top: 0;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description > *:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  /* Escape both paddings (post-split 20px + post-split__content 20px = 40px each side).
     Use separate margin props — shorthand would apply negative value to right too. */
  .post-template .post-content .day-product-rail {
    touch-action: auto; /* allow vertical page scroll; browser disambiguates direction */
    width: calc(100% + 4 * var(--container-padding)); /* = 100vw */
    max-width: none; /* override base rule max-width: 100% so width above takes effect */
    margin-top: 24px;
    margin-bottom: 24px;
    margin-left: calc(-2 * var(--container-padding)); /* -40px */
    gap: 12px;
    padding: 4px 0 4px var(--container-padding); /* left breathing room */
    scroll-snap-type: x mandatory;
    scroll-padding-left: var(--container-padding);
  }

  /* Trailing spacer — Safari ignores padding-right on overflow containers */
  .post-template .post-content .day-product-rail::after {
    content: '';
    flex: 0 0 var(--container-padding);
    min-width: var(--container-padding);
  }

  /* Peek: card narrower than viewport; same fixed height as desktop */
  .post-template .post-content .day-product-rail > .kg-product-card {
    --day-card-height: 85vh;
    flex: 0 0 calc(100vw - 56px);
    max-width: none;
    height: 85vh;
    max-height: 85vh;
    border-radius: var(--card-radius);
    scroll-snap-align: start;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: none;
    height: 100%;
    min-height: 0;
    padding: 0;
    border-radius: inherit;
    box-shadow: none;
    background: var(--color-white);
    overflow: hidden;
    isolation: isolate;
  }

  /* Image = 50% of card height — identical proportion to desktop */
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-image {
    flex: 0 0 calc(var(--day-card-height) * 0.5);
    width: 100%;
    height: calc(var(--day-card-height) * 0.5);
    min-height: 0;
    margin: 0;
    border-radius: 0;
    object-fit: cover;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 14px 6px;
    position: relative;
    z-index: 1;
    text-align: left !important;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title strong,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title b,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title em,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container h4 strong,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-title-container h4 b {
    font-weight: inherit;
    font-style: inherit;
    font-size: inherit;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description {
    flex: 1 1 auto;
    position: relative;
    margin: 0;
    padding: 0 14px 14px;
    min-height: 0;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.45;
    color: var(--color-muted);
    z-index: 1;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol {
    margin: 0;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p + p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p + ul,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p + ol,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul + p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol + p,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul + ul,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol + ol,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ul + ol,
  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description ol + ul {
    margin-top: 0.75em;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description p:first-of-type {
    margin-top: 0;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description::after {
    content: none;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description > *:first-child {
    margin-top: 0;
  }

  .post-template .post-content .day-product-rail > .kg-product-card .kg-product-card-description > *:last-child {
    margin-bottom: 0;
  }
}

/* ============================================
   UTILITY
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
