/* =============================================
   MARATHON POP-UP — marathon.css
   Standalone theme matching the NYCM pop-up flyers:
   cream paper, royal-blue ink, hand-lettered titles.
   ============================================= */

/* Self-hosted (preloaded in index.html); latin subset from Google Fonts */
@font-face {
  font-family: 'Caveat Brush';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/marathon/fonts/caveat-brush-latin.woff2') format('woff2');
}

:root {
  --cream: #f4f1ea;
  --ink: #1b4c9d;
  --ink-soft: rgba(27, 76, 157, 0.6);

  --font-brush: 'Caveat Brush', cursive;
  --font-sans: 'Manjari', sans-serif;

  --gutter: clamp(1rem, 4vw, 3rem);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.is-blue :focus-visible,
.mw-viewer :focus-visible {
  outline-color: var(--cream);
}

.nowrap {
  white-space: nowrap;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Inverted blocks: blue paper, cream ink */
.is-blue {
  background: var(--ink);
  color: var(--cream);
  --ink-soft: rgba(244, 241, 234, 0.65);
}

/* =============================================
   TYPE
   ============================================= */

.brush {
  font-family: var(--font-brush);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.95;
  text-transform: uppercase;
}

.tracked,
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1.6;
  text-wrap: pretty;
}

.eyebrow {
  font-size: 1rem;
  letter-spacing: 0.35em;
}

/* =============================================
   HEADER
   ============================================= */

.mw-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  z-index: 10;
}

.mw-wordmark img {
  width: clamp(200px, 30vw, 360px);
}

/* Nav lives behind the menu button */
.mw-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  flex-direction: column;
  min-width: 220px;
  background: var(--cream);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 0.5rem 0;
}

.mw-nav.is-open {
  display: flex;
}

.mw-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.9rem 1.25rem 0.75rem;
}

.mw-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.mw-menu-btn {
  display: flex;
  margin-right: -9px;
  background: none;
  border: none;
  color: var(--ink);
  width: 44px;
  height: 44px;
  padding: 11px 9px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}

.mw-menu-btn span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s;
}

.mw-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.mw-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mw-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* =============================================
   HERO — kept short so the photos start high
   ============================================= */

.mw-hero {
  display: grid;
  grid-template-columns: 1fr minmax(0, 340px);
  gap: var(--gutter);
  align-items: center;
  padding: 0.5rem 0 3rem;
}

.mw-hero h1 {
  font-size: clamp(3.5rem, 7vw, 6rem);
  margin: 0 0 0 -0.04em;
}

.mw-hero-dates {
  margin-top: 1rem;
}

.mw-hero-art img {
  width: 100%;
}

/* =============================================
   BUTTONS & LINKS
   ============================================= */

.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85rem 1.4rem 0.7rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  border: 1.5px solid var(--ink);
  white-space: nowrap;
  transition: transform 0.15s;
}

.btn:hover {
  transform: translateY(-2px);
}

.is-blue .btn {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
}

.btn--ghost {
  background: none;
  color: var(--ink);
}

.is-blue .btn--ghost {
  background: none;
  color: var(--cream);
}

/* =============================================
   THIS IS A RUNNING SHOW — Instagram reels
   ============================================= */

.mw-show {
  padding: 3.5rem 0 4rem;
}

/* One swipeable row; Instagram's player won't go narrower than 326px */
.mw-show-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter) 0.5rem;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}

.mw-show-row::-webkit-scrollbar {
  display: none;
}

.mw-reel-card {
  flex: 0 0 340px;
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.mw-show-nav {
  display: flex;
  gap: 0.5rem;
}

.mw-show-nav button {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--cream);
  background: none;
  color: var(--cream);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.mw-show-nav button:disabled {
  opacity: 0.35;
  cursor: default;
}

/* height is set from the frame's own MEASURE message; this is the guess
   until then, so the row doesn't jump much */
.mw-reel-card iframe {
  display: block;
  width: 100%;
  height: 620px;
  border: 0;
}

/* =============================================
   FULL ALBUMS + CREDITS
   ============================================= */

.mw-albums {
  padding: 4.5rem 0;
  border-top: 1.5px solid var(--ink);
}

.mw-albums h2 {
  font-size: clamp(3rem, 7vw, 4.5rem);
}

.mw-albums-sub {
  margin: 0.75rem 0 2rem;
}

.mw-albums-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.mw-album {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.15s;
}

.mw-album:hover {
  transform: translateY(-3px);
}

.mw-album img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mw-album-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.25rem 1.25rem 1.5rem;
  flex: 1;
}

