/*
  Inspiration Board — /inspiration-board/ only, loaded after site.css.

  The behaviour is ported from docs/inspiration-board-source.html; the styling isn't.
  Every colour, font, size and radius below is a site.css token (or the black/white
  overlays the site already uses), so the board reads as part of the site — the
  prototype's own palette and fonts were placeholders and are gone. Classes carry an
  ib- prefix because site.css already owns .tabs, .hero and similar names.

  Almost every couple opens this on a phone, so the base rules are the 390px layout
  and the 720px block adds the desktop changes (docs/inspiration-board-SPEC.md §8.8).
*/

/* ===== Gate ===== */
/* A remembered code opens the board straight away; the inline check in the template
   hides the gate meanwhile so a return visit doesn't flash it. The script lifts this
   either way, and the animation brings the gate back regardless after 4s — nothing
   here may be able to hide the page for good if the script never runs. */
.ib-resume .ib-gate {
  visibility: hidden;
  animation: ib-unhide 0s 4s forwards;
}
@keyframes ib-unhide { to { visibility: visible; } }

.ib-gate-form { max-width: 24rem; margin-top: 2.25rem; }
.ib-gate-form .form-field { margin-bottom: 1.25rem; }
.ib-gate-form input[name="code"] { text-transform: uppercase; }
.ib-gate-form .btn { width: 100%; margin-top: 0.5rem; text-align: center; }
.ib-gate-error {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--color-grey-100);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.ib-gate-error:empty { display: none; }
.ib-gate .send-note { margin-top: 1.5rem; }
.ib-gate .send-note a { color: var(--color-text); }
@media (min-width: 700px) {
  .ib-gate-form .btn { width: auto; }
}

