/*
 * Wishlist pages (/<lang>/wishlist, /w/<id> and the landing pages). Loaded
 * after santa.css, whose colors, type and components (buttons, lists, sheets,
 * the message bubble) these pages share, so both tools feel like one site.
 *
 * Motion has one authored moment per screen: the tags falling onto the string
 * (start and landing), the tags carrying down to the people (share), and a
 * gift being wrapped while its tag turns to the bow (claiming). Everything
 * else is a quick, quiet state change. Reduced motion holds every drawing
 * still and keeps the state changes.
 */

/* MARK: Utilities */

.desk-only { display: none !important; }
.danger-text { color: var(--red); }
.textbtn.danger-text { color: var(--red); }

/* MARK: Tag drawings */

.art .tag-letter { font-family: var(--serif); font-size: 21px; font-weight: 600; fill: var(--ink); }
.art .sway { transform-origin: 50% 0%; animation: wl-sway 6s ease-in-out infinite; }
.art .w1 { animation-delay: -1.2s; }
.art .w2 { animation-delay: -2.6s; }
.art .w3 { animation-delay: -3.7s; }
.art .w4 { animation-delay: -4.9s; }
.art .w5 { animation-delay: -0.6s; }
.art .w6 { animation-delay: -3.1s; }
@keyframes wl-sway { 0%, 100% { rotate: -2.2deg; } 50% { rotate: 2.2deg; } }

/* The tags fall onto the string one after another, then settle into the sway. */
.art .fall { animation: wl-fall 900ms var(--wl-ease) backwards; }
.art .f1 { animation-delay: 130ms; }
.art .f2 { animation-delay: 260ms; }
.art .f3 { animation-delay: 390ms; }
.art .f4 { animation-delay: 520ms; }
.art .f5 { animation-delay: 650ms; }
.art .f6 { animation-delay: 780ms; }
@keyframes wl-fall {
  0% { translate: 0 -160px; opacity: 0; }
  50% { opacity: 1; }
  76% { translate: 0 7px; }
  100% { translate: 0 0; }
}
.stage.replay { cursor: pointer; }

.art .flip .back { opacity: 0; }
.art .flip.claimed .back { opacity: 1; }
.art .flip.claimed .front { opacity: 0; }
.art .hop { animation: wl-hop 3.2s var(--wl-ease) infinite; }
.art .hop2 { animation-delay: -1.1s; }
.art .hop3 { animation-delay: -2.2s; }
@keyframes wl-hop { 0%, 60%, 100% { translate: 0 0; } 70% { translate: 0 -6px; } 80% { translate: 0 0; } }

:root { --wl-ease: cubic-bezier(0.16, 1, 0.3, 1); }

/* MARK: The editor */

