/* Locally hosted Google Fonts */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('assets/fonts/nunito.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('assets/fonts/outfit.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html {
  scroll-padding-top: 80px;
  /* Increased from 100px for more breathing room */
  scroll-behavior: smooth;
}

:root {
  /* Color Palette - Reference Redesign */
  --primary-color: #44b3dd;
  /* Friendly Teal */
  --primary-dark: #084b83;
  /* Deep Blue for text/headings */
  /* original --secondary-color: #E6F4F6; */
  --secondary-color: #F0F9FF;
  /* Light teal background */
  --accent-color: #F4B942;
  /* Warm Orange/Yellow */
  --text-color: #084B83;
  /* Using dark blue as main text color */
  --text-light: #4A606B;
  /* Darkened for WCAG 2.1 AA contrast (formerly #5A7B8C) */
  --bg-color: #FFFFFF;
  --white: #ffffff;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 16px rgba(8, 75, 131, 0.1);
  /* Blue-tinted shadow */
  --radius: 16px;

  /* Spacing */
  --container-width: 1200px;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

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

.mobile-cta-container {
  display: none;
}

body {
  font-family: 'Nunito', sans-serif;
  /* Rounded, friendly font */
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-weight: 800;
  /* Bolder headings */
  line-height: 1.2;
  color: var(--primary-dark);
}

h1 {
  font-size: 2.6rem;
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: 1.8rem;
  margin-bottom: var(--spacing-lg);
}

h3 {
  font-size: 1.4rem;
  margin-bottom: var(--spacing-md);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

/* Utilities */
.container,
.container-wide {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  position: relative;
  z-index: 2;
}

.container-wide {
  max-width: 1400px;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-dark);
  color: var(--white);
}

.btn-primary:hover {
  background-color: #063a66;
  transform: translateY(-2px);
}

.btn-emergency {
  background-color: #d32f2f;
  /* Red for emergency */
  color: var(--white) !important;
}

.btn-emergency:hover {
  background-color: #b71c1c;
}

.btn:focus-visible,
a:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 4px;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent-color);
  color: var(--primary-dark);
  padding: 1rem;
  z-index: 10001;
  font-weight: 800;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Navigation --- */
nav {
  background: rgba(68, 179, 221, 0.95);
  /* Light Blue (Teal) */
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  padding: 1rem 0;
  width: 100%;
  z-index: 1000;
  transition: background 0.3s ease;
  /* Only animate background, not position/transform */

  /* Initially absolute at bottom of hero */
  position: absolute;
  bottom: 0;
  left: 0;
}

nav.sticky-nav {
  position: fixed;
  top: 0;
  bottom: auto;
  /* REMOVED animation: slideDown - ensures seamless lock to top */
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: translateY(0);
  }
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10rem;
  /* Massive gap for maximum distance between logo and Start link */
  max-width: 1500px;
}

/* 1. Logo (Left) */
.logo {
  flex: 0 0 auto;
  font-size: 1.1rem;
  /* Smaller font */
  line-height: 1.2;
  /* Tighter line height for two rows */
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  /* Allow wrapping for two rows */
}

.logo-img {
  height: 45px;
  /* Adjust size as needed */
  width: auto;
  filter: invert(1);
  mix-blend-mode: screen;
  /* Make black lines white and hide background */
  display: block;
}

/* 2. Nav Links (Center, natural width) */
.nav-links {
  flex: 0 0 auto;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}

/* 3. Lang Selector (Right, takes available space) */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 5rem;
  flex: 1;
  justify-content: flex-end;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 1rem;
  transition: color 0.3s;
}

.nav-links a.btn {
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  /* Uniform height for all nav buttons */
  padding: 0 1.5rem;
  /* Consistent padding */
}

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

/* Custom Language Selector */
.custom-lang-selector {
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  font-family: 'Outfit', sans-serif;
  z-index: 1100;
}

.custom-lang-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  min-width: 140px;
  justify-content: space-between;
}

.custom-lang-selected:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--white);
}

.custom-lang-selected .lang-text {
  flex: 1;
}

