:root {
  --red: #cc0000;
  --red-hover: #e63333;
  --red-pale: #fff5f5;
  --white: #ffffff;
  --off-white: #f8f8f8;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #ddd;
  --shadow: 0 2px 8px rgba(0,0,0,0.12);
  --font: "Bookman Old Style", Georgia, serif;
  --nav-height: 80px;
  --max-width: 1100px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
}

img { display: block; max-width: 100%; }
a { color: var(--red); }

/* ── NAVBAR ─────────────────────────────────────────────────────────── */

.navbar {
  background: var(--red);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand img {
  height: 52px;
  width: auto;
}

.navbar-brand span {
  color: var(--white);
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.3;
}

.navbar-menu {
  list-style: none;
  display: flex;
  align-items: stretch;
  height: var(--nav-height);
}

.navbar-menu > li {
  position: relative;
  display: flex;
  align-items: center;
}

.navbar-menu > li > a {
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  height: 100%;
  color: var(--white);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  transition: background 0.15s;
}

.navbar-menu > li > a:hover,
.navbar-menu > li > a.active {
  background: var(--red-hover);
}

.dropdown {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  min-width: 240px;
  background: var(--white);
  border-top: 3px solid var(--red);
  box-shadow: var(--shadow);
  list-style: none;
  z-index: 999;
}

.has-dropdown:hover .dropdown {
  display: block;
}

.dropdown li a {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--red);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: bold;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.dropdown li:last-child a { border-bottom: none; }

.dropdown li a:hover {
  background: var(--red-pale);
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.navbar-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.25s;
}

.navbar-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.navbar-toggle.active span:nth-child(2) { opacity: 0; }
.navbar-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── HOME BANNER ─────────────────────────────────────────────────────── */

.site-banner {
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  border-bottom: 4px solid #990000;
}

.site-banner img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.site-banner p {
  color: var(--white);
  font-size: clamp(0.8rem, 1.4vw, 1.2rem);
  font-weight: bold;
  line-height: 1.5;
  text-align: center;
}

/* ── PAGE WRAPPER ────────────────────────────────────────────────────── */

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

.page-title {
  font-size: 1.9rem;
  font-variant: small-caps;
  font-weight: bold;
  border-bottom: 3px solid var(--red);
  padding-bottom: 0.5rem;
  margin-bottom: 1.75rem;
}

.page-subtitle {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: -1.25rem;
  margin-bottom: 1.75rem;
}

/* ── HOME ────────────────────────────────────────────────────────────── */

.home-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.home-hero-logo { width: 130px; height: auto; }
.home-hero-photo { width: 130px; height: 130px; object-fit: cover; border-radius: 50%; box-shadow: var(--shadow); }

.home-hero-text h1 {
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-variant: small-caps;
  color: var(--red);
  font-weight: bold;
  line-height: 1.25;
}

.home-hero-text p {
  font-size: 1rem;
  font-style: italic;
  margin-top: 0.5rem;
  color: var(--text-muted);
}

.home-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 3rem;
  font-size: 1.05rem;
  line-height: 1.85;
  text-align: justify;
}

.home-body p + p { margin-top: 1rem; }

.home-cta {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
}

.home-cta .highlight {
  display: block;
  margin-top: 0.4rem;
  color: var(--red);
  font-size: 1.35rem;
  font-style: italic;
}

/* ── PROSE ───────────────────────────────────────────────────────────── */

.prose {
  font-size: 1.05rem;
  line-height: 1.85;
}

.prose p { margin-bottom: 1rem; }

.prose blockquote {
  border-left: 4px solid var(--red);
  padding: 0.5rem 1rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 1rem 0;
  background: var(--off-white);
}

/* ── NEWS ────────────────────────────────────────────────────────────── */

