/* The public site (V3 W2) in the app's theme: lib/app_colors.dart and lib/app/theme.dart. */
/* Fonts: ?v=1 gets the year-long cache (nginx $byme_public_expires); a changed font file needs ?v=2. */
@font-face { font-family: Inter; src: url("fonts/Inter-Regular.woff2?v=1") format("woff2"), url("fonts/Inter-Regular.ttf?v=1") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url("fonts/Inter-SemiBold.woff2?v=1") format("woff2"), url("fonts/Inter-SemiBold.ttf?v=1") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Inter; src: url("fonts/Inter-Bold.woff2?v=1") format("woff2"), url("fonts/Inter-Bold.ttf?v=1") format("truetype"); font-weight: 700 800; font-display: swap; }

:root {
  --brand: #FF6B6B;
  --brand-light: #FFE5E3;
  --text: #1E1E1E;
  --muted: #757575;
  --border: #D9D9D9;
  --hairline: #EDEDED;
  --surface: #F5F5F5;
  --track: #F0F0F0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; background: #fff; color: var(--text); font: 400 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
img { max-width: 100%; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.25; text-wrap: balance; }
/* Short text blocks: no lone last word. Not on long prose (.sprose p). */
.bio, .desc, .note, .empty p, .sheet p, .hero p, .slead { text-wrap: pretty; }
p { margin: 0; }
button { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }
.grow { flex: 1 1 auto; }

/* Header: logo and the "create your page" button (56 px, as the app's bar). */
.bar { border-bottom: 1px solid var(--hairline); background: #fff; position: sticky; top: 0; z-index: 10; }
.bar-in { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; min-height: 44px; }
.logo img { height: 26px; width: auto; }

/* Buttons: the app's brand button. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 12px;
  background: var(--brand); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(0.95); }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-text { border: 0; background: none; font-weight: 600; padding: 12px; min-height: 44px; cursor: pointer; }

/* Creator */
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 12px; align-items: center; padding-top: 16px; padding-bottom: 4px; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; }
.avatar-letter { background: var(--brand); color: #fff; font-weight: 400; font-size: 26px; display: flex; align-items: center; justify-content: center; }
.profile h1 { font-size: 17px; font-weight: 600; }
/* The app's SocialIcons: small round grey buttons (26 px) in a 32 px tap area. */
.socials { display: flex; flex-wrap: wrap; gap: 0; margin: 2px 0 0 -3px; }
.socials a { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--text); }
.social-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.socials a:hover .social-dot { background: var(--border); }
.bio { grid-column: 1 / -1; color: var(--muted); font-size: 14px; max-width: 640px; padding-top: 12px; }

.section-title { font-size: 16px; font-weight: 600; margin: 16px 0 12px; }
.note { font-size: 12px; color: var(--muted); margin: 4px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
/* Inline style attributes are blocked by the CSP (style-src 'self'), so spacing lives here. */
.grid-top { margin-top: 16px; }

/* Collection card, as the app's CollectionCard: 8 px corners, a fade at the bottom (none at the top: the icons carry their own halo),
   name and count in white; share and bookmark are plain white icons in the top corners (48 px taps). */
.card { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: var(--track); }
.card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-open { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; text-decoration: none;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.667) 100%); }
.card-name { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { color: rgba(255,255,255,0.7); font-size: 12px; }
.chip-icon { position: absolute; top: 0; width: 48px; height: 48px; border: 0; background: none; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; border-radius: 50%; }
.chip-icon.left { left: 0; } .chip-icon.right { right: 0; }
.chip-icon:hover { background: rgba(255,255,255,0.12); }
/* A dark halo, as in the app, so the white icons show on white product pictures (owner, 2026-10-22). */
.chip-icon svg { filter: drop-shadow(0 0 1px rgba(0,0,0,0.4)) drop-shadow(0 0 4px rgba(0,0,0,0.5)); }
/* Inside the app's desktop preview (?preview=1): the page scrolls, but nothing in it can be clicked (owner, 2026-10-22). */
body.preview :is(a, button, input, select, textarea, label, summary, [role="button"], [data-share], [data-save]) { pointer-events: none; cursor: default; }
/* On products: share compact (40 px, 6 px in), bookmark the full-size icon button, as in the app. */
.product-icon { width: 40px; height: 40px; }
.product-icon.left { top: 6px; left: 6px; }
.product-icon.right { top: 0; right: 0; width: 48px; height: 48px; }

/* Collection */
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 0; margin-left: -8px; text-decoration: none; font-weight: 600; font-size: 15px; }
.mini-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; font-size: 12px; font-weight: 400; }
.top { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.cover { width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; object-fit: cover; display: block; background: var(--track); }
/* A faint neutral edge, so a product photo on white keeps its shape on the white page (as the app's imageEdgeDecoration). */
img.cover { outline: 1px solid rgba(0,0,0,0.1); outline-offset: -1px; }
.cover-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; }
.top-text { display: flex; flex-direction: column; gap: 6px; }
.top-text h1 { font-size: 20px; font-weight: 600; }
.desc { font-size: 14px; color: var(--muted); }
.actions { display: flex; align-items: center; margin: 0 -12px; }
.act { display: inline-flex; align-items: center; gap: 4px; min-width: 48px; height: 48px; padding: 0 12px; border: 0; background: none; cursor: pointer; font-size: 15px; border-radius: 24px; color: var(--text); }
.act:hover { background: var(--surface); }

