/* Shared stylesheet for every tenant. Colors, fonts and radius come only from
   the custom properties the layout writes per tenant (see views.ThemeCSS). */

:root {
  --primary: #0f5c6e; --on-primary: #fff; --primary-soft: #e3f0f2;
  --accent: #e07a5f; --on-accent: #1b1b1b;
  --bg: #f7f5f2; --surface: #fff; --text: #1d2a30; --muted: #55626a;
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --radius: 10px;
  --font-heading: Georgia, serif;
  --font-body: system-ui, sans-serif;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .05);
  --wrap: 1180px;
  --open: #17703a; --open-bg: #e3f4e8;
  --closed: #8a2b1f; --closed-bg: #f8e6e3;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip-link:focus { left: 8px; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .85rem; margin: .75rem 0 0; }
.icon { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.site-header__search { padding-bottom: 12px; }
@media (min-width: 900px) {
  .site-header { position: relative; }
  .site-header__search { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); max-width: 460px; padding: 0; }
  .site-header__search .search__input { padding-block: 9px; }
  .site-header__search .search__button span { display: none; }
}
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.wordmark__mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--primary); color: var(--on-primary); font: 700 1rem/1 var(--font-heading);
}
.wordmark__text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark__city { font: 700 1.2rem/1.1 var(--font-heading); }
.wordmark__rest { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 8px 12px; border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 700; font-size: .95rem; }
.site-nav a:hover { background: var(--primary-soft); }
@media (max-width: 480px) {
  .site-header__row { gap: 8px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 8px 7px; font-size: .88rem; }
  .wordmark__rest { display: none; }
}

/* Search */
.search { display: flex; width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.search__input { flex: 1; min-width: 0; border: 0; padding: 14px 16px; font: inherit; color: var(--text); background: transparent; }
.search__input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.search__button { display: flex; align-items: center; gap: 8px; border: 0; padding: 0 18px; background: var(--primary); color: var(--on-primary); font: 700 .95rem var(--font-body); cursor: pointer; }
.search__button:hover { filter: brightness(1.1); }

/* Hero */
.hero {
  color: var(--on-primary);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 35%, transparent) 0, transparent 55%),
    linear-gradient(160deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
}
.hero__inner { padding-block: clamp(48px, 8vw, 96px); max-width: 860px; text-align: center; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .8rem; font-weight: 700; opacity: .85; margin-bottom: .75rem; }
.hero__title { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem); margin-bottom: .4em; }
.hero__lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); opacity: .92; max-width: 620px; margin: 0 auto 1.75rem; }
.hero__search { max-width: 640px; margin: 0 auto; }
.hero__search .search { border: 0; box-shadow: 0 10px 30px rgb(0 0 0 / .2); }
.hero__search .search__button { background: var(--accent); color: var(--on-accent); }
.hero__stat { margin: 1.25rem 0 0; opacity: .9; font-size: .95rem; }

/* Sections */
.section { padding-block: clamp(36px, 5vw, 64px); }
.section--alt { background: var(--surface); border-block: 1px solid var(--line); }
.section--tight { padding-block: 40px 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section__head h2 { margin: 0; }
.section__more { font-weight: 700; text-decoration: none; white-space: nowrap; }

/* Category tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.tile {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 100%;
  padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-decoration: none; font-weight: 700; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--primary); transform: translateY(-1px); }
.tile__count { flex: none; min-width: 2em; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .85rem; text-align: center; }

/* Listing cards */
.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card {
  display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--primary); transform: translateY(-1px); }
.card__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; align-items: flex-start; }
.card__name { font: 700 1.08rem/1.3 var(--font-heading); }
.card__type { color: var(--primary); font-size: .9rem; font-weight: 700; }
.card__meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .9rem; }
.card .badge { margin-top: 6px; }

