/*
Theme Name: NAUHR - National Archive of Unclaimed Human Remains
Theme URI: https://nauhr.com
Author: NAUHR
Author URI: https://nauhr.com
Description: National Archive of Unclaimed Human Remains - Registry and Reunification Network
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nauhr
*/

/* ============================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
============================================================ */
:root {
  --navy: #1b3a5c;
  --navy-dark: #0f2438;
  --gold: #a8842c;
  --gold-light: #fbf7ec;
  --bg: #f2f1ec;
  --card: #ffffff;
  --border: #d7dce2;
  --text: #2b2f36;
  --text-muted: #5b6470;
  --danger: #8b2e2e;
  --success: #2e5e3e;
}

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: 'Public Sans', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lora', Georgia, serif;
  color: var(--navy-dark);
  line-height: 1.25;
  margin-top: 0;
}

a { color: var(--navy); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ============================================================
   SITE HEADER
============================================================ */
.site-header {
  background: var(--navy-dark);
  border-bottom: 4px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  min-width: 0;
}

.brand-seal {
  width: 58px;
  height: 58px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.5px;
  line-height: 1.25;
}

.brand-seal-sub { font-size: 8px; font-weight: 500; }

.brand-title {
  font-family: 'Lora', serif;
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  overflow-wrap: break-word;
  display: block;
}

.brand-sub {
  font-size: 0.7rem;
  color: #aebccb;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-top: 2px;
  display: block;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a,
.nav-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  padding: 9px 18px;
  font-family: 'Public Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 2px;
  transition: 0.15s;
  text-decoration: none;
  display: inline-block;
}

.site-nav a:hover, .nav-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--gold);
  color: #fff;
}

.nav-btn-primary {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: var(--navy-dark) !important;
  font-weight: 700 !important;
}

.nav-btn-primary:hover {
  background: #8f7022 !important;
  border-color: #8f7022 !important;
  color: #fff !important;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  border-radius: 2px;
}

/* ============================================================
   LAYOUT
============================================================ */
.site-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 12px 48px;
}

.page-header {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.page-header h1 { font-size: 1.85rem; margin: 0; }
.lede { color: var(--text-muted); margin-top: 10px; max-width: 760px; }

/* ============================================================
   CARDS
============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--border);
  padding: 30px;
  margin-bottom: 22px;
}

.card h2 {
  font-size: 1.2rem;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  padding: 11px 22px;
  border-radius: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.15s;
  display: inline-block;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); font-weight: 700; }
.btn-gold:hover { background: #8f7022; color: #fff; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.76rem; }

.form-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; }

/* ============================================================
   NOTICES
============================================================ */
.notice {
  background: var(--gold-light);
  border: 1px solid var(--gold);
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 0.9rem;
}
.notice-success { background: #eaf4ec; border-color: var(--success); }
.notice-error { background: #fbeaea; border-color: var(--danger); }
.notice-info { background: var(--gold-light); border-color: var(--gold); }

/* ============================================================
   FORMS
============================================================ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

label.required::after { content: ' *'; color: var(--danger); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
  padding: 11px 12px;
  border: 1px solid var(--border);
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  border-radius: 2px;
  background: #fff;
  color: var(--text);
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold);
  border-color: var(--navy);
}

textarea { resize: vertical; }
.field-note { font-size: 0.78rem; color: var(--text-muted); }

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  grid-column: 1 / -1;
  margin-top: 8px;
}

/* ============================================================
   HERO / SEARCH BAR
============================================================ */
.hero {
  text-align: center;
  padding: 36px 0 30px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.hero h1 { font-size: 2.05rem; margin: 6px 0 12px; }
.hero p { max-width: 680px; margin: 0 auto 26px; color: var(--text-muted); }

.search-bar {
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  border: 2px solid var(--navy);
  border-radius: 2px;
  overflow: hidden;
}

.search-bar input {
  flex: 1;
  border: none;
  padding: 14px 16px;
  font-size: 1rem;
  width: auto;
}

.search-bar input:focus { outline: none; }

.search-bar button {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 14px 30px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Public Sans', sans-serif;
  white-space: nowrap;
}

.search-bar button:hover { background: var(--navy-dark); }
.search-hint { margin-top: 10px; font-size: 0.78rem; color: var(--text-muted); }

/* ============================================================
   TABLE TOOLBAR + PAGINATION
============================================================ */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.result-count { font-family: 'IBM Plex Mono', monospace; font-size: 0.82rem; color: var(--text-muted); }

.per-page-control { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-muted); }
.per-page-control label { text-transform: none; font-weight: 500; letter-spacing: normal; font-size: 0.82rem; }
.per-page-control select { width: auto; padding: 6px 10px; }

.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  font-family: 'Public Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
  transition: 0.15s;
}

.page-btn:hover:not(:disabled) { border-color: var(--navy); background: #edf1f5; }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; cursor: default; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn-ellipsis { border: none; background: none; cursor: default; color: var(--text-muted); }

/* ============================================================
   REGISTRY TABLE
============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); background: #fff; }

.registry-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1100px;
  font-size: 0.84rem;
}

.registry-table thead th {
  background: var(--navy);
  color: #fff;
  text-align: left;
  padding: 11px 12px;
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-bottom: 3px solid var(--gold);
  white-space: nowrap;
  user-select: none;
}

.registry-table thead th.no-sort { cursor: default; }
.registry-table thead th .sort-arrow { margin-left: 5px; opacity: 0.45; font-size: 0.7rem; }
.registry-table thead th.sorted .sort-arrow { opacity: 1; color: var(--gold); }

.registry-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  white-space: nowrap;
}

.registry-table tbody tr:nth-child(even) { background: #f7f8fa; }
.registry-table tbody tr.record-row { cursor: pointer; }
.registry-table tbody tr.record-row:hover { background: #e4ecf3; }
.registry-table .contact-cell { text-align: center; }

.envelope-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--navy);
  border-radius: 2px;
  color: var(--navy);
  background: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  transition: 0.15s;
}
.envelope-btn:hover { background: var(--navy); color: #fff; }
.empty-row td { text-align: center; padding: 28px; color: var(--text-muted); font-family: 'Public Sans', sans-serif; }

/* ============================================================
   RECORD DETAIL
============================================================ */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--border);
}

.detail-field {
  padding: 14px 8px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.detail-field:nth-child(3n) { border-right: none; }
.detail-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.detail-value { font-family: 'IBM Plex Mono', monospace; font-size: 0.92rem; color: var(--text); }

/* ============================================================
   ABOUT PAGE
============================================================ */
.commitment-list { list-style: none; margin: 18px 0 0; padding: 0; }
.commitment-list li { padding: 11px 0 11px 30px; border-bottom: 1px solid var(--border); position: relative; }
.commitment-list li:last-child { border-bottom: none; }
.commitment-list li::before { content: '\2726'; position: absolute; left: 0; color: var(--gold); }

/* ============================================================
   MODAL
============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,36,56,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  max-width: 460px;
  width: 100%;
  padding: 28px;
  border-top: 4px solid var(--gold);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 { margin: 0 0 14px; font-size: 1.15rem; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
.modal-close:hover { color: var(--navy); }

/* ============================================================
   PRICING BOX
============================================================ */
.pricing-box { border: 2px solid var(--gold); background: var(--gold-light); padding: 22px; text-align: center; margin: 22px 0; }
.pricing-box .amount { font-family: 'Lora', serif; font-size: 2.3rem; color: var(--navy-dark); font-weight: 700; }
.pricing-box .period { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }

/* ============================================================
   DASHBOARD CHOICES
============================================================ */
.choice-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; max-width: 1000px; margin: 0 auto; }

.choice-card {
  border: 1px solid var(--border);
  background: #fff;
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
  text-decoration: none;
  display: block;
  color: var(--text);
}
.choice-card:hover { border-color: var(--navy); box-shadow: 0 4px 14px rgba(15,36,56,.08); color: var(--text); }
.choice-card .icon { width: 54px; height: 54px; margin: 0 auto 16px; border: 2px solid var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--gold); }
.choice-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.choice-card p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }

