/* Lookbook docket components (see templates/_includes/lookbook/components.jinja). Only what Tailwind utilities can't do. */

/* Gallery: desktop mosaic */
.lb-gallery { padding: 4px; }
.lb-photo { position: relative; overflow: hidden; background: #f4f2ee; min-height: 0; }
.lb-gallery__mosaic { display: grid; gap: 4px; height: min(70vh, 640px); }
.lb-gallery--n1 .lb-gallery__mosaic { grid-template-columns: 1fr; }
.lb-gallery--n2 .lb-gallery__mosaic { grid-template-columns: 1fr 1fr; }
.lb-gallery--n3 .lb-gallery__mosaic,
.lb-gallery--more .lb-gallery__mosaic { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.lb-gallery--n3 .lb-photo:first-child,
.lb-gallery--more .lb-photo:first-child { grid-row: span 2; }
.lb-gallery__rest { display: flex; gap: 4px; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
.lb-gallery__rest::-webkit-scrollbar { display: none; }
.lb-gallery__rest .lb-photo { flex: none; width: 160px; height: 200px; }
.lb-dots { display: none; }

/* Gallery: phone swipe carousel with dots */
@media (max-width: 767px) {
  .lb-gallery { padding: 0; margin: 0 -20px; } /* edge to edge: cancels the section's 20px gutter */
  .lb-gallery__track { display: flex; gap: 3px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .lb-gallery__track::-webkit-scrollbar { display: none; }
  .lb-gallery__mosaic, .lb-gallery__rest { display: contents; }
  .lb-gallery__track .lb-photo { flex: none; width: 88%; height: 440px; margin: 0; scroll-snap-align: start; }
  .lb-gallery--n1 .lb-gallery__track .lb-photo { width: 100%; }
  .lb-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; }
  .lb-dot { width: 5px; height: 5px; border-radius: 50%; background: #e8e8e8; transition: background .2s; }
  .lb-dot.is-active { background: #2b2b2b; }
}

/* Step into a photo (desktop, from 1024px; frontend/src/lookbook-docket/step-into.js). The look's own section
   becomes a full-viewport charcoal stage in the page flow (not a modal); --lb-stage-top is the sticky header height. */
@media (min-width: 1024px) {
  .lb-gallery .lb-photo { cursor: zoom-in; }
  .lb-gallery .lb-photo img { transition: filter .2s; }
  .lb-gallery .lb-photo:hover img { filter: brightness(.92); }
  .lb-gallery .lb-photo:focus-visible { outline: 1px solid #2b2b2b; outline-offset: 2px; }
}
.lb-look.is-stepped-in { height: calc(100vh - var(--lb-stage-top, 0px)); background: #2b2b2b; color: #fdfdfd; border-color: #2b2b2b; }
.lb-look.is-stepped-in > :not(.lb-stage) { display: none; }
.lb-stage { display: flex; flex-direction: column; height: 100%; font-family: 'DM Sans', sans-serif; font-weight: 300; }
.lb-stage__cap { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; font-weight: 400; }
.lb-stage__view { position: relative; flex: 1; min-height: 0; display: flex; }
.lb-stage__count { position: absolute; top: 20px; left: 36px; color: rgba(253,253,253,.7); z-index: 1; }
.lb-stage__hint { position: absolute; top: 20px; right: 36px; color: rgba(253,253,253,.5); z-index: 1; }
.lb-stage__track { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 18px; padding: 52px 0 24px;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.lb-stage__track::-webkit-scrollbar { display: none; }
.lb-stage__spacer { flex: none; width: 50%; }
.lb-stage__slide { flex: none; height: 100%; aspect-ratio: 2 / 3; scroll-snap-align: center; opacity: .28;
  transition: opacity .35s; cursor: pointer; }
.lb-stage__slide.is-current { opacity: 1; cursor: default; }
.lb-stage__slide img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.lb-stage__slide--video { aspect-ratio: 9 / 16; }
.lb-stage__slide iframe { display: block; width: 100%; height: 100%; border: 0; background: #2b2b2b; pointer-events: none; }
.lb-stage__slide--video.is-current iframe { pointer-events: auto; }
.lb-stage__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; padding: 20px; background: none; border: 0;
  color: #fdfdfd; font: 200 40px/1 'Noto Serif', serif; opacity: .7; cursor: pointer; transition: opacity .2s; }
.lb-stage__arrow:hover, .lb-stage__arrow:focus-visible { opacity: 1; }
.lb-stage__arrow:disabled { opacity: .2; cursor: default; }
.lb-stage__arrow--prev { left: 8px; }
.lb-stage__arrow--next { right: 8px; }
.lb-stage__bar { flex: none; height: 92px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr);
  align-items: center; gap: 28px; padding: 0 36px; border-top: 1px solid rgba(253,253,253,.14); }
.lb-stage__who { display: flex; align-items: baseline; gap: 16px; min-width: 0; }
.lb-stage__num { font-family: 'Noto Serif', serif; font-weight: 200; font-size: 44px; line-height: 1; }
.lb-stage__title { font-family: 'Noto Serif', serif; font-weight: 300; font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-stage__chips { display: flex; align-items: center; gap: 6px; }
.lb-stage__chip { display: block; width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #f4f2ee;
  border: 1px solid rgba(253,253,253,.35); }
.lb-stage__pieces { margin-left: 10px; color: rgba(253,253,253,.6); }
@media (max-width: 1279px) { .lb-stage__pieces { display: none; } } /* room for the title and buttons */
.lb-stage__acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.lb-stage .lb-actions { flex-direction: row; margin-top: 0; gap: 8px; }
.lb-stage .lb-actions > a, .lb-stage .lb-actions > button { padding: 11px 20px; white-space: nowrap;
  background: transparent; color: #fdfdfd; border: 1px solid rgba(253,253,253,.6); }
.lb-stage .lb-actions > a:hover, .lb-stage .lb-actions > button:hover { background: rgba(253,253,253,.12); color: #fdfdfd; }
.lb-stage .lb-actions > .bg-cf-dark { background: #fdfdfd; color: #2b2b2b; border-color: #fdfdfd; }
.lb-stage .lb-actions > .bg-cf-dark:hover { background: rgba(253,253,253,.85); color: #2b2b2b; }
.lb-stage__close { margin-left: 14px; padding: 10px 0; background: none; border: 0; color: #fdfdfd; cursor: pointer; white-space: nowrap; }
.lb-stage__close:hover { text-decoration: underline; text-underline-offset: 3px; }
.lb-stage button:focus-visible, .lb-stage a:focus-visible { outline: 1px solid #fdfdfd; outline-offset: 3px; }
/* The fly-in copy of the clicked photo (FLIP); skipped for prefers-reduced-motion */
.lb-stage-fly { position: fixed; z-index: 60; object-fit: cover; pointer-events: none; }
.lb-stage-fly.is-flying { transition: left .55s cubic-bezier(.2,.7,.2,1), top .55s cubic-bezier(.2,.7,.2,1),
  width .55s cubic-bezier(.2,.7,.2,1), height .55s cubic-bezier(.2,.7,.2,1); }

/* Docket rows */
.lb-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; padding: 11px 0;
  border-bottom: 1px solid #e8e8e8; font-size: 12px; color: #2b2b2b; text-decoration: none; }
a.lb-row:hover .lb-row__arrow { transform: translateX(3px); }
.lb-row__swatch { display: block; flex: none; }
.lb-row__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb-row__name { font-weight: 300; }
.lb-row__meta { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #7d8082; }
.lb-row__arrow { transition: transform .2s; }

/* Earlier try-on results on a photo: Original / Try on toggle (lookbook-docket JS) */
.lb-tryon-result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.lb-tryon-result.is-hidden { opacity: 0; pointer-events: none; }
.lb-tryon-toggle { position: absolute; top: 12px; left: 12px; z-index: 2; display: flex; overflow: hidden;
  border: 1px solid rgba(255,255,255,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.lb-tryon-toggle button { padding: 6px 12px; font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.85); background: transparent; transition: background .2s; }
.lb-tryon-toggle button[aria-pressed="true"] { background: rgba(255,255,255,.3); color: #fff; }

/* Try-on drawer: right-side panel from 768px, bottom sheet below */
html.lb-drawer-lock { overflow: hidden; }
.lb-drawer { position: fixed; inset: 0; z-index: 65; visibility: hidden; pointer-events: none; transition: visibility 0s .3s; }
.lb-drawer.is-open { visibility: visible; pointer-events: auto; transition: visibility 0s; }
.lb-drawer__backdrop { position: absolute; inset: 0; background: rgba(43,43,43,.4); opacity: 0; transition: opacity .3s; }
.lb-drawer.is-open .lb-drawer__backdrop { opacity: 1; }
.lb-drawer__panel { position: absolute; display: flex; flex-direction: column; background: #fdfdfd; color: #2b2b2b;
  border: 1px solid #e8e8e8; transition: transform .3s ease; outline: none;
  left: 0; right: 0; bottom: 0; height: 88vh; height: 88dvh; transform: translateY(100%); border-bottom: 0; }
.lb-drawer.is-open .lb-drawer__panel { transform: none; }
@media (min-width: 768px) {
  .lb-drawer__panel { left: auto; top: 0; height: 100%; width: 480px; max-width: 100%; transform: translateX(100%);
    border-bottom: 1px solid #e8e8e8; border-right: 0; }
}
.lb-drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px;
  border-bottom: 1px solid #e8e8e8; flex: none; }
.lb-drawer__label, .lb-drawer__close { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #2b2b2b; }
.lb-drawer__close { background: none; border: 0; padding: 6px 0; cursor: pointer; }
.lb-drawer__close:hover { text-decoration: underline; text-underline-offset: 3px; }
.lb-drawer__look { display: flex; align-items: center; gap: 12px; padding: 12px 20px; flex: none; }
.lb-drawer__thumb { width: 48px; height: 64px; object-fit: cover; background: #f4f2ee; flex: none; }
.lb-drawer__title { font-family: 'Noto Serif', serif; font-weight: 200; font-size: 18px; }
.lb-drawer__mount { position: relative; flex: 1; min-height: 0; }
.lb-drawer__root { position: absolute; inset: 0; }
/* The drawer has its own Close: hide the panel's corner X and the room kept for it */
.lb-drawer__root > div > button[aria-label="Cancel"] { display: none; }
.lb-drawer__root > div { padding-top: 16px; }

/* List page (large_lookbook block): Chapters and Reels */
/* Sections snap just under the sticky site header ([data-site-header]: 53px on phone, 85px from 768px);
   the Chapters height in large_lookbook.jinja uses the same numbers. */
html:has([data-lb-chapters]) { scroll-snap-type: y proximity; scroll-padding-top: 53px; }
@media (min-width: 768px) { html:has([data-lb-chapters]) { scroll-padding-top: 85px; } }
/* A snap point at the very top too, so the page doesn't jump past its title and intro on load */
html:has([data-lb-chapters]) body { scroll-snap-align: start; }
.lb-chapter { scroll-snap-align: start; }
/* Phone: shade from the bottom for the text, and a light one at the top for the "Look books · 01 / 05" label */
.lb-chapter__shade { background: linear-gradient(0deg, rgba(43,43,43,.75), rgba(43,43,43,0) 55%),
  linear-gradient(180deg, rgba(43,43,43,.35), rgba(43,43,43,0) 18%); }
@media (min-width: 768px) {
  .lb-chapter__shade { background: linear-gradient(90deg, rgba(43,43,43,.6), rgba(43,43,43,0) 55%); }
}
.lb-swipe { overflow-x: auto; scrollbar-width: none; }
.lb-swipe::-webkit-scrollbar { display: none; }
/* Homepage tiles: a swipe row on phone (with a gutter after the last tile), a plain grid from 768px */
[data-lb-tiles] .lb-swipe::after { content: ""; flex: none; width: 4px; }
@media (min-width: 768px) {
  [data-lb-tiles] .lb-swipe { overflow: visible; }
  [data-lb-tiles] .lb-swipe::after { display: none; }
}
[data-lb-reels] .lb-swipe { scroll-snap-type: x proximity; }
[data-lb-reels] .lb-swipe > * { scroll-snap-align: start; }
[data-lb-reels] .lb-swipe > a { height: 320px; }

/* Homepage running reel (_includes/homepage/lookbooks.jinja). Tiles 300x400 (220x293 phone), 10px gap. Phone and
   reduced motion: a plain swipe row (.lb-swipe), duplicate copy hidden. From 768px: a slow marquee (two copies,
   -50% = one copy), paused on hover, keyboard focus or the Pause button. */
.lb-reel { position: relative; }
.lb-reel__track { display: flex; width: max-content; }
.lb-reel__group { display: flex; gap: 10px; padding: 0 10px 0 20px; margin: 0; list-style: none; }
.lb-reel__group[data-lb-reel-copy] { display: none; }
.lb-reel__tile { position: relative; flex: none; list-style: none; width: 220px; height: 293px; background: #f4f2ee; }
.lb-reel__tile a { display: block; position: relative; }
.lb-reel__tile a:focus-visible { outline: 1px solid #2b2b2b; outline-offset: 2px; }
.lb-reel__tag { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); background: rgba(253,253,253,.92);
  padding: 6px 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-reel__fade, .lb-reel__toggle { display: none; }
.lb-reel__toggle { background: none; border: 0; padding: 0 0 3px; cursor: pointer; }
.lb-reel__toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
@keyframes lb-reel-run { to { transform: translateX(-50%); } }
@media (min-width: 768px) {
  .lb-reel.lb-swipe { overflow: hidden; }
  .lb-reel__group { padding-left: 0; }
  .lb-reel__tile { width: 300px; height: 400px; }
  .lb-reel__group[data-lb-reel-copy] { display: flex; }
  .lb-reel__fade { display: block; position: absolute; top: 0; bottom: 0; width: 120px; pointer-events: none; z-index: 1; }
  .lb-reel__fade--l { left: 0; background: linear-gradient(90deg, #fdfdfd, rgba(253,253,253,0)); }
  .lb-reel__fade--r { right: 0; background: linear-gradient(-90deg, #fdfdfd, rgba(253,253,253,0)); }
  .lb-reel__toggle { display: inline-block; }
  .lb-reel__track { animation: lb-reel-run 70s linear infinite; }
  [data-lb-reel]:hover .lb-reel__track, [data-lb-reel]:focus-within .lb-reel__track,
  [data-lb-reel].is-paused .lb-reel__track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .lb-reel.lb-swipe { overflow-x: auto; }
  .lb-reel__track { animation: none; }
  .lb-reel__group[data-lb-reel-copy], .lb-reel__fade, .lb-reel__toggle { display: none; }
}
.lb-reel__tile::marker { content: none; }
