/* Full-width Journal band; the shared theme supplies typography, palette and buttons. */
html.ksg-lightbox-open {
  overflow: hidden;
}
.ksg-band {
  width: 100%;
  background: var(--ink-deep);
  color: var(--paper);
}
.ksg-band-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-items: center;
}
.ksg-preview {
  position: relative;
  min-width: 0;
  align-self: stretch;
  background: var(--ink);
}
.ksg-preview-images {
  height: 100%;
  min-height: 480px;
}
.ksg-preview-images > a {
  position: relative;
  display: block;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
}
.ksg-preview-images img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.ksg-preview-images img.is-active {
  opacity: 1;
}
.ksg-band--text-only .ksg-band-inner {
  grid-template-columns: minmax(0, 1fr);
}
.ksg-copy {
  min-width: 0;
  padding: 64px max(var(--gutter), calc((100vw - 1440px) / 2)) 64px clamp(24px, 4vw, 64px);
}
.ksg-copy > .eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
}
.ksg-copy h2 {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--paper);
  font-size: var(--type-section);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.ksg-description {
  margin-block: 24px;
  font-size: var(--type-reading);
  line-height: 1.65;
}
.ksg-fallback {
  margin-top: 28px;
}
.ksg-fallback > summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}
.ksg-fallback > summary::marker,
.ksg-fallback > summary::-webkit-details-marker {
  display: none;
  content: '';
}
.ksg-fallback > .button-accent:hover,
.ksg-fallback > .button-accent:focus-visible {
  border-color: var(--paper);
  background: transparent;
  color: var(--paper);
}
.ksg-fallback-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.ksg-fallback-images img {
  display: block;
  width: 100%;
  height: auto;
}
.ksg-band :focus-visible,
.ksg-lightbox :focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: -4px;
}
.journal-reading.is-continuation .journal-body > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.ksg-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 24px;
    border: 0;
    background: var(--ink-deep);
    color: var(--paper);
    overflow: hidden;
}

.ksg-lightbox[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 20px;
}

.ksg-lightbox:not([open]),
.ksg-lightbox-image[hidden] {
    display: none;
}

.ksg-lightbox::backdrop {
    background: rgba(0, 0, 0, .85);
}

.ksg-lightbox-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.ksg-lightbox-heading > div {
    min-width: 0;
}

.ksg-lightbox-heading .section-label {
    margin: 0 0 6px;
}

.ksg-lightbox-heading h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.ksg-lightbox-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
}

.ksg-lightbox-thumbnails {
    display: none;
}

.ksg-lightbox-viewer {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 20px;
    min-width: 0;
    min-height: 0;
}

.ksg-lightbox-stage {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 0;
    padding: 0 72px;
    touch-action: pan-y pinch-zoom;
}

.ksg-lightbox-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

.ksg-lightbox-status {
    position: absolute;
    inset: auto 0;
    margin: 0;
    padding: 24px;
    color: var(--soft);
    text-align: center;
}

.ksg-lightbox-status:empty {
    display: none;
}

.ksg-lightbox-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    min-height: 44px;
}

.ksg-lightbox-counter {
    min-width: 80px;
    margin: 0;
    color: var(--soft);
    text-align: center;
    font-size: 14px;
    letter-spacing: 2px;
}

.ksg-lightbox-control {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(244, 245, 242, .3);
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.ksg-lightbox-control:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
}

.ksg-lightbox-control:disabled {
    opacity: .3;
    cursor: default;
}

.ksg-lightbox-previous,
.ksg-lightbox-next {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: 64px;
    height: 100%;
    border: 0;
    background: transparent;
    font-size: 24px;
}

.ksg-lightbox-previous:hover:not(:disabled),
.ksg-lightbox-next:hover:not(:disabled) {
    background: rgba(255, 255, 255, .04);
    color: var(--accent);
}

.ksg-lightbox-previous:focus-visible,
.ksg-lightbox-next:focus-visible {
    outline-offset: -3px;
}

.ksg-lightbox-previous {
    left: 0;
}

.ksg-lightbox-next {
    right: 0;
}

