/* Shared structure for all sites. Colours, type and the distinctive look come from <site>/public/theme.css. */
:root {
  --bg: #fff; --surface: #fff; --surface2: #f3f4f6; --line: #e5e7eb;
  --text: #111827; --muted: #6b7280; --accent: #2563eb; --link: #2563eb; --on-accent: #fff;
  --ok: #059669; --warn: #b45309; --bad: #dc2626; --star: #f59e0b; --star-off: var(--line);
  --radius: 10px; --radius-sm: 8px; --wrap: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: var(--font);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-top: 28px; padding-bottom: 56px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.wrap.narrow { max-width: 460px; padding-top: 60px; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 70ch; }
.sr, .skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.bar { display: flex; align-items: center; gap: 18px; min-height: 62px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-weight: 800; font-size: 1.3rem; }
.logo:hover { text-decoration: none; }
.logo-mark { flex: none; }
.tagline { display: none; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { color: var(--muted); padding: 7px 12px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.actions form { margin: 0; }
.lang { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 9px; font-weight: 700; font-size: .82rem; color: var(--muted); }
.me { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }
@media (max-width: 720px) { .nav { order: 3; flex-basis: 100%; } .me-name { display: none; } }

/* buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; cursor: pointer; background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 700; padding: 10px 18px; border-radius: var(--radius-sm); white-space: nowrap; transition: filter .15s, transform .05s, background .15s, color .15s; }
.btn:hover { filter: brightness(1.08); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.btn.sm { padding: 6px 12px; font-size: .86rem; } .btn.lg { padding: 13px 24px; font-size: 1.05rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.chip { display: inline-block; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip.accent { color: var(--link); } .chip.approved { color: var(--ok); } .chip.pending { color: var(--warn); } .chip.rejected { color: var(--bad); }
.badge { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }

/* layout blocks */
section { margin-top: 44px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; } .sec-head a { font-weight: 600; white-space: nowrap; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-body { padding: 16px; }
.card h3 { margin-bottom: .4em; } .card h3 a { color: var(--text); }
.card p { color: var(--muted); font-size: .94rem; margin-bottom: .6em; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; margin-bottom: 8px; }
.more { font-weight: 700; font-size: .92rem; }
.news .thumb { display: block; aspect-ratio: 16 / 9; background: var(--surface2); }
.news .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news h3, .post h3 { overflow-wrap: anywhere; }

/* home hero */
.hero { margin-top: 0; display: grid; gap: 28px; }
.eyebrow { margin: 0 0 .8em; color: var(--accent); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.hero-sub { color: var(--muted); font-size: 1.15rem; max-width: 62ch; margin-bottom: 1.4em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.hero-kinds a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.hero-kinds a:hover { text-decoration: none; border-color: var(--accent); }
.hero-kinds b { font-family: var(--font-head); font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-kinds span { font-weight: 700; } .hero-kinds small { color: var(--muted); }

.top { padding: 18px; } .top ol { list-style: none; margin: 0 0 12px; padding: 0; }
.top li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.top li a { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; min-width: 0; }
.top li a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top li b { color: var(--star); white-space: nowrap; font-size: .9rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; font-size: .86rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.tabs { display: flex; gap: 6px; margin: 18px 0; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 700; white-space: nowrap; }
.tabs a.active { background: var(--accent); color: var(--on-accent); border-color: transparent; } .tabs a:hover { text-decoration: none; color: var(--text); } .tabs a.active:hover { color: var(--on-accent); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0; color: var(--muted); }

/* avatars, stars */
.avatar { --h: 260; flex: none; display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: var(--radius-sm); font-weight: 800; font-size: 1.2rem; color: #fff; background: hsl(var(--h) 45% 42%); }
.avatar.sm { width: 28px; height: 28px; font-size: .85rem; } .avatar.xl { width: 76px; height: 76px; font-size: 2rem; }
.avatar.logo-img { background: #fff; object-fit: contain; padding: 4px; border: 1px solid var(--line); display: inline-block; } .avatar.logo-img.sm { padding: 2px; } .avatar.logo-img.xl { padding: 7px; }
.stars { position: relative; display: inline-block; font-family: Arial, sans-serif; font-size: 1rem; line-height: 1; letter-spacing: 2px; white-space: nowrap; }
.stars::before { content: "★★★★★"; color: var(--star-off); }
.stars > span { position: absolute; left: 0; top: 0; overflow: hidden; }
.stars > span::before { content: "★★★★★"; color: var(--star); }
.score { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; } .score b { font-size: 1.2rem; } .score small, .score.none { color: var(--muted); font-size: .84rem; }

/* rating */
.rank { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rank-row { display: flex; gap: 14px; align-items: center; padding: 16px; }
.pos { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--muted); width: 1.6em; text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.rank-main { flex: 1; min-width: 0; } .rank-main h2 { font-size: 1.15rem; margin-bottom: .2em; } .rank-main h2 a { color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rank-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
@media (max-width: 720px) { .rank-row { flex-wrap: wrap; } .rank-side { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; width: 100%; } }
.pick { display: inline-block; vertical-align: middle; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-family: var(--font); font-size: .74rem; font-weight: 800; white-space: nowrap; color: var(--on-accent); background: var(--accent); }
.item-head .pick { margin: 0 0 8px; }
.score.ed-score small { text-transform: uppercase; letter-spacing: .05em; font-size: .7rem; font-weight: 700; }
.rank-side .score { justify-content: flex-end; } .rank-side .stars { font-size: 1.15rem; }
.item-score { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.features { list-style: none; padding: 0; margin: 0 0 .8em; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 3px 18px; font-size: .9rem; color: var(--text); }
.features li { padding-left: 1.4em; position: relative; overflow-wrap: anywhere; } .features li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.item .features { font-size: 1rem; margin-bottom: 1.4em; } .h-sub { font-size: 1.1rem; margin-top: 1.2em; }
.item-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; } .item-head h1 { margin: 0 0 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0; }
.facts > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.facts dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; } .facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.reviews { display: grid; gap: 12px; margin-bottom: 26px; }
.review { padding: 14px 16px; margin-bottom: 12px; } .review header { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 8px; }
.review time { color: var(--muted); font-size: .82rem; margin-left: auto; } .review p { color: var(--text); overflow-wrap: anywhere; }
.note { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.note.approved { border-color: var(--ok); } .note.pending { border-color: var(--warn); } .note.rejected { border-color: var(--bad); }
.notice { padding: 18px; }
.review-form, .form { padding: 18px; display: grid; gap: 12px; max-width: 760px; }
.rate { border: 0; padding: 0; margin: 0; display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rate legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-weight: 600; }
.rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rate label { font-family: Arial, sans-serif; font-size: 2rem; line-height: 1; color: var(--star-off); cursor: pointer; }
.rate input:checked ~ label, .rate label:hover, .rate label:hover ~ label { color: var(--star); }
.rate input:focus-visible + label { outline: 2px solid var(--accent); }

/* forms */
label { font-weight: 600; font-size: .92rem; display: grid; gap: 5px; }
input, textarea, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; } textarea.mono, .mono { font-family: var(--font-mono); font-size: .86rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } form.inline { display: inline; margin: 0; }

/* prose */
.article { max-width: 780px; } .article > .meta { margin-bottom: 20px; }
.prose { font-size: 1.05rem; } .prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-left: 1.3em; } .prose li { margin-bottom: .35em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose code { background: var(--surface2); padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: .9em; }
.prose pre { background: var(--surface2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; overflow-x: auto; } .prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; } .prose th, .prose td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; }

/* tables (admin) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface); }
tr:last-child td { border-bottom: 0; } tr.dim { opacity: .5; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: auto; }
.foot { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; padding-top: 30px; padding-bottom: 14px; }
.foot p { color: var(--muted); font-size: .9rem; margin-top: 10px; max-width: 50ch; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; align-content: start; } .foot nav a { color: var(--muted); font-weight: 600; }
.copy { color: var(--muted); font-size: .82rem; padding-bottom: 22px; }
@media (max-width: 720px) { .foot { grid-template-columns: 1fr; } }

/* admin */
.admin .stats .stat { padding: 18px; color: var(--text); display: grid; } .admin .stat b { font-size: 2rem; } .admin .stat span { color: var(--muted); }
.admin h2 { margin-top: 1.6em; } .admin .form { margin-bottom: 14px; }
.admin .site-header .logo { font-size: 1.2rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
