/* =========================================================================
   Conway Tenants Union — styles
   Palette: solidarity red + warm cream + near-black ink
   ========================================================================= */

:root {
  --red: #8a1c1c;
  --red-dark: #6d1414;
  --red-bright: #b02525;
  --cream: #f5efe4;
  --cream-2: #efe7d7;
  --ink: #1c1a17;
  --ink-soft: #423d36;
  --muted: #6b6459;
  --line: #ddd3c1;
  --white: #ffffff;
  --gold: #c99a2e;
  --focus: #1a5fb4;

  --wrap: 1080px;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(28, 26, 23, 0.08);
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-serif); line-height: 1.15; color: var(--ink); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 0 0 0.5em; }
h3 { font-size: 1.15rem; margin: 0 0 0.4em; }

a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--red-bright); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

/* Accessibility */
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--cream);
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ============================ Header ============================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 239, 228, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--red); color: var(--cream);
  font-family: var(--font-serif); font-weight: 700; letter-spacing: 0.5px; font-size: 0.95rem;
  flex-shrink: 0;
}
.brand-mark.small { width: 34px; height: 34px; font-size: 0.8rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-serif); font-size: 1.05rem; }
.brand-text small { color: var(--muted); font-size: 0.75rem; }

.site-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.site-nav a { color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover { color: var(--red); }
.nav-toggle {
  display: none; background: var(--red); color: var(--cream); border: 0;
  padding: 8px 14px; border-radius: 8px; font-weight: 600; cursor: pointer;
}

/* ============================ Hero ============================ */
.hero {
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(176,37,37,0.10), transparent 60%),
    linear-gradient(180deg, var(--cream), var(--cream-2));
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 8vw, 6rem) 0;
}
.hero-inner { max-width: 780px; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; font-weight: 700;
  color: var(--red); margin: 0 0 0.8rem;
}
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); margin: 0 0 0.6rem; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 1.8rem 0 1rem; }
.hero-note { color: var(--muted); font-size: 0.92rem; max-width: 52ch; }

/* ============================ Buttons ============================ */
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 2px solid transparent; font-size: 1rem;
  transition: transform 0.06s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: var(--cream); }
.btn-primary:hover { background: var(--red-dark); color: var(--white); }
.btn-ghost { background: transparent; color: var(--red); border-color: var(--red); }
.btn-ghost:hover { background: var(--red); color: var(--cream); }
.btn-block { width: 100%; margin-top: 8px; }

/* ============================ Sections ============================ */
.section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-alt { background: var(--cream-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-intro { font-size: 1.1rem; color: var(--ink-soft); max-width: 62ch; margin: 0 0 2rem; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.cols p:first-child { margin-top: 0; }

/* Checklists */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { position: relative; padding: 6px 0 6px 32px; }
.checklist li::before {
  content: "✓"; position: absolute; left: 0; top: 6px;
  color: var(--cream); background: var(--red); width: 20px; height: 20px;
  border-radius: 50%; display: grid; place-items: center; font-size: 0.72rem; font-weight: 700;
}

/* Tiers */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tier-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow);
}
.tier-num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--red); color: var(--cream); font-family: var(--font-serif); font-weight: 700;
  margin-bottom: 12px;
}