.monogram {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--primary-soft); color: var(--primary); font: 700 1.1rem/1 var(--font-heading); letter-spacing: .02em;
}
.monogram--lg { width: 76px; height: 76px; font-size: 1.6rem; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--open { background: var(--open-bg); color: var(--open); }
.badge--closed { background: var(--closed-bg); color: var(--closed); }

/* Content pages */
.page { padding-block: 24px 64px; }
.page__title { margin-top: .25em; }
.page__lead { color: var(--muted); margin-bottom: 1.5rem; }
.page__search { max-width: 640px; margin-bottom: 1.5rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.empty { text-align: center; padding-block: 32px; }
.empty .page__search { margin-inline: auto; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-top: 28px; }
.pager__link { font-weight: 700; text-decoration: none; }
.pager__link[rel="next"] { justify-self: end; }
.pager__status { color: var(--muted); font-size: .9rem; }

.callout { background: var(--primary-soft); border-radius: calc(var(--radius) * 1.5); padding: clamp(24px, 4vw, 40px); }
.callout h2 { color: var(--primary); }
.callout p { margin: 0; max-width: 640px; }

/* About the city */
.about__inner { max-width: 760px; }
.about__inner p { font-size: 1.05rem; }
.about__sources { color: var(--muted); font-size: .85rem; margin-top: 1.25rem; }
.about__sources a { color: var(--muted); }
.about__official { font-weight: 700; }

/* Business page */
.biz-head { display: flex; align-items: center; gap: 18px; margin: 12px 0 24px; }
.biz-head__name { margin: 0 0 .2em; }
.biz-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: var(--primary); font-weight: 700; }
.biz-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .biz-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }
.biz-main, .biz-side { display: grid; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.panel--soft { background: var(--primary-soft); border-color: transparent; box-shadow: none; }
.panel__title { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-bottom: 14px; }
.panel p:last-child { margin-bottom: 0; }
.facts { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; }
.facts .icon { margin-top: .3em; color: var(--primary); }
.facts a { word-break: break-word; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none;
}
.btn:hover { border-color: var(--primary); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn--primary:hover { filter: brightness(1.1); }
.map { display: block; width: 100%; height: 280px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--primary-soft); }
.map-link { margin: .5rem 0 0; font-size: .9rem; }

.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 400; }
.hours th { width: 40%; font-weight: 700; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours .is-today { background: var(--primary-soft); }
.hours .is-today th { color: var(--primary); }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: .9rem; font-weight: 700; text-decoration: none; }
.chip:hover { background: var(--primary); color: var(--on-primary); }
.chip--group { background: var(--primary); color: var(--on-primary); }
.chip__count { font-weight: 400; opacity: .8; margin-left: 2px; }
.filters { margin: -0.5rem 0 1.5rem; }

/* Categories page: one block per group (spec 007) */
.groups { columns: 3 280px; column-gap: 24px; }
.group { break-inside: avoid; margin: 0 0 24px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.group__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.15rem; margin: 0 0 4px; }
.group__title a { color: var(--text); text-decoration: none; }
.group__title a:hover { color: var(--primary); }
.group__blurb { color: var(--muted); font-size: .9rem; margin: 0 0 10px; }
.group__types { list-style: none; margin: 0; padding: 0; font-size: .95rem; line-height: 1.9; }
.group__more { font-weight: 700; text-decoration: none; }