.mw-album h3 {
  font-family: var(--font-brush);
  font-weight: 400;
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.mw-album .tracked {
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
}

.mw-album .btn {
  margin-top: auto;
}

.mw-credit a,
.mw-viewer a {
  text-underline-offset: 4px;
  font-weight: 700;
}

/* =============================================
   REEL — photo strip under the headline
   ============================================= */

.mw-reel {
  position: relative;
  overflow: hidden;
  padding: 0 0 1rem;
}

.mw-reel-track {
  --gap: 0.75rem;
  display: flex;
  gap: var(--gap);
  width: max-content;
  animation: mw-reel 70s linear infinite;
}

.mw-reel:hover .mw-reel-track,
.mw-reel-track:focus-within,
.mw-reel.is-paused .mw-reel-track {
  animation-play-state: paused;
}

/* Pause / play for touch and keyboard (moving content needs a stop) */
.mw-reel-pause {
  position: absolute;
  right: var(--gutter);
  bottom: 1.75rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 6px rgba(14, 30, 60, 0.25);
}

.mw-reel-pause::before {
  content: '';
  width: 12px;
  height: 14px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.mw-reel.is-paused .mw-reel-pause::before {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 8px 0 8px 13px;
  border-color: transparent transparent transparent currentColor;
}

.mw-reel .mw-photo {
  flex: none;
  width: auto;
  margin: 0;
}

.mw-reel img {
  height: 300px;
  width: auto;
}

/* half the track = one full copy, so the loop has no seam */
@keyframes mw-reel {
  to { transform: translateX(calc(-50% - var(--gap) / 2)); }
}

/* =============================================
   RECAP — one block per day
   ============================================= */

.mw-day {
  padding: 3.5rem 0;
}

.mw-day-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}

.mw-day-head .brush {
  font-size: clamp(3rem, 6vw, 4.5rem);
  margin: 0.25rem 0 0.4rem;
}

.mw-day-theme {
  font-family: var(--font-brush);
  text-transform: uppercase;
  font-size: 1.8rem;
  letter-spacing: 0.12em;
}

.mw-credit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.mw-credit .tracked {
  font-size: 0.72rem;
}

/* Masonry: marathon.js deals photos into the shortest column */
.mw-photos {
  --gap: 0.75rem;
  display: flex;
  gap: var(--gap);
}

/* Columns stretch to the tallest; shorter ones share the slack across
   their photos (a slight crop each) so every column ends level */
.mw-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.mw-col .mw-photo {
  flex: 1 1 auto;
}

.mw-col .mw-photo img {
  height: 100%;
  object-fit: cover;
}

.mw-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: var(--ink-soft);
  border-radius: 10px;
  overflow: hidden;
  cursor: zoom-in;
}

.mw-photo img {
  width: 100%;
  transition: transform 0.4s ease;
}

.mw-photo:hover img {
  transform: scale(1.03);
}

/* =============================================
   SPONSORS — LMNT big, the rest in a row
   Logos are one-color ink versions of each brand's mark
   ============================================= */

.mw-sponsors {
  padding: 4.5rem 0 5rem;
  border-top: 1.5px solid var(--ink);
  text-align: center;
}

.mw-sponsors h2 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 2.5rem;
}

.mw-sponsor {
  display: inline-block;
  transition: transform 0.15s;
}

.mw-sponsor:hover {
  transform: translateY(-3px);
}

.mw-sponsor img {
  width: auto;
}

.mw-sponsor--lead img {
  height: 160px;
}

.mw-sponsor-row {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem 3.5rem;
  margin-top: 3rem;
}

/* heights tuned so the marks read at similar weight */
.mw-logo-rxbar { height: 34px; }
.mw-logo-brooklyn { height: 92px; }
.mw-logo-create { height: 32px; }
.mw-logo-sport-coffee { height: 80px; }
.mw-logo-huel { height: 34px; }
.mw-logo-finish-line { height: 50px; }

/* too narrow for one row of six: two even rows of three instead of 5 + 1 */
@media (min-width: 601px) and (max-width: 1199px) {
  .mw-sponsor-row {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    justify-items: center;
    gap: 2.5rem 4rem;
  }
}

/* =============================================
   TAG ASK — shown before any album link
   ============================================= */

.mw-ask {
  margin: auto;
  width: min(420px, calc(100vw - 2rem));
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  padding: 2.75rem 1.5rem 1.75rem;
  text-align: center;
}

.mw-ask::backdrop {
  background: rgba(14, 30, 60, 0.6);
}

