/* OpenBarrow Public Site — vanilla CSS, BEM naming */

:root {
  --color-primary: #2E5090;
  --color-primary-dark: #1E3A6E;
  --color-attention: #F57C00;
  --color-attention-bg: #FFF3E0;
  --color-attention-text: #E65100;
  --color-border: #E0E0E0;
  --color-bg: #F5F5F5;
  --color-surface: #FFFFFF;
  --color-text: #333;
  --color-text-secondary: #555;
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Base */
body {
  font-family: var(--font-stack);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
}

/* Navigation */
.pub-nav {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.pub-nav__inner {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 56px;
  max-width: 960px;
  margin: 0 auto;
  gap: 1.5rem;
}

.pub-nav__site {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.pub-nav__links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.pub-nav__links a {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 0.5rem 0;
}

.pub-nav__links a:hover {
  color: var(--color-primary);
}

.pub-nav__link--active {
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-primary) !important;
  font-weight: 600;
}

.pub-nav__toggle-input {
  display: none;
}

.pub-nav__toggle-label {
  display: none;
  cursor: pointer;
  font-size: 1.25rem;
  padding: 0.5rem;
  margin-left: auto;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* Main content area */
.pub-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Footer */
.pub-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.pub-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

/* Meeting list table */
.pub-meeting-table {
  width: 100%;
  border-collapse: collapse;
}

.pub-meeting-table th {
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid var(--color-border);
  padding: 0.75rem 0.5rem;
  text-align: left;
}

.pub-meeting-table td {
  font-size: 0.875rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.pub-meeting-table tr:hover {
  background: #F9F9F9;
}

.pub-meeting-table a {
  color: var(--color-primary);
  text-decoration: none;
}

.pub-meeting-table a:hover {
  text-decoration: underline;
}

/* Filter chips */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chip {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  background: #E0E0E0;
  color: #555;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.chip--active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.chip:hover:not(.chip--active) {
  background: #D0D0D0;
}

/* Meeting detail header */
.meeting-header {
  margin-bottom: 2rem;
}

.meeting-header__title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.meeting-header__stats {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 0.5rem;
}

.meeting-header__pdfs {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.meeting-header__pdfs a {
  color: var(--color-primary);
}

.meeting-header__disclosure {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Agenda item rows */
.pub-item-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.pub-item-row--attention {
  border-left: 3px solid var(--color-attention);
  padding-left: 1rem;
}

.pub-item-row__header {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}

.pub-item-row__number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  min-width: 3rem;
  flex-shrink: 0;
}

.pub-item-row__summary {
  font-size: 1rem;
  line-height: 1.5;
}

.pub-item-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.pub-item-row__meta a {
  color: var(--color-primary);
  text-decoration: none;
}

.pub-item-row__attention-note {
  font-size: 0.875rem;
  color: var(--color-attention-text);
  font-weight: 600;
  margin: 0.25rem 0 0;
}

/* Category badge */
.category-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
}

/* Attention indicator dot (meeting list) */
.attention-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-attention);
}

/* Type badge */
.type-badge {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* Empty state */
.pub-empty {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 3rem 1rem;
  font-size: 0.875rem;
}

/* Page heading */
.pub-page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1.5rem;
}

/* Back link */
.pub-back {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: 1.5rem;
}

.pub-back:hover {
  text-decoration: underline;
}

/* Chip groups label */
.filter-chips__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

/* Hero section */
.hero {
  background: var(--color-surface);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.hero__title {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.hero__meta {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0 0 1rem;
}

.hero__item {
  padding: 0.25rem 0;
}

.hero__item-number {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 0.5rem;
}

.hero__link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
}

/* Category groups (homepage) */
.category-group {
  margin-bottom: 2rem;
}

.category-group__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.category-group__count {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.category-group__item {
  padding: 0.25rem 0;
  font-size: 1rem;
}

.category-group__item-number {
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-right: 0.5rem;
  font-size: 0.875rem;
}

.category-group__date {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-left: 0.5rem;
}

/* Category grid (category index) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.category-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--color-text);
  display: block;
}

.category-card:hover {
  border-color: var(--color-primary);
}

.category-card__name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.category-card__count {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

/* FOIA tracker table */
.pub-foia-table {
  width: 100%;
  border-collapse: collapse;
}

.pub-foia-table th {
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid var(--color-border);
  padding: 0.75rem 0.5rem;
  text-align: left;
}

.pub-foia-table td {
  font-size: 0.875rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

/* FOIA status badges */
.foia-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.foia-badge--submitted { background: #E3F2FD; color: #1565C0; }
.foia-badge--acknowledged { background: #FFF3E0; color: #E65100; }
.foia-badge--fulfilled { background: #E8F5E9; color: #2E7D32; }
.foia-badge--denied { background: #FFEBEE; color: #C62828; }
.foia-badge--overdue { background: #FFEBEE; color: #C62828; }
.foia-badge--draft { background: #E0E0E0; color: #555; }

/* About page */
.about-content {
  max-width: 640px;
  margin: 0 auto;
}

.about-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.about-content a {
  color: var(--color-primary);
}

/* ======= Responsive: max-width 640px ======= */
@media (max-width: 640px) {
  .pub-nav__toggle-label {
    display: flex;
  }

  .pub-nav__links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    z-index: 100;
    gap: 0;
    margin-left: 0;
  }

  .pub-nav__links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .pub-nav__links a:last-child {
    border-bottom: none;
  }

  #nav-toggle:checked ~ .pub-nav__links {
    display: flex;
  }

  /* Mobile table: collapse to card stack */
  .pub-meeting-table thead {
    display: none;
  }

  .pub-meeting-table tr {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .pub-meeting-table td {
    display: block;
    padding: 0.25rem 0;
    border: none;
  }

  .pub-meeting-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8125rem;
    color: #555;
    display: block;
  }

  .pub-main {
    padding: 1rem 0.75rem;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }

  .chip {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  /* FOIA table: card stack at mobile */
  .pub-foia-table thead {
    display: none;
  }

  .pub-foia-table tr {
    display: block;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .pub-foia-table td {
    display: block;
    padding: 0.25rem 0;
    border: none;
  }

  .pub-foia-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.8125rem;
    color: #555;
    display: block;
  }
}
