/* ===== CSS VARIABLES (LIGHT & DARK THEMES) ===== */
:root {
  --color-primary: #0077ff;
  --color-primary-soft: #e0f1ff;
  --color-secondary: #00a98f;
  --color-accent: #ffb547;
  --color-bg: #f7fbff;
  --color-surface: #ffffff;
  --color-text: #1c2534;
  --color-muted: #6b7280;
  --color-border: rgba(148, 163, 184, 0.4);
  --color-border-strong: rgba(148, 163, 184, 0.7);
  --color-nav-bg: rgba(247, 251, 255, 0.9);
  --color-section-alt: #f1f5f9;
  --color-footer-bg: rgba(247, 251, 255, 0.9);
  --color-footer-border: rgba(55, 65, 81, 0.9);
  --card-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  --card-shadow-strong: 0 22px 50px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --transition-fast: 0.2s ease;
  --transition-med: 0.35s ease;
  --color-text-hover: #0077ff;
  --color-hero-subtitle: #cbd0da;
  --color-hero-heading: #fff;
}

body[data-theme="dark"] {
  --color-primary: #5ab0ff;
  --color-primary-soft: rgba(90, 176, 255, 0.1);
  --color-secondary: #00d0b1;
  --color-accent: #ffc977;
  --color-bg: #0b1220;
  --color-surface: #111b2f;
  --color-text: #e6efff;
  --color-muted: #9ba6bf;
  --color-border: rgba(99, 112, 141, 0.45);
  --color-border-strong: rgba(138, 153, 187, 0.8);
  --color-nav-bg: rgba(11, 18, 32, 0.9);
  --color-section-alt: #0f172a;
  --color-footer-bg: #050913;
  --color-footer-border: rgba(26, 32, 45, 0.9);
  --card-shadow: 0 18px 35px rgba(3, 7, 18, 0.7);
  --card-shadow-strong: 0 25px 60px rgba(3, 7, 18, 0.85);
  --shadow-soft: 0 18px 45px rgba(3, 7, 18, 0.75);
  --color-text-hover: #0077ff;
  --color-hero-subtitle: #cbd0da;
}

/* ===== BASE & RESET ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== HEADER & NAVIGATION ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar {
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: #e5efff;
  font-size: 0.85rem;
}

.top-bar-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.4rem 0;
}

.top-bar a {
  color: #ffffff;
  text-decoration: underline;
}

.navbar {
  background: var(--color-nav-bg);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  transition:
    box-shadow var(--transition-fast),
    background var(--transition-fast),
    border-color var(--transition-fast);
}

.navbar.scrolled {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  background: #ffffff;
  border-color: transparent;
}

body[data-theme="dark"] .navbar.scrolled {
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  background: rgba(11, 18, 32, 0.98);
  border-color: rgba(99, 112, 141, 0.3);
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.logo-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.35);
  padding: 4px;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text strong {
  display: block;
  font-size: 1rem;
}

.logo-text small {
  display: block;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  margin: 0;
}

.nav-theme {
  margin-left: 0.4rem;
}

.nav-theme .theme-toggle {
  font-size: 0.75rem;
  padding: 0.3rem 0.65rem;
}

.nav-links a {
  font-size: 0.95rem;
  padding-bottom: 0.15rem;
  position: relative;
  color: var(--color-muted);
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  border-radius: 999px;
  transition: width var(--transition-med);
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  margin-left: 0.8rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 999px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: linear-gradient(
    120deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.5);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(255, 255, 255, 0.7);
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.btn-outline:hover {
  background: #ffffff;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

/* ===== HERO SECTION ===== */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(1, 10, 24, 0.8), rgba(1, 6, 14, 0.9)),
    url("../images/hospital-building.jpg");
  background-size: cover;
  background-position: center;
  transform: translateY(0);
  transition: transform 0.4s ease-out;
  opacity: 0.9;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 3rem;
  padding: 3.5rem 0 3.75rem;
}

.hero-text h1 {
  font-size: 2.6rem;
  line-height: 1.2;
  margin: 0.2rem 0 0.4rem;
  color: var(--color-hero-heading);
}

.hero-subtitle {
  color: var(--color-hero-subtitle);
  max-width: 32rem;
  margin-bottom: 1.3rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.7rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--color-secondary);
  font-weight: 600;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
  min-width: 120px;
  box-shadow: 0 12px 30px rgba(148, 163, 184, 0.35);
}