.custom-lang-selected .arrow {
  font-size: 0.8rem;
  opacity: 0.8;
}

.custom-lang-options {
  position: absolute;
  bottom: calc(100% + 8px);
  /* Default to upwards for bottom navbar */
  top: auto;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
  display: none;
  z-index: 1200;
  min-width: 160px;
  padding: 8px;
  border: 1px solid rgba(8, 75, 131, 0.1);
  overflow: hidden;
  animation: fadeInUp 0.2s ease-out;
}

nav.sticky-nav .custom-lang-options,
#subpage-header nav .custom-lang-options {
  top: calc(100% + 8px);
  /* Opens downwards when sticky */
  bottom: auto;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-lang-options.show {
  display: block;
}

.custom-lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--primary-dark);
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.custom-lang-option:hover {
  background: var(--secondary-color);
  color: var(--primary-color);
}

.fi {
  width: 20px !important;
  height: 15px !important;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* --- Hero Section --- */
header#hero {
  position: relative;
  height: 100vh;
  /* Fullscreen only for Home Hero */
  width: 100%;
  overflow: hidden;
  display: flex;
  /* Centering only for Hero */
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  background-color: var(--primary-dark);
}

/* Default Header for Subpages */
header {
  width: 100%;
  background-color: var(--primary-color);
}

#subpage-header {
  height: 80px;
  /* Standard height for the header bar */
  display: flex;
  align-items: center;
}

#subpage-header nav {
  position: fixed;
  top: 0;
  bottom: auto;
  /* Prevent stretching to full screen from base nav rule */
  background-color: var(--primary-color);
}

/* REDUNDANT: Removed to avoid double spacing since header already has height */
/* body:not(:has(#hero)) header + * { margin-top: 80px; } */

.subpage-content {
  padding: 4rem 2rem;
  max-width: 900px !important;
  margin: 0 auto;
}

/* Hero Slider */
.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: fadeLoop 24s infinite;
  /* 24s for 4 slides (6s each) */
}

@media (max-width: 768px) {
  .slide {
    background-position: center top;
    /* Better for showing people's faces on narrow screens */
  }
}

.slide:nth-child(1) {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('assets/images/hero_exam.webp');
  animation-delay: 0s;
}

.slide:nth-child(2) {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('assets/images/hero_mfa_oezguel.webp');
  animation-delay: 6s;
}

.slide:nth-child(3) {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('assets/images/hero_reception.webp');
  animation-delay: 12s;
}

.slide:nth-child(4) {
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), url('assets/images/hero_dino.webp');
  animation-delay: 18s;
}

@keyframes fadeLoop {
  0% {
    opacity: 0;
  }

  4% {
    opacity: 1;
  }

  25% {
    opacity: 1;
  }

  30% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}


.hero-content {
  position: relative;
  z-index: 1;
  /* Above slider */
  max-width: 800px;
  padding: 2rem;
  /* Move content up slightly to account for bottom nav */
  margin-bottom: 80px;
}

.hero-content h1 {
  font-size: 3rem;
  /* Larger */
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: 1.4rem;
  margin-bottom: 2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--primary-dark);
  padding: 0.8rem 2rem;
  /* Big CTA */
  border-radius: 50px;
  text-decoration: none;
  font-weight: 800;
  transition: transform 0.2s, background-color 0.2s;
  font-size: 1.1rem;
  border: none;
  display: inline-block;
}

.btn-accent:hover {
  transform: scale(1.05);
  background-color: #e0a838;
}

/* Wave Decoration */
.wave-container {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-container svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
  fill: var(--white);
}