/* Entity cards */
.entity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 1.5rem; }
.entity-card {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: 10px; padding: 22px;
}
.entity-card h3 { color: var(--red-dark); }
.entity-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* By-the-numbers band */
.stats-band { background: var(--red-dark); color: var(--cream); }
.stats-band h2 { color: var(--cream); }
.stats-intro { color: #f0dede; }
.stat-grid {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.stat { text-align: center; padding: 12px; }
.stat-num {
  display: block; font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 3.6rem); line-height: 1; color: var(--cream);
}
.stat-label { display: block; margin-top: 8px; font-size: 0.92rem; color: #f0dede; }
.stats-oneline {
  margin: 2.5rem 0 0; font-size: 1.15rem; text-align: center;
  border-top: 1px solid rgba(245,239,228,0.25); padding-top: 1.8rem;
}
.stats-oneline strong { color: var(--white); }
.stats-caption { margin-top: 1.2rem; font-size: 0.8rem; color: #d9b8b8; text-align: center; }
.stats-caption a { color: var(--cream); }

/* Buildings list */
.buildings-title { margin-top: 2.5rem; }
.building-list {
  list-style: none; padding: 0; margin: 0 0 1rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.building-list li {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 2px;
  border-left: 4px solid var(--gold);
}
.b-addr { font-family: var(--font-serif); font-weight: 700; font-size: 1.05rem; }
.b-boro { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; }

/* Warning section */
.section-warn { background: linear-gradient(180deg, #fbf4ea, #f7ecdb); border-top: 3px solid var(--gold); }
.section-warn h2 { color: var(--red-dark); }

/* Rights */
.rights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 2.5rem; }
.right-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.right-card h3 { color: var(--red-dark); }
.resources-title { margin-top: 1rem; }

/* Link lists */
.link-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.link-list li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-list.two-col { columns: 2; column-gap: 40px; }
.link-list.two-col li { break-inside: avoid; }

.fine-print { color: var(--muted); font-size: 0.85rem; margin-top: 1.5rem; }

/* ============================ Connect / form ============================ */
.section-connect { background: var(--ink); color: var(--cream); }
.section-connect h2 { color: var(--cream); }
.section-connect .section-intro { color: #d8cfbe; }
.section-connect .section-intro strong { color: var(--white); }

.connect-form {
  background: var(--cream); color: var(--ink);
  padding: 30px; border-radius: 16px; box-shadow: var(--shadow); margin-top: 1.5rem;
}
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.req { color: var(--red-bright); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; background: var(--white); color: var(--ink);
}
.field textarea { resize: vertical; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-field input { width: auto; margin-top: 5px; flex-shrink: 0; }
.checkbox-field label { font-weight: 400; font-size: 0.88rem; margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 12px 0 0; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--red-dark); }
.form-status.err { color: var(--red-bright); }

.alt-contact { text-align: center; margin-top: 1.5rem; color: #d8cfbe; }
.alt-contact a { color: var(--gold); }
.alt-contact small { color: #a99f8d; }

/* ============================ Footer ============================ */
.site-footer { background: var(--red-dark); color: var(--cream); padding: 2.5rem 0; }
.footer-inner { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; align-items: start; }
.footer-inner .brand-mark { background: var(--cream); color: var(--red-dark); margin-bottom: 10px; }
.footer-inner p { margin: 0; }
.footer-fine { color: #e9c9c9; font-size: 0.82rem; line-height: 1.55; }

/* ============================ Responsive ============================ */
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .site-nav ul {
    display: none; position: absolute; top: 68px; right: 0; left: 0;
    flex-direction: column; gap: 0; background: var(--cream);
    border-bottom: 1px solid var(--line); padding: 8px 24px 16px;
  }
  .site-nav ul.open { display: flex; }
  .site-nav li { padding: 10px 0; border-bottom: 1px solid var(--line); }

  .cols, .tiers, .entity-grid, .rights-grid, .field-row, .footer-inner { grid-template-columns: 1fr; }
  .building-list { grid-template-columns: 1fr 1fr; }
  .link-list.two-col { columns: 1; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 18px; }
}

/* =========================================================================
   Building record pages (/buildings/<slug>/)
   ========================================================================= */
.doc-page { padding: 2.5rem 0 4rem; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); text-decoration: underline; }

.doc-page h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 0.2rem; }
.doc-borough { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin: 0 0 1.2rem; }
.doc-summary { font-size: 1.15rem; color: var(--ink-soft); }
.doc-updated { color: var(--muted); font-size: 0.85rem; margin-top: 0.4rem; }

.draft-banner {
  background: #fff4d6; border: 1px solid var(--gold); border-left: 4px solid var(--gold);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 1.5rem; font-size: 0.92rem;
}
.draft-banner code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; }

.doc-disclaimer {
  background: var(--cream-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 18px; margin: 1.5rem 0 2.5rem; font-size: 0.9rem; color: var(--ink-soft);
}
.doc-notice {
  background: #fff4d6; border: 1px solid var(--gold); border-left: 4px solid var(--gold);
  border-radius: 8px; padding: 14px 18px; margin: 1.5rem 0 0; font-size: 0.92rem; color: var(--ink-soft);
}

.doc-section { margin: 2.5rem 0; }
.doc-section h2 {
  font-size: 1.5rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--red);
  margin-bottom: 1rem;
}
.doc-section-intro { color: var(--muted); font-size: 0.95rem; margin-top: 0; }

.doc-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.doc-table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 0.95rem; }
.doc-table th, .doc-table td { text-align: left; padding: 12px 14px; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc-table thead th { background: var(--cream-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); }
.doc-table tbody th { font-weight: 700; width: 22%; color: var(--ink); }
.doc-table tr:last-child th, .doc-table tr:last-child td { border-bottom: 0; }
.doc-table .col-asof { white-space: nowrap; color: var(--muted); width: 12%; }
.doc-table .col-source { width: 26%; font-size: 0.88rem; }
.fact-note { color: var(--muted); font-size: 0.85rem; }

.means-item { margin: 1.2rem 0; }
.means-item h3 { color: var(--red-dark); margin-bottom: 0.2rem; }
.means-item p { margin-top: 0; }

.doc-list { margin: 0; padding-left: 1.2rem; }
.doc-list li { padding: 4px 0; }
.source-list { list-style: none; padding: 0; }
.source-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 0.92rem; }
.source-list li:last-child { border-bottom: 0; }

.doc-cta {
  margin-top: 3rem; padding: 2rem; background: var(--ink); color: var(--cream);
  border-radius: 16px; text-align: center;
}
.doc-cta p { font-size: 1.1rem; margin: 0 0 1.2rem; }
.doc-cta .btn { margin: 0 6px 6px; }
.doc-cta .btn-ghost { color: var(--cream); border-color: var(--cream); }
.doc-cta .btn-ghost:hover { background: var(--cream); color: var(--ink); }

/* Clickable building cards on the homepage (used once pages are linked) */
.building-list li a { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 2px; }
.building-list li:has(a) { padding: 0; }
.building-list li:has(a) a { padding: 16px 18px; }
.building-list li:has(a):hover { box-shadow: var(--shadow); transform: translateY(-1px); transition: box-shadow 0.15s, transform 0.15s; }
.b-more { color: var(--red); font-weight: 600; font-size: 0.82rem; margin-top: 4px; }

@media (max-width: 640px) {
  .doc-table tbody th { width: auto; }
  .doc-table .col-asof, .doc-table .col-source { width: auto; }
}