.stat-number {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.hero-image-card {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  padding: 1.5rem 1.5rem 2rem;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
  font-size: 0.78rem;
  font-weight: 600;
}

.hero-main-visual {
  position: relative;
  margin-top: 1.3rem;
}

.hero-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, #bfdbfe, #bbf7d0, #e0f2fe);
  margin: 0 auto;
  filter: drop-shadow(0 25px 40px rgba(15, 23, 42, 0.35));
}

.hero-doctor-illustration {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 150px;
  border-radius: 40px;
  background: linear-gradient(160deg, #f9fafb, #e5f0ff);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.35);
}

.stethoscope,
.cross-symbol {
  position: absolute;
}

.stethoscope {
  width: 80px;
  height: 80px;
  border: 3px solid var(--color-primary);
  border-radius: 999px;
  bottom: 8px;
  left: 10px;
}

.cross-symbol {
  right: 8px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-weight: 700;
}

.hero-floating-card {
  position: absolute;
  bottom: 1.3rem;
  right: 1.2rem;
  background: #0f172a;
  color: #e5e7eb;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  font-size: 0.8rem;
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.9);
}

.hero-floating-card h3 {
  margin: 0.1rem 0 0;
  font-size: 1.1rem;
  color: #ffffff;
}

/* ===== SECTIONS & GRIDS ===== */
.section {
  padding: 3.25rem 0;
}

.section-alt {
  background:
    radial-gradient(
      circle at 10% 0,
      rgba(191, 219, 254, 0.35),
      transparent 45%
    ),
    radial-gradient(
      circle at 90% 0,
      rgba(187, 247, 208, 0.35),
      transparent 45%
    ),
    var(--color-section-alt);
}

.section-header {
  text-align: center;
  margin-bottom: 2.2rem;
}

.section-header h2 {
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
}

.section-header p {
  max-width: 32rem;
  margin: 0 auto;
  color: var(--color-muted);
}

.history-content {
  text-align: justify;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.news-card {
  min-height: 220px;
}

.news-date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-secondary);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.news-card h3 {
  margin: 0 0 0.4rem;
}

.article-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.article-meta {
  color: var(--color-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
}

/* ===== NEWS CARD STYLES (your existing) ===== */
.news-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1rem;
  line-height: 1.6;
  min-height: calc(1.6em * 3);
}

.news-card .card-link {
  margin-top: auto;
  align-self: flex-start;
}

.amharic-news-card {
  font-family: "Noto Sans Ethiopic", "Poppins", system-ui, sans-serif;
}

.amharic-news-card .amharic-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  margin-bottom: 1rem;
  line-height: 1.6;
  min-height: calc(1.6em * 3);
}

.amharic-news-card .card-link {
  margin-top: 0.75rem;
}

.news-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: -1.4rem -1.5rem 1rem -1.5rem;
  width: calc(100% + 3rem);
  max-width: none;
}

/* ===== PAGINATION STYLES ===== */
.pagination-wrapper {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-item {
  margin: 0;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.8rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}

.page-link:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(0, 119, 255, 0.25);
}

.page-item.disabled .page-link {
  opacity: 0.5;
  pointer-events: none;
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-muted);
  box-shadow: none;
}

/* Dark theme adjustments */
body[data-theme="dark"] .page-link {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

body[data-theme="dark"] .page-link:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

body[data-theme="dark"] .page-item.active .page-link {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
}

/* Responsive: stack on very small screens */
@media (max-width: 480px) {
  .pagination {
    gap: 0.3rem;
  }

  .page-link {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
  }
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--color-border);
  transform: translateY(0) scale(1);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med),
    border-color var(--transition-med);
}

.card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--card-shadow-strong);
  border-color: rgba(59, 130, 246, 0.45);
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: rgba(219, 234, 254, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  font-size: 1.3rem;
}

.card-link {
  display: inline-flex;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* ===== HISTORY SECTION (MODIFIED) ===== */
/* Stack content vertically, gallery full width, scrollbar hidden */
.history .card.history-gallery-wrap {
  padding: 0;
  /* Remove card padding so images stretch edge‑to‑edge */
}

.history-gallery {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem;
  /* keep inner spacing */
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE/Edge */
}

.history-gallery::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

.history-gallery-wrap {
  position: relative;
}

.history-slide {
  scroll-snap-align: start;
  flex: 0 0 46%;
  min-width: 220px;
  max-width: 520px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--card-shadow);
}

.history-slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.history-slide figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  color: var(--color-muted);
}

.gallery-controls {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  display: flex;
  gap: 0.4rem;
}

