:root {
  --bg: #f7f5f0;
  --ink: #1f1e1b;
  --muted: #625e56;
  --line: #d8d3c8;
  --field: #ffffff;
  --topbar-bg: #fffdf9;
  --accent: #2f5a4b;
  --accent-dark: #254a3d;
  --accent-ink: #ffffff;
  --error: #9b2c2c;
  --error-bg: #fbf1f0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --gutter: clamp(1.25rem, 6vw, 5rem);
}

/* Accessibility menu states (toggled on <html>) */
html.a11y-large { font-size: 20px; }
html.a11y-xlarge { font-size: 24px; }
html.a11y-contrast {
  --bg: #000000; --ink: #ffffff; --muted: #e6e6e6; --line: #9a9a9a; --field: #111111; --topbar-bg: #000000;
  --accent: #ffd54f; --accent-dark: #ffca28; --accent-ink: #000000; --error: #ff8a80; --error-bg: #2a0000;
}
html.a11y-links a { text-decoration: underline !important; }

* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--serif); line-height: 1.55; }
html[lang="he"] body { font-family: "David", "Frank Ruhl Libre", "Times New Roman", serif; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; inset-inline-start: 1rem; top: -5rem; z-index: 10; padding: .5rem .9rem; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink); font-family: var(--sans); text-decoration: none; }
.skip:focus { top: .5rem; }

/* Thin top menu */
.topbar { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem 1.4rem; min-height: 44px; padding: .3rem var(--gutter);
  background: var(--topbar-bg); border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: .84rem; }
.brand { font-family: var(--serif); font-size: 1rem; color: var(--ink); text-decoration: none; white-space: nowrap; }
html[lang="he"] .brand { font-family: inherit; }
.menu { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.menu a { color: var(--muted); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--ink); }
.menu a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.tools { display: flex; align-items: center; gap: .7rem; margin-inline-start: auto; }
.tool-link { color: var(--muted); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.tool-link:hover { color: var(--ink); }
button.tool-link { background: none; border: 0; border-bottom: 2px solid transparent; font: inherit; cursor: pointer; }
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); letter-spacing: .04em; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: " \25BE"; font-size: .8em; }
.langs[open] summary, .langs summary:hover { color: var(--ink); border-color: var(--ink); }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + .3rem); z-index: 20; min-width: 9rem; margin: 0; padding: .3rem 0; list-style: none; background: var(--field); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.langs li a { display: flex; align-items: center; gap: .55rem; padding: .45rem .9rem; color: var(--ink); text-decoration: none; }
.flag { flex: none; display: inline-block; }
.icon { flex: none; display: inline-block; vertical-align: -.15em; }
.langs li a:hover { background: var(--bg); }
.langs li a[aria-current] { font-weight: 600; color: var(--accent); }
.a11y-toggle { display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.a11y-toggle:hover, .a11y-toggle[aria-expanded="true"] { color: var(--ink); background: var(--line); }
.legal-line { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; padding: .35rem var(--gutter) 0; font-family: var(--sans); font-size: .78rem; font-weight: 700; color: #000; }
.legal-row { display: flex; align-items: center; gap: .55rem; }
.legal-line a { color: #000; text-decoration: none; }
.legal-line a:hover { text-decoration: underline; }
.legal-line .sep { font-weight: 400; }
html.a11y-contrast .legal-line, html.a11y-contrast .legal-line a { color: var(--ink); }
.a11y-panel { position: absolute; top: 2.9rem; inset-inline-end: var(--gutter); z-index: 30; display: flex; flex-direction: column; align-items: stretch; gap: .3rem; width: 13rem; padding: .5rem; background: var(--field); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 4px 14px rgba(0,0,0,.08); font-family: var(--sans); font-size: .84rem; }
.a11y-panel[hidden] { display: none; }
.a11y-panel button { font: inherit; background: var(--field); color: var(--ink); border: 1px solid var(--line); border-radius: 3px;
  padding: .3rem .7rem; cursor: pointer; }
.a11y-panel button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.a11y-panel a { margin: .2rem 0 0; text-align: center; }

/* Content sits at the start edge of the page, not centered */
.page { max-width: 64rem; padding: 3.5rem var(--gutter) 3rem; }
.page.wide, .page.home { max-width: none; }
.intro { max-width: none; }
.intro-text, .sign, .text { max-width: 40rem; }

.kicker { font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; color: var(--muted); margin: 0 0 1rem; }
h1 { font-weight: 400; font-size: 2.7rem; line-height: 1.08; margin: 0 0 .9rem; letter-spacing: -.01em; }
h2 { font-weight: 400; font-size: 1.45rem; margin: 2.2rem 0 .6rem; }
html[lang="he"] h1, html[lang="he"] .kicker { letter-spacing: 0; }

.intro p { font-size: 1.12rem; margin: 0 0 1rem; }
.intro .lede { font-size: 1.3rem; color: var(--accent); margin-bottom: 1.8rem; }
.cta { margin-top: 2.2rem; text-align: end; }
.cta-lead { font-family: var(--sans); font-weight: 600; font-size: 1.05rem; margin: 0 0 .6rem; }

.sign h1 { font-size: 2.2rem; }
.meaning { margin: 0 0 1.8rem; font-size: 1.05rem; }

form { font-family: var(--sans); }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.field { margin-bottom: 1.4rem; }
label { display: block; font-size: .95rem; font-weight: 600; margin-bottom: .35rem; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.help { font-size: .88rem; color: var(--muted); margin: -.1rem 0 .5rem; }

input[type=text], input[type=email], input[type=tel], textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: .65rem .75rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--line); border-radius: 4px;
}
textarea { resize: vertical; min-height: 6rem; }
input:focus, textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type=file] { font-size: .95rem; width: 100%; color: var(--ink); }
.has-error input, .has-error textarea { border-color: var(--error); }

.error { color: var(--error); font-size: .9rem; margin: .4rem 0 0; }
.error[hidden] { display: none; }
.form-error { font-family: var(--sans); background: var(--error-bg); border: 1px solid var(--error); padding: .75rem 1rem; border-radius: 4px; margin: 0 0 1.5rem; }

.preview img { display: block; max-width: 14rem; max-height: 10rem; margin-top: .6rem; border: 1px solid var(--line); border-radius: 4px; }
.preview .file-name { font-size: .88rem; color: var(--muted); margin: .5rem 0 0; }

.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; font-size: .95rem; line-height: 1.45; }
.check input { margin: .25rem 0 0; flex: none; width: 1.1rem; height: 1.1rem; }
.minor-check { margin-top: .7rem; }
.field.waived input[type=file], .field.waived .help { opacity: .45; }