.edit-heading { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.edit-col { padding-bottom: 8px; }
.edit-col .field + .field { margin-top: 16px; }
.edit-col > .field:first-of-type { margin-top: 6px; }
.edit-col .bar { padding-inline: 0; }
.preview-col { display: none; }
.delete-row { margin-top: 18px; }

.idea { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 10px 12px; border: 0; border-top: 1px solid var(--hair); background: transparent; color: inherit; text-align: start; font: inherit; cursor: pointer; transition: background-color 160ms ease; }
.idea:first-child { border-top: 0; }
.idea:hover { background: rgba(14, 41, 35, 0.025); }
.idea:active { background: rgba(14, 41, 35, 0.05); }
.idea .val { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.idea .val .shop { color: var(--green); font-weight: 600; }
.idea.added { animation: wl-row-in 520ms var(--wl-ease); }
@keyframes wl-row-in { from { opacity: 0; transform: translateY(-6px); background-color: #EAF2E4; } to { background-color: transparent; } }
.thumb { flex: none; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; background: var(--gold-soft); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb.tile { display: inline-flex; align-items: center; justify-content: center; background: var(--raised); box-shadow: inset 0 0 0 1px var(--hair); }
.thumb.tile .gift-tag { width: 26px; height: 36px; }
.ic.dash { background: transparent; border: 1.5px dashed #C7BDA6; color: var(--green); width: 52px; height: 52px; border-radius: 14px; }
.add-name { color: var(--green); }

/* MARK: The idea sheet */

.url-input { display: flex; align-items: center; gap: 6px; }
.url-input .input { flex: 1; min-width: 0; }
.idea-status { min-height: 18px; margin-top: 2px; }
.idea-status:empty { display: none; }
.idea-sheet .sheet-fields { display: flex; flex-direction: column; gap: 14px; }
.idea-sheet .field + .field { margin-top: 0; }

.preview { border-radius: 20px; overflow: hidden; background: var(--paper); box-shadow: var(--shadow-card); animation: wl-preview-in 520ms var(--wl-ease); }
@keyframes wl-preview-in { from { opacity: 0; transform: translateY(8px) scale(0.98); filter: blur(4px); } }
.preview .img { position: relative; aspect-ratio: 16 / 10; background: var(--gold-soft); overflow: hidden; }
.preview .img img { display: block; width: 100%; height: 100%; object-fit: cover; animation: wl-fade 360ms ease; }
.preview .noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gold-ink); opacity: 0.6; }
.preview .found { position: absolute; inset-inline-start: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: rgba(254, 252, 247, 0.94); font-size: 12.5px; font-weight: 600; color: var(--green); }
.preview .pv-body { padding: 12px 14px 14px; }
.preview .pv-title { margin: 0; min-height: 1.2em; font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.preview .pv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 14px; color: var(--muted); }
.preview .pv-meta .shop { color: var(--green); font-weight: 600; }
.price { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* While a link is being read: a soft shimmer where the picture and words will go. */
.preview.loading .img, .preview.loading .pv-title, .preview.loading .pv-meta .shop {
  background: linear-gradient(100deg, #EFE6D6 30%, #F8F1E6 50%, #EFE6D6 70%) 0 0 / 300% 100%;
  animation: wl-shimmer 1.3s ease-in-out infinite;
}
.preview.loading .pv-title { width: 70%; border-radius: 6px; }
.preview.loading .pv-meta .shop { display: inline-block; width: 30%; min-height: 14px; border-radius: 6px; }
@keyframes wl-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes wl-fade { from { opacity: 0; } }

.photo-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border-radius: 14px; border: 1.5px dashed #C7BDA6; background: transparent; color: var(--green); font: 600 15px var(--sans); cursor: pointer; transition: background-color 160ms ease; }
.photo-btn:hover { background: rgba(41, 97, 71, 0.04); }
.photo-btn[data-mode="remove"] { border-style: solid; border-color: var(--hair); color: var(--text-3); }
.photo-btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }

/* MARK: The share screen */

.open-list { margin-top: 18px; }

/* MARK: The shared list */

.list-head { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.list-head .av { width: 48px; height: 48px; font-size: 22px; background: var(--peach-soft); color: var(--peach-ink); }
.list-head h1, .list-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.08; letter-spacing: -0.4px; text-wrap: balance; overflow-wrap: anywhere; }
.when { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.when .ic { width: 40px; height: 40px; border-radius: 13px; }
.when b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; }
.when span span { display: block; font-size: 14px; color: var(--muted); }
.list-main { padding-top: 6px; }
.list-main > .heading-row { margin-top: 26px; }
.list-page .list-aside .stage { margin-top: 4px; }
.foot-line { margin: 28px 0 8px; text-align: center; font-size: 15px; color: var(--muted); }
.foot-line a { font-weight: 600; }
.owner-bar { margin-top: 12px; }

.gifts { display: grid; gap: 14px; margin-top: 12px; }
.gift { position: relative; border-radius: 24px; background: var(--paper); border: 1px solid rgba(255, 255, 255, 0.9); box-shadow: var(--shadow-card); overflow: hidden; transition: box-shadow 260ms ease, transform 260ms var(--wl-ease); }
.gift-link { display: block; color: inherit; text-decoration: none; }
a.gift-link:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a.gift-link:focus-visible { outline: 3px solid rgba(41, 97, 71, 0.45); outline-offset: -3px; border-radius: 24px; }
.gift .img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--gold-soft); }
.gift .img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale 500ms var(--wl-ease); }
a.gift-link:hover .img img { scale: 1.03; }
.gift .source { position: absolute; inset-inline-start: 12px; bottom: 12px; max-width: calc(100% - 110px); display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: rgba(254, 252, 247, 0.94); font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.price-chip { position: absolute; inset-inline-end: 12px; bottom: 12px; display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--forest); color: var(--paper); font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: 0 4px 12px rgba(14, 41, 35, 0.18); }
.gift-text { padding: 16px 18px 18px; }
.gift-top { display: flex; gap: 12px; align-items: flex-start; }
.gift-top .gift-tag { flex: none; width: 34px; height: 46px; margin-top: 2px; }
.gift h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 23px; line-height: 1.15; letter-spacing: -0.2px; text-wrap: balance; overflow-wrap: anywhere; }
.gift .note { margin: 6px 0 0; font-size: 15.5px; line-height: 1.45; color: var(--text-3); white-space: pre-line; overflow-wrap: anywhere; }
.gift-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 10px 0 0; }
.gift-meta .site { display: inline-flex; align-items: center; gap: 5px; font-size: 14.5px; font-weight: 600; color: var(--green); }
.gift-actions { padding: 0 18px 18px; margin-top: -2px; }
.gift.taken-by-other h3 { color: var(--text-3); }