.gallery-controls button {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.gallery-controls button:hover {
  transform: translateY(-2px);
}

/* ===== TESTIMONIALS ===== */
.testimonials {
  position: relative;
}

.testimonial-slider {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.testimonial-track {
  position: relative;
  min-height: 240px;
}

.testimonial-card {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(12px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.9rem;
  box-shadow: var(--shadow-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.testimonial-card.active {
  opacity: 1;
  transform: translateX(0);
}

.testimonial-card p {
  margin: 0;
  max-width: 480px;
}

.testimonial-card h4 {
  margin: 0;
}

.testimonial-card span {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.testimonial-controls {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.8rem;
}

.slider-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.7);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    width 0.2s ease;
}

.slider-dot.active {
  background: var(--color-primary);
  transform: scale(1.2);
  width: 22px;
}

/* ===== CHECKLIST ===== */
.checklist {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  columns: 2;
  column-gap: 1rem;
}

.checklist li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05rem;
  font-size: 0.75rem;
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== FORMS ===== */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--color-border-strong);
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  background: rgba(248, 250, 252, 0.9);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
  background: #ffffff;
}

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

.form-actions {
  margin-top: 0.4rem;
}

.form-message {
  margin-top: 0.4rem;
  font-size: 0.85rem;
}

.form-message.success {
  color: #16a34a;
}

.form-message.error {
  color: #b91c1c;
}

/* ===== PAGE HERO ===== */
.page-hero {
  padding: 2.7rem 0 2.4rem;
  background: linear-gradient(135deg, #e0f2fe, #eff6ff);
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.page-hero.center {
  text-align: center;
}

.page-hero h1 {
  margin-bottom: 0.5rem;
}

.page-hero p {
  max-width: 40rem;
  color: var(--color-muted);
}

body[data-theme="dark"] .page-hero {
  background: linear-gradient(135deg, #0b1830, #0d1f3f);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

body[data-theme="dark"] .page-hero h1 {
  color: #f8fafc;
}

body[data-theme="dark"] .page-hero p,
body[data-theme="dark"] .page-hero .eyebrow {
  color: rgba(226, 232, 240, 0.9);
}

/* ===== GRID UTILITIES ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.pill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.pill-card {
  background: var(--color-surface);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

/* ===== DOCTOR CARDS ===== */
.doctor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
  grid-auto-rows: 1fr;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.doctor-grid.draggable {
  cursor: grab;
}

.doctor-grid.draggable:active {
  cursor: grabbing;
}

.doctor-card {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 0;
  overflow: hidden;
  height: 100%;
  transition:
    transform 260ms var(--transition-med),
    box-shadow 260ms var(--transition-med);
  will-change: transform;
  transform-origin: center center;
  cursor: pointer;
}

.doctor-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 30px 50px rgba(15, 23, 42, 0.12);
}

.doctor-photo {
  width: 100%;
  background: #f1f5f9;
  transition: transform 450ms cubic-bezier(0.2, 0.9, 0.2, 1);
  overflow: hidden;
  position: relative;
  height: 500px;
}

.doctor-card:hover .doctor-photo img {
  transform: scale(1.06);
}

.doctor-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.doctor-body {
  padding: 1.1rem 1.2rem 1.3rem;
  flex: 1 1 auto;
}

.doctor-card h3 {
  margin-bottom: 0.1rem;
}

.doctor-meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

/* ===== ADMIN CARDS ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-card .doctor-photo img {
  /* height: 160px; */
  object-fit: cover;
}

/* ===== ACCORDION ===== */
.accordion-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.accordion-card {
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.accordion-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
}

.accordion-icon {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accordion-toggle {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  background: #f9fafb;
  position: relative;
}

.accordion-toggle::before,
.accordion-toggle::after {
  content: "";
  position: absolute;
  background: #4b5563;
  transition: transform 0.18s ease;
}

.accordion-toggle::before {
  width: 10px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.accordion-toggle::after {
  width: 2px;
  height: 10px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.accordion-card.open .accordion-toggle::after {
  transform: translate(-50%, -50%) scaleY(0);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  transition: max-height 0.3s ease;
}

.accordion-card.open .accordion-body {
  padding-top: 0.6rem;
  padding-bottom: 0.9rem;
}
.accordion-icon-emergency {
  color: red;
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* ===== DEPARTMENTS ===== */
.department-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.department-card {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  background: var(--color-surface);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--card-shadow);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med);
}

.department-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 55px rgba(15, 23, 42, 0.14);
}

.department-media {
  position: relative;
  overflow: hidden;
  height: 300px;
  background: #e2efff;
}

.department-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.department-card:hover .department-media img {
  transform: scale(1.04);
}

.department-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  color: #ffffff;
  background: rgba(17, 88, 201, 0.9);
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.department-body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.4rem 1.5rem 1.5rem;
  flex: 1;
}

.department-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.12);
  color: var(--color-primary);
  font-size: 1.35rem;
}

.department-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.department-card p {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.7;
}

.department-location {
  font-size: 0.92rem;
  color: var(--color-secondary);
  font-weight: 600;
}

.department-action {
  margin-top: auto;
  align-self: flex-start;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
  grid-auto-rows: minmax(0, 1fr);
}

.coordinator-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--card-shadow);
  transition:
    transform var(--transition-med),
    box-shadow var(--transition-med);
}

