/* ============================================
   Graeser Neighbors for Safety
   Static Site Styles — Light/Dark Mode
   ============================================ */

/* --- Custom Properties (Light Mode Default) --- */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f6f8;
  --bg-accent: #e8edf3;
  --bg-alert: #fff3cd;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #7a7a8e;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --border: #e2e4e8;
  --border-strong: #c5c8ce;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.15);
  --status-green: #16a34a;
  --status-red: #dc2626;
  --status-amber: #d97706;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --nav-height: 64px;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --bg-primary: #0f1118;
  --bg-secondary: #1a1d2e;
  --bg-accent: #242840;
  --bg-alert: #3d2f0a;
  --text-primary: #e8e8f0;
  --text-secondary: #b0b0c4;
  --text-muted: #7878a0;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-light: #1e3a5f;
  --border: #2a2d40;
  --border-strong: #3a3d55;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-strong: rgba(0, 0, 0, 0.5);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Prevent flex/grid children from forcing overflow */
.nav, .nav .container, .nav-links,
.container, .hero, section, article,
.collapsible, .collapsible-content,
.highlight-grid, .highlight-card,
.cta-row, .email-cta, .status-banner,
.gallery, .gallery-item, .facts-table,
.footer, .footer .container,
.doc-category, .doc-list {
  min-width: 0;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 48px 0;
}

.section + .section {
  border-top: 1px solid var(--border);
}

/* --- Navigation --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px var(--shadow);
  height: var(--nav-height);
  transition: background 0.3s ease;
  /* Needed for mobile dropdown positioning */
  overflow: visible;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  position: relative;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* --- Theme Toggle --- */
.theme-toggle {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.theme-toggle:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* --- Hero / Status Banner --- */
.hero {
  background: var(--bg-secondary);
  padding: 48px 0;
  border-bottom: 3px solid var(--accent);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.status-banner {
  background: var(--bg-alert);
  border: 1px solid var(--status-amber);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.status-banner h2 {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--status-amber);
  margin-bottom: 8px;
}

.status-banner .status-detail {
  font-size: 1.25rem;
  font-weight: 600;
}

.status-banner .status-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn-cta-email {
  font-size: 1.1rem;
  padding: 14px 28px;
}

/* --- Section Headers --- */
.section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --- Quick Facts Table --- */
.facts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
}

.facts-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.facts-table td:first-child {
  font-weight: 600;
  white-space: nowrap;
  width: 140px;
  color: var(--text-secondary);
}

/* --- Collapsible Meeting Recaps --- */
.collapsible {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.collapsible:hover {
  box-shadow: 0 2px 8px var(--shadow);
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  cursor: pointer;
  user-select: none;
  border: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text-primary);
  transition: background 0.2s ease;
}

.collapsible-header:hover {
  background: var(--bg-accent);
}

.collapsible-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.collapsible-chevron {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.collapsible.open .collapsible-chevron {
  transform: rotate(180deg);
}

.collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.collapsible.open .collapsible-body {
  max-height: 5000px;
}

.collapsible-content {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.collapsible-content p {
  margin-bottom: 12px;
}

.collapsible-content p:last-child {
  margin-bottom: 0;
}

.meeting-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}

.label-summary {
  background: var(--accent-light);
  color: var(--accent);
}

.label-take {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .label-take {
  background: #3d2f0a;
  color: #fbbf24;
}

/* --- Approval Process (Flowchart) --- */
.process-steps {
  list-style: none;
  counter-reset: step;
  position: relative;
  padding-left: 40px;
}

.process-steps::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-strong);
}

.process-steps li {
  position: relative;
  margin-bottom: 20px;
  counter-increment: step;
}

.process-steps li::before {
  content: counter(step);
  position: absolute;
  left: -40px;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-accent);
  border: 2px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  z-index: 1;
}

.process-steps li.step-active::before {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* --- Renderings Gallery --- */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 16px;
}

.gallery-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-secondary);
}

.gallery-item img {
  width: 100%;
}

.gallery-item figcaption {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Why It Matters (Highlight Boxes) --- */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.highlight-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  border-left: 4px solid var(--accent);
}

.highlight-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.highlight-card-red {
  border-left: 4px solid var(--status-red);
  background: var(--bg-alert);
}

.highlight-card-red h4 {
  font-size: 1.25rem;
  color: var(--status-red);
}

.highlight-card-amber {
  border-left: 4px solid var(--status-amber);
  background: #fef9f0;
}