.news-article {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.news-article:first-child { border-top: none; padding-top: 0; }

.news-date-headline {
  color: var(--red);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.news-subtitle {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.news-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.news-text {
  flex: 1;
  font-size: 1rem;
  line-height: 1.8;
  text-align: justify;
  order: 1;
}

.news-image {
  flex: 1;
  order: 2;
}

.news-image img { width: 100%; height: auto; border-radius: 4px; }

/* Alternate: even articles have image on the left */
.news-article:nth-child(even) .news-text { order: 2; }
.news-article:nth-child(even) .news-image { order: 1; }

/* ── MEETING DATES ───────────────────────────────────────────────────── */

.dates-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}

.dates-intro {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.dates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: column;
  border: 3px dotted var(--red);
  border-radius: 8px;
  overflow: hidden;
}

.date-cell {
  padding: 0.9rem 1rem;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.4;
}

.date-light { background: var(--white); color: var(--text); }
.date-dark  { background: #111; color: var(--white); }

.dates-note {
  margin-top: 1.25rem;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.8;
}

.dates-photo img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

/* ── PRECEPTORS ──────────────────────────────────────────────────────── */

.preceptors-layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.cert-image {
  width: 280px;
  box-shadow: var(--shadow);
  border-radius: 4px;
}

/* ── TABLE ───────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.data-table th {
  background: var(--red);
  color: var(--white);
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.9rem;
}

.data-table td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
}

.data-table tr:nth-child(even) td { background: #f2f2f2; }

/* ── MEMBERS ─────────────────────────────────────────────────────────── */

.members-card {
  text-align: center;
  font-size: 1.1rem;
  line-height: 2.1;
}

.members-card .cpi-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 1.5rem;
  font-style: italic;
}

/* ── MEMBERSHIP ──────────────────────────────────────────────────────── */

.membership-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
}

.membership-text { font-size: 1.05rem; line-height: 1.85; }
.membership-text p { margin-bottom: 1rem; }

.membership-list {
  list-style: none;
  margin: 1rem 0;
  line-height: 2.2;
}

.membership-list li {
  background: url('../images/KEVII Design 2.png') no-repeat 0 50%;
  background-size: 20px auto;
  padding-left: 30px;
  font-size: 1rem;
}

.form-preview {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 4px;
  overflow: hidden;
}

.form-preview img { width: 100%; }

/* ── HISTORY ─────────────────────────────────────────────────────────── */

.history-books {
  float: right;
  display: flex;
  gap: 1rem;
  margin: 0 0 1.5rem 2rem;
}

.history-books img {
  width: 160px;
  height: auto;
  box-shadow: 8px 8px 15px rgba(0,0,0,0.25);
  border-radius: 2px;
}

/* ── ANNUAL REPORTS ──────────────────────────────────────────────────── */

.reports-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.report-link {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border: 2px solid var(--red);
  color: var(--red);
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s;
}

.report-link:hover {
  background: var(--red);
  color: var(--white);
}

/* ── BOOKS ───────────────────────────────────────────────────────────── */

.book-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.book-item:first-child { border-top: none; }

.book-cover {
  width: 80px;
  flex-shrink: 0;
  box-shadow: 5px 5px 12px rgba(0,0,0,0.25);
  border-radius: 2px;
}

.book-text {
  font-size: 1rem;
  line-height: 1.7;
  padding-top: 0.5rem;
}

.guidance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.guidance-item img {
  width: 80px;
  margin: 0 auto;
  box-shadow: 4px 4px 8px rgba(0,0,0,0.2);
}

.guidance-item p {
  font-size: 0.9rem;
  margin-top: 0.6rem;
  line-height: 1.4;
}

/* ── CONTACT ─────────────────────────────────────────────────────────── */

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.contact-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.9;
  background: var(--off-white);
}

.contact-card strong { font-size: 1.1rem; display: block; }
.contact-card em { color: var(--text-muted); }

.contact-social {
  text-align: center;
  margin-top: 2rem;
}

.contact-social img { width: 60px; margin: 0 auto; }

/* ── LICENCE ─────────────────────────────────────────────────────────── */

.licence-body {
  font-size: 1rem;
  line-height: 1.85;
}

.licence-body ol {
  counter-reset: item;
  list-style: none;
}

.licence-body li {
  display: block;
  margin-bottom: 0.4rem;
}

.licence-body li::before {
  content: counters(item, ".") ". ";
  counter-increment: item;
  font-weight: bold;
}

.licence-l2 { margin-left: 2rem; }
.licence-l3 { margin-left: 4rem; }

.licence-section { margin-top: 1.5rem; }

.licence-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.licence-footer img { width: 90px; }
.licence-footer p { font-style: italic; line-height: 1.7; }

/* ── BUTTONS ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

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

.btn-outline {
  background: transparent;
  color: var(--red);
}
.btn-outline:hover { background: var(--red-pale); color: var(--red); }

.btn-danger { background: #b00; border-color: #b00; }
.btn-danger:hover { background: #900; border-color: #900; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }

.btn-success { background: #2a7a2a; border-color: #2a7a2a; }
.btn-success:hover { background: #1e5c1e; }

/* ── ADMIN ───────────────────────────────────────────────────────────── */

.admin-login {
  max-width: 420px;
  margin: 5rem auto;
  padding: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  box-shadow: var(--shadow);
}

.admin-login h1 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.admin-login p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 0.95rem; }

.admin-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin-bottom: 1rem;
  font-family: var(--font);
}

.admin-input:focus { outline: 2px solid var(--red); border-color: var(--red); }