.mw-ask-title {
  font-family: var(--font-brush);
  font-size: clamp(1.7rem, 7.5vw, 2.3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.mw-ask .tracked {
  font-size: 0.7rem;
}

.mw-ask-handles {
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  line-height: 1.8;
  margin: 1.25rem 0 1.5rem;
}

.mw-ask-handles a {
  font-weight: 700;
  text-underline-offset: 4px;
}

.mw-ask-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.mw-ask-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* =============================================
   PHOTO VIEWER
   ============================================= */

.mw-viewer {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: none;
  background: rgba(14, 30, 60, 0.96);
  color: var(--cream);
  display: none;
  align-items: center;
  justify-content: center;
}

.mw-viewer[open] {
  display: flex;
}

.mw-viewer::backdrop {
  background: transparent;
}

.mw-viewer figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
  padding: 3.5rem 4.5rem 1.5rem;
}

.mw-viewer img {
  max-width: 100%;
  max-height: calc(100dvh - 8rem);
  object-fit: contain;
  border-radius: 6px;
}

.mw-viewer figcaption {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.7rem;
}

.mw-viewer button {
  position: absolute;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 3rem;
  line-height: 1;
  width: 56px;
  height: 56px;
  cursor: pointer;
  z-index: 1;
}

.mw-viewer-close {
  top: 0.5rem;
  right: 0.5rem;
}

.mw-viewer-nav {
  top: 50%;
  transform: translateY(-50%);
}

.mw-viewer-prev { left: 0.5rem; }
.mw-viewer-next { right: 0.5rem; }

/* =============================================
   OUTRO
   ============================================= */

.mw-outro {
  padding: 5rem 0 2rem;
  text-align: center;
}

.mw-outro .wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.mw-outro h2 {
  font-size: clamp(2.8rem, 8vw, 6rem);
}

.mw-outro img {
  width: min(640px, 100%);
}

.mw-outro-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.mw-outro-sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.mw-outro .mw-mark {
  width: 150px;
}

.mw-outro footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 241, 234, 0.25);
  font-size: 0.7rem;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 900px) {
  .mw-hero {
    grid-template-columns: 1fr minmax(0, 220px);
  }
  /* Albums become a swipeable row */
  .mw-albums-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 0.5rem;
    scroll-padding: 0 var(--gutter);
    scrollbar-width: none;
  }
  .mw-albums-row::-webkit-scrollbar {
    display: none;
  }
  .mw-album {
    flex: 0 0 min(78%, 320px);
    scroll-snap-align: start;
  }
  .mw-reel-card {
    flex-basis: 326px;
  }
  .mw-show-nav {
    display: none;
  }
}

@media (max-width: 600px) {
  /* Drawing drops out so the first photos land on the first screen */
  .mw-header {
    padding: 1rem 0 1.25rem;
  }
  .mw-hero {
    grid-template-columns: 1fr;
    padding: 0 0 2rem;
  }
  .mw-hero-art {
    display: none;
  }
  .mw-hero {
    padding-bottom: 1.5rem;
  }
  .mw-hero h1 {
    font-size: 4.5rem;
    line-height: 0.9;
  }
  .mw-reel img {
    height: 220px;
  }
  .mw-reel-track {
    --gap: 0.5rem;
    animation-duration: 55s;
  }
  .eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.22em;
  }
  .mw-albums,
  .mw-day,
  .mw-show {
    padding: 2.5rem 0;
  }
  .mw-sponsors {
    padding: 3rem 0 3.5rem;
  }
  .mw-sponsors h2 {
    margin-bottom: 2rem;
  }
  .mw-sponsor--lead img {
    height: 120px;
  }
  /* even 2×2: each logo centered in its own cell */
  .mw-sponsor-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: center;
    align-items: center;
    gap: 2rem 1rem;
    margin-top: 2.25rem;
  }
  .mw-logo-rxbar { height: 26px; }
  .mw-logo-brooklyn { height: 76px; }
  .mw-logo-create { height: 26px; }
  .mw-logo-sport-coffee { height: 66px; }
  .mw-logo-huel { height: 28px; }
  .mw-logo-finish-line { height: 40px; }
  /* odd one out (5th) sits centered under the 2×2 */
  .mw-sponsor-row li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .mw-day-bar {
    margin-bottom: 1.25rem;
  }
  .mw-photos {
    --gap: 0.5rem;
  }
  .mw-photo {
    border-radius: 8px;
  }
  .mw-viewer figure {
    padding: 3.5rem 0.5rem 1.5rem;
  }
  .mw-viewer-nav {
    top: auto;
    bottom: 0.25rem;
    transform: none;
  }
  .mw-outro footer {
    flex-direction: column;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  .mw-show-row { scroll-behavior: auto; }
  /* Strip stands still: swipe it instead, one copy only, inside the gutter */
  .mw-reel {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--gutter);
  }
  .mw-reel-track {
    animation: none;
    padding: 0 var(--gutter);
  }
  .mw-reel .mw-photo { scroll-snap-align: start; }
  .mw-reel [aria-hidden="true"],
  .mw-reel-pause { display: none; }
  .mw-photo img { transition: none; }
}
