/* ============================================================
   NOVAMILLI — shared list board (/f/<code>)
   "The Nursery" design language; tokens come from ../styles.css
   ============================================================ */

/* ---------- Nav & shell ---------- */
/* relative + z-index so the open language menu paints above the hero,
   whose positioned children come later in DOM order */
.share-nav { position: relative; z-index: 100; padding: 16px 0; }
.share-nav-inner {
  max-width: var(--wrap-narrow); margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
}
.share-shell {
  max-width: var(--wrap-narrow); margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) clamp(70px, 10vh, 110px);
}

/* ---------- Loading ---------- */
.loading {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: clamp(100px, 24vh, 180px) 0;
  font-family: var(--serif); font-style: italic;
  font-size: 19px; color: var(--ink-soft);
}
.loading::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--rose);
  animation: loading-pulse 1.3s var(--ease-soft) infinite;
}
@keyframes loading-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ---------- Hero ---------- */
.share-hero { position: relative; padding: clamp(34px, 6vh, 64px) 0 clamp(10px, 2vh, 18px); }
.share-ghost {
  position: absolute; top: -0.16em; right: -0.04em; z-index: 0;
  font-family: var(--serif); font-style: italic; font-weight: 340;
  font-size: clamp(130px, 26vw, 230px); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(57, 46, 40, 0.13);
  pointer-events: none; user-select: none;
}
.share-hero > *:not(.share-ghost) { position: relative; z-index: 1; }
.share-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: clamp(16px, 2.6vh, 24px);
}
.share-title {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 380;
  font-size: clamp(38px, 7vw, 64px);
  line-height: 1.06; letter-spacing: -0.015em;
  text-wrap: balance;
}
.share-title em { font-style: italic; font-weight: 430; color: var(--rose-deep); }
/* The follow board's quiet secondary path to the gift list (/w/<wishlist code>). */
.share-wishlist-link { margin-top: clamp(18px, 3vh, 28px); }
.share-wishlist-link a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--rose-deep); text-decoration: none;
}
.share-wishlist-link a:hover { text-decoration: underline; text-underline-offset: 3px; }
.share-wishlist-link a:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }
.share-sub {
  max-width: 540px; margin-top: 16px;
  font-size: 17.5px; line-height: 1.65;
  color: var(--ink-soft);
}

/* ---------- Sections ---------- */
.section { margin-top: clamp(44px, 7vh, 64px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.board-section-title {
  font-family: var(--serif); font-weight: 420;
  font-size: clamp(24px, 3.4vw, 31px);
  letter-spacing: -0.01em;
}
.section-count {
  font-size: 12.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute); white-space: nowrap;
}

/* ---------- Category card & rows ---------- */
.board-card {
  background: var(--paper-card);
  border: 1px solid rgba(57, 46, 40, 0.08);
  border-radius: 22px;
  box-shadow: 0 16px 44px -20px rgba(57, 46, 40, 0.22);
  overflow: hidden;
}
/* screen-reader-only text (the collapsed category button carries the
   category name this way; the thumbnails inside it are decorative) */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Collapsible category header ---------- */
/* whole header is the toggle: featured-thumbnail teaser left, Browse right */
.cat-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%; padding: 14px 20px;
  background: transparent; border: 0; cursor: pointer;
  font-family: var(--sans); text-align: left;
}
.cat-toggle[aria-expanded="true"] { border-bottom: 1px solid rgba(57, 46, 40, 0.07); }
/* the teaser strip is redundant once the rows are visible */
.cat-toggle[aria-expanded="true"] .cat-thumbs { display: none; }
.cat-thumbs { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.cat-thumb {
  width: 44px; height: 44px; object-fit: contain; flex-shrink: 0;
  background: #fff; border-radius: 12px;
  border: 1px solid rgba(57, 46, 40, 0.07);
}
/* "+N" overflow bubble closing the teaser strip */
.cat-more {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 6px; flex-shrink: 0;
  background: var(--paper); border: 1px solid rgba(57, 46, 40, 0.07); border-radius: 12px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-mute);
}
.cat-browse {
  display: inline-flex; align-items: center; gap: 7px; margin-left: auto;
  font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--rose-deep); white-space: nowrap;
  transition: color 0.2s;
}
.cat-toggle:hover .cat-browse { color: var(--rose); }
.cat-toggle:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: -2px; border-radius: 22px; }
.toggle-chevron { flex-shrink: 0; transition: transform 0.3s var(--ease-out); }
/* Category toggle flips open/closed; the row's options toggle is progressive
   (see all → show more → show fewer) and only points up in its collapse state. */