.login-error {
  color: #b00;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.admin-panel { display: none; }
.admin-panel.visible { display: block; }

.admin-header {
  background: var(--red);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-header h1 { font-size: 1.3rem; }

.admin-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-section {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--red);
}

.admin-section-header h2 { font-size: 1.2rem; }

.admin-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.admin-item-info { flex: 1; font-size: 0.95rem; }
.admin-item-info small { display: block; color: var(--text-muted); margin-top: 0.2rem; }
.admin-item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

.add-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.add-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 0.95rem;
}

/* ── MODAL ───────────────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--white);
  border-radius: 8px;
  padding: 2rem;
  width: min(580px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.modal h2 { margin-bottom: 1.25rem; font-size: 1.2rem; }

.form-group { margin-bottom: 0.9rem; }
.form-group label { display: block; font-size: 0.88rem; font-weight: bold; margin-bottom: 0.3rem; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus { outline: 2px solid var(--red); border-color: var(--red); }

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

.form-group.checkbox { display: flex; align-items: center; gap: 0.5rem; }
.form-group.checkbox label { margin-bottom: 0; font-weight: normal; }

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}

/* ── SAVE STATUS ─────────────────────────────────────────────────────── */

.save-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.save-feedback {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  display: none;
}
.save-feedback.success { display: block; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.save-feedback.error   { display: block; background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── SKELETON LOADERS ────────────────────────────────────────────────── */

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skel {
  background: linear-gradient(90deg, #ebebeb 25%, #d8d8d8 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 4px;
}
.skel-line  { height: 0.85em; margin-bottom: 0.45rem; display: block; }
.skel-block { border-radius: 6px; display: block; }

/* ── PAST MEETING DATES ──────────────────────────────────────────────── */

.date-cell.date-past { opacity: 0.38; }

/* ── BACK TO TOP ─────────────────────────────────────────────────────── */

.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 40px;
  height: 40px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, background 0.15s;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover   { background: var(--red-hover); }

/* ── COPY EMAIL ──────────────────────────────────────────────────────── */

.copy-email-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: 0.35rem;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  vertical-align: middle;
}
.copy-email-btn:hover  { background: var(--red-pale); color: var(--red); border-color: var(--red); }
.copy-email-btn.copied { background: #d4edda; color: #155724; border-color: #c3e6cb; }

/* ── FILE UPLOAD DROP ZONES ──────────────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--off-white);
  user-select: none;
}

.upload-zone:hover,
.upload-zone.dz-hover { border-color: var(--red); background: var(--red-pale); }

.upload-zone p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }
.dz-browse { color: var(--red); text-decoration: underline; }
.dz-icon { font-size: 1.4rem; line-height: 1; margin-bottom: 0.2rem; }

.upload-zone.dz-report {
  padding: 1.1rem 1.5rem;
  margin-bottom: 1rem;
}

.dz-confirm {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
  cursor: default;
}

.dz-confirm input[type=number] {
  width: 85px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.88rem;
}

.upload-status {
  margin-top: 0.35rem;
  min-height: 1.1em;
  font-size: 0.82rem;
  cursor: default;
}
.upload-status.ok   { color: #2a7a2a; }
.upload-status.err  { color: #b00; }
.upload-status.warn { color: #b06000; }

/* ── HOME SIDEBAR LAYOUT ─────────────────────────────────────────────── */

.next-meeting-bar {
  background: #1a1a1a;
  color: var(--white);
  text-align: center;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
}

.next-meeting-bar strong { color: #ffcc00; }

.home-layout {
  display: grid;
  grid-template-columns: 270px 1fr 340px;
  min-height: calc(100vh - 122px);
}

.home-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding-top: 1rem;
}

.home-sidebar ul { list-style: none; }

.home-sidebar > ul > li { position: relative; }

.home-sidebar > ul > li > a {
  display: block;
  padding: 1rem 1.5rem;
  color: var(--red);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: bold;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
}

.home-sidebar > ul > li > a:hover { background: var(--red-pale); }

.sidebar-dropdown {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 230px;
  background: var(--white);
  border-left: 5px solid var(--red);
  box-shadow: 5px 5px 10px rgba(0,0,0,0.18);
  z-index: 999;
  list-style: none;
}

.home-sidebar > ul > li:hover .sidebar-dropdown { display: block; }

.sidebar-dropdown li a {
  display: block;
  padding: 0.75rem 1.1rem;
  color: var(--red);
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.sidebar-dropdown li:last-child a { border-bottom: none; }
.sidebar-dropdown li a:hover { background: var(--red-pale); }

.home-main {
  padding: 2.5rem 2rem 2rem;
  overflow: hidden;
}

.home-title {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.home-crest { width: 100px; flex-shrink: 0; }

.home-title-text h1 {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-variant: small-caps;
  color: var(--red);
  font-weight: bold;
  line-height: 1.25;
}

.home-title-text p {
  font-size: 0.95rem;
  font-style: italic;
  margin-top: 0.4rem;
  color: var(--text-muted);
}

.home-body { font-size: 1.05rem; line-height: 1.85; text-align: justify; }
.home-body p + p { margin-top: 0.9rem; }

.home-photo-col { overflow: hidden; background: #111; }
.home-photo-col img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.92; }

/* ── SEARCH ──────────────────────────────────────────────────────────── */

.search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0.5rem;
}

.search-input {
  padding: 0.35rem 0.7rem;
  border: none;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.85rem;
  width: 160px;
  background: rgba(255,255,255,0.9);
}

.search-input:focus { outline: 2px solid #ffcc00; width: 200px; transition: width 0.2s; }

.search-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  opacity: 0.85;
}

.search-btn:hover { opacity: 1; }

.search-result {
  padding: 1rem;
  border-top: 1px solid var(--border);
}

.search-result:first-child { border-top: none; }

.search-result h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.search-result h3 a { color: var(--red); text-decoration: none; }
.search-result h3 a:hover { text-decoration: underline; }
.search-result p { font-size: 0.9rem; color: var(--text-muted); }
.search-result .tag { font-size: 0.78rem; background: var(--red-pale); color: var(--red); padding: 0.1rem 0.5rem; border-radius: 10px; margin-right: 0.4rem; }

.no-results { color: var(--text-muted); font-style: italic; padding: 1rem 0; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .home-photo-col { display: none; }
  .home-layout { grid-template-columns: 240px 1fr; }
}

@media (max-width: 700px) {
  .home-layout { grid-template-columns: 1fr; }
  .home-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .home-sidebar > ul > li > a { padding: 0.75rem 1.25rem; }
  .sidebar-dropdown { left: 0; top: 100%; border-left: none; border-top: 5px solid var(--red); }
  .site-banner img { display: none; }
  .site-banner p { font-size: 0.85rem; }
}

@media (max-width: 900px) {
  .navbar-brand span { display: none; }
  .navbar-toggle { display: flex; }

  .navbar-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--red);
    flex-direction: column;
    height: auto;
    padding: 0.5rem 0;
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  }

  .navbar-menu.active { display: flex; }
  .navbar-menu > li { width: 100%; }
  .navbar-menu > li > a { padding: 0.8rem 1.5rem; font-size: 1rem; height: auto; }
  .dropdown { display: none !important; }

  .home-hero { grid-template-columns: 1fr; justify-items: center; gap: 1rem; }
  .home-hero-photo { display: none; }

  .news-body { grid-template-columns: 1fr; }
  .dates-layout { grid-template-columns: 1fr; }
  .dates-photo { display: none; }
  .membership-layout { grid-template-columns: 1fr; }
  .form-preview { display: none; }
  .preceptors-layout { grid-template-columns: 1fr; }
  .cert-image { display: none; }
  .history-books { float: none; margin: 0 auto 1.5rem; justify-content: center; }
  .guidance-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .page { padding: 1.5rem 1rem; }
  .page-title { font-size: 1.5rem; }
  .dates-grid { grid-template-columns: 1fr; }
  .guidance-grid { grid-template-columns: repeat(2, 1fr); }
  .search-input { width: 120px; }
  .site-banner img { display: none; }
  .site-banner p { font-size: 0.85rem; }
}

/* ── PRINT ───────────────────────────────────────────────────────────── */

@media print {
  .navbar,
  .site-banner,
  .next-meeting-bar,
  .home-sidebar,
  .home-photo-col,
  .btn,
  .admin-header,
  .save-bar { display: none !important; }

  body { color: #000; background: #fff; font-size: 11pt; }

  .page { max-width: 100%; padding: 0; margin: 0; }

  .page-title {
    font-size: 16pt;
    border-bottom: 2px solid #000;
    color: #000;
  }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #444; }
  a[href^="#"]::after,
  a[href^="mailto"]::after { content: ""; }

  .licence-body { font-size: 10pt; line-height: 1.6; }
  .licence-l2 { margin-left: 1.5rem; }
  .licence-l3 { margin-left: 3rem; }
  .licence-section { page-break-inside: avoid; }
  .licence-footer { page-break-before: avoid; }

  .data-table { font-size: 10pt; }
  .data-table th { background: #333 !important; color: #fff !important; -webkit-print-color-adjust: exact; }
  .data-table tr:nth-child(even) td { background: #eee !important; -webkit-print-color-adjust: exact; }

  .news-body { display: block; }
  .news-image { max-width: 60%; margin: 0.5rem auto; }

  .history-books { float: none; page-break-inside: avoid; }
  .history-books img { width: 120px; }

  .home-layout { display: block; }
  .home-main { padding: 0; }
}
