/* =====================================================
   Scroll of Honor — Public Stylesheet
   Theme: Patriotic Red, White & Blue
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Sans+3:wght@400;600&family=Libre+Baskerville:ital,wght@0,700;1,400&display=swap');

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

:root {
  --navy:       #0a1f44;
  --navy-mid:   #162d5e;
  --navy-light: #1e3a7a;
  --red:        #b22234;
  --red-dark:   #8b0000;
  --red-light:  #cc2936;
  --white:      #ffffff;
  --off-white:  #f5f0e8;
  --gold:       #c9a84c;
  --gold-light: #e8c97a;
  --text-dark:  #0d1b2a;
  --text-mid:   #334155;
  --border:     rgba(10,31,68,0.18);
  --shadow:     0 4px 24px rgba(10,31,68,0.13);
  --shadow-lg:  0 8px 40px rgba(10,31,68,0.18);
  --radius:     6px;
  --radius-lg:  12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.65;
}

/* ── Header ───────────────────────────────────────── */
.site-header {
  background: var(--navy);
  border-bottom: 4px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logos img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.header-logo-cs {
  background: white;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.site-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--off-white);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.site-nav a.nav-submit {
  background: var(--red);
  border-color: var(--red-dark);
  color: var(--white);
}

.site-nav a.nav-submit:hover {
  background: var(--red-dark);
}

/* ── Hero Banner ─────────────────────────────────── */
.hero {
  background: var(--navy);
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      rgba(255,255,255,0.025) 11px,
      rgba(255,255,255,0.025) 12px
    );
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '★';
  position: absolute;
  font-size: 28rem;
  color: rgba(255,255,255,0.02);
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  line-height: 1;
}

.hero-event-logo {
  max-width: 420px;
  width: 90%;
  margin: 0 auto 1.5rem;
  display: block;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.hero-title span {
  color: var(--gold-light);
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.72);
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

.hero-stripe {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 1.5rem;
}

.hero-stripe span {
  height: 6px;
  width: 80px;
}

.hero-stripe .s1 { background: var(--red); }
.hero-stripe .s2 { background: var(--white); }
.hero-stripe .s3 { background: var(--navy-light); }

/* ── Stats Bar ────────────────────────────────────── */
.stats-bar {
  background: var(--red);
  color: white;
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}

.stat-item {
  padding: 0.75rem 2rem;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.25);
  min-width: 140px;
}

.stat-item:last-child { border-right: none; }

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ── Main Layout ─────────────────────────────────── */
.main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Search & Filter Panel ───────────────────────── */
.filter-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.filter-panel h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.filter-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.35rem;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--off-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(30,58,122,0.12);
  background: var(--white);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  letter-spacing: 0.03em;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

.btn-primary:hover { background: var(--navy-light); box-shadow: var(--shadow); }

.btn-red {
  background: var(--red);
  color: var(--white);
}

.btn-red:hover { background: var(--red-dark); box-shadow: var(--shadow); }

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

.btn-outline:hover { background: var(--off-white); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }

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

/* ── Sort Controls ───────────────────────────────── */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sort-bar span {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mid);
  margin-right: 0.25rem;
}

.sort-btn {
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.15s;
}

.sort-btn:hover,
.sort-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ── Results Info ────────────────────────────────── */
.results-info {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.results-count { font-weight: 600; color: var(--navy); }

/* ── Honoree Grid ────────────────────────────────── */
.honoree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ── Honoree Card ────────────────────────────────── */
.honoree-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.honoree-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-top-stripe {
  height: 5px;
}

.stripe-kia   { background: linear-gradient(90deg, var(--red), var(--red-dark)); }
.stripe-mia   { background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.stripe-pow   { background: linear-gradient(90deg, #555, #333); }
.stripe-natural { background: linear-gradient(90deg, var(--navy-light), var(--navy)); }
.stripe-other { background: linear-gradient(90deg, #888, #555); }

.card-photo-wrap {
  padding: 1rem 1rem 0;
  display: flex;
  justify-content: center;
}

.card-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--off-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.card-photo-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: rgba(255,255,255,0.5);
  border: 3px solid var(--off-white);
}

.card-body {
  padding: 0.75rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  margin-bottom: 0.15rem;
}

.card-rank {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 0.75rem;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-branch {
  background: var(--navy);
  color: var(--off-white);
}

.badge-kia   { background: var(--red); color: var(--white); }
.badge-mia   { background: var(--gold); color: var(--text-dark); }
.badge-pow   { background: #333; color: #fff; }
.badge-natural { background: var(--navy-light); color: var(--off-white); }
.badge-service { background: #2a7a3b; color: #fff; }
.badge-other { background: #666; color: #fff; }

.card-era {
  font-size: 0.8rem;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 0.5rem;
}

.card-dates {
  font-size: 0.78rem;
  color: var(--text-mid);
  text-align: center;
  margin-bottom: 0.75rem;
}

.card-bio {
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Salute indicator for natural/honorable passing */
.card-salute {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-mid);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-family: 'Playfair Display', serif;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

/* ── Submit CTA Section ──────────────────────────── */
.submit-cta {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 3rem;
  border-radius: var(--radius-lg);
}

.submit-cta h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
}

.submit-cta p {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  opacity: 0.85;
}

/* ── Pagination ──────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-link {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--navy);
  text-decoration: none;
  background: var(--white);
  transition: all 0.15s;
}

.page-link:hover,
.page-link.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  border-top: 4px solid var(--red);
  color: rgba(255,255,255,0.65);
  padding: 2rem 1.5rem;
  text-align: center;
  margin-top: 3rem;
}

.footer-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.footer-logos img {
  height: 44px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

.footer-logo-cs { background: white; padding: 4px 8px; border-radius: 4px; }

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--gold-light); }

.footer-copy {
  font-size: 0.78rem;
  opacity: 0.5;
}

/* ── Loading Spinner ─────────────────────────────── */
.spinner {
  text-align: center;
  padding: 3rem;
  color: var(--text-mid);
}

/* ── Alerts ──────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert-success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #1b5e20;
}

.alert-error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #7f1d1d;
}

.alert-info {
  background: #e3f2fd;
  border: 1px solid #90caf9;
  color: #0d47a1;
}

/* ── Forms (submit page) ─────────────────────────── */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.form-section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--off-white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.form-group label .req {
  color: var(--red);
  margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--off-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(30,58,122,0.1);
  background: var(--white);
}

.form-group input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--navy);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-row label {
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
}

.field-hint {
  font-size: 0.76rem;
  color: var(--text-mid);
  opacity: 0.75;
}

.form-footer {
  text-align: center;
  margin-top: 1rem;
}

.photo-preview {
  max-width: 180px;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  margin-top: 0.5rem;
  display: none;
}

/* ── Mobile Responsive ───────────────────────────── */
@media (max-width: 768px) {
  .header-inner { padding: 0.6rem 1rem; gap: 0.75rem; }
  .header-logos img { height: 40px; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero-title { font-size: 1.8rem; }
  .honoree-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: row; }
  .stat-item { min-width: 100px; padding: 0.6rem 1rem; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-section { padding: 1.25rem; }
  .site-nav { display: none; }
  .mobile-nav-toggle { display: block; }
}

@media (max-width: 480px) {
  .filter-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.2); }
  .stat-item:last-child { border-bottom: none; }
}

/* ── Print ───────────────────────────────────────── */
@media print {
  .site-header, .filter-panel, .sort-bar, .pagination,
  .submit-cta, .site-footer { display: none; }
  .honoree-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
