:root {
  --navy: #12213b;
  --navy-dark: #0a1526;
  --gold: #c9a24b;
  --gold-light: #e8cf8f;
  --paper: #f6f4ee;
  --ink: #1f2430;
  --muted: #6b7280;
  --danger: #b3261e;
  --border: #e2ddd0;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Georgia', 'Iowan Old Style', serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

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

/* Header */
.site-header {
  background: var(--navy);
  border-bottom: 4px solid var(--gold);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  color: var(--gold-light);
  font-size: 1.25rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: 1rem;
}
.main-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.main-nav a { color: #d7dce6; font-size: 0.95rem; }
.main-nav a:hover { color: var(--gold-light); }

.auth-area { display: flex; align-items: center; gap: 10px; }
.user-chip { color: var(--gold-light); font-size: 0.85rem; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-dark);
  padding: 10px 18px;
  border-radius: 3px;
  font-weight: bold;
  border: 1px solid var(--gold);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
}
.btn:hover { background: var(--gold-light); text-decoration: none; }
.btn-small { padding: 6px 12px; font-size: 0.85rem; }
.btn-outline { background: transparent; color: var(--gold-light); border-color: var(--gold); }
.btn-outline:hover { background: rgba(201,162,75,0.15); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }

.link-button {
  background: none; border: none; padding: 0; color: var(--danger);
  font-family: inherit; font-size: inherit; cursor: pointer; text-decoration: underline;
}

/* Layout */
.site-main { max-width: 900px; margin: 0 auto; padding: 40px 24px 80px; }

.hero { text-align: center; margin-bottom: 36px; }
.hero h1 { font-size: 2.2rem; color: var(--navy); margin-bottom: 6px; }
.hero p { color: var(--muted); }

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.dept-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  border-radius: 4px;
  padding: 22px;
  display: block;
  color: var(--ink);
}
.dept-card:hover { border-top-color: var(--gold); text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.dept-card h2 { margin: 0 0 8px; font-size: 1.2rem; color: var(--navy); }
.dept-card p { color: var(--muted); font-size: 0.92rem; margin: 0 0 12px; }
.dept-card-link { color: var(--gold); font-weight: bold; font-size: 0.85rem; }
.dept-card-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 12px; }

.dept-header-logo { width: 88px; height: 88px; object-fit: contain; margin-bottom: 14px; }

.dept-header { margin-bottom: 28px; border-bottom: 2px solid var(--border); padding-bottom: 18px; }
.dept-header h1 { color: var(--navy); margin-bottom: 6px; }
.dept-header p { color: var(--muted); }
.dept-header .btn { margin-top: 10px; margin-right: 10px; }

.doc-category { margin-bottom: 28px; }
.doc-category h2 {
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dotted var(--border);
}
.doc-list a { font-size: 1.02rem; }
.doc-updated { color: var(--muted); font-size: 0.8rem; white-space: nowrap; margin-left: 12px; }

.empty-state { color: var(--muted); font-style: italic; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.filter-bar input[type="text"] { flex: 1; min-width: 180px; }

.breadcrumb { margin-bottom: 20px; }

.document { background: white; border: 1px solid var(--border); border-radius: 4px; padding: 30px; }
.document-header { border-bottom: 2px solid var(--border); padding-bottom: 16px; margin-bottom: 20px; }
.doc-category-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--gold-light);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.document-header h1 { margin: 0 0 8px; color: var(--navy); }
.doc-meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 12px; }
.doc-actions { display: flex; gap: 8px; }
.document-body { font-size: 1.05rem; }
.document-body.ql-editor { padding: 0; overflow: visible; }
.document-body img { max-width: 100%; height: auto; border-radius: 3px; margin: 10px 0; }

/* Rich text editor on the add/edit form */
.doc-form-wrap { max-width: 720px; }
#editor-toolbar { border: 1px solid var(--border); border-bottom: none; background: #fafaf7; }
#editor { height: 320px; background: white; border: 1px solid var(--border); font-size: 1rem; margin-bottom: 8px; }
#editor .ql-editor { font-family: 'Georgia', 'Iowan Old Style', serif; }

/* Forms */
.auth-form-wrap { max-width: 520px; margin: 0 auto; }
.auth-form-wrap h1 { color: var(--navy); }
.auth-form, .doc-form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.auth-form label, .doc-form label { display: flex; flex-direction: column; gap: 6px; font-weight: bold; font-size: 0.9rem; color: var(--navy); }
.hint { font-weight: normal; color: var(--muted); font-size: 0.8rem; }
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
.form-error { color: var(--danger); font-weight: bold; }
.form-success { color: #1e7b34; font-weight: bold; }

/* Dashboard table */
.doc-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: white; }
.doc-table th, .doc-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.doc-table th { background: var(--navy); color: var(--gold-light); font-size: 0.85rem; text-transform: uppercase; }
.doc-table-actions a, .doc-table-actions .link-button { margin-right: 10px; font-size: 0.9rem; }

/* City-style homepage */
.city-hero {
  text-align: center;
  background: linear-gradient(rgba(10,21,38,0.7), rgba(10,21,38,0.7)), linear-gradient(135deg, var(--navy), #1c3159);
  color: white;
  padding: 60px 24px;
  margin: -40px -24px 36px;
  border-bottom: 4px solid var(--gold);
}
.city-hero h1 { font-size: 2rem; margin-bottom: 20px; color: white; }
.city-search { display: flex; max-width: 560px; margin: 0 auto; }
.city-search input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 3px 0 0 3px;
  font-size: 1rem;
}
.city-search button {
  background: var(--gold);
  border: none;
  padding: 0 20px;
  border-radius: 0 3px 3px 0;
  cursor: pointer;
  font-size: 1.1rem;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.quick-link-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 20px;
  color: var(--ink);
}
.quick-link-card:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.quick-link-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.05rem; }
.quick-link-arrow { color: var(--gold); font-weight: bold; font-size: 0.85rem; }

.city-dept-grid { margin-top: 10px; }
.site-main:has(.city-hero) { padding-top: 0; }
.site-footer { text-align: center; padding: 20px; color: var(--muted); font-size: 0.8rem; border-top: 1px solid var(--border); }
