/* =========================================
   DESIGN SYSTEM - TOKENS
   ========================================= */
:root {
  /* Color Palette */
  --color-bg-base: #F6F0E8;
  --color-bg-tint: #EFE8DD;
  --color-primary: #8F9D72;
  --color-secondary: #768457;
  --color-muted-olive: #7A7F6E;
  --color-text-main: #2E2E2E;
  --color-text-muted: #60635F;
  --color-surface: #FFFFFF;
  --color-border: #E1DBD2;

  /* Typography */
  --font-family-base: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-family-heading: "Domine", "Inter", serif;
  /* Assuming a serif for headings matches the 'Medical/Premium' vibe */
  --line-height-base: 1.6;
  --line-height-tight: 1.2;
  --line-height-loose: 1.8;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(46, 46, 46, 0.05), 0 4px 6px -2px rgba(46, 46, 46, 0.025);

  /* Transitions */
  --transition-base: all 0.2s ease-in-out;
}

/* =========================================
   RESET & BASE
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

body {
  font-family: var(--font-family-base);
  color: var(--color-text-main);
  background-color: var(--color-bg-base);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Textured Background Implementation */
  background-image:
    radial-gradient(at 10% 10%, rgba(239, 232, 221, 0.5) 0px, transparent 50%),
    radial-gradient(at 90% 0%, rgba(255, 255, 255, 0.4) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(143, 157, 114, 0.05) 0px, transparent 50%),
    linear-gradient(to bottom right, rgba(255, 255, 255, 0.2), transparent);
  background-attachment: fixed;
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* =========================================
   TYPOGRAPHY
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  color: var(--color-text-main);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

h1 {
  font-size: 3rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.25rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: var(--space-md);
  color: var(--color-text-main);
  max-width: 70ch;
}

small,
.text-sm {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-base);
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* =========================================
   LAYOUT
   ========================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.section {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.grid-doctors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
  gap: var(--space-lg);
}

/* =========================================
   HEADER
   ========================================= */
.site-header {
  background-color: var(--color-bg-base);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem 0;
}

.header-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.header-top a {
  font-family: var(--font-family-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-main);
  text-decoration: none;
}

.header-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-family-base);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-base);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-secondary);
  /* Using Darker Olive for CTA logic */
  color: var(--color-surface);
}

.btn-primary:hover {
  background-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background-color: var(--color-bg-tint);
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}

/* =========================================
   CARDS (DOCTORS)
   ========================================= */
.card-doctor {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
}

.card-doctor:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.card-image-wrap {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background-color: var(--color-bg-tint);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  filter: grayscale(10%);
}

.card-doctor:hover .card-image {
  transform: scale(1.05);
  filter: grayscale(0%);
}

.card-content {
  padding: var(--space-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.doctor-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: var(--space-xs);
}

.doctor-role {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
  display: block;
}

.doctor-specialties {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-md);
}

.pill {
  background-color: var(--color-bg-base);
  color: var(--color-secondary);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  border: 1px solid var(--color-border);
}

.doctor-bio {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Special Case: Dr. Vithal Lahane (Highlight) */
.card-doctor.highlight {
  border: 2px solid var(--color-primary);
  background-color: white;
  position: relative;
}

.card-doctor.highlight::before {
  content: "Chief Surgeon";
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--color-secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  z-index: 10;
}

/* =========================================
   TESTIMONIALS / QUOTES
   ========================================= */
.quote-block {
  background-color: var(--color-bg-tint);
  border-left: 4px solid var(--color-primary);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  position: relative;
}

.quote-text {
  font-family: var(--font-family-heading);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--color-text-main);
  margin-bottom: var(--space-sm);
}

.quote-author {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-secondary);
}

/* =========================================
   UTILITIES
   ========================================= */
