/* Art Imitating Life. The drawings carry the page. */

.ail .study-hero h1 {
  max-width: 11em;
  font-size: clamp(3.15rem, 6.4vw, 5.6rem);
}

.ail .study-hero {
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

.ail-intro {
  margin-top: 1.75rem;
}

.ail-gallery {
  padding: clamp(1.25rem, 3vw, 2rem) 0 clamp(2.5rem, 6vw, 4rem);
}

.ail-episode {
  width: min(1024px, calc(100% - 1.25rem));
  margin: 0 auto;
}

.ail-episode + .ail-episode {
  margin-top: clamp(3.5rem, 8vw, 6rem);
}

.ail-episode__title {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(1.4rem, 2.3vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.ail-episode__no {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--pink-deep);
}

.ail-episode__name {
  min-width: 0;
}

.ail-episode .shot {
  background: transparent;
  cursor: zoom-in;
}

.ail-episode .shot img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.ail-show__rail {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}

.ail-show__rail::-webkit-scrollbar {
  display: none;
}

.ail-show__rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}

.ail-show__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ail-show__slide .shot img {
  width: 100%;
  height: auto;
  object-fit: contain;
  -webkit-user-drag: none;
}

.ail-show__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas:
    "dots dots dots"
    "prev count next";
  align-items: center;
  gap: 0.15rem 0.75rem;
  margin-top: 0.7rem;
}

.ail-show__dots {
  grid-area: dots;
  justify-self: center;
}

.ail-show__prev {
  grid-area: prev;
  justify-self: end;
}

.ail-show__count {
  grid-area: count;
}

.ail-show__next {
  grid-area: next;
  justify-self: start;
}

.ail-show__prev,
.ail-show__next {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.ail-show__prev:hover,
.ail-show__next:hover {
  color: var(--pink-deep);
}

.ail-show__prev:disabled,
.ail-show__next:disabled {
  opacity: 0.38;
  cursor: default;
  color: var(--ink);
}

.ail-show__dots {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

.ail-show__dots button {
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.ail-show__dots button::after {
  content: "";
  position: absolute;
  inset: 0.46rem;
  border-radius: 50%;
  background: var(--blush);
}

.ail-show__dots button[aria-current="true"]::after {
  inset: 0.34rem;
  background: var(--pink-deep);
}

.ail-show__count {
  margin: 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.ail .shot img,
.ail .shot:hover img {
  transform: none;
}

.ail-more {
  width: min(40rem, calc(100% - 2rem));
  margin: clamp(3rem, 7vw, 4.75rem) auto 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  line-height: 1.4;
  color: var(--ink);
}

.ail .study-section h2 {
  max-width: 11em;
}

.ail-skills {
  margin: 1.6rem 0 0;
  max-width: 40rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--teal-ink);
}

.ail-back {
  margin: 2.4rem 0 0;
}

.ail-back a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--blush);
}

.ail-back a:hover {
  color: var(--pink-deep);
  border-bottom-color: var(--pink);
}

.ail-page .study-light {
  display: flex;
  flex-direction: column;
  width: min(1200px, calc(100vw - 2rem));
  height: min(92vh, calc(100vh - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  margin: auto;
  overflow: hidden;
  background: transparent;
}

.ail-page .study-light__bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0 0.55rem;
}

.ail-page .study-light__close,
.ail-page .study-light__prev,
.ail-page .study-light__next {
  position: static;
  float: none;
  margin: 0;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.ail-page .study-light__close {
  margin-left: auto;
}

.ail-page .study-light__prev:disabled,
.ail-page .study-light__next:disabled {
  opacity: 0.38;
  cursor: default;
}

.ail-page .study-light__frame {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ail-page .study-light__frame img {
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: contain;
  border-radius: 0.6rem;
}

@media (max-width: 719px) {
  .ail .study-hero h1,
  .ail .study-section h2 {
    max-width: none;
  }

  .ail-episode {
    width: calc(100% - 1rem);
  }

  .ail-episode--show {
    width: 100%;
  }

  .ail-episode--show .ail-episode__title,
  .ail-episode--show .ail-show__bar {
    padding-inline: 0.75rem;
  }

  .ail-page .study-light {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }

  .ail-page .study-light__bar {
    padding: 0.45rem 0.45rem 0.55rem;
  }

  .ail-page .study-light__frame img {
    width: 1024px;
    max-width: none;
    height: auto;
    object-fit: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ail-show__rail {
    scroll-behavior: auto;
  }
}