.cat-toggle[aria-expanded="true"] .toggle-chevron,
.options-toggle[data-state="collapse"] .toggle-chevron { transform: rotate(180deg); }
.options-toggle.is-loading { opacity: 0.55; cursor: progress; }
.options-toggle:disabled { cursor: progress; }
.cat-body:not([hidden]) { animation: unfold 0.35s var(--ease-out); }
@keyframes unfold {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.row {
  display: flex; flex-direction: column; gap: 12px;
  padding: 15px 20px;
  border-bottom: 1px solid rgba(57, 46, 40, 0.07);
}
.row:last-child { border-bottom: 0; }
/* name + action on one line, so every gift button aligns with its item
   name regardless of whether a product pick follows below */
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row-name { min-width: 0; font-weight: 600; font-size: 16px; }
.row-done .row-name { color: var(--ink-mute); }

/* the toggles drive visibility via the hidden attribute, which the explicit
   display values below would otherwise override */
.pick[hidden], .options[hidden] { display: none; }

/* featured product pick under a row */
.pick {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; max-width: 520px;
  background: var(--paper);
  border: 1px solid rgba(57, 46, 40, 0.07);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s var(--ease-out);
}
.pick:hover { border-color: rgba(198, 74, 112, 0.4); transform: translateY(-1px); }
.pick img {
  width: 54px; height: 54px; object-fit: contain;
  background: #fff; border-radius: 10px; flex-shrink: 0;
}
.pick-text { flex: 1; min-width: 0; }
.pick-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--ink);
}
.pick-meta { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-mute); }
/* trailing ↗ tells the visitor this whole strip opens the shop */
.pick-arrow { display: inline-flex; flex-shrink: 0; color: var(--rose-deep); }

/* ---------- Expanded options (the row's mini-shop) ---------- */
.options {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px;
}
.options:not([hidden]) { animation: unfold 0.35s var(--ease-out); }
.option {
  display: flex; gap: 12px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid rgba(57, 46, 40, 0.07);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.25s, transform 0.25s var(--ease-out);
}
.option:hover { border-color: rgba(198, 74, 112, 0.4); transform: translateY(-1px); }
.option:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; }
.option img {
  width: 56px; height: 56px; object-fit: contain; flex-shrink: 0;
  background: #fff; border-radius: 10px;
}
.option-body { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.option-badge {
  padding: 2px 9px; border-radius: 100px;
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: color-mix(in srgb, var(--gold) 45%, var(--ink));
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.option-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--ink);
}
.option-price { font-size: 13px; color: var(--ink-mute); }
/* explicit shop cue on every tile — the title alone doesn't read as a link */
.option-shop {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 2px;
  font-size: 12px; font-weight: 700; color: var(--rose-deep);
}
.option:hover .option-shop { text-decoration: underline; text-underline-offset: 3px; }
.options-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0; background: transparent; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--rose-deep);
}
.options-toggle:hover .options-toggle-text { text-decoration: underline; text-underline-offset: 3px; }
.options-toggle:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 2px; border-radius: 6px; }