@media (min-width: 1100px) and (min-height: 600px) {
    .ksg-lightbox {
        --thumb-rail-width: clamp(136px, 12vw, 176px);
        --thumb-rail-gap: 24px;
    }

    .ksg-lightbox-body {
        grid-template-columns: var(--thumb-rail-width) minmax(0, 1fr);
        gap: var(--thumb-rail-gap);
    }

    .ksg-lightbox-thumbnails {
        display: grid;
        grid-template-rows: minmax(0, 1fr);
        min-height: 0;
    }

    .ksg-lightbox-thumb-list {
        position: relative;
        min-height: 0;
        margin: 0;
        padding: 4px;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: var(--accent) var(--ink);
        scrollbar-gutter: stable;
        list-style: none;
    }

    .ksg-lightbox-thumb-list li + li {
        margin-top: 10px;
    }

    .ksg-lightbox-thumb {
        position: relative;
        display: block;
        width: 100%;
        aspect-ratio: 1;
        padding: 0;
        border: 2px solid transparent;
        background: var(--ink);
        color: var(--paper);
        cursor: pointer;
    }

    .ksg-lightbox-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: .55;
        transition: opacity .2s ease;
    }

    .ksg-lightbox-thumb[aria-current="true"],
    .ksg-lightbox-thumb:hover {
        border-color: var(--accent);
    }

    .ksg-lightbox-thumb[aria-current="true"] img,
    .ksg-lightbox-thumb:hover img {
        opacity: 1;
    }

    .ksg-lightbox-thumb.is-unavailable img {
        visibility: hidden;
    }

    .ksg-lightbox-thumb:focus-visible {
        outline-offset: 1px;
    }

    .ksg-lightbox-thumb-number {
        position: absolute;
        right: 3px;
        bottom: 3px;
        padding: 1px 5px;
        background: rgba(5, 5, 5, .85);
        font-size: 11px;
        line-height: 1.5;
        pointer-events: none;
    }

}

.ksg-lightbox-control:hover:not(:disabled) {
  color: var(--ink);
}
.ksg-lightbox-previous:hover:not(:disabled),
.ksg-lightbox-next:hover:not(:disabled) {
  color: var(--accent);
}
.ksg-lightbox-controls {
  flex-wrap: wrap;
  gap: 8px 28px;
}
.ksg-lightbox-caption {
  flex-basis: 100%;
  max-height: 4.8em;
  margin: 0;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}
.ksg-lightbox-caption:empty {
  display: none;
}
.ksg-lightbox-heading h2 {
  max-height: 24dvh;
  overflow: auto;
  color: var(--paper);
}
@media (max-width: 760px) {
  .ksg-band-inner {
    grid-template-columns: minmax(0, 1fr);
  }
  .ksg-preview-images {
    height: 90vw;
    min-height: 320px;
    max-height: 520px;
  }
  .ksg-copy {
    padding: 32px var(--gutter);
  }
  .ksg-fallback > summary {
    display: flex;
    width: 100%;
  }
  .ksg-lightbox {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .ksg-lightbox-heading h2 {
    font-size: 20px;
  }
  .ksg-lightbox-stage {
    padding: 0;
  }
  .ksg-lightbox-previous,
  .ksg-lightbox-next {
    width: 44px;
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ksg-preview-images img,
  .ksg-lightbox-thumb img {
    transition: none;
  }
}

.ksg-lightbox-video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.ksg-lightbox-video[hidden] {
  display: none;
}
.ksg-video-mark,
.ksg-has-video::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  transform: translate(-50%, -50%);
  background: var(--ink-deep);
  color: var(--paper);
  content: '▶';
  pointer-events: none;
}
.ksg-has-video .ksg-video-mark {
  display: none;
}
/* Keep native video playback and fullscreen controls outside the side hit areas. */
.ksg-lightbox-stage:has(.ksg-lightbox-video:not([hidden])) .ksg-lightbox-previous,
.ksg-lightbox-stage:has(.ksg-lightbox-video:not([hidden])) .ksg-lightbox-next {
  bottom: 64px;
  height: calc(100% - 64px);
}
