/* ==========================================================================
   Krishna Hospital — Departments & Services
   Extends the existing brand system. Only new selectors used by the
   Departments module live here — nothing global is overridden.
   ========================================================================== */

:root {
  /* Brand (sampled from the existing site) */
  --kh-purple-900: #241357;
  --kh-purple-700: #33206f;
  --kh-purple-600: #3d2a85;
  --kh-purple-100: #efeaf9;
  --kh-green-600:  #1fa15e;
  --kh-green-500:  #2fc074;
  --kh-green-100:  #e6f7ee;
  --kh-ink:        #1c1830;
  --kh-ink-soft:   #5c5772;
  --kh-bg:         #ffffff;
  --kh-bg-tint:    #faf9fd;
  --kh-line:       #e8e5f1;

  --kh-radius-lg: 20px;
  --kh-radius-md: 14px;
  --kh-radius-sm: 10px;

  --kh-shadow-card: 0 1px 2px rgba(36, 19, 87, 0.06), 0 12px 28px -14px rgba(36, 19, 87, 0.22);
  --kh-shadow-card-hover: 0 8px 16px rgba(36, 19, 87, 0.08), 0 28px 48px -18px rgba(36, 19, 87, 0.28);

  --kh-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 1. Navbar → Departments dropdown ---------- */

.kh-dropdown { position: relative; }

.kh-dropdown__panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, 8px);
  width: 320px;
  background: var(--kh-bg);
  border-radius: var(--kh-radius-md);
  border: 1px solid var(--kh-line);
  box-shadow: var(--kh-shadow-card-hover);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s var(--kh-ease), transform 0.18s var(--kh-ease), visibility 0.18s;
  z-index: 60;
}

.kh-dropdown:hover .kh-dropdown__panel,
.kh-dropdown:focus-within .kh-dropdown__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.kh-dropdown__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--kh-radius-sm);
  color: var(--kh-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.kh-dropdown__item:hover {
  background: var(--kh-purple-100);
  color: var(--kh-purple-700);
  padding-left: 18px;
}

.kh-dropdown__icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  background: var(--kh-green-100);
  color: var(--kh-green-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kh-dropdown__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.kh-dropdown__meta small {
  font-weight: 500;
  color: var(--kh-ink-soft);
  font-size: 0.78rem;
}

/* ---------- 2. Category page ---------- */

.kh-cat-hero {
  background: var(--kh-purple-900);
  color: #fff;
  padding: 64px 24px 56px;
}

.kh-cat-hero__inner { max-width: 1200px; margin: 0 auto; }

.kh-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 18px;
}

.kh-breadcrumb a { color: rgba(255, 255, 255, 0.65); text-decoration: none; }
.kh-breadcrumb a:hover { color: #fff; }
.kh-breadcrumb span[aria-current] { color: #fff; }

.kh-cat-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin: 0 0 12px;
  font-weight: 700;
  color: #ffffff;
}

.kh-cat-hero p {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

.kh-cat-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 1024px) {
  .kh-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
}

@media (max-width: 640px) {
  .kh-cat-grid { grid-template-columns: 1fr; gap: 18px; padding: 40px 20px 64px; }
  .kh-cat-hero { padding: 48px 20px 44px; }
}

/* ---------- 3. Department card ---------- */

.kh-dept-card {
  display: flex;
  flex-direction: column;
  background: var(--kh-bg);
  border: 1px solid var(--kh-line);
  border-radius: var(--kh-radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--kh-ink);
  box-shadow: var(--kh-shadow-card);
  transition: transform 0.3s var(--kh-ease), box-shadow 0.3s var(--kh-ease);
}

.kh-dept-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--kh-shadow-card-hover);
}

.kh-dept-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--kh-purple-100);
}

.kh-dept-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--kh-ease);
}

.kh-dept-card:hover .kh-dept-card__media img { transform: scale(1.08); }

.kh-dept-card__tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--kh-purple-700);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.kh-dept-card__body {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.kh-dept-card__body h3 {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 700;
}

.kh-dept-card__body p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--kh-ink-soft);
  margin: 0;
  flex: 1;
}

.kh-dept-card__cta {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--kh-green-600);
}

.kh-dept-card__cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--kh-ease);
}

.kh-dept-card:hover .kh-dept-card__cta svg { transform: translateX(4px); }

/* ---------- 4. Department detail page ---------- */

.kh-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.kh-hero__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.kh-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(28, 15, 66, 0.92) 0%, rgba(28, 15, 66, 0.55) 55%, rgba(28, 15, 66, 0.15) 100%);
}

.kh-hero__content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 24px 40px;
  width: 100%;
}

.kh-hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3.25rem);
  margin: 0 0 14px;
  font-weight: 700;
  color: #ffffff;
}

.kh-hero p {
  max-width: 620px;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 26px;
}

.kh-hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.kh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s var(--kh-ease), box-shadow 0.2s var(--kh-ease), background 0.2s ease;
}

.kh-btn:active { transform: translateY(1px); }

.kh-btn--primary {
  background: var(--kh-green-500);
  color: #0e2116;
}
.kh-btn--primary:hover { box-shadow: 0 10px 24px -8px rgba(47, 192, 116, 0.65); }

.kh-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}
.kh-btn--ghost:hover { background: rgba(255, 255, 255, 0.16); }

.kh-btn--dark {
  background: var(--kh-purple-900);
  color: #fff;
}
.kh-btn--dark:hover { background: var(--kh-purple-700); }

/* About (two-column) */

/* Standalone full-width section wrappers */
.kh-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
}

/* Full-bleed tinted band — the inner .kh-section provides the max-width+padding */
.kh-section--tint {
  background: var(--kh-bg-tint);
}