/* ============================================================
   MANAGE TABLE
============================================================ */
.manage-table-wrap { overflow-x: auto; border: 1px solid var(--border); background: #fff; }
.manage-table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: 0.85rem; }
.manage-table thead th { background: var(--navy); color: #fff; text-align: left; padding: 11px 12px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 3px solid var(--gold); white-space: nowrap; }
.manage-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-family: 'IBM Plex Mono', monospace; font-size: 0.8rem; }
.manage-table tbody tr:nth-child(even) { background: #f7f8fa; }
.manage-table tbody tr:hover { background: #edf1f5; }
.actions-cell { display: flex; gap: 8px; }

/* ============================================================
   STATUS PILL
============================================================ */
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 12px; background: #eaf4ec; color: var(--success); font-family: 'Public Sans', sans-serif; font-weight: 600; font-size: 0.74rem; }
.status-pill-used { background: #fbeaea; color: var(--danger); }

/* ============================================================
   FOOTER
============================================================ */
.site-footer { background: var(--navy-dark); color: #aebccb; padding: 34px 12px; margin-top: 50px; font-size: 0.85rem; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.footer-title { font-family: 'Lora', serif; color: #fff; font-size: 1rem; margin-bottom: 6px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: #aebccb; font-size: 0.85rem; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-disclaimer { font-size: 0.76rem; color: #7e8fa1; margin-top: 14px; max-width: 1280px; margin-left: auto; margin-right: auto; line-height: 1.6; }

/* ============================================================
   PRINT STYLES
============================================================ */
.print-header { display: none; }
.print-footer { display: none; }

@media print {
  body { background: #fff; }
  .site-header, .site-footer, .form-actions, .modal-overlay { display: none !important; }
  .site-main { padding: 0; max-width: none; }
  .print-header { display: block; text-align: center; margin-bottom: 20px; border-bottom: 2px solid var(--gold); padding-bottom: 14px; }
  .print-footer { display: block; margin-top: 24px; font-size: 0.74rem; color: var(--text-muted); text-align: center; }
  .card { border: 1px solid var(--border); break-inside: avoid; }
  .detail-field { break-inside: avoid; }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .table-wrap, .manage-table-wrap { overflow-x: auto; }
  .registry-table { min-width: 900px; }
}

@media (max-width: 900px) {
  .choice-grid { grid-template-columns: repeat(2,1fr); }
  .detail-grid { grid-template-columns: repeat(2,1fr); }
  .detail-field:nth-child(3n) { border-right: 1px solid var(--border); }
  .detail-field:nth-child(2n) { border-right: none; }
}

@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; padding-bottom: 10px; }
  .site-nav.open { display: flex; }
  .site-nav a, .nav-btn { width: 100%; }
  .hero h1 { font-size: 1.6rem; }
  .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field { border-right: none; }
  .table-toolbar { flex-direction: column; align-items: flex-start; }
}
