.meme-page,
body {
  overflow-x: clip;
}

.meme-page {
  width: var(--page);
  margin: 0 auto;
  padding: clamp(72px, 9vw, 140px) 0 clamp(90px, 12vw, 170px);
}

.meme-intro {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  align-items: end;
  padding-bottom: clamp(36px, 5vw, 70px);
  border-bottom: 1px solid var(--ink);
}

.meme-intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(6rem, 14vw, 13rem);
  font-weight: 400;
  letter-spacing: -0.075em;
  line-height: 0.72;
}

.meme-intro > p:last-child {
  max-width: 24rem;
  margin: 0;
  color: var(--muted);
}

.meme-carousel {
  margin-top: clamp(28px, 5vw, 70px);
}

.meme-stage {
  min-height: min(72svh, 840px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y pinch-zoom;
  -webkit-overflow-scrolling: touch;
}

.meme-stage::-webkit-scrollbar {
  display: none;
}

.meme-stage:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.meme-track {
  display: flex;
  align-items: stretch;
}

.meme-slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  min-height: min(72svh, 840px);
  border: 1px solid var(--ink);
  background: var(--paper);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  content-visibility: auto;
  contain-intrinsic-size: 1000px 840px;
}

.meme-slide figure {
  position: relative;
  display: grid;
  min-height: 0;
  margin: 0;
  padding: clamp(16px, 2.2vw, 34px);
  place-items: center;
  border-right: 1px solid var(--ink);
  background: #111;
}

.meme-media-count {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--paper);
  background: rgba(16, 16, 16, 0.82);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.meme-slide figure img {
  width: 100%;
  height: min(65svh, 760px);
  object-fit: contain;
}

.meme-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(26px, 4vw, 64px);
}

.meme-date {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meme-caption {
  margin: 60px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3vw, 3.2rem);
  line-height: 1.06;
}

.meme-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.meme-controls button {
  width: 72px;
  height: 64px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.meme-controls button:first-child { border-right: 1px solid var(--ink); }
.meme-controls button:last-child { border-left: 1px solid var(--ink); }
.meme-controls button:hover,
.meme-controls button:focus-visible { color: var(--paper); background: var(--ink); }
.meme-controls button:disabled { color: var(--line); cursor: default; background: transparent; }
.meme-status { display: grid; gap: 7px; justify-items: center; padding: 9px 18px; }
.meme-controls p { margin: 0; text-align: center; font-size: 0.66rem; letter-spacing: 0.12em; }

.meme-dots {
  display: flex;
  min-height: 10px;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.meme-dot {
  width: 7px !important;
  height: 7px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50%;
  background: var(--line) !important;
}

.meme-dot.is-active {
  width: 9px !important;
  height: 9px !important;
  background: var(--ink) !important;
}

.meme-progress { height: 3px; margin-top: 16px; background: var(--soft); overflow: hidden; }
.meme-progress span { display: block; width: 100%; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease); }

.meme-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.meme-thumbnails button {
  flex: 0 0 82px;
  width: 82px;
  height: 82px;
  padding: 4px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  opacity: 0.48;
}

.meme-thumbnails button.is-active { border-color: var(--ink); opacity: 1; }
.meme-thumbnails img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 720px) {
  .meme-page { padding-top: 58px; }
  .meme-intro { grid-template-columns: 1fr; gap: 20px; }
  .meme-intro h1 { font-size: clamp(5.6rem, 29vw, 8rem); }
  .meme-stage { min-height: 0; }
  .meme-slide { grid-template-columns: 1fr; min-height: 0; contain-intrinsic-size: 390px 650px; }
  .meme-slide figure { min-height: 0; aspect-ratio: 1 / 1; padding: 12px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .meme-slide figure img { height: 100%; max-height: 68svh; }
  .meme-copy { min-height: 180px; padding: 22px 20px 28px; }
  .meme-caption { margin-top: 32px; font-size: clamp(1.45rem, 7vw, 2.1rem); }
  .meme-controls button { width: 58px; height: 56px; }
  .meme-thumbnails { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  .meme-controls { grid-template-columns: 1fr; }
  .meme-controls > button { display: none; }
  .meme-status { min-height: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  .meme-progress span { transition: none; }
  .meme-stage { scroll-behavior: auto; }
}
.meme-intro h1, .meme-caption { line-height: 1.3; letter-spacing: -0.02em; }
.meme-dots { gap: 0; flex-wrap: wrap; }
.meme-dot, .meme-dot.is-active { width: 28px !important; height: 44px !important; background: transparent !important; border-radius: 0; }
.meme-dot::after { content: ""; display: block; width: 7px; height: 7px; margin: auto; border-radius: 50%; background: var(--line); }
.meme-dot.is-active::after { width: 9px; height: 9px; background: var(--ink); }
.meme-dot:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.meme-slide figure img { object-fit: scale-down; }
.meme-thumbnails img { object-fit: contain; }
/* Keep each swipe panel inside its viewport, including long hashtags. */
.meme-track { align-items: flex-start; }
.meme-slide, .meme-slide figure, .meme-copy { min-width: 0; }
.meme-caption { overflow-wrap: anywhere; }
.meme-stage { overflow-y: hidden; }
@media (max-width: 720px) {
  .meme-slide { grid-template-columns: minmax(0, 1fr); }
}
.instagram-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; text-underline-offset: 5px; }
