@charset "UTF-8";
:root {
  --slide-width: min(90vw, 600px);
  --slide-height: calc(var(--slide-width) * 0.56);
  --side-scale: 0.65;
}

main {
  align-items: center;
}

.carousel-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  padding-bottom: 3rem;
  position: relative;
}

/* -------------------- */
/* Carousel */
/* -------------------- */
.carousel-main {
  position: relative;
  width: 96%;
  height: var(--slide-height);
  margin-left: auto;
  margin-right: auto;
}

.carousel-feature {
  position: absolute;
  width: var(--slide-width);
  height: var(--slide-height);
  border-radius: var(--radius-8);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  background: var(--gray-950);
  transition: all 0.45s ease;
  display: flex;
}
.carousel-feature figure {
  width: 60%;
}
.carousel-feature figure picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta {
  width: 40%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-16);
  padding: 1rem;
  background: var(--gray-900);
  color: var(--white);
}
.meta span {
  font-family: var(--serif);
  font-size: 2rem;
  font-size: var(--space-32);
  color: var(--highlight-500);
}
.meta h3 {
  font-size: calc(var(--h6) * 0.85);
  line-height: 110%;
}
.meta p {
  line-height: 120%;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -------------------- */
/* Controls */
/* -------------------- */
.carousel-controls {
  display: flex;
  justify-content: space-between;
  width: 96%;
  position: absolute;
  bottom: 50%;
  transform: translateY(50%);
  z-index: 40;
  /* the bar spans the carousel's full width over the active card's centre;
     let clicks through its empty middle to the card, keep the arrows live */
  pointer-events: none;
}

.carousel-controls button {
  pointer-events: auto;
}

/* Under 767px the card grows to ~90vw and the edge arrows overlap its left/
   right edges, eating taps on those parts of the card link. Hide the arrows on
   mobile and rely on swipe (touchstart/touchend in js/carousel.js) so the whole
   card is tappable. */
@media (max-width: 767px) {
  .carousel-controls {
    display: none;
  }
}
button:not(.mobile-menu) {
  padding: var(--space-16);
  border: none;
  background: var(--gray-700);
  color: var(--limestone-100);
  border-radius: var(--radius-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
button:not(.mobile-menu) img {
  width: 80%;
}

/* -------------------- */
/* Timeline */
/* -------------------- */
.timeline-scroller {
  position: relative;
  width: 92%;
  max-width: 800px;
  margin-bottom: var(--space-48);
}

.timeline-nav {
  position: relative;
  width: 100%;
  margin-bottom: 0;
}

.timeline-scroller.is-scrollable .timeline-nav {
  overflow-x: hidden;
}

button.timeline-arrow {
  position: absolute;
  top: 50%;
  display: none;
  background: transparent;
  padding: var(--space-8);
  z-index: 30;
}
button.timeline-arrow img {
  width: var(--space-16);
}

button.timeline-arrow-left {
  left: 0;
  transform: translate(-130%, -50%);
}

button.timeline-arrow-right {
  right: 0;
  transform: translate(130%, -50%);
}

button.timeline-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

@media (min-width: 768px) {
  .timeline-scroller.is-scrollable button.timeline-arrow {
    display: flex;
  }
}
.timeline-years {
  display: flex;
  gap: var(--space-32);
  align-items: center;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding: 0 var(--space-4);
  justify-content: space-between;
  scrollbar-width: none;
}

.timeline-years::-webkit-scrollbar {
  display: none;
}

.timeline-year:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.carousel-feature:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

/* When the years overflow, rest positions leave an equal "peek" of a partial
   year at both edges (handled in js/carousel.js — see computeSnapPositions),
   so it's always clear there's more to scroll. */
.timeline-track {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--space-4);
  background: var(--gray-400);
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

/* The year is now a <button role="tab">. Scope as button.timeline-year so it
   overrides the global button:not(.mobile-menu) rule (equal specificity, later
   in source), mirroring button.timeline-arrow above. */
button.timeline-year {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 0;
  display: inline-block;
  line-height: 1;
  font-size: var(--p-lg);
  font-family: var(--serif);
  cursor: pointer;
  color: var(--gray-700);
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 20;
  background: var(--limestone-100);
  padding: 0 var(--space-4);
}

button.timeline-year::before {
  content: "";
  position: absolute;
  width: var(--space-12);
  height: var(--space-12);
  border-radius: 50%;
  background: var(--gray-400);
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  transition: 0.3s;
}

button.timeline-year.active {
  color: var(--gray-950);
  font-weight: 700;
}

button.timeline-year.active::before {
  background: var(--highlight-500);
  transform: translateX(-50%) scale(1.4);
}

/* keyboard focus rings (WCAG 2.4.7) — outline draws outside the box, so the
   active card's overflow:hidden can't clip it. offset clears the year's dot. */
button.timeline-year:focus-visible {
  outline: 2px solid var(--highlight-500);
  outline-offset: 3px;
  border-radius: 2px;
}

.carousel-feature:focus-visible {
  outline: 3px solid var(--highlight-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-feature,
  .timeline-indicator,
  button.timeline-year::before {
    transition: none;
  }
}
.timeline-indicator {
  position: absolute;
  top: 50%;
  height: var(--space-4);
  width: 0;
  background: var(--highlight-500);
  transform: translateY(-50%);
  transition: 0.45s ease;
}

/* -------------------- */
/* Mobile adjustments */
/* -------------------- */
@media (max-width: 767px) {
  :root {
    --slide-height: var(--slide-width);
  }
  .carousel-main {
    height: var(--slide-height);
  }
  .carousel-feature {
    flex-direction: column;
  }
  .carousel-feature figure {
    width: 100%;
    height: 70%;
  }
  .carousel-feature figure picture {
    width: 100%;
    height: 100%;
  }
  .meta {
    width: 100%;
    height: 30%;
  }
}
