/* ============================================
   Dayton Informs — Design System
   A civic information platform for Dayton, Ohio
   ============================================ */

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: #1a1a1a;
  background-color: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.25;
  color: #1a1a1a;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h3 {
  font-size: 1.17rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #8b0000;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: #5c0000;
}

a:focus-visible {
  outline: 3px solid #8b0000;
  outline-offset: 2px;
}

/* --- Layout --- */
.site-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

.page-header {
  padding: 1.25rem 0;
  border-bottom: 2px solid #1a1a1a;
  margin-bottom: 2rem;
}

.page-content {
  padding: 1rem 0 3rem;
}

/* --- Site Header & Nav --- */
.site-name {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.site-name:hover {
  color: #1a1a1a;
}

.site-tagline {
  font-size: 0.833rem;
  color: #555;
  font-style: italic;
  margin-bottom: 0.75rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.main-nav a {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.889rem;
  color: #1a1a1a;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.main-nav a:hover,
.main-nav a:focus {
  background-color: #f0f0f0;
  color: #8b0000;
}

.main-nav a.active {
  background-color: #8b0000;
  color: #ffffff;
}

/* --- Buttons --- */
.btn {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  transition: background-color 0.15s, color 0.15s;
}

.btn-primary {
  background-color: #8b0000;
  color: #ffffff;
  border-color: #8b0000;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #5c0000;
  border-color: #5c0000;
  color: #ffffff;
}

.btn-secondary {
  background-color: #ffffff;
  color: #8b0000;
  border-color: #8b0000;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: #8b0000;
  color: #ffffff;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.889rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #1a1a1a;
}

.form-group .hint {
  display: block;
  font-size: 0.778rem;
  color: #555;
  margin-bottom: 0.35rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #ffffff;
  color: #1a1a1a;
  min-height: 44px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: #8b0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #8b0000;
}

.form-checkbox label {
  font-weight: 400;
  margin-bottom: 0;
}

/* --- Cards --- */
.card {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background-color: #ffffff;
}

.card:hover {
  border-color: #bbb;
}

.card h3 a {
  color: #1a1a1a;
  text-decoration: none;
}

.card h3 a:hover {
  color: #8b0000;
}

.card .meta {
  font-size: 0.778rem;
  color: #555;
  margin-bottom: 0.5rem;
}

/* --- Obituary-specific (extends card) --- */
.obituary-card {
  border-left: 3px solid #8b0000;
}

.obituary-card .dates {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.833rem;
  color: #555;
}

.obituary-detail .photo {
  max-width: 200px;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.obituary-detail .survivors {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.obituary-detail .military-service {
  margin-top: 1rem;
  padding: 0.75rem;
  background-color: #f8f8f8;
  border-radius: 4px;
  font-size: 0.889rem;
}

/* --- Meeting Calendar --- */
.meeting-item {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}

.meeting-item:last-child {
  border-bottom: none;
}

.meeting-body-name {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 600;
  color: #1a1a1a;
}

.meeting-type {
  font-size: 0.778rem;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meeting-datetime {
  font-weight: 600;
  color: #8b0000;
}

.meeting-location {
  font-size: 0.889rem;
  color: #555;
}

.meeting-links a {
  font-size: 0.833rem;
  margin-right: 1rem;
}

/* --- Enhanced Meeting Calendar --- */
.this-week-section {
  background-color: #fdf8f8;
  border: 1px solid #e8d0d0;
  border-radius: 4px;
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.this-week-section h2 {
  color: #8b0000;
  font-size: 1.17rem;
  margin-bottom: 0.75rem;
}

.meeting-category {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.667rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #555;
  background-color: #f0f0f0;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 0.25rem;
}

.meeting-address {
  font-size: 0.833rem;
  color: #777;
}

.meeting-address a {
  color: #777;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.meeting-address a:hover {
  color: #8b0000;
}

.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-small {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.778rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border: 1.5px solid #8b0000;
  border-radius: 4px;
  background: none;
  color: #8b0000;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 36px;
  transition: background-color 0.15s, color 0.15s;
}

.btn-small:hover,
.btn-small:focus {
  background-color: #8b0000;
  color: #ffffff;
}

.meeting-item--past {
  opacity: 0.85;
}

.meeting-item--past .meeting-datetime {
  color: #555;
}

.meeting-resources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.meeting-resources a {
  font-size: 0.833rem;
  color: #8b0000;
  font-weight: 600;
}

.filters input[type="date"] {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.889rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #ffffff;
  min-height: 44px;
}

.filters input[type="date"]:focus {
  outline: none;
  border-color: #8b0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}

.show-more-btn {
  width: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.889rem;
  font-weight: 600;
  padding: 0.75rem;
  border: 2px solid #8b0000;
  border-radius: 4px;
  background-color: #fdf8f8;
  color: #8b0000;
  cursor: pointer;
  margin-top: 1rem;
  min-height: 44px;
  transition: background-color 0.15s, color 0.15s;
}

.show-more-btn:hover,
.show-more-btn:focus {
  background-color: #8b0000;
  color: #ffffff;
}

.results-count {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.778rem;
  color: #555;
  margin-bottom: 0.75rem;
}

/* --- Filters & Search --- */
.search-bar {
  margin-bottom: 1.5rem;
}

.search-bar input {
  width: 100%;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 2px solid #ccc;
  border-radius: 4px;
  min-height: 44px;
}

.search-bar input:focus {
  outline: none;
  border-color: #8b0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.filters select {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.889rem;
  padding: 0.5rem 0.75rem;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #ffffff;
  min-height: 44px;
}

.filters select:focus {
  outline: none;
  border-color: #8b0000;
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.15);
}

/* --- Tab Navigation --- */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #ddd;
  margin-bottom: 1.5rem;
}

.tab-nav button {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.889rem;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  border: none;
  background: none;
  color: #555;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  min-height: 44px;
}

.tab-nav button:hover {
  color: #1a1a1a;
}

.tab-nav button.active {
  color: #8b0000;
  border-bottom-color: #8b0000;
}

/* --- Notices & Labels --- */
.notice {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.889rem;
}

.notice-info {
  background-color: #f0f4f8;
  border: 1px solid #c8d6e5;
}

.notice-success {
  background-color: #f0f8f0;
  border: 1px solid #c8e5c8;
}

.notice-ai {
  background-color: #f8f4f0;
  border: 1px solid #e5d6c8;
}

.ai-label {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.722rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b6914;
  background-color: #fdf6e3;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  display: inline-block;
}

/* --- Footer --- */
.site-footer {
  border-top: 2px solid #1a1a1a;
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.778rem;
  color: #555;
}

.site-footer p {
  margin-bottom: 0.35rem;
}

.site-footer a {
  color: #555;
}

.site-footer a:hover {
  color: #8b0000;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #555;
}

.empty-state p {
  font-size: 1.1rem;
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Print Styles --- */
@media print {
  .main-nav,
  .search-bar,
  .filters,
  .tab-nav,
  .btn,
  .btn-small,
  .meeting-actions,
  .this-week-section,
  .show-more-btn,
  .site-footer {
    display: none;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .site-container {
    max-width: 100%;
    padding: 0;
  }

  .obituary-detail .photo {
    max-width: 150px;
  }
}

/* --- Responsive --- */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .main-nav {
    gap: 0.15rem;
  }

  .main-nav a {
    font-size: 0.833rem;
    padding: 0.5rem 0.5rem;
  }

  .filters {
    flex-direction: column;
  }

  .filters select,
  .filters input[type="date"] {
    width: 100%;
  }

  .meeting-actions {
    flex-direction: column;
  }

  .meeting-actions .btn-small {
    justify-content: center;
  }
}