/* ===== Board shell ===== */
.ib {
  /* Narrower than --content-max: a 4:5 photo at 980px wide is taller than any screen. */
  --ib-col: 760px;
  opacity: 0;
  transition: opacity 0.8s var(--ease);
}
.ib.is-in { opacity: 1; }
.ib-wrap {
  max-width: calc(var(--ib-col) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.ib button:focus-visible { outline: 2px solid var(--color-black); outline-offset: 2px; }

/* The page scrolls as a whole, so the bar offset lives on html — only while a board
   is open (the script adds .ib-on), never on the gate. It keeps anything the browser
   scrolls to (a focused checkbox, say) clear of the bar. The script measures
   --ib-offset: site header + tab bar.

   No scroll-snap: SPEC §4 asked for proximity snap on the section headers, but it
   fought the chevron's scrolls and made the page jump about — the twitch §8.7
   warns of — so it's dropped, as §8.7 allows. The chevron does the walking. */
html.ib-on { scroll-padding-top: var(--ib-offset, 110px); }

/* ===== Draft preview banner =====
   Only on /inspiration-board/<code>?preview, which the stylist opens from the
   dashboard: it shows her draft, so it says so, plainly, before anything else. */
.ib-preview {
  padding: 0.6rem var(--gutter);
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
}

/* ===== Sticky tab bar =====
   Sits directly under the site header, the way Apple's product nav sits under its
   global nav: light frosted glass under the header's dark. */
.ib-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 40; /* under .site-header (100), over the board */
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border);
}
.ib-tabs {
  position: relative; /* each pill's offsetLeft is measured against the strip */
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0.55rem max(var(--gutter), calc((100% - var(--ib-col)) / 2));
}
.ib-tabs::-webkit-scrollbar { display: none; }
.ib-tab {
  flex: 0 0 auto;
  appearance: none;
  padding: 0.5rem 0.9rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: var(--title-tracking);
  line-height: 1.2;
  color: var(--color-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.ib-tab:hover { color: var(--color-text); }
.ib-tab[aria-selected="true"] { background: var(--color-black); color: var(--color-white); }
.ib-tab-num,
.ib-tab-count { font-variant-numeric: tabular-nums; font-weight: 500; opacity: 0.6; }
.ib-tab-num { margin-right: 0.4em; }
.ib-tab-count { margin-left: 0.45em; }
.ib-tab-count:empty { display: none; }
/* Schedule and Bring are a different kind of thing from the numbered concepts, so a
   hairline sets them apart. */
.ib-tab-rule {
  flex: 0 0 1px;
  align-self: stretch;
  margin: 0.4rem 0.35rem;
  background: var(--color-border);
}

/* ===== Names ===== */
.ib-hero { padding-top: 3rem; }
.ib-names { font-size: var(--size-name); line-height: 1.05; margin: 0 0 0.35em; }
.ib-names:focus { outline: none; }
/* The ampersand in the body face's italic — the Bodoni the site already loads. */
.ib-names em { font-family: var(--font-body); font-style: italic; font-weight: 400; }
.ib-date { margin: 0; color: var(--color-muted); }
.ib-change {
  margin-top: 1.75rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  background: var(--color-grey-100);
}
.ib-change b {
  display: block;
  margin-bottom: 0.3em;
  font-family: var(--font-display);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ib-change p { margin: 0; color: var(--color-grey-800); }

/* ===== Sections ===== */
.ib-sec { padding-top: 3.5rem; }
.ib-h { font-size: var(--size-subhead); margin: 0 0 1.25rem; }
.ib-note { margin: -0.5rem 0 2rem; color: var(--color-muted); }

/* Every photo slot shows a grey well until its image lands, and opens the lightbox
   when tapped. */
.ib-loc-hero,
.ib-loc-cell,
.ib-fit-img,
.ib-det-img { overflow: hidden; background: var(--color-grey-100); }
.ib-loc-hero img,
.ib-loc-cell img,
.ib-fit-img img,
.ib-det-img img,
.ib-mood-sheet img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

/* ----- Location: hero, then a strip of the rest; an odd last one spans the row ----- */
.ib-loc-hero { aspect-ratio: 4 / 5; border-radius: var(--radius-media); }
.ib-loc-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.ib-loc-cell { aspect-ratio: 1; border-radius: 12px; }
.ib-loc-cell:last-child:nth-child(odd) { grid-column: 1 / -1; aspect-ratio: 16 / 7; }
.ib-loc-name { font-size: var(--size-headline); margin: 1.25rem 0 0.15em; }
.ib-loc-area { margin: 0; color: var(--color-muted); }

/* ----- Mood: one 9:16 collage, never cropped -----
   The stylist composed it, and cropping undoes that — so contain rather than cover,
   in case an upload is a hair off 9:16. Height-capped so it never outgrows the
   screen; on desktop it sits centred on the page. The spec's dark ground was
   swapped for the page white at the studio's request. */
.ib-mood { display: flex; justify-content: center; background: var(--color-bg); }
.ib-mood-sheet {
  width: 100%;
  max-width: calc(100vh * 9 / 16);
  max-width: calc(100svh * 9 / 16);
  aspect-ratio: 9 / 16;
}
.ib-mood-sheet img { object-fit: contain; }

/* ----- Outfits: one person at a time, stacked so a look can be compared with its
   alternates. The person switch is the site's own segmented .tabs control. ----- */
.ib-who { margin-bottom: 1.5rem; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ib-who::-webkit-scrollbar { display: none; }
.ib-fits { display: grid; gap: 2rem; }
.ib-fit { margin: 0; }
.ib-fit-img { aspect-ratio: 3 / 4; border-radius: var(--radius-media); }
.ib-fit-cap { display: flex; gap: 0.6rem; align-items: baseline; margin-top: 0.8rem; }
.ib-fit-cap p { margin: 0; }
.ib-tag {
  flex: 0 0 auto;
  padding: 0.2em 0.7em;
  border: 1px solid var(--color-grey-400);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ----- Details: labelled thumbnails, three across on a phone ----- */
.ib-det { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem 0.6rem; }
.ib-det figure { margin: 0; }
.ib-det-img { aspect-ratio: 1; border-radius: 12px; }
.ib-det figcaption {
  margin-top: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  line-height: 1.35;
}
.ib-det-who {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ----- Next set: full-width handoff to the next pane ----- */
.ib-next {
  display: block;
  width: 100%;
  margin-top: 4rem;
  padding: 1.75rem 0 2rem;
  border: 0;
  background: var(--color-grey-100);
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ib-next-in { display: flex; align-items: center; gap: 1rem; }
.ib-next-t { flex: 1; min-width: 0; }
.ib-next-t > span {
  display: block;
  margin-bottom: 0.35em;
  font-family: var(--font-display);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.ib-next-t > b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--size-headline);
  font-weight: 700;
  line-height: 1.12;
}
.ib-next-c {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-black);
  color: var(--color-white);
  transition: transform 0.25s var(--ease);
}
.ib-next-c svg { width: 18px; height: 18px; }
.ib-next:hover .ib-next-c { transform: translateX(3px); }

/* ===== Schedule ===== */
.ib-sched { margin: 0; padding: 0; list-style: none; }
.ib-s-row {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 0 0 1.5rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
button.ib-s-row { cursor: pointer; }
.ib-s-row time {
  flex: 0 0 3.5rem;
  padding-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--color-muted);
}
/* One rule per row, running on into the next; each marker's white ring punches
   through it. */
.ib-s-dot {
  position: relative;
  flex: 0 0 1.75rem;
  align-self: stretch;
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}
.ib-s-dot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: -1.5rem;
  width: 1px;
  transform: translateX(-0.5px);
  background: var(--color-border);
}
.ib-sched li:first-child .ib-s-dot::before { top: 0.9rem; }
.ib-sched li:last-child .ib-s-dot::before { content: none; }
.ib-s-dot i {
  position: relative;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-grey-400);
  box-shadow: 0 0 0 4px var(--color-bg);
}
.ib-s-body { flex: 1; min-width: 0; }
.ib-s-body b {
  display: block;
  padding-top: 0.25rem;
  font-family: var(--font-display);
  font-size: var(--size-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.ib-s-body span { display: block; font-size: 0.9375rem; color: var(--color-muted); }
/* Locations: a solid marker, the set's name large, and a tap opens that set */
.ib-s-loc time,
.ib-s-edge time { color: var(--color-text); }
.ib-s-loc .ib-s-dot i { width: 11px; height: 11px; border-radius: 2px; background: var(--color-black); }
.ib-s-loc .ib-s-body b {
  padding-top: 0;
  font-size: var(--size-subhead);
  letter-spacing: var(--title-tracking);
  text-transform: none;
  line-height: 1.2;
  color: var(--color-text);
}
.ib-s-go { flex: 0 0 auto; padding-top: 0.15rem; color: var(--color-muted); }
.ib-s-go svg { display: block; width: 18px; height: 18px; }
/* Start and wrap bookend the day */
.ib-s-edge .ib-s-dot i { width: 11px; height: 11px; background: var(--color-black); }
.ib-s-edge .ib-s-body b { color: var(--color-text); }

/* ===== Bring with you ===== */
.ib-grp { margin-bottom: 2rem; }
.ib-grp-name { margin-bottom: 0.4rem; }
.ib-chk {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  width: 100%;
  padding: 0.95rem 0;
  border: 0;
  border-top: 1px solid var(--color-border);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ib-box {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 0.1rem;
  border: 1.5px solid var(--color-grey-400);
  border-radius: 50%;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.ib-box::after {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid var(--color-white);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(42deg) scale(0);
  transition: transform 0.2s var(--ease);
}
.ib-chk[aria-checked="true"] .ib-box { background: var(--color-black); border-color: var(--color-black); }
.ib-chk[aria-checked="true"] .ib-box::after { transform: rotate(42deg) scale(1); }
.ib-chk-t { flex: 1; min-width: 0; }
.ib-chk-t b {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.ib-chk-t span { display: block; font-size: 0.9375rem; color: var(--color-muted); }
.ib-chk[aria-checked="true"] .ib-chk-t b,
.ib-chk[aria-checked="true"] .ib-chk-t span {
  color: var(--color-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.ib-foot {
  margin-top: 1.5rem;
  padding: 2rem 0 6rem;
  border-top: 1px solid var(--color-border);
}
.ib-foot p { margin: 0 0 0.9rem; color: var(--color-muted); }
.ib-switch {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ===== Floating chevron: jumps to the next section header in this pane ===== */
.ib-down {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  color: var(--color-white);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.ib-down.is-on { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
.ib-down svg { width: 20px; height: 20px; }

/* ===== Lightbox ===== */
.ib-lb {
  position: fixed;
  inset: 0;
  z-index: 200; /* over the site header */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.92);
}
.ib-lb[hidden] { display: none; }
.ib-lb img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
  max-height: 88dvh;
  object-fit: contain;
}
.ib-lb-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--color-white);
  cursor: pointer;
}
.ib-lb-x svg { width: 20px; height: 20px; }
.ib-lb-x:focus-visible { outline: 2px solid var(--color-white); outline-offset: 2px; }

/* ===== Reveals =====
   The fade itself is site.css's [data-reveal] / .is-visible; the script only picks
   the targets and their stagger. The mood collage fades without the lift, as §8.6
   asks. */
.js [data-reveal][data-reveal-fade],
.js [data-reveal][data-reveal-fade].is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .ib,
  .ib-tab,
  .ib-box,
  .ib-box::after,
  .ib-next-c,
  .ib-down { transition: none; }
  .ib-next:hover .ib-next-c { transform: none; }
}

/* ===== Wider screens ===== */
@media (min-width: 720px) {
  .ib-hero { padding-top: 4.5rem; }
  .ib-sec { padding-top: 5rem; }
  .ib-fits { grid-template-columns: 1fr 1fr; gap: 2.5rem 1.5rem; }
  .ib-det { grid-template-columns: repeat(6, 1fr); gap: 1.25rem 0.75rem; }
  .ib-mood-sheet { max-width: calc(88vh * 9 / 16); max-width: calc(88svh * 9 / 16); }
}
