/* Personal page — sections (content + optional photo column), lightbox, people strip */

.page-personal.page-stack {
  gap: clamp(1rem, 2.5vw, 1.35rem);
}

/* ── Hero ───────────────────────────────────────────────────────── */
.personal-hero.tile {
  position: relative;
  padding: clamp(1.35rem, 3.5vw, 2.25rem);
  border: 1px solid var(--jb-rule);
  background:
    linear-gradient(145deg, rgba(255, 122, 61, 0.06) 0%, transparent 42%),
    var(--jb-surface);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.personal-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--jb-accent), transparent 85%);
  border-radius: var(--jb-radius-sm, 2px) 0 0 var(--jb-radius-sm, 2px);
  opacity: 0.85;
}

.personal-hero__title {
  font-family: var(--jb-font-display);
  font-weight: 800;
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 0.55rem;
  color: var(--jb-text);
  animation: personal-hero-in 0.55s ease-out both;
}

.personal-hero__lede {
  margin: 0;
  max-width: 42rem;
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--jb-sub);
}

@keyframes personal-hero-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .personal-hero__title {
    animation: none;
  }
}

/* ── Section cards ───────────────────────────────────────────────── */
.personal-section.tile {
  display: block;
  padding: 0;
  border: 1px solid var(--jb-rule);
  border-radius: var(--jb-radius, 4px);
  background: var(--jb-surface);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.personal-section__inner {
  padding: clamp(1.15rem, 2.8vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.85rem, 2vw, 1.15rem);
}

.personal-section__main {
  min-width: 0;
}

/* Two columns from tablet up: prose left, thumbnails right; single column on small screens */
.personal-section--has-gallery .personal-section__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1rem, 3vw, 1.5rem);
  align-items: start;
}

@media (min-width: 768px) {
  .personal-section--has-gallery .personal-section__inner {
    /* Photo rail wide enough for two flex columns of thumbnails */
    grid-template-columns: minmax(0, 1fr) minmax(13.5rem, 18rem);
    gap: clamp(1.15rem, 3vw, 2rem);
  }
}

@media (min-width: 1100px) {
  .personal-section--has-gallery .personal-section__inner {
    grid-template-columns: minmax(0, 1fr) minmax(15rem, 21rem);
  }
}

.personal-section__head {
  margin: 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--jb-rule);
  margin-bottom: 1rem;
}

.personal-section__title {
  font-family: var(--jb-font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
  color: var(--jb-text);
}

h2.personal-section__title {
  margin: 0;
}

/* Prose: paragraphs, headings, lists, small */
.personal-section__body.jb-prose {
  font-family: var(--jb-font-body);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--jb-text);
  max-width: 62ch;
}

.personal-section__body.jb-prose > *:first-child {
  margin-top: 0;
}

.personal-section__body.jb-prose > *:last-child {
  margin-bottom: 0;
}

.personal-section__body.jb-prose p {
  margin: 0 0 0.85rem;
  color: var(--jb-sub);
}

.personal-section__body.jb-prose p:last-child {
  margin-bottom: 0;
}

.personal-section__body.jb-prose a {
  color: var(--jb-accent);
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 1px;
}

.personal-section__body.jb-prose a:hover {
  color: var(--jb-text);
}

.personal-section__body.jb-prose small {
  font-size: 0.82em;
  color: var(--jb-sub);
}

.personal-section__body.jb-prose h2 {
  font-family: var(--jb-font-display);
  font-weight: 800;
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  letter-spacing: -0.02em;
  margin: 1.15rem 0 0.45rem;
  line-height: 1.2;
  color: var(--jb-text);
}

.personal-section__body.jb-prose h2:first-child {
  margin-top: 0;
}

.personal-section__body.jb-prose h3 {
  font-family: var(--jb-font-display);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 1rem 0 0.4rem;
  line-height: 1.25;
  color: var(--jb-text);
}

.personal-section__body.jb-prose h4 {
  font-family: var(--jb-font-body);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0.95rem 0 0.35rem;
  line-height: 1.3;
  color: var(--jb-text);
}

.personal-section__body.jb-prose h4 + p {
  margin-top: 0.25rem;
}