.logo {
  font-size: 1.1rem;
  line-height: 1.2;
  font-weight: 900;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-links a:hover {
  opacity: 0.9;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 5rem 0 8rem 0;
  /* Extra bottom padding for wave */
  background: var(--primary-color);
  color: var(--white);
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.hero-content {
  flex: 1;
}

.hero-content h1 {
  font-size: 3.5rem;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.hero-content p {
  font-size: 1.35rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  font-weight: 600;
}

.hero-image {
  flex: 1.2;
  display: flex;
  justify-content: center;
}

.hero-image img {
  border-radius: 50% 50% 50% 50% / 30% 30% 70% 70%;
  /* Blobby organic shape */
  border: 4px solid var(--white);
  box-shadow: var(--shadow-md);
  max-width: 90%;
}

/* Services Section */
.services {
  padding: 3.5rem 0 5rem 0;
  text-align: center;
  background-color: var(--white);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.card {
  background: var(--white);
  padding: 3rem 2rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-top: 5px solid var(--primary-color);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-8px);
  border-top-color: var(--accent-color);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

/* CTA Section */
.cta-section {
  background-color: var(--secondary-color);
  padding: 4rem 0;
  text-align: center;
  margin: 0 0 4rem 0;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: "";
  position: absolute;
  top: -50px;
  left: -50px;
  width: 200px;
  height: 200px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.1;
}

.cta-section h2 {
  color: var(--primary-dark);
}

/* Footer */
footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 4rem 0;
  font-size: 0.95rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* Top align for map and text */
  flex-wrap: wrap;
  /* Wrap on mobile */
  gap: 2rem;
}

.footer-content {
  flex: 1;
  min-width: 300px;
}

.footer-map {
  flex: 0 0 400px;
  /* Fixed width for map */
  /* Removed fixed height so it grows to fit button */
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--primary-dark);
  /* Match footer background so gaps look seamless */
  padding-bottom: 0.5rem;
  /* Add some spacing for the button area */
}

.footer-map iframe {
  width: 100%;
  height: 250px;
  /* Fixed height for map area */
  border: 0;
  display: block;
  /* Remove inline gap */
}

@media (max-width: 768px) {
  .footer-map {
    flex: 1 0 100%;
    /* Full width on mobile */
    height: 300px;
  }
}

/* =========================================
   New Parallax & Split Layout Styles
   ========================================= */

/* Remove default container padding for split sections to allow full width/flush look */
.split-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.split-section {
  display: flex;
  flex-wrap: wrap;
  min-height: 60vh;
  /* Ensure they have height */
  overflow: hidden;
}

/* 40% Text Side */
.split-text {
  flex: 0 0 40%;
  background-color: var(--white);
  padding: 1.5rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 2;
}

/* 60% Image Side (Parallax) */
.split-image {
  flex: 0 0 60%;
  background-size: cover;
  background-color: var(--secondary-color);
  background-position: top center;
  background-repeat: no-repeat;
  /* background-attachment: fixed removed to fix scaling; JS parallax will handle movement */
  position: relative;
  min-height: 400px;
  /* Fallback height for mobile */
  transform: translateZ(0);
  /* Force hardware acceleration */
  will-change: background-position;
}

#team .split-image {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  aspect-ratio: 2000 / 1088;
  background-color: var(--white);
}

#team .split-text {
  padding-top: 1rem;
  padding-bottom: 5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#team.split-section {
  min-height: auto;
  align-items: stretch;
}

/* Alternating Layout */
.split-section.alt {
  flex-direction: row-reverse;
}

/* Balanced Split (50/50) - Only for Desktop */
@media (min-width: 901px) {

  .split-section.balanced .split-text,
  .split-section.balanced .split-image {
    flex: 0 0 50%;
  }

  .split-section.balanced .split-text {
    padding: 3.5rem 6rem 4rem;
  }
}

/* Extra space after headline for the first two sections (Philosophy & About Practice) as requested */
#philosophy .split-text h2,
#about .split-text h2 {
  margin-bottom: 2.5rem;
}

/* Background Utility */
.split-section.no-bg .split-image,
.split-section.no-bg .split-content {
  background-color: var(--white) !important;
}

.split-section.bg-secondary,
.split-section.bg-secondary .split-text,
.split-section.bg-secondary .split-image,
.split-section.bg-secondary .split-content {
  background-color: var(--secondary-color) !important;
}