.coordinator-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 55px rgba(15, 23, 42, 0.14);
}

.coordinator-photo {
  position: relative;
  width: 100%;
  height: 320px; /* important */
  overflow: hidden;
  background: #f8fbff;
  display: grid;
  place-items: center;
}

.coordinator-photo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: fill;
  object-position: center;
  transition: transform 0.35s ease;

  transform: translateY(-10px);
}

.coordinator-card:hover .coordinator-photo img {
  transform: scale(1.03);
}

.coordinator-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: linear-gradient(
    120deg,
    var(--color-primary),
    var(--color-secondary)
  );
  color: #ffffff;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.16);
}

.coordinator-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.4rem 1.5rem 1.5rem;
  flex: 1;
}

.coordinator-card h3 {
  margin: 0;
}

.coordinator-meta {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.coordinator-text {
  margin: 0;
  line-height: 1.7;
  color: var(--color-text);
}

.coordinator-social {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.coordinator-social a {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  transition:
    transform var(--transition-fast),
    background var(--transition-fast);
}

.coordinator-social a:hover {
  transform: translateY(-2px);
  background: rgba(37, 99, 235, 0.18);
}

@media (max-width: 960px) {
  .department-grid,
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    .coordinator-photo {
      height: 600px;
      object-fit: fill;
    }
  }
}

@media (max-width: 768px) {
  .department-grid,
  .team-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .coordinator-photo {
    height: 300px;
    object-fit: fill;
  }
}

@media (max-width: 640px) {
  .coordinator-photo {
    height: 220px;
    width: 100%;
    object-fit: fill;
  }
  .coordinator img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

@media (max-width: 320px) {
  .coordinator-photo {
    width: 300px;
    object-fit: cover;
  }
  .coordinator img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* ===== CONTACT PAGE ===== */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 2rem;
}

.map-wrapper {
  margin-top: 1rem;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
}

/* ===== FOOTER ===== */
.site-footer {
  margin-top: 3rem;
  background: var(--color-footer-bg);
  color: #e5e7eb;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.6rem;
  padding: 2.5rem 0 1.4rem;
  font-size: 0.9rem;
}

.site-footer h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.site-footer p,
.site-footer a {
  color: var(--color-text);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.4rem;
}

.site-footer a:hover {
  color: var(--color-text-hover);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.5rem;
}

.social-links a {
  font-size: 0.82rem;
}

.footer-bottom {
  border-top: 1px solid var(--color-footer-border);
  padding: 0.8rem 0 1rem;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--color-secondary)
  );
  font-size: 0.85rem;
}

.footer-bottom p {
  display: flex;
  justify-content: center;
  color: #e5efff;
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    border-color var(--transition-fast);
}

.theme-toggle span {
  font-size: 0.9rem;
}

.theme-toggle:hover {
  border-color: var(--color-primary);
}

/* ===== ANIMATIONS ===== */
.fade-in-up {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInLeft 0.8s ease-out forwards;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(20px);
  animation: slideInRight 0.8s ease-out forwards;
}

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== DARK THEME ADJUSTMENTS ===== */
body[data-theme="dark"] .hero-pill {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
}

