/* Connecticut Gun Owners — site styles */
@font-face { font-family: "Anton"; src: url("../fonts/anton-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-700.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-800.woff") format("woff"); font-weight: 800; font-display: swap; }

:root {
  --navy: #0E1A2B; --navy-2: #16263D; --gold: #F2A900; --gold-dk: #8A5A00;
  --teal: #4FD1C5; --teal-dk: #16504B; --cream: #F5F1E8; --paper: #F4F2EC;
  --ink: #14171C; --muted: #5A5F66; --line: #E2DED3; --line-2: #CFCABE;
  --red: #A3262E; --warn-bg: #FFF6DD; --warn-line: #E8C35A;
  --radius: 14px; --max: 1080px;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--paper); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--gold-dk); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--gold); color: var(--navy); padding: 10px 14px; border-radius: 8px; font-weight: 800; z-index: 100; }
.skip:focus { top: 8px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
.display { font-family: var(--display); font-weight: 400; letter-spacing: .5px; text-transform: uppercase; }

/* Header */
.site-header { background: var(--navy); color: var(--cream); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { flex-shrink: 0; display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; }
.brand img { width: 44px; height: 44px; }
.brand span { font-family: var(--display); font-size: 22px; letter-spacing: .5px; white-space: nowrap; }
.brand:hover { color: var(--gold); }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; background: transparent; color: var(--cream); border: 1px solid #3A4B63; border-radius: 10px; font: 700 14px var(--body); cursor: pointer; }
.site-nav { display: none; }
.site-nav.open { display: block; position: absolute; left: 0; right: 0; top: 64px; background: var(--navy); border-top: 1px solid #23344C; padding: 8px 16px 16px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.site-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--cream); text-decoration: none; font-weight: 600; border-radius: 8px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--navy-2); color: var(--gold); }
.soon { font-size: 11px; font-weight: 700; color: var(--teal); margin-left: 6px; }
@media (min-width: 1180px) {
  .site-nav a { white-space: nowrap; padding: 0 7px; font-size: 15px; }
  .soon { margin-left: 4px; font-size: 10px; }
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; padding: 0; border: 0; }
  .site-nav ul { flex-direction: row; gap: 4px; }
}

/* Hero */
.hero { position: relative; background: var(--navy); color: var(--cream); overflow: hidden; }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }
.hero .wrap { position: relative; padding-top: 40px; padding-bottom: 40px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 60px); letter-spacing: .5px; margin: 0 0 10px; }
.hero p { font-size: 18px; max-width: 640px; margin: 0 0 18px; color: #DDE3EA; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: 800 15px var(--body); text-decoration: none; cursor: pointer; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #FFBE1F; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--cream); border-color: #5A6B82; }
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); }
.btn-dark { background: var(--navy); color: var(--cream); }
.btn-dark:hover { background: var(--navy-2); color: var(--gold); }
.btn-line { background: #fff; color: var(--ink); border-color: var(--line-2); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Layout */
main { display: block; }
.section { padding: 32px 0; }
.grid-2 { display: grid; gap: 24px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.pad { padding: 16px; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Feed */
.feed { display: flex; flex-direction: column; gap: 18px; }
.post { overflow: hidden; }
.post img { width: 100%; background: var(--line); }
.post .body { padding: 14px 16px 16px; }
.post .meta { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--gold-dk); text-transform: uppercase; margin-bottom: 6px; }
.post h2 { font-size: 20px; margin-bottom: 6px; }
.post p { margin: 0 0 10px; white-space: pre-line; }
.post .src { font-weight: 700; }
.skeleton { height: 340px; border-radius: var(--radius); background: linear-gradient(90deg, #ECE8DD, #F6F3EC, #ECE8DD); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Sidebar */
.side { display: flex; flex-direction: column; gap: 16px; }
.side h2 { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .5px; }

/* Forms */
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], input[type=url], textarea, select {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; font: 16px var(--body); color: var(--ink); background: #fff; }
textarea { min-height: 140px; resize: vertical; }
.form { display: flex; flex-direction: column; gap: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.status { font-size: 14px; font-weight: 600; min-height: 1.2em; margin: 0; }
.status:empty { display: none; }
.status.ok { color: var(--teal-dk); }
.status.err { color: var(--red); }

/* Prose pages */
.prose { max-width: 760px; }
.prose h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 6vw, 44px); letter-spacing: .5px; }
.prose h2 { font-size: 22px; margin-top: 1.4em; }
.prose li { margin-bottom: 6px; }

/* Law guide */
.permit { background: var(--teal-dk); color: #fff; border-radius: var(--radius); padding: 18px; }
.permit h2 { font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--gold); letter-spacing: .5px; }
.permit ol { padding-left: 20px; }
details.law { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; }
details.law summary { list-style: none; cursor: pointer; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-weight: 800; color: var(--navy); }
details.law summary::-webkit-details-marker { display: none; }
details.law summary::after { content: "+"; font-size: 22px; }
details.law[open] summary::after { content: "−"; }
details.law > div { padding: 0 16px 14px; }
.sources { background: var(--navy); color: var(--cream); border-radius: 12px; padding: 16px; }
.sources a { color: var(--cream); }
.sources a:hover { color: var(--gold); }

/* Gate (entry disclosure) */
.gate[hidden] { display: none; }
.gate { position: fixed; inset: 0; z-index: 50; background: rgba(14, 26, 43, .86); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate .box { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; }
.gate header { background: var(--navy); color: var(--cream); padding: 16px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; }
.gate header img { width: 44px; height: 44px; }
.gate h2 { font-family: var(--display); font-weight: 400; font-size: 24px; margin: 0; letter-spacing: .5px; }
.gate .content { padding: 16px; font-size: 14px; }
.gate ol { padding-left: 20px; margin: 0 0 10px; }
.gate li { margin-bottom: 8px; }
.gate .actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 12px 16px 16px; position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); }
body.gated { overflow: hidden; }

/* Footer */
.site-footer { background: var(--navy); color: #C9D2DE; margin-top: 32px; padding: 28px 0; font-size: 14px; }
.site-footer a { color: var(--cream); }
.site-footer .cols { display: grid; gap: 18px; }
@media (min-width: 700px) { .site-footer .cols { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }

/* Admin */
.admin-only[hidden], [data-auth][hidden] { display: none !important; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: #E6EEF9; color: #1D3A66; }
.pill.live { background: #DDF3E6; color: var(--teal-dk); }
.preview img { border-radius: 10px; border: 1px solid var(--line); }

/* Gate shown before first paint when not yet accepted (set by gate-check.js) */
html.gated .gate[hidden] { display: flex !important; }
html.gated body { overflow: hidden; }
