/* Everyone Lawyer — warm, civic, editorial design.
 * Serif display headings, generous whitespace, paper-and-ink palette. */

:root {
  --ink: #1e2430;
  --ink-soft: #3d4454;
  --muted: #6b7280;
  --paper: #faf7f1;
  --card: #ffffff;
  --accent: #1f5c8b;      /* deep civic blue */
  --accent-deep: #153f63;
  --gold: #b98a2f;        /* editorial gold */
  --line: #e5ddcf;
  --radius: 10px;
  --serif: "Georgia", "Times New Roman", "Noto Serif", "Songti SC", "STSong", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

/* ---------- header ---------- */
.site-header {
  border-bottom: 3px double var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
.brand {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand .zh { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
}
.main-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.main-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--gold);
  font-weight: 600;
}
.main-nav a:hover { color: var(--accent); }

.lang-toggle {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
main.wrap { padding-top: 2.5rem; padding-bottom: 4rem; }

.hero {
  text-align: center;
  padding: 3rem 1.25rem 2.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  font-weight: 700;
}
.hero p.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0 auto 1.5rem;
}
.kicker {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h2, h3 {
  font-family: var(--serif);
  line-height: 1.35;
}
h2.section-title {
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
  padding-top: 2rem;
}
.section-intro { color: var(--ink-soft); max-width: 40rem; margin-bottom: 1.5rem; }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(30,36,48,0.04);
}
.card h3 { margin-top: 0; font-size: 1.25rem; }
.card p:last-child, .card form:last-child { margin-bottom: 0; }

.grid { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 1rem; }
label.field > span {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}
input[type="text"], input[type="email"], input[type="number"],
input[type="file"], select, textarea {
  width: 100%;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.65rem 1.5rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--accent-deep); }
.btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn.secondary:hover { background: var(--accent); color: #fff; }

.form-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.75rem;
}
.form-ok {
  background: #eef7ee;
  border: 1px solid #bfe0bf;
  color: #1d5c1d;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}
.form-err {
  background: #fdf0ee;
  border: 1px solid #eec5be;
  color: #8c2b1f;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
}

/* ---------- pledge ---------- */
.pledge {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
}
.pledge blockquote {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

/* ---------- misc ---------- */
.disclaimer {
  border-left: 4px solid var(--gold);
  background: #fffdf6;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}
.disclaimer strong { display: block; margin-bottom: 0.25rem; }

.coming-soon {
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.5);
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0;
}
.social-row a, .social-row span.na {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
}
.social-row a:hover { border-color: var(--accent); color: var(--accent); }
.social-row span.na { color: #a8a29e; cursor: default; }

.poll-option {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  font: inherit;
  width: 100%;
  text-align: left;
}
.poll-option:hover { border-color: var(--accent); }
.poll-option[disabled] { cursor: default; opacity: 0.85; }
.poll-bar {
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  margin-top: 0.4rem;
  overflow: hidden;
}
.poll-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.meta { font-size: 0.85rem; color: var(--muted); }
.comment { border-top: 1px solid var(--line); padding: 0.75rem 0; }
.comment .meta { margin-bottom: 0.25rem; }
.admin-comments { margin-top: 1rem; border-top: 1px dashed var(--line); padding-top: 0.75rem; }

.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: #000; }
video.stored { width: 100%; max-height: 420px; border-radius: 8px; background: #000; }

/* Watermark badge overlaid on case videos (deterrent, not DRM). */
.wm-wrap { position: relative; }
.wm-wrap video.stored { display: block; }
.wm-overlay {
  position: absolute; right: 0.6rem; bottom: 0.6rem;
  color: rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.35);
  font-size: 0.8rem; padding: 0.15rem 0.5rem; border-radius: 0.25rem;
  pointer-events: none; user-select: none; -webkit-user-select: none;
}

/* Petition page. */
.signer-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 2rem; }
.signer-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
@media (max-width: 600px) { .signer-list { columns: 1; } }
.share-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.petition-banner { text-align: center; border-top: 3px solid var(--gold); }
.petition-banner h2 { font-size: 1.35rem; }
.pre-line { white-space: pre-line; }
.petition-points li { margin-bottom: 0.5rem; }

ul.links { list-style: none; padding: 0; }
ul.links li { margin-bottom: 0.6rem; }
ul.links a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--line); }
ul.links a:hover { border-bottom-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 3px double var(--ink);
  margin-top: 2rem;
  padding: 2rem 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap { padding: 0; }

/* bilingual: show only active language */
html[lang="en"] .zh { display: none !important; }
html[lang="zh"] .en { display: none !important; }

/* Direct-giving (CV Educations) blocks on donate.html */
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0; }
.qr-box { border: 1px solid #e5e7eb; border-radius: 12px; padding: .75rem .5rem; text-align: center; background: #fafafa; }
.qr-box img { width: 100%; max-width: 170px; height: auto; border-radius: 8px; background: #fff; }
.qr-label { font-weight: 600; margin-top: .5rem; font-size: .95rem; }
.qr-detail { color: #4b5563; font-size: .85rem; margin-top: .25rem; word-break: break-word; }
/* Donation amount picker */
.amount-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.amount-btn { border: 1px solid #d1d5db; background: #fff; border-radius: 999px; padding: .5rem 1rem; font-size: 1rem; cursor: pointer; }
.amount-btn.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 700; }
.amount-custom { flex: 1 1 140px; border: 1px solid #d1d5db; border-radius: 999px; padding: .5rem 1rem; font-size: 1rem; min-width: 0; }
.field-label { display: block; font-weight: 600; margin-bottom: .25rem; }
.btn-big { font-size: 1.1rem; padding: .8rem 2.5rem; width: 100%; }
.form-error { color: #b91c1c; font-weight: 600; }
.fine-print { font-size: .85rem; color: #6b7280; background: #f9fafb; border-left: 3px solid #d1d5db; padding: .6rem .9rem; border-radius: 0 8px 8px 0; margin: 1rem 0 0; }
.inline-form .field { flex: 1 1 160px; margin: 0; }
.inline-form .btn { flex: 0 0 auto; }

/* ---- Direct on-page editing (admin only) ---- */
#elEditBtn { position: fixed; right: 14px; bottom: 14px; z-index: 20000; border: none; border-radius: 999px; padding: .7rem 1.2rem; font-size: 1rem; background: #1a73e8; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.28); cursor: pointer; }
#elEditBtn:active { transform: scale(.96); }
#elEditBar { position: fixed; top: 0; left: 0; right: 0; z-index: 20000; background: #202124; color: #fff; padding: .55rem .8rem; display: flex; align-items: center; gap: .6rem; font-size: .9rem; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
#elEditBar .spacer { flex: 1; }
#elEditBar button { border: none; border-radius: 8px; padding: .45rem .95rem; font-size: .95rem; cursor: pointer; white-space: nowrap; }
#elEditSave { background: #1a73e8; color: #fff; }
#elEditSave:disabled { opacity: .6; }
#elEditCancel { background: #5f6368; color: #fff; }
.el-editing { outline: 2px dashed #1a73e8 !important; outline-offset: 3px; cursor: text; }
.el-editing:focus { outline: 3px solid #1a73e8 !important; background: #e8f0fe; }
.el-article-ta { width: 100%; min-height: 42vh; font: inherit; line-height: 1.6; padding: .8rem; border: 2px solid #1a73e8; border-radius: 8px; box-sizing: border-box; margin: .6rem 0; }
#elToast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #202124; color: #fff; padding: .7rem 1.3rem; border-radius: 999px; z-index: 20001; font-size: .95rem; box-shadow: 0 4px 14px rgba(0,0,0,.3); white-space: nowrap; }
body.el-editing-mode { padding-top: 54px; }

/* Donation CTA card — shown at the bottom of videos/articles/polls/cases/petitions pages */
.donate-cta {
  text-align: center;
  border: 2px solid var(--accent);
  background: linear-gradient(135deg, #f4f8fc, #eef4fa);
}
.donate-cta h3 { margin-top: 0; }
.donate-cta p:last-child { margin-bottom: 0; }

/* Section-level edit trigger: hidden for visitors, revealed for signed-in admin */
.el-editing-mode [data-inline-edit-trigger] { display: none; }

/* Word-style formatting toolbar (on-page editor, admin only) */
#elFormatBar { position: fixed; z-index: 30000; display: flex; flex-wrap: wrap; gap: 4px; max-width: 94vw; background: #202124; border-radius: 12px; padding: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
#elFormatBar[hidden] { display: none; }
#elFormatBar button { border: none; border-radius: 8px; min-width: 34px; height: 34px; padding: 0 8px; font-size: 15px; color: #fff; background: transparent; cursor: pointer; }
#elFormatBar button:active { background: #3c4043; }
/* Share-modal (WeChat QR) and share toast. */
.el-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.el-modal[hidden] { display: none; }
.el-modal-card { background: #fff; border-radius: 14px; padding: 22px; max-width: 320px; width: 100%; text-align: center; }
.el-qr-box { display: flex; justify-content: center; align-items: center; margin-bottom: 12px; min-height: 180px; }
.el-qr-box img, .el-qr-box canvas { display: block; }
.el-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #222; color: #fff; border-radius: 10px; padding: 10px 16px; font-size: 14px; z-index: 2001; max-width: 92vw; text-align: center; }
.el-toast[hidden] { display: none; }
/* "Missing translation" placeholder shown in edit mode for fallback spans. */
.el-editing[data-ph]:empty:before { content: attr(data-ph); opacity: .45; font-style: italic; }
/* Hidden-paragraph marker shown in edit mode (Word-like deletion, reversible). */
.el-para-hidden { outline: 2px dashed #d93025 !important; outline-offset: 3px; opacity: .8; cursor: pointer; }
.el-para-hidden:after { content: attr(data-hidden-note); display: inline-block; font-size: 12px; color: #d93025; border: 1px solid #d93025; border-radius: 6px; padding: 2px 8px; margin: 6px 0; }
div.el-article-ta { background: #fff; }
div.el-article-ta p { margin: 0 0 .8em; }
div.el-article-ta p:last-child { margin-bottom: 0; }