/* ---------- Chips & gift pill ---------- */
.chip {
  flex-shrink: 0;
  padding: 6px 13px; border-radius: 100px;
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em;
  white-space: nowrap;
}
.chip-done { background: color-mix(in srgb, var(--sage) 20%, transparent); color: color-mix(in srgb, var(--sage) 55%, var(--ink)); }
.chip-gift { background: color-mix(in srgb, var(--gold) 22%, transparent); color: color-mix(in srgb, var(--gold) 45%, var(--ink)); }
.chip-mute { background: rgba(57, 46, 40, 0.07); color: var(--ink-mute); }
.gift-pill {
  flex-shrink: 0;
  padding: 8px 18px; border-radius: 100px;
  border: 1.5px solid rgba(198, 74, 112, 0.4);
  background: transparent; color: var(--rose-deep);
  font-family: var(--sans); font-size: 13.5px; font-weight: 700; letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.gift-pill:hover {
  background: var(--rose-deep); color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(198, 74, 112, 0.35);
}
.gift-pill:focus-visible, .btn-primary:focus-visible, .btn-ghost:focus-visible,
.wish-title:focus-visible, .wish-shop:focus-visible, .pick:focus-visible {
  outline: 2px solid var(--rose-deep); outline-offset: 2px;
}

/* ---------- Wishlist ---------- */
.wish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wish-card {
  display: grid;
  grid-template-columns: auto 1fr;
  /* 1fr top row pins every card's action bar to its bottom edge, so bars
     align across a grid row even when titles wrap to different heights */
  grid-template-rows: 1fr auto;
  align-items: start;
  column-gap: 16px; row-gap: 14px;
  padding: 18px;
  background: var(--paper-card);
  border: 1px solid rgba(57, 46, 40, 0.08);
  border-radius: 20px;
  box-shadow: 0 16px 44px -20px rgba(57, 46, 40, 0.22);
}
.wish-media { display: block; }
.wish-thumb {
  display: block;
  width: 82px; height: 82px; object-fit: contain;
  background: #fff; border-radius: 14px;
  border: 1px solid rgba(57, 46, 40, 0.05);
  flex-shrink: 0;
}
.wish-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wish-kicker {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--rose-deep);
}
.heart { color: var(--rose); font-size: 13px; }
.wish-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14.5px; font-weight: 600; line-height: 1.45;
  color: var(--ink); text-decoration: none;
}
.wish-title:hover { color: var(--rose-deep); text-decoration: underline; text-underline-offset: 3px; }
.wish-price { font-family: var(--serif); font-size: 17.5px; font-weight: 500; white-space: nowrap; margin-top: 2px; }
/* Action bar: spans the full card width and WRAPS — a long localized gift
   button drops to its own right-aligned line instead of overflowing the card */
.wish-foot {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(57, 46, 40, 0.07);
}
.wish-shop {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--rose-deep); text-decoration: none; white-space: nowrap;
}
.wish-shop:hover { text-decoration: underline; text-underline-offset: 3px; }
/* margin-left:auto keeps the action right-aligned even once the bar wraps */
.wish-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; margin-left: auto; }
/* owner-flagged "most wanted" entries lead the grid and wear a small star badge */
.wish-priority {
  align-self: flex-start;
  padding: 3px 9px; border-radius: 100px;
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: color-mix(in srgb, var(--gold) 45%, var(--ink));
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.wish-qty {
  margin-left: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink-mute); text-transform: none;
}
/* the owner's short note for gift-givers — quiet italic line under the price */
.wish-note {
  font-size: 12.5px; font-style: italic; line-height: 1.5;
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}
/* quantity progress next to the gift button ("1 of 3 reserved") */
.wish-count { font-size: 12px; font-weight: 600; color: var(--ink-mute); white-space: nowrap; }
/* the gifter's own follow-through button reads as a quieter sibling of the gift pill */
.gift-pill.bought { border-color: color-mix(in srgb, var(--sage) 55%, transparent); color: color-mix(in srgb, var(--sage) 55%, var(--ink)); }
.gift-pill.bought:hover {
  background: color-mix(in srgb, var(--sage) 55%, var(--ink));
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sage) 40%, transparent);
}