[data-theme="dark"] .highlight-card-amber {
  background: #2a2418;
}

.highlight-card-amber h4 {
  font-size: 1.15rem;
  color: var(--status-amber);
}

.highlight-card-green {
  border-left: 4px solid var(--status-green);
  background: var(--bg-secondary);
}

.highlight-card-green h4 {
  font-size: 1.15rem;
  color: var(--status-green);
}

.highlight-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Email CTA Section --- */
.email-cta {
  background: var(--bg-accent);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin: 24px 0;
}

.email-cta p {
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.email-cta .email-link {
  font-size: 1.1rem;
  font-weight: 700;
}

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 48px;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
}

.social-links a:hover {
  color: var(--accent);
}

/* --- Documents List --- */
.doc-list {
  list-style: none;
}

.doc-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.doc-list li:last-child {
  border-bottom: none;
}

.doc-category {
  margin-bottom: 24px;
}

.doc-category h3 {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 12px;
}

/* --- Tablet: hamburger menu kicks in earlier --- */
@media (max-width: 1024px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
    box-shadow: 0 4px 12px var(--shadow-strong);
    z-index: 99;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }
}

/* --- Mobile --- */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
  }

  /* Container breathing room */
  .container {
    padding: 0 16px;
  }

  .nav-brand {
    font-size: 0.95rem;
  }

  /* Hero */
  .hero {
    padding: 32px 0;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  .hero .tagline {
    font-size: 0.95rem;
  }

  /* Status banner */
  .status-banner {
    padding: 16px;
    border-radius: var(--radius);
  }

  .status-banner h2 {
    font-size: 0.9rem;
  }

  .status-banner .status-detail {
    font-size: 0.95rem;
  }

  .status-banner .status-date {
    font-size: 0.8rem;
  }

  /* Email CTA button — full width on mobile */
  .email-cta {
    padding: 16px;
  }

  .email-cta .btn,
  .email-cta a[class*="btn"] {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.9rem !important;
    padding: 12px 12px !important;
    box-sizing: border-box;
    white-space: normal;
    word-break: break-word;
  }

  /* CTA row buttons stack */
  .cta-row {
    flex-direction: column;
  }

  .cta-row .btn {
    text-align: center;
  }

  /* Sections */
  .section {
    padding: 24px 0;
  }

  .section h2 {
    font-size: 1.25rem;
  }

  /* Facts table — stack on mobile */
  .facts-table td {
    display: block;
    padding: 6px 0;
    border-bottom: none;
  }

  .facts-table td:first-child {
    width: auto;
    padding-top: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .facts-table tr {
    border-bottom: 1px solid var(--border);
  }

  .facts-table tr:last-child {
    border-bottom: none;
  }

  /* Highlight cards stack */
  .highlight-grid {
    grid-template-columns: 1fr;
  }

  /* Gallery single column */
  .gallery {
    grid-template-columns: 1fr;
  }

  /* Collapsibles tighter on mobile */
  .collapsible-header {
    padding: 12px 16px;
  }

  .collapsible-content {
    padding: 16px;
  }

  .collapsible-header h3 {
    font-size: 0.9rem;
  }

  /* Process steps */
  .process-steps {
    padding-left: 36px;
  }

  .process-steps li {
    font-size: 0.9rem;
  }

  /* Footer */
  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  /* Doc list items wrap nicely */
  .doc-list li {
    word-break: break-word;
  }

  .doc-category h3 {
    font-size: 1rem;
  }

  /* About page bios stack nicely */
  .highlight-card figure img {
    max-width: 80px !important;
  }
}

/* --- Very small screens (iPhone SE etc) --- */
@media (max-width: 380px) {
  .hero h1 {
    font-size: 1.2rem;
  }

  .status-banner .status-detail {
    font-size: 0.95rem;
  }

  .nav-brand {
    font-size: 0.85rem;
  }

  .collapsible-header h3 {
    font-size: 0.85rem;
  }
}

@media (min-width: 769px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Global overflow protection --- */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

img {
  max-width: 100%;
  height: auto;
}

.collapsible-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* Word wrap for long URLs in links */
a {
  word-break: break-word;
}

/* Prevent any element from blowing out viewport */
.container, .status-banner, .email-cta, .collapsible, .highlight-card, .gallery-item, .facts-table {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Table must not exceed container */
table {
  table-layout: fixed;
  width: 100%;
}

/* --- Utility --- */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
