/* WeOrthodox — colours come from the logo: deep slate and teal, with a touch of icon gold. */
:root {
  --slate: #2b3f4a;
  --slate-2: #41596a;
  --teal: #44cdc6;
  --teal-ink: #0f7570;      /* teal dark enough for text on white */
  --teal-soft: #e6f7f6;
  --gold: #b88a2e;
  --bg: #f3f6f7;
  --card: #ffffff;
  --line: #dfe7ea;
  --text: #1f2e37;
  --muted: #5d6e78;
  --danger: #b3261e;
  --radius: 14px;
  --serif: Georgia, 'Times New Roman', 'PT Serif', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); }
img { max-width: 100%; height: auto; }
a { color: var(--teal-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); color: var(--slate); line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0 0 12px; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-weight: 400; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--slate); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- header */
.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--slate); font: 700 21px/1 var(--serif); flex: none; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 50%; display: block; }
.brand b { color: var(--teal-ink); }
.searchbox { flex: 1; max-width: 340px; }
.searchbox input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--bg); }
.searchbox input:focus { background: #fff; border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-soft); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { color: var(--slate); font-weight: 600; padding: 7px 11px; border-radius: 8px; }
.nav a:hover { background: var(--bg); text-decoration: none; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; flex: none; }
.lang a { padding: 4px 11px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lang a.on { background: var(--slate); color: #fff; }
.lang a:hover { text-decoration: none; }
.account { display: flex; align-items: center; gap: 8px; flex: none; }
.account form { margin: 0; }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--slate); color: #fff; border: 1px solid var(--slate);
  border-radius: 999px; padding: 7px 18px; font-weight: 600; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--slate-2); border-color: var(--slate-2); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--slate); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); border-color: var(--slate-2); }
.btn-wide { width: 100%; padding: 10px 18px; }
.btn-small { padding: 3px 12px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font-size: 14px; }
.linkbtn:hover { color: var(--slate); text-decoration: underline; }
.linkbtn.danger:hover, .danger { color: var(--danger); }
.avatar { --h: 180; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: hsl(var(--h) 55% 88%); color: hsl(var(--h) 55% 28%); font-weight: 700; }
.avatar-s { width: 24px; height: 24px; font-size: 12px; }