/* Forms (account pages) */
.auth { max-width: 520px; }
.auth__links { margin-top: 20px; color: var(--muted); }
.auth__email { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.auth__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.auth__actions form { margin: 0; }
.form { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 4vw, 28px); box-shadow: var(--shadow); }
.form__field { display: grid; gap: 6px; }
.form__field label { font-weight: 700; }
.form__field input, .form__field select, .form__field textarea {
  width: 100%; padding: 11px 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 35%, transparent); border-radius: var(--radius);
}
.form__field input:focus, .form__field select:focus, .form__field textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
.form__hint { margin: 0; color: var(--muted); font-size: .88rem; }
.form .btn { justify-self: start; cursor: pointer; font: 700 1rem var(--font-body); }
.form-errors { border: 1px solid var(--closed); background: var(--closed-bg); color: var(--closed); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.form-errors p { margin: 0 0 .25em; }
.form-errors ul { margin: 0; padding-left: 1.2em; }
.notice { margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.callout--compact { padding: 18px 20px; margin-top: 20px; }
.callout--compact p { margin-bottom: 12px; }
.callout--compact form { margin: 0; }
button.btn { cursor: pointer; font: 700 1rem var(--font-body); }
/* Public forms (spec 002) */
.formpage { max-width: 720px; }
.form__row { display: grid; gap: 18px; }
@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
.form__section { display: grid; gap: 18px; margin: 0; padding: 0; border: 0; min-width: 0; }
.form__section legend { padding: 0; margin-bottom: 4px; font: 700 1.1rem var(--font-heading); }
.form__field textarea { resize: vertical; min-height: 120px; }
.optional { font-weight: 400; color: var(--muted); }
.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.panel__link { display: inline-block; margin-top: 4px; font-weight: 700; }
/* Honeypot: off-screen, not display:none, so naive bots still fill it. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { background: var(--text); color: color-mix(in srgb, var(--bg) 85%, transparent); padding-block: 40px; margin-top: 24px; font-size: .92rem; }
.site-footer a { color: inherit; }
.site-footer__grid { display: grid; gap: 24px; }
@media (min-width: 768px) { .site-footer__grid { grid-template-columns: 1.2fr 1fr 1.6fr; } }
.site-footer__name { font: 700 1.15rem var(--font-heading); color: var(--bg); margin-bottom: .25em; }
.site-footer nav { display: grid; gap: 6px; align-content: start; }
.site-footer__legal p { margin-bottom: .5em; }

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

/* Legal pages (terms, privacy) */
.legal { max-width: 760px; }
.legal h2 { font-size: 1.3rem; margin: 2rem 0 .5rem; }
.legal h3 { font-size: 1.05rem; margin: 1.25rem 0 .25rem; }
.legal ul { padding-left: 1.25rem; }
.legal li { margin: .25rem 0; }
.legal__table { overflow-x: auto; margin: 1rem 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.legal th { color: var(--muted); font-weight: 700; }

/* Claims and owner editing (spec 004) */
.badge--claimed { background: var(--primary-soft); color: var(--primary); }
.steps { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.method { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; background: var(--surface); }
.method h2 { font-size: 1.1rem; margin: 0 0 6px; }
.method p { margin: 0 0 12px; }
.inline-email { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inline-email input { flex: 1 1 160px; min-width: 0; }
.inline-email span { font-weight: 700; overflow-wrap: anywhere; }
.code-input { font: 700 1.5rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3em; max-width: 12ch; }
.record { display: block; padding: 10px 12px; border-radius: var(--radius); background: var(--primary-soft); font: .95rem ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; user-select: all; }
.hours-edit { display: grid; gap: 8px; }
.hours-edit__row { display: grid; grid-template-columns: 7.5rem auto 1fr; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-edit__ranges { display: grid; gap: 6px; justify-content: start; }
.hours-edit__range { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hours-edit__ranges input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.hours-edit__row:has(.hours-edit__closed input:checked) .hours-edit__ranges { opacity: .4; pointer-events: none; }
.locked { color: var(--muted); font-size: .88rem; }
.owned { display: grid; gap: 8px; padding: 0; list-style: none; }
.owned li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
@media (max-width: 560px) {
  .hours-edit__row { grid-template-columns: 1fr auto; }
  .hours-edit__ranges { grid-column: 1 / -1; }
}
.method.choice { align-items: flex-start; }
.method.choice input[type=radio] { margin-top: 4px; }
.method.choice .inline-email { margin-top: 10px; }
.method.choice .inline-email input { width: auto; height: auto; padding: 8px 10px; border: 1px solid var(--muted); border-radius: var(--radius); font: inherit; background: var(--surface); }
.formpage > .method { margin-top: 24px; }

/* Reviews (spec 005). Stars are amber, dark enough for 3:1 on white. */
.stars { display: inline-flex; gap: 1px; vertical-align: -3px; }
.star { width: 18px; height: 18px; }
.star__bg { fill: color-mix(in srgb, var(--text) 18%, transparent); }
.star__fg { fill: var(--star, #b7791f); }
.star--empty .star__fg { display: none; }
.star--half .star__fg { clip-path: inset(0 50% 0 0); }
.rating { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.rating__text strong { color: var(--text); }
.card .stars .star { width: 15px; height: 15px; }
.biz-head__rating { text-decoration: none; }
.review-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 8px; }
.review-summary p { margin: 0; }
.review-summary__score { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.review-summary__avg { font: 700 2rem/1 var(--font-heading); }
.review { padding: 16px 0; border-top: 1px solid var(--line); }
.review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.review__author { font-weight: 700; }
.review__date { color: var(--muted); font-size: .88rem; }
.review p { margin: 0 0 .6em; overflow-wrap: anywhere; }
.review__reply { margin: 10px 0 6px; padding: 10px 14px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.review__reply-head { font-weight: 700; color: var(--primary); font-size: .9rem; }
.review__reply p:last-child { margin-bottom: 0; }
.review__report { font-size: .85rem; color: var(--muted); }
.panel > .review:last-of-type { padding-bottom: 4px; }

/* Star input: radios stay focusable for keyboards and screen readers; the
   chosen star and the ones before it fill in. */
.rate { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.rate label { cursor: pointer; padding: 2px; border-radius: 6px; line-height: 0; }
.rate .star { width: 36px; height: 36px; fill: color-mix(in srgb, var(--text) 18%, transparent); transition: fill .1s; }
.rate input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 1px; }
.rate:has(input:checked) label .star { fill: var(--star, #b7791f); }
.rate input:checked + label ~ label .star { fill: color-mix(in srgb, var(--text) 18%, transparent); }
.rate:has(label:hover) label .star { fill: var(--star, #b7791f); }
.rate label:hover ~ label .star { fill: color-mix(in srgb, var(--text) 18%, transparent) !important; }
.rate__label { margin-left: 8px; font-weight: 700; min-height: 1.5em; }
.rate__text { display: none; }
.rate:has(#rating-1:checked) .rate__text--1, .rate:has(#rating-2:checked) .rate__text--2,
.rate:has(#rating-3:checked) .rate__text--3, .rate:has(#rating-4:checked) .rate__text--4,
.rate:has(#rating-5:checked) .rate__text--5 { display: inline; }
.btn--ghost { background: transparent; }
.danger-zone { margin-top: 18px; }
.danger-zone .btn { color: var(--closed); border-color: var(--closed); cursor: pointer; font: 700 1rem var(--font-body); }
.manage-review { margin-bottom: 16px; }
.manage-review .review { border-top: 0; padding-top: 0; }
.manage-review__reply { display: grid; gap: 6px; }
.manage-review__reply label { font-weight: 700; }
.manage-review__reply textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; resize: vertical; }
.manage-review__reply .btn { justify-self: start; cursor: pointer; font: 700 1rem var(--font-body); }

/* Images (spec 006) */
.wordmark__logo { height: 48px; width: auto; max-width: 180px; object-fit: contain; }
.hero--photo { position: relative; isolation: isolate; overflow: hidden; background: var(--primary); }
.hero__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
/* Darken the photo so white text keeps at least 4.5:1 contrast. */
.hero--photo::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(0 0 0 / .55), rgb(0 0 0 / .62)),
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 45%, transparent), transparent 70%); }
.card__photo { flex: none; width: 64px; height: 64px; border-radius: var(--radius); object-fit: cover; background: var(--primary-soft); }
.gallery { display: grid; gap: 8px; margin: 0 0 20px; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 150px; }
.gallery__item { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--primary-soft); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery__item:hover img { transform: scale(1.03); }
.gallery__item:first-child { grid-row: span 2; }
.gallery--1 { grid-template-columns: 1fr; grid-auto-rows: clamp(220px, 38vw, 380px); }
.gallery--1 .gallery__item:first-child { grid-row: auto; }
.gallery--2 { grid-template-columns: 2fr 1fr; }
.gallery--2 .gallery__item:nth-child(2) { grid-row: span 2; }
.gallery--3 { grid-template-columns: 2fr 1fr; }
.gallery--4 .gallery__item:nth-child(2) { grid-area: 1 / 2; }
.gallery--4 .gallery__item:nth-child(3) { grid-area: 2 / 2; }
.gallery--4 .gallery__item:nth-child(4) { grid-area: 1 / 3 / span 2; }
.gallery--5 { grid-template-columns: 2fr 1fr 1fr; }
.gallery__more { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / .55); color: #fff; font-weight: 700; font-size: 1.1rem; }
@media (max-width: 640px) {
  .gallery, .gallery--2, .gallery--3, .gallery--5 { grid-template-columns: 1fr 1fr; grid-auto-rows: 110px; }
  .gallery .gallery__item { grid-area: auto; grid-row: auto; }
  .gallery .gallery__item:first-child { grid-column: 1 / -1; grid-row: span 2; }
  /* An odd number of thumbnails: the last one takes the whole row. */
  .gallery .gallery__item:last-child:nth-child(even) { grid-column: 1 / -1; }
  .gallery--1 .gallery__item:first-child { grid-row: auto; }
}
.photo-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 0; padding: 0; list-style: none; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--primary-soft); }
.photo-grid figcaption { margin-top: 6px; color: var(--muted); font-size: .9rem; }
.photo-list { display: grid; gap: 14px; padding: 0; list-style: none; }
.photo-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.photo-row img { width: 120px; height: 90px; object-fit: cover; border-radius: calc(var(--radius) * .6); }
.photo-row__body { display: grid; gap: 8px; min-width: 0; }
.photo-row__alt { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-row__alt input { flex: 1 1 200px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
.photo-row__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-row form { margin: 0; }
.photo-row .btn { cursor: pointer; font: 700 .9rem var(--font-body); padding: 6px 12px; }
.badge--cover { background: var(--primary-soft); color: var(--primary); }
@media (max-width: 480px) { .photo-row { grid-template-columns: 1fr; } .photo-row img { width: 100%; height: 180px; } }
.btn.danger { color: var(--closed); border-color: var(--closed); }
.upload-status { padding: 12px 16px; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.upload-status ul { margin: .4em 0; padding-left: 1.2em; font-weight: 400; color: var(--text); }

/* Support tickets (spec 008) */
.badge--info { background: var(--primary-soft); color: var(--primary); }
.badge--muted { background: var(--line); color: var(--muted); }
.thread { list-style: none; margin: 8px 0 24px; padding: 0; display: grid; gap: 12px; }
.msg { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.msg--staff { border-left: 4px solid var(--primary); }
.msg__meta { margin: 0 0 6px; font-size: .9rem; color: var(--muted); }
.msg__meta strong { color: var(--text); }
.msg__body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Sponsorship (spec 009) */
.badge--featured { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--text); }
.badge--featured::before { background: var(--accent); }
.sponsored { margin: 0 0 28px; padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.sponsored__label { margin: 0 0 12px; font: 700 .8rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.spotlight .spot { display: grid; gap: 6px; align-content: start; }
.spot__label { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.spot__label--pick { color: var(--primary); }
.notice--warn { background: var(--closed-bg); color: var(--closed); }
.plans { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.plan { position: relative; display: flex; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
label.plan { cursor: pointer; }
label.plan:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
label.plan:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.plan input { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--primary); flex: none; }
.plan__body { display: grid; gap: 4px; align-content: start; }
.plan__name { font: 700 1.25rem var(--font-heading); margin: 0; }
.plan__price { font: 700 1.6rem var(--font-heading); }
.plan__price s { font-size: 1rem; font-weight: 400; color: var(--muted); margin-right: 4px; }
.plan__price small { font: 400 .9rem var(--font-body); color: var(--muted); }
.plan__alt { color: var(--muted); font-size: .9rem; }
.plan__perks { margin: 8px 0 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: .95rem; }
.plan__full { color: var(--closed); font-size: .9rem; }
.plans--static { margin: 24px 0 12px; }
.sponsor-status { margin: 0 0 20px; }
.sponsor-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 16px; }
.sponsor-facts dt { font-weight: 700; }
.sponsor-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .sponsor-facts { grid-template-columns: 1fr; } .sponsor-facts dd { margin-bottom: 6px; } }
.sponsor-status form, .sponsor-keep { margin: 0; }
.sponsor-page .form { margin-top: 20px; }
.sponsor-page .btn { cursor: pointer; font: 700 1rem var(--font-body); }
.offer { margin: 0 0 20px; border-color: var(--primary); }
.advertise .section-block { margin: 32px 0; }
.owned, .spots { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.spots { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.steps { padding-left: 1.3em; display: grid; gap: 6px; }

.excl-prices, .reach { border-collapse: collapse; width: 100%; max-width: 36rem; margin: .5rem 0; font-size: .95rem; }
.excl-prices th, .excl-prices td, .reach th, .reach td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.excl-prices thead th, .reach thead th { font-size: .85rem; }
.reach tbody th { font-weight: 600; }
.table-wrap { overflow-x: auto; }
.plan__reach { color: var(--muted); font-size: .9rem; }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-list__row form { margin: 0; flex: none; }
.manage-cats .panel { margin-bottom: 1.25rem; }
.cat-list .small { font-size: .85rem; }

/* Business stats (spec 011) */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 10px; margin: .25rem 0 0; }
.stat-tile { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem; }
.stat-tile dt { font-size: .85rem; color: var(--muted); }
.stat-tile dd { margin: .15rem 0 0; font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stats { border-collapse: collapse; width: 100%; font-size: .95rem; }
.stats th, .stats td { text-align: right; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.stats th:first-child { text-align: left; }
.stats thead th { font-size: .85rem; }
.manage-stats .panel { margin-bottom: 1.25rem; }
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin: .35rem 0; }
.manage-teaser { margin: 0 0 1.5rem; }
.manage-teaser__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.manage-teaser__head h2 { margin: 0; font-size: 1.1rem; }
.form--inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 1rem 0 1.5rem; }
.form--inline .choice { margin: 0; }
.stats abbr { text-decoration: none; }
@media (max-width: 480px) {
  .stats { font-size: .9rem; }
  .stats th, .stats td { padding: .45rem .3rem; }
}