.personal-section__body.jb-prose ul,
.personal-section__body.jb-prose ol {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  color: var(--jb-sub);
}

.personal-section__body.jb-prose ul {
  list-style-type: disc;
}

.personal-section__body.jb-prose ol {
  list-style-type: decimal;
}

.personal-section__body.jb-prose li {
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.personal-section__body.jb-prose li::marker {
  color: var(--jb-accent);
}

.personal-section__body.jb-prose ul ul,
.personal-section__body.jb-prose ol ol,
.personal-section__body.jb-prose ul ol,
.personal-section__body.jb-prose ol ul {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.personal-section__body.jb-prose blockquote {
  margin: 0.75rem 0;
  padding: 0.5rem 0 0.5rem 0.9rem;
  border-left: 3px solid var(--jb-accent);
  color: var(--jb-sub);
  font-size: 0.9em;
  font-style: italic;
}

.personal-section__body.jb-prose hr {
  border: none;
  height: 1px;
  margin: 1rem 0;
  background: var(--jb-rule);
}

/* ── Photo thumbnails (filmstrip on small screens; right column on wide) ─ */
.personal-gallery {
  position: relative;
  margin: 0;
  padding: 0;
  width: 100%;
  min-width: 0;
}

/* Mobile / narrow: horizontal strip under copy */
.personal-gallery__scroller {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.55rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0.25rem;
  padding: 0.35rem 0 0.65rem;
  margin: 0 calc(-1 * clamp(0.25rem, 1.5vw, 0.5rem));
  padding-left: clamp(0.25rem, 1.5vw, 0.5rem);
  padding-right: clamp(0.25rem, 1.5vw, 0.5rem);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--jb-rule) transparent;
}

.personal-gallery__scroller::-webkit-scrollbar {
  height: 5px;
}

.personal-gallery__scroller::-webkit-scrollbar-thumb {
  background: var(--jb-rule-strong);
  border-radius: 99px;
}

@media (max-width: 767px) {
  .personal-gallery::before,
  .personal-gallery::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0.65rem;
    width: 1.25rem;
    z-index: 1;
    pointer-events: none;
  }

  .personal-gallery::before {
    left: 0;
    background: linear-gradient(to right, var(--jb-surface), transparent);
  }

  .personal-gallery::after {
    right: 0;
    background: linear-gradient(to left, var(--jb-surface), transparent);
  }
}

.personal-gallery__thumb {
  flex: 0 0 auto;
  scroll-snap-align: start;
  position: relative;
  width: 7.25rem;
  height: 5rem;
  padding: 0;
  margin: 0;
  border: 1px solid var(--jb-rule);
  border-radius: var(--jb-radius-sm, 4px);
  background: var(--jb-surface-2);
  cursor: zoom-in;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.personal-gallery__thumb:hover {
  border-color: var(--jb-accent);
  box-shadow: 0 0 0 1px var(--jb-accent-glow);
}

.personal-gallery__thumb:focus {
  outline: none;
}

.personal-gallery__thumb:focus-visible {
  outline: 2px solid var(--jb-accent);
  outline-offset: 2px;
}

.personal-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@media (min-width: 768px) {
  .personal-gallery {
    position: sticky;
    top: clamp(0.65rem, 2vw, 1rem);
    align-self: start;
    padding: 0.5rem 0 0.5rem 0.85rem;
    margin: 0;
    border-left: 1px solid var(--jb-rule);
  }

  /* Two columns of thumbs via flex wrap; vertical scroll keeps section height in check */
  .personal-gallery__scroller {
    --gallery-gap: 0.5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    gap: var(--gallery-gap);
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    margin: 0;
    padding: 0 0.15rem 0.35rem 0;
    max-height: min(70vh, 36rem);
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--jb-rule) transparent;
  }

  .personal-gallery__scroller::-webkit-scrollbar {
    height: auto;
    width: 5px;
  }

  .personal-gallery__thumb {
    box-sizing: border-box;
    flex: 0 0 calc((100% - var(--gallery-gap)) / 2);
    max-width: calc((100% - var(--gallery-gap)) / 2);
    min-width: 0;
    height: auto;
    aspect-ratio: 3 / 2;
    scroll-snap-align: none;
  }

  .personal-gallery__thumb img {
    height: 100%;
  }
}