/* ---------- Finale (download card) ---------- */
.share-finale {
  margin-top: clamp(56px, 9vh, 88px);
  padding: clamp(34px, 6vw, 54px);
  border-radius: 28px; text-align: center;
  color: var(--dusk-ink);
  background: radial-gradient(130% 130% at 50% 0%, var(--dusk-2) 0%, var(--dusk) 68%);
  box-shadow: 0 30px 80px -28px rgba(36, 27, 33, 0.55);
}
.finale-heading {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(25px, 3.6vw, 34px); letter-spacing: -0.01em;
  color: #FFF6E9;
}
.finale-sub { margin: 10px auto 0; max-width: 440px; font-size: 15.5px; color: var(--dusk-mute); }
.share-finale .download-row { margin-top: 26px; }
.download-row { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.download-row img { height: 46px; width: auto; border-radius: 8px; }
.download-row a { display: inline-block; transition: transform 0.3s var(--ease-out), filter 0.3s; }
.download-row a:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* ---------- Gift dialog ---------- */
.gift-dialog {
  margin: auto; /* the global reset zeroes the UA margin that centers <dialog> */
  border: 0; border-radius: 24px; padding: 0;
  background: var(--paper-card); color: var(--ink);
  width: min(430px, calc(100vw - 36px));
  box-shadow: 0 34px 90px -18px rgba(36, 27, 33, 0.5);
}
.gift-dialog::backdrop {
  background: rgba(36, 27, 33, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.gift-form { padding: clamp(24px, 5vw, 32px); }
.gift-heading {
  font-family: var(--serif); font-weight: 430;
  font-size: 24px; line-height: 1.25; letter-spacing: -0.01em;
}
.gift-heading em { font-style: italic; color: var(--rose-deep); }
.gift-note { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.gift-field {
  display: block; margin-top: 20px;
  font-size: 13.5px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.gift-field input {
  display: block; width: 100%; margin-top: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(57, 46, 40, 0.18); border-radius: 12px;
  background: #fff; font: inherit; font-size: 15.5px; color: var(--ink);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.gift-field input:focus {
  outline: none;
  border-color: var(--rose-deep);
  box-shadow: 0 0 0 3px rgba(198, 74, 112, 0.15);
}
.gift-hint {
  display: block; margin-top: 6px;
  font-size: 12.5px; font-weight: 400; line-height: 1.45; letter-spacing: 0;
  color: var(--dusk-mute);
}
/* confirm is first in the DOM (so Enter submits it); render it on the right */
.gift-actions { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 10px; margin-top: 24px; }

/* post-claim confirmation variant: product thumbnail above the heading, and the
   buy CTA is a link that must wear the primary-button clothes */
.confirm-thumb {
  width: 96px; height: 96px; object-fit: contain;
  background: #fff; border-radius: 16px;
  border: 1px solid rgba(57, 46, 40, 0.08);
  margin-bottom: 16px;
}
.gift-confirm .gift-actions { align-items: center; }
a.confirm-buy { display: inline-block; text-decoration: none; text-align: center; }
/* post-claim app invite: the visitor already carries a follower identity */
.confirm-invite {
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid rgba(57, 46, 40, 0.1);
}
.confirm-invite-title { font-family: var(--serif); font-weight: 430; font-size: 17px; }
.confirm-invite-sub { margin-top: 4px; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.confirm-invite .download-row { margin-top: 14px; justify-content: flex-start; }
.confirm-invite .download-row img { height: 38px; }
.btn-primary {
  padding: 10px 22px; border: 0; border-radius: 100px;
  background: var(--rose-deep); color: #fff;
  font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(198, 74, 112, 0.28);
  transition: background 0.25s, transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.btn-primary:hover { background: var(--rose); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(198, 74, 112, 0.4); }
.btn-ghost {
  padding: 10px 16px; border: 0; border-radius: 100px;
  background: transparent; color: var(--ink-soft);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-ghost:hover { background: var(--paper-deep); color: var(--ink); }
.btn-outline { border: 1.5px solid rgba(57, 46, 40, 0.25); }

/* ---------- Error state ---------- */
.error { text-align: center; padding: clamp(70px, 14vh, 120px) 0; }
.error .share-sub { margin-inline: auto; }
.error p { margin-top: 22px; }
.error .download-row { margin-top: 28px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 60;
  padding: 12px 22px; border-radius: 100px;
  background: var(--ink); color: var(--paper);
  font-size: 14.5px; font-weight: 600;
  box-shadow: 0 14px 44px rgba(36, 27, 33, 0.4);
  animation: toast-rise 0.45s var(--ease-out);
}
@keyframes toast-rise {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Footer ---------- */
.share-footer {
  max-width: var(--wrap-narrow); margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px) 42px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .wish-grid { grid-template-columns: 1fr; }
  .wish-thumb { width: 70px; height: 70px; }
  .row { padding: 14px 16px; }
  .share-ghost { font-size: clamp(110px, 34vw, 150px); top: -0.08em; }
  .cat-toggle { padding: 12px 16px; }
  .cat-thumb, .cat-more { width: 38px; height: 38px; border-radius: 10px; }
  .cat-more { min-width: 38px; }
  .options { grid-template-columns: 1fr; }
}
/* compact nav so brand + language toggle + CTA breathe in every language
   (the French "Télécharger l'app" CTA is the widest) */
@media (max-width: 480px) {
  .share-nav .nav-cta { padding: 8px 14px; font-size: 13px; }
  .share-nav .nav-wordmark { font-size: 18px; }
  .share-nav .nav-logo { width: 26px; height: 26px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .loading::before, .toast, .cat-body:not([hidden]), .options:not([hidden]) { animation: none; }
  .gift-pill:hover, .pick:hover, .option:hover, .download-row a:hover, .btn-primary:hover { transform: none; }
  .toggle-chevron { transition: none; }
}