/* ---------- page layout */
main.wrap { padding-top: 22px; padding-bottom: 48px; min-height: 70vh; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.col { min-width: 0; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.hero { margin-bottom: 16px; }
.hero h1 { font-size: clamp(26px, 4vw, 34px); margin-bottom: 6px; }
.hero p { color: var(--muted); max-width: 62ch; margin: 0; }
.hero-src { display: flex; gap: 14px; align-items: flex-start; }
.hero-src .srcicon { width: 56px; height: 56px; font-size: 24px; }
.hero-sub { font-size: 14px; margin-bottom: 6px !important; }

/* ---------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.col > .card:hover { border-color: #c5d3d9; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.src { display: inline-flex; align-items: center; gap: 8px; color: var(--slate); font-weight: 600; }
.srcicon { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none;
  background: var(--teal-soft); color: var(--teal-ink); font: 700 13px/1 var(--sans); }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--slate-2); background: var(--bg);
  border-radius: 999px; padding: 2px 9px; }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--slate-2)); }
.chip-warn { background: #fdecc8; color: #8a5a00; }
.p-youtube { --dot: #e62117; } .p-reddit { --dot: #ff5700; } .p-instagram { --dot: #c13584; } .p-tiktok { --dot: #111; }
.p-facebook, .p-facebook_group { --dot: #1877f2; } .p-threads { --dot: #444; } .p-x { --dot: #000; } .p-substack { --dot: #ff6719; }
.card-title { font-size: 21px; margin-bottom: 10px; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--teal-ink); text-decoration: none; }
.card-summary { margin-bottom: 10px; }
.points { margin: 0 0 12px; }
.points li { position: relative; padding-left: 20px; margin-bottom: 5px; }
.points li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 8px; height: 8px; border-radius: 2px; background: var(--teal); transform: rotate(45deg); }
.card-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line); }
.card-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.card-link svg, .vote svg { fill: currentColor; }
.card-more { margin-left: auto; font-weight: 600; }
.vote { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px;
  color: var(--slate-2); font-weight: 700; cursor: pointer; font-size: 14px; }
.vote:hover { border-color: var(--teal); color: var(--teal-ink); }
.vote.on { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-ink); }
.vote-s { padding: 2px 9px; font-size: 13px; }
.moments-inline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.empty { color: var(--muted); padding: 28px 0; text-align: center; }

/* ---------- media */
.video { position: relative; aspect-ratio: 16 / 9; background: var(--slate); border-radius: 10px; overflow: hidden; margin-bottom: 12px; cursor: pointer; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video-tall.playing { aspect-ratio: auto; height: 640px; max-width: 360px; margin-inline: auto; background: #fff; }
.video-plain { aspect-ratio: auto; min-height: 92px; background: linear-gradient(120deg, var(--slate), var(--slate-2)); }
.video-plain.playing { aspect-ratio: 16 / 9; }
.video-tall.video-plain.playing { aspect-ratio: auto; }
.play { position: absolute; inset: 0; margin: auto; width: max-content; height: max-content; min-width: 64px; min-height: 64px; display: inline-flex; align-items: center;
  gap: 10px; padding: 0 20px; border: 0; border-radius: 999px; background: rgba(43, 63, 74, 0.86); color: #fff; font-weight: 600; cursor: pointer; }
.play svg { fill: var(--teal); }
.video:hover .play { background: var(--slate); }
.dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 12px; font-weight: 600; padding: 1px 6px; border-radius: 5px; }
.shot { display: block; margin-bottom: 12px; border-radius: 10px; overflow: hidden; background: var(--bg); max-height: 460px; text-align: center; }
.shot img { max-height: 460px; object-fit: contain; display: block; margin: 0 auto; }
.embed-post iframe { width: 100%; max-width: 560px; height: 520px; border: 1px solid var(--line); border-radius: 10px; display: block; margin: 0 auto 12px; }

/* ---------- post page */
.post-title { font-size: clamp(25px, 4vw, 32px); margin-bottom: 14px; }
.post-summary { font-size: 17px; }
.post-h2 { font-size: 18px; margin: 16px 0 8px; }
.videobox { background: var(--teal-soft); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.videobox h2 { font-size: 17px; margin-bottom: 6px; }
.videobox h3 { font: 700 13px/1.3 var(--sans); letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate-2); margin: 12px 0 8px; }
.moments li { display: flex; gap: 10px; align-items: baseline; margin-bottom: 7px; }
.tc { flex: none; min-width: 52px; text-align: center; border: 0; border-radius: 6px; background: var(--slate); color: #fff; font: 700 13px/1 ui-monospace, Consolas, monospace;
  padding: 5px 7px; cursor: pointer; }
a.tc:hover, button.tc:hover { background: var(--teal-ink); text-decoration: none; }
.tc-static { cursor: default; background: var(--slate-2); }
.adminbar { display: flex; gap: 18px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.adminbar form { margin: 0; }

/* ---------- discussion */
.discussion { margin-top: 22px; }
.discussion > h2 { font-size: 22px; margin-bottom: 6px; }
.note { font-size: 14px; color: var(--muted); border-left: 3px solid var(--gold); padding-left: 10px; margin-bottom: 14px; }
.cform textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; background: #fff; display: block; margin-bottom: 8px; }
.cform textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-soft); }
.discussion > .cform, .loginhint { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.loginhint { color: var(--muted); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.discussion > .tree > .c { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.tree .tree { margin: 12px 0 0 4px; padding-left: 14px; border-left: 2px solid var(--line); }
.tree .tree > .c { margin-bottom: 12px; }
.tree .tree > .c:last-child { margin-bottom: 0; }
.c:target > .c-head, .c:target > .c-body > .c-text { background: #fff8e6; box-shadow: 0 0 0 6px #fff8e6; border-radius: 4px; }
.c-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.fold { width: 20px; height: 20px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); cursor: pointer; line-height: 1; padding: 0; font-size: 14px; }
.fold:hover { border-color: var(--slate-2); color: var(--slate); }
.c.folded > .c-body { display: none; }
.c-name { color: var(--slate); }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: var(--gold); color: #fff; border-radius: 5px; padding: 1px 6px; }
.c-likes { font-size: 13px; }
.c-text p { margin: 0 0 8px; overflow-wrap: anywhere; }
.c-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.c-actions form { margin: 0; }
.replybox summary { cursor: pointer; color: var(--muted); list-style: none; font-size: 14px; }
.replybox summary::-webkit-details-marker { display: none; }
.replybox summary:hover { color: var(--slate); text-decoration: underline; }
.replybox[open] { flex-basis: 100%; order: 5; }
.replybox .cform { margin-top: 8px; }

/* opinion labels: neutral by default, coloured when the same participant speaks more than once */
.op { font: 700 13px/1 ui-monospace, Consolas, monospace; padding: 4px 8px; border-radius: 6px; background: #edf1f3; color: #4a5b65; }
.op-1 { background: #d6f3f1; color: #0d635f; } .op-2 { background: #fdebc6; color: #7d5200; }
.op-3 { background: #fcdde4; color: #9a1f43; } .op-4 { background: #dbe8fb; color: #1b4a93; }
.op-5 { background: #e8dffa; color: #54349c; } .op-6 { background: #dcf1d9; color: #28631f; }
.op-7 { background: #fde1cf; color: #99400c; } .op-8 { background: #d9dfe4; color: #263845; }
.op[class*=' op-'] { box-shadow: inset 0 0 0 1px currentColor; }

/* ---------- sidebar */
.side { position: sticky; top: 78px; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; font-size: 15px; }
.box p:last-child { margin-bottom: 0; }
.box-title { font: 700 13px/1.3 var(--sans); letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-2); margin-bottom: 10px; }
.srclist { margin-bottom: 10px; }
.srclist a { display: flex; align-items: center; gap: 9px; padding: 5px 6px; margin: 0 -6px; border-radius: 8px; color: var(--slate); }
.srclist a:hover { background: var(--bg); text-decoration: none; }
.srclist-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.srclist-n { font-size: 13px; color: var(--muted); }
.morelist li { padding: 8px 0; border-top: 1px solid var(--line); }
.morelist li:first-child { border-top: 0; padding-top: 0; }
.morelist a { display: block; color: var(--slate); font-weight: 600; line-height: 1.35; }
.morelist span { font-size: 13px; color: var(--muted); }

/* ---------- sort bar and pager */
.sortbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.sortbar a { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--slate-2); font-weight: 600; font-size: 14px; }
.sortbar a:hover { border-color: var(--slate-2); text-decoration: none; }
.sortbar a.on { background: var(--slate); border-color: var(--slate); color: #fff; }
.sortbar-label { font-size: 14px; color: var(--muted); margin-left: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-top: 18px; }

/* ---------- sources page */
.srcgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.srccard { margin: 0; }
.srccard-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.srccard-head .srcicon { width: 44px; height: 44px; font-size: 18px; }
.srccard h2 { font-size: 19px; }
.srccard p:last-child { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------- text pages and forms */
.prose { max-width: 760px; margin-inline: auto; padding: 28px 32px; }
.prose h1 { font-size: 30px; margin-bottom: 18px; }
.prose h2 { font-size: 20px; margin: 22px 0 6px; }
.center { text-align: center; }
.authbox { max-width: 420px; margin: 28px auto; padding: 28px; }
.authbox h1 { font-size: 26px; margin-bottom: 16px; }
.authbox label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 14px; color: var(--slate); }
.authbox input[type='email'], .authbox input[type='text'], .authbox input[type='password'] { display: block; width: 100%; margin-top: 5px; height: 42px;
  border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font-weight: 400; }
.authbox input:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px var(--teal-soft); }
.authbox small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
.codeinput { font: 700 24px/1 ui-monospace, Consolas, monospace !important; letter-spacing: 8px; text-align: center; }
.authlinks { text-align: center; font-size: 14px; color: var(--muted); margin: 16px 0 0; }
.alert { border-radius: 10px; padding: 10px 14px; font-size: 15px; }
.alert-err { background: #fdecea; color: #8c1d18; }
.alert-ok { background: var(--teal-soft); color: #0d635f; }

/* ---------- footer */
.foot { background: var(--slate); color: #c9d6dc; font-size: 14px; padding: 28px 0; }
.foot-in p { max-width: 70ch; }
.foot-brand { display: flex; align-items: center; gap: 8px; color: #fff; font: 700 17px/1 var(--serif); }
.foot-brand img { border-radius: 50%; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.foot a { color: var(--teal); }

/* ---------- small screens */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .top-in { gap: 8px; height: auto; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
  .brand-name { font-size: 18px; }
  .searchbox { order: 9; flex-basis: 100%; max-width: none; }
  .nav a { padding: 6px 8px; }
  .hide-s { display: none !important; }
  .card { padding: 14px; border-radius: 12px; }
  .card-title { font-size: 19px; }
  .card-more { margin-left: 0; flex-basis: 100%; }
  .prose { padding: 20px 16px; }
  .tree .tree { padding-left: 10px; margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .vote, .sortbar a, .card { transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
}

/* ============================== admin dashboard ============================== */
.admin { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: 78px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.admin-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--slate); font-weight: 600; }
.admin-nav a:hover { background: var(--bg); text-decoration: none; }
.admin-nav a.on { background: var(--slate); color: #fff; }
.admin h1 { font-size: 26px; margin-bottom: 14px; }
.admin h2 { font-size: 19px; margin-bottom: 10px; }
.admin .card { overflow-x: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat-tile b { display: block; font: 700 26px/1.1 var(--serif); color: var(--slate); }
.stat-tile span { font-size: 13px; color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table form { display: inline; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ok-text { color: #1f6b3a; } .err-text { color: var(--danger); } .warn-text { color: #8a5a00; }
.checklist li { padding: 3px 0; }
.fieldset { border: 0; padding: 0; margin: 0; }
.field { margin-bottom: 14px; max-width: 720px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 14px; color: var(--slate); margin-bottom: 4px; }
.field input[type='text'], .field input[type='number'], .field input[type='password'], .field input[type='url'], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.field input[type='number'] { max-width: 160px; }
.field textarea { min-height: 150px; font: 13px/1.5 ui-monospace, Consolas, monospace; resize: vertical; }
.field small, .hint { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.savebar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
.logline { font: 13px/1.5 ui-monospace, Consolas, monospace; padding: 4px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.logline time { color: var(--muted); margin-right: 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
details.edit summary { cursor: pointer; color: var(--teal-ink); font-size: 14px; }
details.edit[open] { margin-top: 8px; }
@media (max-width: 800px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { position: static; display: flex; flex-wrap: wrap; }
}