body[data-theme="dark"] .stat-card {
  background: rgba(17, 24, 39, 0.85);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

body[data-theme="dark"] .hero-floating-card {
  background: #1e293b;
  color: #e2e8f0;
  box-shadow: 0 20px 35px rgba(2, 6, 23, 0.9);
}

body[data-theme="dark"] .navbar {
  background: rgba(11, 18, 32, 0.95);
  border-bottom-color: rgba(99, 112, 141, 0.3);
}

body[data-theme="dark"] .navbar .nav-links a {
  color: rgba(226, 232, 240, 0.9);
}

body[data-theme="dark"] .navbar .logo-text strong {
  color: #f1f5f9;
}

body[data-theme="dark"] .navbar .logo-text small {
  color: rgba(203, 213, 225, 0.8);
}

body[data-theme="dark"] .navbar .nav-toggle span {
  background: #e2e8f0;
}

body[data-theme="dark"] .doctor-photo {
  background: #0f172a;
}

body[data-theme="dark"] .top-bar {
  background: linear-gradient(90deg, #0f1b32, #102840);
  color: #cbd5f5;
}

body[data-theme="dark"] .top-bar a {
  color: #f8fafc;
}

body[data-theme="dark"] .card,
body[data-theme="dark"] .accordion-card,
body[data-theme="dark"] .department-card,
body[data-theme="dark"] .card.service-card {
  background: rgba(13, 23, 42, 0.9);
  border-color: rgba(99, 112, 141, 0.5);
  box-shadow: 0 18px 35px rgba(2, 6, 23, 0.65);
}

body[data-theme="dark"] .card-link {
  color: #8ec6ff;
}

body[data-theme="dark"] .form-group input,
body[data-theme="dark"] .form-group select,
body[data-theme="dark"] .form-group textarea {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--color-text);
}

body[data-theme="dark"] .form-group input::placeholder,
body[data-theme="dark"] .form-group textarea::placeholder {
  color: rgba(226, 232, 240, 0.6);
}

body[data-theme="dark"] .map-wrapper {
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.75);
}

body[data-theme="dark"] .btn-outline {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(148, 163, 184, 0.6);
  color: #e2e8f0;
}

body[data-theme="dark"] .btn-outline:hover {
  background: rgba(17, 24, 39, 0.95);
}

body[data-theme="dark"] .testimonial-card {
  background: rgba(15, 23, 42, 0.9);
  color: var(--color-text);
}

body[data-theme="dark"] .accordion-body {
  border-top-color: rgba(99, 112, 141, 0.4);
}

body[data-theme="dark"] .section-alt {
  background:
    radial-gradient(circle at 10% 0, rgba(59, 130, 246, 0.12), transparent 55%),
    radial-gradient(circle at 90% 0, rgba(16, 185, 129, 0.12), transparent 55%),
    #0f172a;
}

body[data-theme="dark"] .site-footer p,
body[data-theme="dark"] .site-footer a {
  color: #94a3b8;
}

body[data-theme="dark"] .site-footer a:hover {
  color: #e5e8f0;
}

body[data-theme="dark"] .footer-bottom {
  background: linear-gradient(90deg, #0f1b32, #102840);
  color: #cbd5f5;
}

body[data-theme="dark"] .footer-bottom p {
  color: #f8fafc;
}

body[data-theme="dark"] .admin-table th {
  background: rgba(30, 41, 59, 0.8);
}

body[data-theme="dark"] .admin-table tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.55);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 1000px) {
  .doctor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .doctor-photo {
    height: 300px;
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-content {
    grid-template-columns: minmax(0, 1.2fr);
    padding-bottom: 2.5rem;
  }

  .hero-image {
    order: -1;
  }

  .card-grid,
  .department-grid,
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .doctor-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .doctor-photo {
    height: 360px;
  }
}

@media (max-width: 800px) {
  .history-slide {
    flex: 0 0 78%;
    min-width: 260px;
  }

  .gallery-controls {
    top: 0.4rem;
    right: 0.4rem;
  }
}

@media (max-width: 768px) {
  .top-bar-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    padding: 0.75rem 1.5rem 1.1rem;
    background: #ffffff;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.open {
    max-height: 320px;
  }

  .nav-cta {
    margin-left: 0;
  }

  .hero-text h1 {
    font-size: 2.1rem;
  }

  .hero-stats {
    gap: 0.6rem;
  }

  .form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-grid,
  .department-grid,
  .news-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .doctor-grid {
    grid-template-columns: 1fr;
  }

  .doctor-photo {
    height: 700px;
  }
}

@media (max-width: 1024px) {
  .doctor-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
  }

  .doctor-photo {
    height: 340px;
  }
}

@media (max-width: 640px) {
  .doctor-grid {
    grid-template-columns: 1fr;
  }

  .doctor-photo {
    height: 220px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-image-card {
    border-radius: 24px;
  }

  .hero-circle {
    width: 180px;
    height: 180px;
  }

  .hero-doctor-illustration {
    width: 100px;
    height: 130px;
  }

  .doctor-photo {
    height: 320px;
  }
}