/* Mobile Responsiveness for Split */
@media (max-width: 900px) {

  .split-section,
  .split-section.alt {
    flex-direction: column;
  }

  .split-text {
    flex: 1 0 auto;
    width: 100%;
    padding: 2.5rem 1.5rem 3rem;
    justify-content: flex-start;
  }

  #team .split-text {
    padding-top: 1rem;
  }

  .split-image {
    flex: 1 0 300px;
    width: 100%;
    min-height: 300px;
    background-attachment: scroll;
    /* Disable parallax on mobile for performance */
  }
}

/* 60% Content Side (Non-Image, e.g. Services Grid) */
.split-content {
  flex: 0 0 60%;
  background-color: var(--secondary-color);
  padding: 3.5rem 2rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .split-content {
    flex: 1 0 auto;
    width: 100%;
    padding: 2.5rem 1.5rem 3rem;
    justify-content: flex-start;
  }
}

/* --- Medical Services 3D Flip Grid --- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4x4 for 16 items */
  gap: 1rem;
  /* Tighter gap for the 4x4 layout */
}



@media (max-width: 900px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
    /* 2 columns to reduce vertical scrolling */
    gap: 0.8rem;
  }

  .service-icon {
    width: 3.5rem;
    height: 3.5rem;
    padding: 0.4rem;
  }

  .service-card-front h3 {
    font-size: 0.9rem;
  }

  .service-item {
    aspect-ratio: auto;
    min-height: 170px;
  }

  .service-card-back p {
    font-size: 0.7rem;
    line-height: 1.25;
    hyphens: auto !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  .service-card-back p span {
    hyphens: auto !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    white-space: normal !important;
  }
}

@media (max-width: 480px) {
  .service-grid {
    gap: 0.6rem;
  }

  .service-icon {
    width: 3rem;
    height: 3rem;
  }

  .service-card-front,
  .service-card-back {
    padding: 0.5rem;
    border-radius: 15px;
  }

  .service-item {
    min-height: 160px;
  }

  .service-card-back p {
    font-size: 0.65rem;
  }
}

.service-item {
  background: transparent;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  perspective: 1000px;
}

.service-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.service-item:not(.closing-card):hover .service-card-inner,
.service-item.is-flipped .service-card-inner {
  transform: rotateY(180deg);
}

.service-card-front,
.service-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--secondary-color);
}

/* Front Styling */
.service-card-front {
  background: var(--white);
  color: var(--primary-dark);
  z-index: 2;
  border-top: 8px solid var(--primary-color);
}

/* Specific Treatment for Closing Times Card to allow Auto-Height */
.closing-card .service-card-inner {
  display: grid !important;
  height: auto !important;
}

.closing-card .service-card-front,
.closing-card .service-card-back {
  position: relative !important;
  grid-area: 1 / 1 !important;
  height: auto !important;
  width: 100% !important;
}

.service-icon {
  font-size: 2.1rem;
  width: 4.8rem;
  height: 4.8rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary-color);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  padding: 0.5rem;
  /* Add padding for SVGs */
}

.service-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  transition: transform 0.3s ease;
}

.service-item:hover .service-icon svg {
  transform: scale(1.1);
}

.service-card-front h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  color: var(--primary-dark);
  line-height: 1.2;
  hyphens: none;
  overflow-wrap: normal;
  word-break: keep-all;
}

/* Back Styling */
.service-card-back {
  background: var(--primary-dark);
  color: var(--white);
  transform: rotateY(180deg);
}

.service-card-back p {
  font-size: 0.85rem;
  line-height: 1.4;
  font-weight: 400;
  margin: 0;
  text-align: center;
  word-break: keep-all;
  hyphens: none;
  overflow-wrap: normal;
}



/* Team Member Styles */
.team-member {
  margin-bottom: 2.5rem;
  background: var(--white);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(8, 75, 131, 0.04);
  border: 1px solid var(--secondary-color);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.team-member:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(8, 75, 131, 0.08);
}

.team-header {
  display: flex;
  align-items: flex-start;
  /* Changed from center to ensure names start at same height */
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--secondary-color);
}