.product { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.product-img { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; background: var(--track); }
.product-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.product-body { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px 10px; text-decoration: none; flex: 1 1 auto; }
.product-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.product-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-meta span:last-child { white-space: nowrap; }
.product-name { font-size: 13px; font-weight: 400; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.more { padding-top: 16px; }
.section-link { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 0; }

/* Empty states and errors */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; }
.empty h2, .empty .h2 { font-size: 17px; font-weight: 700; margin-top: 8px; max-width: 420px; }
.empty p { color: var(--muted); font-size: 14px; margin-bottom: 8px; }
.round-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; }

.hero { padding: 64px 16px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; max-width: 720px; }
.hero p { color: #5B5B5B; max-width: 560px; }

/* The page fills the window, so on a short page the footer sits at the bottom (32 px at least below the content). */
body { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.foot { margin-top: auto; padding-top: 32px; font-size: 12px; color: var(--muted); }
.foot-in { border-top: 1px solid var(--hairline); padding: 16px 0 28px; }
.foot p + p { margin-top: 8px; }
.foot a { color: var(--text); }

/* "Save this to your list": a bottom sheet on phones, a centred box on larger screens. */
.sheet { border: 0; padding: 10px 20px 24px; width: 100%; max-width: 440px; margin: auto auto 0; border-radius: 22px 22px 0 0; text-align: center; color: var(--text); }
.sheet::backdrop { background: rgba(0,0,0,0.45); }
.sheet[open] { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--border); }
.sheet h2 { font-size: 20px; font-weight: 700; }
.sheet p { color: #5B5B5B; max-width: 320px; }
.sheet form { margin: 0; }
.report-reasons { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.report-reasons .btn-outline { width: 100%; justify-content: center; min-height: 44px; font-weight: 600; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; width: max-content; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Larger screens: same order, wider grids (owner's review, 2026-10-19). */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .sheet { margin: auto; border-radius: 22px; }
  .sheet-grip { display: none; }
}
@media (min-width: 900px) {
  .wrap { padding: 0 32px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .profile { grid-template-columns: auto minmax(0, 1fr) auto; padding-top: 36px; padding-bottom: 20px; gap: 8px 20px; }
  .avatar { width: 96px; height: 96px; }
  .profile h1 { font-size: 24px; font-weight: 600; }
  .bio { font-size: 15px; }
  .top { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: start; padding-top: 8px; padding-bottom: 16px; }
  .top-text { padding-top: 4px; gap: 10px; }
  .top-text h1 { font-size: 28px; font-weight: 600; }
  .actions { order: 3; margin: 4px 0 0; }
  .desc { font-size: 16px; }
  .section-title { font-size: 18px; margin-top: 28px; }
  .note { font-size: 13px; }
  .hero h1 { font-size: 52px; letter-spacing: -1.4px; }
}

/* Motion (owner, 2026-10-19), only on screens whose user allows it ("reduce motion" off):
   the first screen's lines come in one after another; further down, site.js marks blocks
   below the fold with .s-hide and swaps it for .s-show when they scroll into view. */
@keyframes s-in { from { opacity: 0; translate: 0 12px; filter: blur(4px); } }
@media screen and (prefers-reduced-motion: no-preference) {
  .shero-text > *, .shero-art, .spage-hero .swrap > *, .shero .sstats, .profile > *, .top > * { animation: s-in 300ms ease-out backwards; }
  .shero-text > :nth-child(2), .spage-hero .swrap > :nth-child(2), .profile > :nth-child(2), .top > :nth-child(2) { animation-delay: 100ms; }
  .shero-text > :nth-child(3), .spage-hero .swrap > :nth-child(3), .profile > :nth-child(3), .top > :nth-child(3), .shero-art { animation-delay: 200ms; }
  .shero-text > :nth-child(4), .spage-hero .swrap > :nth-child(4), .profile > :nth-child(4) { animation-delay: 300ms; }
  .shero-text > :nth-child(n+5), .spage-hero .swrap > :nth-child(n+5), .shero .sstats { animation-delay: 400ms; }
  .s-hide { opacity: 0; translate: 0 12px; filter: blur(4px); }
  /* body: outranks the cards' own hover transition in pages.css. */
  body .s-show { transition: opacity 300ms ease-out, translate 300ms ease-out, filter 300ms ease-out; }
  /* A pressed button gives way a little. */
  .sbtn, .btn { transition: scale 150ms ease-out; }
  .sbtn:active, .btn:active { scale: 0.96; }
}

/* /unsubscribe (views/public/unsubscribe.php) */
.unsub p { max-width: 460px; }
.unsub-pick { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.unsub-pick fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.unsub-pick legend { color: var(--muted); font-size: 14px; margin-bottom: 6px; padding: 0; }
.unsub-row { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
.unsub-row input { width: 20px; height: 20px; accent-color: var(--brand); }