.button {
  display: inline-block; font-family: var(--sans); font-size: 1.05rem; font-weight: 600; padding: .85rem 1.6rem;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 4px; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--accent-dark); }
.button[disabled] { opacity: .6; cursor: default; }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-size: .95rem; padding: .6rem 1.1rem; }
.button.secondary:hover { background: var(--line); }

.text h1 { font-size: 2.2rem; }
.text .meta { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: -.3rem; }
.text ul { padding-inline-start: 1.3rem; }
.text li { margin-bottom: .35rem; }

.footer { padding: 1.4rem var(--gutter) 2rem; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .78rem; color: var(--muted); }
.footer-line { margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.footer-line a { color: var(--muted); text-decoration: none; }
.footer-line a:hover { color: var(--ink); text-decoration: underline; }

/* discussion */
.discussion { max-width: 44rem; }
.intro-line { font-size: 1.05rem; color: var(--muted); margin: 0; }
.comments { list-style: none; padding: 0; margin: 2rem 0 0; }
.comment-item { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.comment-meta { font-family: var(--sans); font-size: .85rem; color: var(--muted); margin: 0 0 .4rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.comment-name { color: var(--ink); font-weight: 600; }
.comment-text { margin: 0; white-space: pre-line; font-size: 1.05rem; overflow-wrap: anywhere; }
.pager { display: flex; gap: 1.2rem; align-items: center; margin-top: 2rem; font-family: var(--sans); font-size: .9rem; }

/* notices, your word, login */
.notice { max-width: 44rem; margin: 0 0 1.5rem; padding: .75rem 1rem; border-radius: 4px; background: var(--field); border: 1px solid var(--accent); font-family: var(--sans); font-size: .95rem; }
.notice p { margin: 0; }
.menu .inline { display: inline; }
.menu-button { background: none; border: 0; padding: .2rem 0; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.menu-button:hover { color: var(--ink); }
.compose { margin: 1.5rem 0 2rem; padding: 1rem 1.2rem; background: var(--field); border: 1px solid var(--line); border-radius: 4px; font-family: var(--sans); }
.compose .whoami { margin: 0 0 .8rem; font-size: .9rem; color: var(--muted); }
.compose label { font-size: 1rem; }
.compose textarea { margin-bottom: .5rem; }
.compose .button { margin-top: .3rem; }
.guest { font-size: 1.05rem; margin: 1.5rem 0 .8rem; }
.guest-links { display: flex; gap: .8rem; flex-wrap: wrap; margin: 0 0 2rem; }
.replies { list-style: none; padding: 0; margin: 1rem 0 0; margin-inline-start: 1.5rem; border-inline-start: 2px solid var(--line); }
.reply { padding: .7rem 0; padding-inline-start: 1rem; }
.reply .comment-text { font-size: 1rem; }
.reply-box { margin-top: .6rem; font-family: var(--sans); font-size: .9rem; }
.reply-box summary { cursor: pointer; color: var(--accent); }
.reply-box form { margin-top: .6rem; }
.reply-box textarea { margin-bottom: .5rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.login-form { margin-top: 1.5rem; max-width: 26rem; }
.contact-form { margin-top: 1.5rem; max-width: 34rem; }
.empty { color: var(--muted); }

/* admin */
.admin { font-family: var(--sans); }
.admin h1 { font-size: 2rem; }
.admin .count { color: var(--muted); font-size: 1.2rem; margin-inline-start: .5rem; }
.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; background: var(--field); }
th, td { text-align: start; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--bg); white-space: nowrap; }
td.comment { max-width: 24rem; white-space: pre-wrap; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--error); }
.inline { display: inline; margin-inline-start: .5rem; }
.muted { color: var(--muted); }

@media (max-width: 600px) {
  html { font-size: 16px; }
  html.a11y-large { font-size: 19px; }
  html.a11y-xlarge { font-size: 22px; }
  .page { padding-top: 2.5rem; }
  h1 { font-size: 2.2rem; }
  .tools { margin-inline-start: 0; width: 100%; }
  .legal-line { align-items: flex-start; }
  .langs ul { inset-inline-end: auto; inset-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
