/* Card catalog — sits on top of home.css */

.browse {
  padding: 48px 0 88px;
}

.browse-head h1,
.browse-head h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}

.home-cards {
  padding: 28px 0 48px;
  scroll-margin-top: 108px;
}

.browse-head .lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  margin: 0 0 28px;
  max-width: 36em;
}

.browse-filters {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.chip {
  appearance: none;
  border: 1.5px solid rgba(58, 24, 79, 0.22);
  background: var(--white);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font: 600 14px/1.2 var(--sans);
  cursor: pointer;
}

.chip.is-on {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.card-grid > [hidden] { display: none; }

.card-tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: none;
  background: #fff;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-illustrated,
.cover-simple {
  padding: 22px 18px;
  text-align: center;
  gap: 6px;
}

.cover-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cover-word {
  font-family: var(--serif);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.cover-note {
  font-size: 13px;
  opacity: 0.78;
}

.theme-cake { background: #fff7ee; color: var(--purple-deep); }
.theme-confetti { background: linear-gradient(165deg, #3a184f 0%, #5a2a72 100%); color: #f7f0ff; }
.theme-thirty { background: #f4ead8; color: var(--purple-deep); }
.theme-mint { background: #e7f6f1; color: #1f4a40; }
.theme-thanks { background: #f3ebf6; color: var(--purple); }
.theme-garden { background: #eef6ea; color: #2a4a28; }
.theme-team { background: #3a184f; color: #e0b33a; }
.theme-solong { background: #fff; color: var(--purple); border: 1px solid rgba(58, 24, 79, 0.08); }
.theme-voyage { background: #e8f1f6; color: #1d3a4a; }
.theme-roses { background: #f8ece6; color: #6b2e2e; }
.theme-party { background: #2a103b; color: #f6edd4; }
.theme-welcome { background: #eef6f3; color: #2a4a3c; }
.theme-nursery { background: #f7f1e8; color: var(--ink); }
.theme-chapter { background: #f7f1e8; color: var(--purple-deep); }
.theme-watch { background: #3a184f; color: #e0b33a; }
.theme-think { background: #fff; color: var(--purple); }
.theme-because { background: #fdeee6; color: #6a2e1a; }

.theme-confetti::after,
.theme-party::after,
.theme-watch::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(224, 179, 58, 0.45);
  border-radius: 12px;
  pointer-events: none;
}

.cover-compose {
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
}

.cover-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-photo {
  position: absolute;
  top: var(--photo-t, 16%);
  left: var(--photo-l, 27%);
  width: var(--photo-w, 46%);
  aspect-ratio: var(--photo-a, 1);
  z-index: 2;
  overflow: hidden;
  background: #f6edd4;
  box-shadow: none;
}

.cover-photo--circle { border-radius: 50%; }
.cover-photo--oval { border-radius: 50%; }
.cover-photo--rect { border-radius: 10px; }

.cover-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.cover-photo-img,
.cover-photo-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cover-photo-img { object-fit: cover; }

.cover-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4ead8;
}

.cover-photo-empty svg {
  width: 42%;
  height: auto;
}

.cover-photo-hint {
  display: none;
}

.cover.is-editable .cover-photo {
  cursor: pointer;
}

.cover.is-editable .cover-photo.is-empty .cover-photo-hint {
  display: block;
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 12%;
  z-index: 3;
  text-align: center;
  font: 700 10px/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a5a52;
}

.cover-copy {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
}

.cover.is-editable .cover-kicker,
.cover.is-editable .cover-word,
.cover.is-editable .cover-note {
  pointer-events: auto;
  cursor: text;
  outline: none;
}

.cover.is-editable .cover-kicker:hover,
.cover.is-editable .cover-word:hover,
.cover.is-editable .cover-note:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cover.is-editable .cover-kicker:focus,
.cover.is-editable .cover-word:focus,
.cover.is-editable .cover-note:focus {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.cover-copy--bottom {
  left: 0;
  right: 0;
  bottom: 0;
  padding: 56px 16px 20px;
}

.cover-copy--center {
  inset: 18% 14%;
  justify-content: center;
  padding: 0;
}

.cover-ink-light .cover-copy--bottom {
  background: linear-gradient(to top, rgba(42, 16, 59, 0.78), rgba(42, 16, 59, 0.05) 70%, transparent);
  color: #fff7ee;
}

.cover-ink-dark .cover-copy--bottom {
  background: linear-gradient(to top, rgba(247, 241, 232, 0.94), rgba(247, 241, 232, 0.2) 72%, transparent);
  color: var(--purple-deep);
}

.cover-ink-dark .cover-copy--center {
  color: var(--purple-deep);
}

.theme-together-wreath .cover-copy--bottom,
.theme-heart-window .cover-copy--bottom {
  background: none;
  padding: 0 16px 7%;
}

.theme-party-portrait .cover-copy--bottom,
.theme-moon-and-baby .cover-copy--bottom {
  background: linear-gradient(to top, rgba(26, 16, 22, 0.15), transparent 55%);
}

.theme-sunset-chapter .cover-copy--bottom {
  background: none;
  padding: 0 18px 9%;
  color: #fff7ee;
}

.theme-suitcase-stamp .cover-copy--center {
  inset: 23% 24% 50% 24%;
}

.theme-comic-love .cover-copy--center {
  inset: 24% 16% 48% 16%;
}

.theme-knit-booties .cover-copy--center {
  inset: 8% 14% 54% 14%;
}

.theme-comic-love .cover-word {
  font-style: italic;
}

.theme-knit-booties .cover-word {
  font-weight: 500;
}

.theme-balloon-lift {
  background: linear-gradient(180deg, #1a1464 0%, #c3126b 68%, #ff6b3d 100%);
}

.theme-balloon-lift .cover-copy--center {
  inset: 30% 12%;
  color: #fff8ee;
  text-shadow: 0 2px 18px rgba(20, 6, 40, 0.35);
}

.theme-hearts-aloft {
  background: linear-gradient(180deg, #4a0d2e 0%, #c41e5a 55%, #ff7a4d 100%);
}

.theme-hearts-aloft .cover-copy--center {
  inset: 32% 12%;
  color: #fff7ee;
  text-shadow: 0 2px 18px rgba(40, 6, 20, 0.35);
}

.cover-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.fw-balloon,
.fw-heart,
.fw-spark,
.fw-confetti {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: block;
}

.fw-balloon {
  width: calc(22% * var(--s, 1));
  color: var(--c);
  animation: fw-bob 6.5s var(--d, 0s) ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(20, 6, 32, 0.22));
}

.fw-balloon svg {
  display: block;
  width: 100%;
  height: auto;
}

.fw-heart {
  width: calc(14% * var(--s, 1));
  color: #ff6b9d;
  animation: fw-float 7.5s var(--d, 0s) ease-in-out infinite;
  filter: drop-shadow(0 6px 8px rgba(80, 10, 30, 0.25));
}

.fw-heart:nth-child(3n) { color: #ffd24a; }
.fw-heart:nth-child(4n) { color: #fff; }

.fw-heart svg {
  display: block;
  width: 100%;
  height: auto;
}

.fw-spark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff6c8;
  box-shadow: 0 0 10px #fff6c8;
  animation: fw-twinkle 2.4s var(--d, 0s) ease-in-out infinite;
}

.fw-confetti {
  top: var(--y, -10%);
  width: var(--w, 7px);
  height: calc(var(--w, 7px) * 1.6);
  border-radius: 2px;
  background: var(--c, #ffd24a);
  animation: fw-fall 8s var(--d, 0s) linear infinite;
}

@keyframes fw-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14%) rotate(5deg); }
}

@keyframes fw-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.92; }
  50% { transform: translateY(-18%) scale(1.06); opacity: 1; }
}

@keyframes fw-twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes fw-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translateY(160%) rotate(280deg); opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-motion * {
    animation: none !important;
  }
}

.cover-compose .cover-kicker {
  font-size: 11px;
}

.cover-compose .cover-word {
  font-size: clamp(22px, 2.2vw, 30px);
}

.cover-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  font-style: italic;
  opacity: 0.92;
}

.cover-edit-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.card-meta h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 2px;
}

.card-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.browse-empty {
  display: none;
  margin: 48px 0 0;
  color: var(--muted);
  text-align: center;
}

.browse-empty.is-on { display: block; }

.choose-dialog {
  width: min(560px, calc(100% - 32px));
  padding: 28px 26px 26px;
  border: 0;
  border-radius: 24px;
  background: var(--ivory);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.choose-dialog::backdrop {
  background: rgba(42, 16, 59, 0.48);
}
.choose-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: 600 22px/1 var(--sans);
  cursor: pointer;
}
.choose-dialog {
  position: relative;
}
.choose-dialog .eyebrow { margin-bottom: 8px; }
.choose-dialog h2 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.choose-dialog .choose-lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
}
.choose-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.choose-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px 16px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(42, 16, 59, 0.08);
  color: inherit;
}
.choose-option h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.choose-option p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}
.choose-option .btn { align-self: flex-start; }

@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .browse { padding-top: 32px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 16px 12px; }
  .choose-options { grid-template-columns: 1fr; }
}
