/* ============================
   RESET
============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================
   BASE STYLES
============================ */
body {
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
  background-color: #f5f3f0;
  color: #222;
  font-size: 18px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

/* ============================
   LAYOUT
============================ */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ============================
   HEADER
============================ */
.site-header {
  background: linear-gradient(135deg, #1a1a1a, #2d1a1a);
  color: #fff;
  padding: 2.5rem 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border-bottom: 6px solid #d4a017;
}

.header-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}

.header-badge-link {
  text-decoration: none;
}

.dept-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #d4a017;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dept-badge-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid #d4a017;
  background: #8b1a1a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.header-text h1 {
  font-size: 2.4rem;
  font-weight: 800;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.tagline {
  font-size: 1.1rem;
  color: #e8d5b5;
}

/* ============================
   NAVIGATION
============================ */
.main-nav {
  background-color: #8b1a1a;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 1rem;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding-bottom: 0.25rem;
}

.main-nav a:hover {
  color: #d4a017;
}

.main-nav a.active {
  border-bottom: 3px solid #d4a017;
}

/* ============================
   MAIN CONTENT
============================ */
main section {
  background-color: #fff;
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

main p {
  margin-bottom: 1.25rem;
}

main section:not(.callout) p {
  max-width: 65ch;
}

/* ============================
   HEADINGS
============================ */
main h2 {
  font-size: 1.7rem;
  font-weight: 700;
  color: #8b1a1a;
  border-bottom: 3px solid #8b1a1a;
  padding-bottom: 0.25rem;
  margin-bottom: 1rem;
}

main h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-top: 1.5rem;
}

/* ============================
   LISTS
============================ */
main ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

main li {
  list-style: none;
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.6rem;
}

main li::before {
  content: "\25AA";
  position: absolute;
  left: 0;
  color: #8b1a1a;
}

/* ============================
   LINKS
============================ */
main a {
  color: #8b1a1a;
  font-weight: 600;
}

main a:hover {
  color: #6b1414;
}

/* ============================
   BUTTONS
============================ */
.button {
  display: inline-block;
  background: #8b1a1a;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: #6b1414;
}

/* ============================
   CALLOUTS
============================ */
.callout {
  border-left: 6px solid #8b1a1a;
  background: #faf5f0;
  padding: 1rem 1.5rem;
  border-radius: 6px;
}

.callout.info {
  border-color: #1a3e5f;
  background: #eef5fa;
}

.callout.warning {
  border-color: #f57c00;
  background: #fff3e0;
}

.callout.danger {
  border-color: #d32f2f;
  background: #ffebee;
}

/* ============================
   STATUS BADGES
============================ */
.status-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
}

.status-ok { background: #2e7d32; }
.status-warn { background: #f9a825; color: #222; }
.status-down { background: #c62828; }
.status-retired { background: #555; }

/* ============================
   QUICK LINKS GRID
============================ */
.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.quick-link {
  display: block;
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-top: 4px solid #8b1a1a;
  text-decoration: none;
  color: #222;
  transition: transform 0.2s ease;
}

.quick-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.quick-link strong {
  display: block;
  color: #8b1a1a;
  margin-bottom: 0.35rem;
}

.quick-link span {
  font-size: 0.9rem;
  color: #555;
}

/* ============================
   TIMELINE
============================ */
.timeline {
  position: relative;
  padding-left: 2rem;
  border-left: 3px solid #8b1a1a;
  margin: 1.5rem 0;
}

.timeline-entry {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-entry:last-child {
  margin-bottom: 0;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -2.65rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b1a1a;
  border: 3px solid #f5f3f0;
}

.timeline-year {
  font-weight: 700;
  color: #8b1a1a;
  font-size: 1.1rem;
}

.timeline-text {
  margin-top: 0.25rem;
  max-width: 65ch;
}

/* ============================
   APPARATUS CARDS
============================ */
.apparatus-card {
  background: #fff;
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-top: 6px solid #8b1a1a;
}

.apparatus-card.memorial {
  border-top-color: #444;
  background: #fafafa;
}

.apparatus-card h3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.apparatus-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.apparatus-specs dt {
  font-weight: 600;
  color: #555;
}

.apparatus-specs dd {
  margin: 0 0 0.5rem 0;
}

/* ============================
   FUNDRAISING PROGRESS
============================ */
.fundraising-progress {
  background: #e0e0e0;
  border-radius: 8px;
  height: 2.25rem;
  overflow: hidden;
  margin: 1rem 0;
  position: relative;
}

.fundraising-progress .fill {
  background: linear-gradient(90deg, #8b1a1a, #b22222);
  height: 100%;
  border-radius: 8px;
  transition: width 0.6s ease;
}

.fundraising-progress .label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 0.9rem;
  color: #1a1a1a;
  white-space: nowrap;
}

.fundraising-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #555;
  margin-top: 0.5rem;
}

/* ============================
   NEWS CARDS
============================ */
.news-card {
  border-bottom: 1px solid #e5e5e5;
  padding: 1.25rem 0;
}

.news-card:first-child {
  padding-top: 0;
}

.news-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-card h3 {
  margin-top: 0;
}

.news-card h3 a {
  color: #8b1a1a;
  text-decoration: none;
}

.news-card h3 a:hover {
  text-decoration: underline;
}

.news-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.news-body img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1rem 0;
}

/* ============================
   FORMS
============================ */
form {
  max-width: 640px;
  margin-top: 1.5rem;
}

form label {
  display: block;
  font-weight: 600;
  margin-top: 1.25rem;
}

form input,
form textarea,
form select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
}

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

form button {
  margin-top: 1.5rem;
  padding: 0.5rem 1.25rem;
  background-color: #8b1a1a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

form button:hover {
  background-color: #6b1414;
}

form .note {
  margin-top: 0.75rem;
  font-style: italic;
  font-size: 0.95rem;
  color: #475569;
}

/* ============================
   FOOTER
============================ */
.site-footer {
  background-color: #1a1a1a;
  color: #e5e7eb;
  border-top: 6px solid #d4a017;
}

.footer-main {
  padding: 2.5rem 1rem 1.75rem;
  text-align: center;
}

.footer-title {
  font-weight: 700;
}

.footer-sub,
.footer-copy {
  font-size: 0.85rem;
  opacity: 0.85;
}

.footer-links {
  margin: 1.5rem 0 1.25rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: #d4a017;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.fiction-disclaimer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.8rem;
  opacity: 0.7;
  font-style: italic;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================
   ADMIN
============================ */
.admin-header {
  background: #333;
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  text-align: center;
}

.admin-header a {
  color: #d4a017;
  margin-left: 1rem;
}

.login-form {
  max-width: 360px;
  margin: 3rem auto;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.flash.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.flash.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 640px) {
  .header-row {
    flex-direction: column;
  }

  .header-text h1 {
    font-size: 1.8rem;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
  }

  .apparatus-card h3 {
    flex-direction: column;
    align-items: flex-start;
  }

  .quick-links {
    grid-template-columns: 1fr;
  }
}