/* ── Lightbox ────────────────────────────────────────────────────── */
.personal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.personal-lightbox[hidden] {
  display: none !important;
}

.personal-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 4, 0.92);
  backdrop-filter: blur(4px);
}

.personal-lightbox__frame {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  max-width: min(96vw, 1200px);
  width: 100%;
  padding: 2.5rem 0.5rem 1.5rem;
}

.personal-lightbox__stage {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.personal-lightbox__img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(88vh, 900px);
  object-fit: contain;
  border-radius: var(--jb-radius-sm, 4px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.personal-lightbox__counter {
  margin: 0;
  font-family: var(--jb-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jb-sub);
}

.personal-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--jb-rule);
  border-radius: var(--jb-radius-sm, 4px);
  background: rgba(22, 23, 15, 0.85);
  color: var(--jb-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.personal-lightbox__close:hover {
  border-color: var(--jb-accent);
  color: var(--jb-accent);
}

.personal-lightbox__nav {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--jb-rule);
  border-radius: var(--jb-radius-sm, 4px);
  background: rgba(22, 23, 15, 0.75);
  color: var(--jb-text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.personal-lightbox__nav:hover:not([hidden]) {
  border-color: var(--jb-accent);
  color: var(--jb-accent);
}

.personal-lightbox__nav[hidden] {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 520px) {
  .personal-lightbox__frame {
    padding: 2.75rem 0.25rem 1rem;
    gap: 0.25rem;
  }

  .personal-lightbox__nav {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 1.15rem;
  }

  .personal-lightbox__img {
    max-height: min(78vh, 800px);
  }
}

/* ── People strip (unchanged structure, light polish) ─────────────── */
.personal-people.tile {
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  border: 1px solid var(--jb-rule);
  background: var(--jb-surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.personal-people__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.personal-people__title {
  font-family: var(--jb-font-display);
  font-weight: 800;
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--jb-text);
}

.personal-people__sub {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--jb-sub);
  max-width: 36rem;
  line-height: 1.45;
}

.personal-people__nav {
  display: flex;
  gap: 0.35rem;
}

.personal-people__scroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  border: 1px solid var(--jb-border, rgba(255, 255, 255, 0.12));
  background: var(--jb-surface-2, rgba(255, 255, 255, 0.04));
  color: var(--jb-text);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.personal-people__scroll-btn:hover:not(:disabled) {
  color: var(--jb-accent);
  border-color: var(--jb-accent);
}

.personal-people__scroll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.personal-people__strip-wrap {
  position: relative;
  margin: 0 calc(-1 * var(--jb-space-4, 1rem));
  padding: 0 var(--jb-space-4, 1rem);
}

@media (min-width: 1100px) {
  .personal-people__strip-wrap {
    margin: 0;
    padding: 0;
  }
}

.personal-people__strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--jb-space-4, 1rem);
  padding-bottom: 0.35rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.personal-people__strip:focus-visible {
  outline: 2px solid var(--jb-accent);
  outline-offset: 2px;
}

.personal-people__card {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  border-radius: var(--jb-radius, 8px);
  border: 1px solid var(--jb-border, rgba(255, 255, 255, 0.1));
  background: var(--jb-surface-2, rgba(255, 255, 255, 0.03));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.personal-people__card-photo {
  aspect-ratio: 16 / 10;
  background: var(--jb-surface-2, rgba(0, 0, 0, 0.25));
}

.personal-people__card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.personal-people__card-body {
  position: relative;
  padding: 0.85rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.personal-people__card-name {
  font-family: var(--jb-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  color: var(--jb-text);
}

.personal-people__card-rel {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jb-accent);
  margin: 0;
}

.personal-people__card-cat {
  font-size: 0.72rem;
  color: var(--jb-sub);
  margin: 0;
  position: absolute;
  top: .65rem;
  right: 1rem;
}

.personal-people__card-bio {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--jb-sub);
  margin: 0.25rem 0 0;
}

.personal-people__card-bio p {
  margin: 0 0 0.5rem;
}

.personal-people__card-bio p:last-child {
  margin-bottom: 0;
}