.text-center {
  text-align: center;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-sm {
  margin-bottom: var(--space-sm) !important;
}

.mb-md {
  margin-bottom: var(--space-md) !important;
}

.mt-lg {
  margin-top: var(--space-lg) !important;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================
   ACCESSIBILITY HELPERS
   ========================================= */
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 4px;
}

/* ---------------------------
   Mobile Responsiveness Fix
---------------------------- */

@media (max-width: 768px) {

  body {
    overflow-x: hidden;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  header nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero {
    padding: 3rem 1rem;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  .hero p {
    font-size: 1rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .grid-doctors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .card-doctor .card-image {
    width: 100%;
    height: auto;
  }

  section {
    padding: 2.5rem 0;
  }

  iframe {
    max-width: 100%;
  }

  footer {
    text-align: center;
  }

  /* --- Mobile Header Specifics --- */
  .site-header .container {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .header-top {
    width: 100%;
    text-align: center;
    margin-bottom: 0.5rem;
  }

  .header-bottom {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .header-bottom .main-nav {
    justify-content: center;
    gap: 1rem;
    width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
    /* Prevent wrapping */
  }

  .header-bottom nav a {
    font-size: 0.9rem;
  }

  .header-actions {
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
  }
}

.map-embed {
  margin-top: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
}

/* =========================================
   BEFORE & AFTER SLIDER
   ========================================= */
.slider-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: var(--space-sm) 0;
  gap: var(--space-md);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.slider-container::-webkit-scrollbar {
  display: none;
}

/* --- Card --- */
.case-card {
  scroll-snap-align: start;
  flex: 0 0 88%;
  max-width: 360px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

.case-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

/* --- Comparison Slider --- */
.ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: col-resize;
  user-select: none;
  -webkit-user-select: none;
  background-color: var(--color-bg-tint);
  isolation: isolate;
}

.ba-img {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.ba-overlay {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(0 50% 0 0);
  z-index: 2;
  overflow: hidden;
}

.ba-overlay .ba-img {
  position: absolute !important;
  width: 100%;
  height: 100%;
}

/* --- Labels --- */
.ba-tag {
  position: absolute;
  bottom: 0.6rem;
  background-color: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  pointer-events: none;
  z-index: 4;
}

.ba-tag--before {
  left: 0.6rem;
  right: auto;
}

.ba-tag--after {
  right: 0.6rem;
  left: auto;
}

/* --- Handle --- */
.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  z-index: 3;
  pointer-events: none;
}

.ba-handle::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.ba-handle-grip {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-secondary);
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  cursor: col-resize;
}

/* arrows inside grip */
.ba-handle-grip::before,
.ba-handle-grip::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
}

.ba-handle-grip::before {
  left: 5px;
  border-width: 5px 5px 5px 0;
  border-color: transparent #fff transparent transparent;
  transform: translateY(-50%);
}

.ba-handle-grip::after {
  right: 5px;
  border-width: 5px 0 5px 5px;
  border-color: transparent transparent transparent #fff;
  transform: translateY(-50%);
}

/* --- Card Content --- */
.case-content {
  padding: var(--space-md);
}

.case-title {
  font-family: var(--font-family-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: var(--space-xs);
}

.case-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

/* --- Responsive --- */
@media (min-width: 600px) {
  .case-card {
    flex: 0 0 46%;
  }
}

@media (min-width: 992px) {
  .case-card {
    flex: 0 0 31%;
  }

  .slider-container {
    justify-content: center;
  }
}

/* --- Case Section Layout (New) --- */
.case-section-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.case-story-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.case-story {
  background-color: var(--color-surface);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.story-title {
  font-family: var(--font-family-heading);
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.story-body p {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--color-text-main);
}

.story-body p:last-child {
  margin-bottom: 0;
}

@media (min-width: 1024px) {
  .case-section-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
  }

  .case-card-col .case-card {
    flex: 1 1 auto;
    /* Allow full width in grid column */
    max-width: 100%;
    width: 100%;
  }
}

/* =========================================
   PROFILE PAGE
   ========================================= */
.profile-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .profile-layout-grid {
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
  }
}