.team-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--primary-color);
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.placeholder-avatar {
  background-color: var(--secondary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-dark);
}

.placeholder-avatar svg {
  width: 50%;
  height: 50%;
}

.team-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin: 0.3rem 0 0 0;
  font-weight: 500;
}

.team-details {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.team-detail-group h4 {
  font-size: 0.8rem;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem 0;
  font-weight: 800;
}

.team-info-text {
  font-size: 0.9rem;
  color: var(--primary-dark);
  line-height: 1.6;
  margin: 0;
}

.team-member.simple {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-member.simple .team-avatar {
  width: 80px;
  height: 80px;
  border-color: var(--accent-color);
  margin-bottom: 0.8rem;
}

.team-member.simple h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary-dark);
}

/* --- Doctor Flip Cards --- */
.doctors-section {
  padding: 3.5rem 0 3rem;
  background-color: var(--white);
}

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

@media (max-width: 900px) {
  .doctor-card-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

.doctor-card {
  perspective: 1500px;
  height: 550px;
  cursor: pointer;
}

.doctor-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.doctor-card:hover .doctor-card-inner,
.doctor-card.is-flipped .doctor-card-inner {
  transform: rotateY(180deg);
}

.doctor-card-front,
.doctor-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--secondary-color);
}

.doctor-card-front {
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.doctor-photo {
  height: 75%;
  width: 100%;
  background-size: cover;
  background-position: center top;
}

.doctor-info-front {
  height: 25%;
  padding: 1.5rem 1rem;
  /* Adjust padding for better look when aligned to top */
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  /* Changed from center to ensure names are at the same height */
  background: var(--white);
}

.doctor-info-front h3 {
  margin: 0;
  font-size: 1.2rem;
  overflow-wrap: break-word;
}

.doctor-info-front p {
  margin: 0.2rem 0 0 0;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 600;
}

.doctor-card-back {
  background: var(--primary-dark);
  color: var(--white);
  transform: rotateY(180deg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.doctor-card-back h3 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  border-bottom: 2px solid rgba(244, 185, 66, 0.3);
  padding-bottom: 0.5rem;
}

.doctor-card-back p {
  font-size: 0.9rem;
  line-height: 1.6;
}

/* --- Contact & Appointment Cards --- */
.contact-card {
  border-radius: 20px;
  background-color: var(--white);
  border: 2px solid var(--secondary-color);
  border-top: 8px solid var(--primary-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  flex: 1 1 280px;
  min-width: 280px;
  min-height: auto;
}

.hours-container {
  padding: 0 40px;
}

.closing-card {
  flex: 1 1 280px;
  min-width: 280px;
  min-height: auto;
}

/* Width adjustments: +15% for first two, -10% for others */
.hours-container>div>div:nth-child(1),
.hours-container>div>div:nth-child(2) {
  flex: 1.4 1 240px;
}

.hours-container>div>div:nth-child(3),
.hours-container>div>div:nth-child(4),
.hours-container>div>div:nth-child(5) {
  flex: 0.8 1 220px;
}

.closing-card .service-card-front {
  border-top: 8px solid var(--primary-color) !important;
}

/* 2-2-1 Layout for Tablet / Landscape */
@media (max-width: 1350px) and (min-width: 901px) {
  .hours-container>div>div {
    flex: 1 1 48% !important;
  }

  .hours-container>div>div:nth-child(5) {
    flex: 1 1 100% !important;
  }
}

@media (max-width: 900px) {
  #appointments .split-text {
    padding-left: 0;
    padding-right: 0;
  }

  /* Keep standalone text indented but allow background boxes/buttons to go full-width */
  #appointments .split-text>h2,
  #appointments .appointment-options>h3,
  #appointments .appointment-options>div>p:not(.contact-card p),
  #appointments h3[data-i18n="app_note_title"],
  #appointments ul {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hours-container {
    padding: 0;
  }

  .contact-card,
  .closing-card,
  .closing-card .service-card-front,
  .closing-card .service-card-back {
    border-radius: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 250px !important;
    /* Ensure consistent height where possible */
    margin-bottom: 1.5rem !important;
    /* Consistent vertical spacing */
  }

  .closing-card {
    min-height: 250px !important;
  }

  #appointments .appointment-options .btn {
    border-radius: 0 !important;
  }

  /* Specific handling for row gap in hours section on mobile */
  .hours-container>div {
    gap: 0 !important;
  }

  .doctor-info-front h3 {
    font-size: 1.05rem;
  }
}

