:root {
  --navy: #0f2a3a;
  --navy-2: #163c52;
  --gold: #c9a84c;
  --gold-dark: #a8872f;
  --text: #1f2933;
  --muted: #5b6b79;
  --border: #e3e8ee;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --link: #0f5c8a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--link); }
a:hover { color: var(--gold-dark); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.editor-bar {
  background: #fff7dc;
  border-bottom: 1px solid #ecd98f;
  font-size: 0.8125rem;
  text-align: center;
  padding: 4px 16px;
}

.site-header { background: var(--navy); color: #fff; }

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { font-weight: 700; font-size: 1.5rem; letter-spacing: 0.04em; }
.brand-sub { color: var(--gold); font-weight: 500; font-size: 0.9375rem; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }

.header-link { color: #fff; font-size: 0.875rem; font-weight: 500; text-decoration: none; white-space: nowrap; border: 1px solid rgba(255,255,255,0.35); border-radius: 6px; padding: 6px 12px; }
.header-link:hover { color: var(--navy); background: var(--gold); border-color: var(--gold); }

.hero { text-align: center; padding-top: 36px; padding-bottom: 56px; }
.hero h1 { margin: 0 0 20px; font-size: clamp(1.75rem, 5vw, 2.5rem); font-weight: 600; }
.eyebrow { margin: 0 0 6px; color: var(--gold); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.8125rem; font-weight: 600; }

/* ---------- Search ---------- */
.search { display: flex; flex: 1; max-width: 420px; }
.search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 0.9375rem;
  padding: 8px 12px;
  border: 1px solid transparent; border-right: none;
  border-radius: 6px 0 0 6px;
  background: #fff; color: var(--text);
}
.search button {
  font: inherit; font-size: 0.9375rem; font-weight: 600;
  padding: 8px 16px;
  border: none; border-radius: 0 6px 6px 0;
  background: var(--gold); color: var(--navy);
  cursor: pointer;
}
.search button:hover { background: #d8b95e; }
.search input:focus { outline: 2px solid var(--gold); outline-offset: -2px; }
.search-big { max-width: 620px; margin: 0 auto; }
.search-big input { padding: 14px 16px; font-size: 1.0625rem; }
.search-big button { padding: 14px 24px; font-size: 1.0625rem; }
main .search-big { margin: 0 0 24px; }
main .search-big input { border-color: var(--border); }

/* ---------- Main ---------- */
main { padding-top: 28px; padding-bottom: 56px; min-height: 50vh; }
main h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.25; margin: 0 0 12px; font-weight: 600; color: var(--navy); }

.crumbs { font-size: 0.875rem; color: var(--muted); margin-bottom: 16px; }
.crumbs span { margin: 0 4px; }
.lead { font-size: 1.0625rem; color: var(--muted); margin: 0 0 24px; }
.empty { color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.cat-card { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--gold); border-radius: 8px; padding: 20px 22px; }
.cat-card h2 { margin: 0 0 4px; font-size: 1.125rem; font-weight: 600; }
.cat-card h2 a { color: var(--navy); text-decoration: none; }
.cat-card h2 a:hover { color: var(--gold-dark); }
.cat-desc { margin: 0 0 10px; color: var(--muted); font-size: 0.875rem; }
.more { display: inline-block; margin-top: 10px; font-size: 0.875rem; font-weight: 500; }

.article-list { list-style: none; margin: 0; padding: 0; }
.article-list li { padding: 5px 0; font-size: 0.9375rem; }
.article-list a { text-decoration: none; }
.article-list a:hover { text-decoration: underline; }
.article-list-full li { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; margin-bottom: 10px; font-size: 1rem; }
.article-list-full a { font-weight: 500; }
.article-list-full p { margin: 4px 0 0; color: var(--muted); font-size: 0.875rem; }
.result-count { color: var(--muted); font-size: 0.875rem; }
.result-cat { font-size: 0.75rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }

.draft-tag { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; background: #fff1c2; color: #7a5a00; border-radius: 4px; padding: 1px 6px; }
.draft-banner { background: #fff1c2; color: #7a5a00; border-radius: 6px; padding: 8px 12px; font-size: 0.875rem; margin-bottom: 16px; }

/* ---------- Article ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.article-layout > article { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px 32px; min-width: 0; }
.article-layout > article:only-child { grid-column: 1 / -1; max-width: 820px; }

.side { position: sticky; top: 16px; font-size: 0.875rem; }
.side h2 { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }
.side ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.side li { padding: 5px 0 5px 12px; margin-left: -2px; border-left: 2px solid transparent; }
.side li.current { border-left-color: var(--gold); font-weight: 600; color: var(--navy); }
.side a { text-decoration: none; }
.side a:hover { text-decoration: underline; }

.article-body { overflow-wrap: break-word; }
.article-body h2 { font-size: 1.375rem; margin: 1.8em 0 0.5em; color: var(--navy); font-weight: 600; line-height: 1.3; }
.article-body h3 { font-size: 1.125rem; margin: 1.6em 0 0.4em; color: var(--navy); font-weight: 600; }
.article-body p { margin: 0 0 1em; }
.article-body ul, .article-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.article-body li { margin-bottom: 0.35em; }
.article-body img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; }
.article-body table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; margin: 0 0 1em; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.article-body th { background: var(--bg); font-weight: 600; }
.article-body blockquote { margin: 0 0 1em; padding: 10px 16px; border-left: 4px solid var(--gold); background: #fbf7ea; border-radius: 0 6px 6px 0; }
.article-body blockquote > :last-child { margin-bottom: 0; }
.article-body code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 0.875em; }
.article-body pre { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; overflow-x: auto; }
.article-body pre code { border: none; padding: 0; background: none; }
.article-body .video { position: relative; padding-bottom: 56.25%; height: 0; margin: 0 0 1em; }
.article-body .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 6px; }

.updated { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.8125rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255,255,255,0.8); font-size: 0.875rem; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; padding-top: 20px; padding-bottom: 20px; }
.site-footer a { color: var(--gold); }

@media (max-width: 820px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-layout > article { padding: 20px 18px; }
  .side { position: static; }
}

@media (max-width: 640px) {
  .header-row { flex-wrap: wrap; }
  .header-row .search { order: 3; flex-basis: 100%; max-width: none; }
  .search-big button { padding: 14px 16px; }
}