/* About section: plain white, no tint */
.kh-section--about {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 24px;
}

.kh-about {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
}

.kh-about__media img {
  width: 100%;
  border-radius: var(--kh-radius-lg);
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.kh-about__text h2 {
  font-size: 1.9rem;
  margin: 0 0 16px;
  font-weight: 700;
  color: var(--kh-purple-900);
}

.kh-about__text p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--kh-ink-soft);
}

/* Treatments grid */

.kh-section h2.kh-section__title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--kh-purple-900);
  margin: 0 0 24px;
}

.kh-treat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kh-treat-card {
  padding: 20px 18px;
  border-radius: var(--kh-radius-md);
  background: #fff;
  border: 1px solid var(--kh-line);
  transition: transform 0.25s var(--kh-ease), box-shadow 0.25s var(--kh-ease), border-color 0.25s ease;
}

.kh-treat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--kh-shadow-card);
  border-color: transparent;
}

.kh-treat-card__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--kh-green-100);
  color: var(--kh-green-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.kh-treat-card h3 { font-size: 0.95rem; margin: 0; font-weight: 700; color: var(--kh-ink); }

/* Why choose us */

.kh-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.kh-why-card {
  text-align: left;
  padding: 4px 0;
}

.kh-why-card__num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--kh-green-600);
  margin-bottom: 10px;
  display: block;
}

.kh-why-card h3 { font-size: 1.05rem; margin: 0 0 6px; font-weight: 700; }
.kh-why-card p { margin: 0; font-size: 0.92rem; color: var(--kh-ink-soft); line-height: 1.55; }

/* Doctors */

.kh-doc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.kh-doc-card {
  border: 1px solid var(--kh-line);
  border-radius: var(--kh-radius-lg);
  overflow: hidden;
  background: #fff;
  transition: transform 0.25s var(--kh-ease), box-shadow 0.25s var(--kh-ease);
}

.kh-doc-card:hover { transform: translateY(-4px); box-shadow: var(--kh-shadow-card); }

.kh-doc-card__photo { aspect-ratio: 3 / 4; overflow: hidden; background: var(--kh-purple-100); }
.kh-doc-card__photo img { width: 100%; height: 100%; object-fit: cover; }

.kh-doc-card__body { padding: 16px 18px 20px; }
.kh-doc-card__body h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 700; }
.kh-doc-card__body span { display: block; font-size: 0.85rem; color: var(--kh-ink-soft); margin-bottom: 10px; }
.kh-doc-card__body a { font-size: 0.85rem; font-weight: 700; color: var(--kh-green-600); text-decoration: none; }

.kh-doc-empty {
  border: 1px dashed var(--kh-line);
  border-radius: var(--kh-radius-lg);
  padding: 40px;
  text-align: center;
  color: var(--kh-ink-soft);
  font-size: 0.95rem;
}

/* Related departments */

.kh-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Appointment CTA band */

.kh-section--cta {
  padding-top: 0;
  padding-bottom: 44px;
}

.kh-cta-band {
  background: var(--kh-purple-900);
  color: #fff;
  border-radius: var(--kh-radius-lg);
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.kh-cta-band__content {
  flex: 1 1 auto;
  min-width: 0;
}

.kh-cta-band h2,
.kh-cta-band__content h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  margin: 0 0 3px;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: -0.01em;
}

.kh-cta-band p,
.kh-cta-band__content p {
  font-size: 0.88rem;
  line-height: 1.4;
  margin: 0;
  color: rgba(255, 255, 255, 0.8) !important;
}

.kh-cta-band__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.kh-cta-band__actions .kh-btn {
  padding: 11px 22px;
  font-size: 0.88rem;
  white-space: nowrap;
}

/* ---------- Responsive: detail page ---------- */

@media (max-width: 1024px) {
  .kh-about { grid-template-columns: 1fr; gap: 28px; }
  .kh-about__media img { aspect-ratio: 16 / 9; }
  .kh-treat-grid { grid-template-columns: repeat(2, 1fr); }
  .kh-why-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .kh-doc-grid { grid-template-columns: repeat(2, 1fr); }
  .kh-related-grid { grid-template-columns: repeat(2, 1fr); }
  .kh-cta-band { padding: 18px 24px; gap: 16px; }
  .kh-cta-band h2 { font-size: 1.15rem; }
  .kh-cta-band p { font-size: 0.84rem; }
  .kh-cta-band__actions .kh-btn { padding: 10px 18px; font-size: 0.84rem; }
}

@media (max-width: 640px) {
  .kh-section { padding: 36px 20px; }
  .kh-section--about { padding: 36px 20px; }
  .kh-section--cta { padding: 0 20px 32px; }
  .kh-treat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kh-treat-card { padding: 16px 14px; }
  .kh-why-grid { grid-template-columns: 1fr; gap: 18px; }
  .kh-doc-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .kh-related-grid { grid-template-columns: 1fr; }
  .kh-cta-band { flex-direction: column; align-items: stretch; padding: 20px 18px; gap: 14px; }
  .kh-cta-band__content { text-align: left; }
  .kh-cta-band h2 { font-size: 1.15rem; }
  .kh-cta-band p { font-size: 0.84rem; }
  .kh-cta-band__actions { display: flex; flex-direction: column; width: 100%; gap: 10px; }
  .kh-cta-band__actions .kh-btn { width: 100%; justify-content: center; padding: 11px 16px; font-size: 0.88rem; }
  .kh-hero { min-height: 320px; }
  .kh-hero__content { padding: 24px 20px 28px; }
  .kh-btn { padding: 12px 20px; font-size: 0.9rem; }
}

/* ---------- Motion: respect user preference ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* GSAP entrance helper classes (JS toggles these via ScrollTrigger) */
.kh-reveal { opacity: 0; }