/* A claimed gift is wrapped: paper and ribbon slide over its picture. */
.wrapping { position: absolute; inset: 0; pointer-events: none; clip-path: inset(0 100% 0 0); }
.gift.taken-by-other .wrapping, .gift.mine .wrapping { clip-path: inset(0 0 0 0); }
.paper { position: absolute; inset: 0; background:
  linear-gradient(90deg, transparent calc(50% - 11px), #A3C4A5 calc(50% - 11px), #A3C4A5 calc(50% + 11px), transparent calc(50% + 11px)),
  linear-gradient(0deg, transparent calc(50% - 11px), #A3C4A5 calc(50% - 11px), #A3C4A5 calc(50% + 11px), transparent calc(50% + 11px)),
  radial-gradient(circle at 12px 12px, rgba(237, 184, 152, 0.55) 2.2px, transparent 2.6px) 0 0 / 24px 24px,
  #F7E3D2; }
.gift.mine .paper { background:
  linear-gradient(90deg, transparent calc(50% - 10px), rgba(41, 97, 71, 0.9) calc(50% - 10px), rgba(41, 97, 71, 0.9) calc(50% + 10px), transparent calc(50% + 10px)),
  linear-gradient(0deg, transparent calc(50% - 10px), rgba(41, 97, 71, 0.9) calc(50% - 10px), rgba(41, 97, 71, 0.9) calc(50% + 10px), transparent calc(50% + 10px)); }
.wrapping .bow { position: absolute; left: 50%; top: 50%; width: 92px; height: 64px; translate: -50% -58%; }
.gift.mine .bow .lp { fill: #296147; }
.gift.mine .bow .kn { fill: #1E4A36; }
.gift .yours { position: absolute; inset-inline-end: 12px; top: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: var(--forest); color: var(--paper); font-size: 13px; font-weight: 700; opacity: 0; transition: opacity 300ms ease 300ms; }
.gift.mine .yours { opacity: 1; }

/* MARK: The claim control: one rounded box that changes in place */

.claim { display: flex; }
.claim .take { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; border-radius: 16px; border: 1.5px solid rgba(19, 59, 52, 0.2); background: transparent; color: var(--forest); font: 600 16px var(--sans); cursor: pointer; transition: background-color 200ms ease, border-color 200ms ease, transform 140ms var(--wl-ease); }
.claim .take:hover { background: rgba(19, 59, 52, 0.04); border-color: rgba(19, 59, 52, 0.32); }
.claim .take:active { transform: scale(0.98); }
.claimbox { display: flex; align-items: stretch; min-height: 54px; border-radius: 16px; overflow: hidden; animation: wl-box-in 320ms var(--wl-ease); }
@keyframes wl-box-in { from { opacity: 0.4; transform: scale(0.985); } }
.claimbox.owned { background: var(--forest); color: var(--paper); box-shadow: 0 8px 20px rgba(19, 59, 52, 0.18); }
.box-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 10px 6px 10px 16px; font-size: 16px; font-weight: 600; line-height: 1.25; }
.box-label span { min-width: 0; overflow-wrap: anywhere; }
.box-change { flex: none; width: 54px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-inline-start: 1px solid rgba(254, 252, 247, 0.18); background: transparent; color: #CFE3D2; cursor: pointer; transition: background-color 160ms ease; }
.box-change:hover { background: rgba(254, 252, 247, 0.08); }
.claimbox.editing { padding: 5px; border: 1.5px solid var(--green); background: var(--paper); box-shadow: 0 0 0 3px rgba(41, 97, 71, 0.14); }
.claimbox.editing input { flex: 1; min-width: 0; padding: 0 11px; border: 0; background: transparent; color: var(--ink); font: 600 16px var(--sans); }
.claimbox.editing input::placeholder { color: var(--faint); font-weight: 500; }
.claimbox.editing input:focus { outline: none; }
.box-done { flex: none; padding: 0 18px; border: 0; border-radius: 11px; background: var(--forest); color: var(--paper); font: 600 15.5px var(--sans); cursor: pointer; transition: background-color 180ms ease; }
.box-done.let-go { background: var(--red); }
.taken { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: 0; font-size: 15px; font-weight: 600; color: var(--muted); }
.av-xs { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--peach-soft); color: var(--peach-ink); font: 600 14px var(--serif); }

/* Centered with margins rather than a 50% shift, so short messages stay on one line. */
.toast { position: fixed; inset-inline: 0; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); margin-inline: auto; translate: 0 16px; opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--forest); color: var(--paper); font-size: 14.5px; font-weight: 600; pointer-events: none; transition: opacity 200ms ease, translate 320ms var(--wl-ease); box-shadow: 0 12px 28px rgba(14, 41, 35, 0.25); }
.toast.show { opacity: 1; translate: 0 0; }

/* MARK: Your lists */

a.disclose { color: inherit; text-decoration: none; }
a.disclose:hover { background: rgba(14, 41, 35, 0.025); }

/* MARK: Computers (from 900px) */

@media (min-width: 900px) {
  .desk-only { display: block !important; }
  .phone-only { display: none !important; }

  .page.wide { max-width: 1240px; padding: 0 40px; }
  .page.wide > .brand { padding: 0; min-height: 76px; }
  .page.wide > .brand .wordmark { font-size: 23px; }
  .page.wide > .brand .ghost.slim { width: auto; min-height: 44px; padding: 0 18px; border-radius: 14px; font-size: 15.5px; }

  /* The editor: the form on the left, what the family will see on the right. */
  .edit-page > .top { display: none; }
  .edit-layout { display: grid; grid-template-columns: 460px minmax(0, 1fr); gap: 0; min-height: 100dvh; }
  .edit-col { padding: 40px 48px 48px 0; border-inline-end: 1px solid rgba(14, 41, 35, 0.08); }
  .edit-heading { position: static; width: auto; height: auto; margin: 0 0 24px; overflow: visible; clip: auto; white-space: normal; font-size: 40px; }
  .edit-col .bar { position: static; padding: 24px 0 0; background: none; }
  .preview-col { display: block; position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow-y: auto; padding: 40px 0 40px 48px; scrollbar-width: thin; }
  .prev-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
  .prev-label h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-2); }
  .prev-frame { margin-top: 14px; padding: 28px; border-radius: 28px; background: var(--cream); box-shadow: 0 24px 60px -24px rgba(14, 41, 35, 0.25), 0 0 0 1px rgba(14, 41, 35, 0.04); }
  .prev-frame .list-head { margin-top: 0; }
  .prev-frame .gifts { margin-top: 22px; }
  .preview-empty { margin-top: 22px; }

  /* The shared list: the drawing and details stay put while the gifts scroll. */
  .list-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 56px; align-items: start; padding-bottom: 24px; }
  .list-aside { position: sticky; top: 16px; }
  .list-aside .stage { margin: 0; }
  .list-aside .content, .list-main.content { padding: 0; }
  .list-aside .list-head { margin-top: 26px; }
  .list-aside .list-head h1 { font-size: 42px; letter-spacing: -0.8px; }
  .list-main > .heading-row { margin-top: 4px; }
  .list-main > .heading-row h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; letter-spacing: -0.3px; }
  .list-main > .heading-row .count { font-size: 15px; }
  .list-page .owner-bar { position: sticky; bottom: 0; flex-direction: row; justify-content: flex-end; padding-inline: 0; }
  .list-page .owner-bar .btn, .list-page .owner-bar .ghost { width: auto; padding: 0 26px; }
  .list-page .footer { padding-inline: 0; }

  .masonry { display: block; columns: 2; column-gap: 20px; }
  .masonry > .gift { break-inside: avoid; margin-bottom: 20px; }
  .gift h3 { font-size: 24px; }

  .toast { bottom: 36px; }
}

@media (min-width: 1240px) {
  .list-page .masonry { columns: 2; }
}

/* MARK: Reduced motion: drawings hold still, state still changes */

@media (prefers-reduced-motion: reduce) {
  .art .sway, .art .fall, .art .hop, .idea.added, .preview, .preview .img img, .claimbox, .preview.loading .img, .preview.loading .pv-title, .preview.loading .pv-meta .shop { animation: none !important; }
  .gift, .gift .img img, .toast, .claim .take { transition: none !important; }
}