@media (max-width: 480px) {
  .doctor-info-front h3 {
    font-size: 0.95rem;
  }
}

/* MFA Grid - 2x2 Layout */
.team-mfa-grid-full {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

@media (max-width: 1200px) {
  .team-mfa-grid-full {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

/* Specific to MFA cards in the grid to ensure they align well */
.team-mfa-grid-full .team-member.simple {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  border: 1px solid var(--secondary-color);
  transition: transform 0.3s ease, background 0.3s ease;
  margin-bottom: 0;
}

.team-mfa-grid-full .team-member.simple:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.9);
}

/* Maintain Team Section split on smaller screens */
@media (max-width: 900px) and (min-width: 601px) {
  #team.split-section {
    flex-direction: row;
    min-height: auto;
  }

  #team .split-text {
    flex: 0 0 50%;
    padding: 1rem 2rem 2rem 2rem;
  }

  #team .split-image {
    flex: 0 0 50%;
    min-height: 400px;
    background-attachment: scroll;
  }

  .team-mfa-grid-full {
    grid-template-columns: 1fr;
  }
}

/* --- Emergency (Notfall) Section --- */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 1600px) {
  .emergency-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

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

.emergency-card {
  background: #fffafa;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-top: 8px solid #ff4d4d;
  /* Red for emergency */
  text-align: center;
  transition: transform 0.3s ease;
}

.emergency-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.emergency-card h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.emergency-card .phone {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
  color: #ff4d4d;
  margin-top: 0.5rem;
}

.emergency-info-box {
  background: var(--secondary-color);
  padding: 2.5rem;
  border-radius: var(--radius);
  margin-top: 3rem;
  border-left: 8px solid var(--primary-color);
}

.emergency-info-box h3 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

.emergency-hospital {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.emergency-hospital strong {
  display: block;
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.emergency-hospital p {
  margin-bottom: 0.5rem;
}

.emergency-note {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-top: 1rem;
}

.emergency-pharmacy-btn {
  margin-top: 1.5rem;
}

/* --- News Popup Styles --- */
.news-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.news-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.news-box {
  background: var(--white);
  padding: 2.5rem;
  border-radius: 16px;
  max-width: 550px;
  width: 90%;
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
  border-top: 5px solid var(--accent-color);
}

.news-overlay.visible .news-box {
  transform: translateY(0) scale(1);
}

.news-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.news-close:hover {
  color: var(--primary-dark);
}

.news-title {
  color: var(--primary-dark);
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.news-content {
  line-height: 1.6;
  white-space: pre-wrap;
}

.news-content a {
  color: var(--primary-dark);
  text-decoration: underline;
  font-weight: 800;
}

.news-content a:hover {
  color: var(--primary-color);
}

@media (max-width: 600px) {
  .news-box {
    padding: 1.5rem;
    width: 95%;
  }

  .news-title {
    font-size: 1.3rem;
  }

  .news-content {
    font-size: 0.95rem;
  }
}

.news-content {
  color: var(--text-color);
  line-height: 1.6;
  font-size: 1.05rem;
}

/* --- AI Attribution Badge --- */
.ai-badge {
  position: absolute;
  bottom: 0.8rem;
  right: 1rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.3s ease;
}

[dir="rtl"] .ai-badge {
  right: auto;
  left: 1rem;
}

.ai-badge.badge-left {
  right: auto;
  left: 1rem;
}

.ai-badge.badge-right {
  left: auto;
  right: 1rem;
}

.hero-slider .ai-badge {
  bottom: 7.5rem;
  /* Moved further up to clear the navbar */
}

.split-image {
  position: relative;
}

/* --- Mobile Navigation Toggle --- */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.8rem;
  z-index: 1001;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.hamburger {
  display: block;
  position: relative;
  width: 24px;
  height: 2px;
  background-color: var(--white);
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  transition: all 0.3s ease;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

/* Open State Animation */
.nav-toggle[aria-expanded="true"] .hamburger {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Media Queries for Navigation */
@media (max-width: 900px) {
  html {
    scroll-padding-top: 60px;
  }

  nav {
    position: fixed;
    top: 0;
    bottom: auto;
    padding: 0.5rem 0;
    background: var(--primary-color);
  }

  .logo-img {
    height: 35px;
  }

  .logo {
    font-size: 0.9rem;
  }

  .nav-toggle {
    display: flex;
    padding: 0.5rem;
  }

  nav .container {
    gap: 1rem;
    padding: 0 1rem;
    /* Reset massive desktop gap */
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--primary-color);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem;
    padding: 5rem 2rem 2rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    /* Ensure it's above everything */
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    align-items: center;
  }

  .nav-links a {
    font-size: 1.3rem;
    color: var(--white) !important;
  }

  .nav-links a.btn {
    min-width: 250px;
  }

  .lang-selector {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .custom-lang-selected {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    min-width: 160px;
    padding: 10px 20px;
  }

  .custom-lang-options {
    right: 50%;
    transform: translateX(50%);
    bottom: calc(100% + 10px);
    top: auto;
    width: 180px;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translate(50%, 10px);
    }

    to {
      opacity: 1;
      transform: translate(50%, 0);
    }
  }

  .custom-lang-options.show {
    animation: fadeInUp 0.2s ease-out;
  }
}

/* Accessibility: Focus Trap Support and Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  backdrop-filter: blur(3px);
}

.nav-overlay.active {
  display: block;
}

/* Responsive Headings */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  .hero-title {
    display: none;
  }

  .hero-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 3rem;
  }

  /* Hide original button wrapper on mobile */
  .hero-content div {
    display: none;
  }

  .hero-content p {
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }

  .hero-slider .ai-badge {
    bottom: 1.5rem !important;
  }

  .mobile-cta-container {
    display: block;
    text-align: center;
    padding: 2rem 1rem;
    background: var(--white);
    position: relative;
    z-index: 10;
    margin-top: -1px;
    /* Overlap slightly with wave if needed, or just flush */
  }

  .mobile-cta-container .btn {
    width: 100%;
    max-width: 300px;
  }

  /* Force Hero Slider to take full width and height without any clipping parents */
  header#hero {
    height: 50vh;
    /* Reduced height for better visibility of content below */
    display: block;
    /* Disable flex centering to use our custom flex-end logic in hero-content */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
  }
}

/* --- High-Priority Mobile/iPhone Overrides --- */
@media screen and (max-width: 600px) {

  /* Hero Slider Fix for iPhone */
  .slide {
    background-position: center 25% !important;
    /* Forces focus on faces/top part of image */
    background-size: cover !important;
  }

  /* Compact Service Grid for Mobile */
  .service-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .service-item {
    aspect-ratio: auto !important;
    min-height: 180px !important;
    /* Ensure enough height for flip text */
  }

  .closing-card {
    min-height: 250px !important;
    margin-bottom: 1.5rem !important;
  }

  .contact-card {
    margin-bottom: 1.5rem !important;
    min-height: 250px !important;
  }

  .service-icon {
    width: 3.5rem !important;
    height: 3.5rem !important;
    margin-bottom: 6px !important;
  }

  .service-card-front h3 {
    font-size: 0.92rem !important;
    padding: 0 4px !important;
  }

  .service-card-back p {
    font-size: 0.69rem !important;
    line-height: 1.25 !important;
    padding: 2px !important;
    hyphens: auto !important;
  }
}

/* Specific Target for smaller iPhones */
@media screen and (max-width: 380px) {
  .service-grid {
    gap: 5px !important;
  }

  .service-item {
    min-height: 160px !important;
  }

  .service-card-back p {
    font-size: 0.6rem !important;
  }
}