/* ========================================
   OPTIMIZED GYNÄKOLOGIKUM CHUR STYLES
   Modern, Minimal, Clean Design
   ======================================== */

/* CSS Variables for consistency */
:root {
  --primary: #DF7684;
  --primary-light: #F1B6D1;
  --gray: #929191;
  --gray-dark: #666;
  --white: #ffffff;
  --bg-alt: #f9f9f9;

  --font-main: 'Hind Siliguri', sans-serif;
  --font-accent: 'Old Standard TT', serif;

  --spacing-xs: 10px;
  --spacing-sm: 20px;
  --spacing-md: 40px;
  --spacing-lg: 60px;
  --spacing-xl: 80px;

  --nav-height: 208px;
  --max-width: 1200px;

  --shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 220px;
}

body {
  font-family: var(--font-main);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--gray);
  overflow-x: hidden;
}

/* Typography */
h2, h3 {
  color: var(--gray);
}

h2.section-heading {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 2rem;
  text-align: center;
  margin-bottom: var(--spacing-md);
  color: var(--gray);
}

h3.signature {
  font-family: var(--font-accent);
  font-weight: 400;
  font-style: italic;
  font-size: 20px;
  color: var(--gray);
  margin: var(--spacing-md) 0 var(--spacing-sm) 0;
}

p {
  margin-bottom: var(--spacing-sm);
}

.signature {
  font-family: var(--font-accent);
  font-weight: 400;
  font-style: italic;
  font-size: 20px;
  color: var(--gray);
}

.welcome {
  font-weight: 400;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  text-decoration: underline;
}

.link-primary {
  color: var(--primary);
}

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

ul {
  margin-left: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

ul ul {
  margin-left: var(--spacing-md);
  margin-top: var(--spacing-xs);
}

li {
  margin-bottom: var(--spacing-xs);
}

/* Layout Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.content {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.center {
  text-align: center;
}

/* Navigation - Shrinking on Scroll */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--spacing-sm) var(--spacing-md);
  transition: padding 0.3s ease;
}

.nav-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  transition: margin 0.3s ease;
}

.logo-img {
  width: 252px;
  height: 96px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.practice-title {
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: all 0.3s ease;
}

.title-main {
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 24px;
  color: var(--gray);
  transition: font-size 0.3s ease;
}

.title-doctors {
  font-family: var(--font-main);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.4;
  color: var(--gray);
  opacity: 1;
  max-height: 100px;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
}

/* Scrolled / Shrunk Navigation State */
#main-nav.scrolled .nav-container {
  padding: 10px var(--spacing-md);
}

#main-nav.scrolled .nav-header {
  margin-bottom: 10px;
}

#main-nav.scrolled .logo-img {
  width: 180px;
  height: 68px;
}

#main-nav.scrolled .title-main {
  opacity: 0;
  max-height: 0;
  margin: 0;
}

#main-nav.scrolled .title-doctors {
  opacity: 0;
  max-height: 0;
  margin: 0;
}

#main-nav.scrolled .practice-title {
  display: none;
}

#main-nav.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 2px solid var(--gray);
  padding: 8px 10px;
  cursor: pointer;
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--gray);
  transition: var(--transition);
}

.nav-menu {
  display: flex;
  justify-content: center;
  gap: 0;
  list-style: none;
  margin: 0;
  flex-wrap: wrap;
}

.nav-menu li {
  margin: 0;
}

.nav-menu a {
  display: block;
  padding: 10px 20px;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 18px;
  color: var(--primary);
  background-color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--primary);
  background-color: rgba(255, 255, 255, 1);
  border-bottom-color: var(--primary);
}

/* Header Spacer */
#header {
  height: 220px;
}

/* Sections */
section {
  padding: var(--spacing-xl) 0;
}

section.alt-bg {
  background-color: var(--bg-alt);
}

/* Ensure sections have proper spacing from top for scroll anchors */
section[id] {
  scroll-margin-top: 240px;
}

@media (max-width: 992px) {
  section[id] {
    scroll-margin-top: 200px;
  }
}

@media (max-width: 768px) {
  section[id] {
    scroll-margin-top: 200px;
  }
}

@media (max-width: 480px) {
  section[id] {
    scroll-margin-top: 220px;
  }
}

/* Praxis Section - Two Column Layout */
.praxis-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
}

.praxis-text {
  text-align: left;
}

.praxis-image {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.praxis-image img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}

/* Team Grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.team-member {
  text-align: center;
}

.team-member img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: var(--spacing-sm);
}

.team-name {
  font-weight: 400;
  color: var(--gray-dark);
  margin-bottom: 5px;
}

.team-role {
  font-size: 14px;
  color: var(--gray);
}

.team-photo {
  max-width: 900px;
  margin: var(--spacing-lg) auto 0;
}

.team-photo img {
  width: 100%;
  border-radius: 4px;
}

/* CV Links - Slim Navigation Style */
.cv-links {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.cv-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 15px;
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
  background-color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  position: relative;
  border-bottom: 3px solid transparent;
  font-family: var(--font-main);
  font-weight: 400;
  font-size: 14px;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: fit-content;
}

.cv-link:hover {
  text-decoration: none;
  background-color: rgba(255, 255, 255, 1);
  border-bottom-color: var(--primary);
}

.cv-link.active {
  color: var(--primary);
  background-color: rgba(255, 255, 255, 1);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

.cv-link span {
  display: none;
}

.cv-link span:first-child {
  display: inline;
  font-size: 13px;
  font-weight: 300;
  color: var(--gray);
  margin-right: 5px;
}

.cv-link span:nth-child(2) {
  display: inline;
  font-size: 14px;
  font-weight: inherit;
  color: inherit;
}

.cv-link.active span:first-child {
  color: var(--primary);
}

/* CV Arrow - Down Arrow Indicator */
.cv-arrow {
  display: inline !important;
  margin-left: 8px;
  font-size: 12px;
  color: var(--gray);
  transition: var(--transition);
}

.cv-link:hover .cv-arrow {
  color: var(--primary);
  transform: translateY(2px);
}

.cv-link.active .cv-arrow {
  color: var(--primary);
  transform: rotate(180deg);
}

/* CV Details - Accordion/Collapsible */
.cv-detail {
  background-color: var(--bg-alt);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
  padding: 0;
}

.cv-detail.active {
  max-height: 5000px;
  opacity: 1;
  padding: var(--spacing-xl) 0;
}

.cv-heading {
  font-size: 20px;
  font-weight: 400;
  color: var(--gray);
  margin-bottom: var(--spacing-md);
}

/* CV Close Link - Clickable Heading to Collapse */
.cv-close-link {
  color: var(--gray);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  display: inline-block;
}

.cv-close-link:hover {
  color: var(--primary);
  text-decoration: none;
}

/* CV Close Arrow - Up Arrow Indicator */
.cv-close-arrow {
  display: inline-block;
  margin-left: 8px;
  font-size: 14px;
  color: var(--gray);
  transition: var(--transition);
}

.cv-close-link:hover .cv-close-arrow {
  color: var(--primary);
  transform: translateY(-2px);
}

.cv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-md);
}

.cv-table tr {
  border-bottom: 1px solid #e5e5e5;
}

.cv-table td {
  padding: var(--spacing-sm) var(--spacing-xs);
  vertical-align: top;
}

.cv-label {
  width: 25%;
  font-weight: 400;
  color: var(--gray-dark);
}

.cv-section {
  font-weight: 400;
  color: var(--gray-dark);
  border-top: 2px solid var(--primary);
  padding-top: var(--spacing-sm) !important;
}

/* Icon Wrapper */
.icon-wrapper {
  margin: var(--spacing-md) auto;
  text-align: center;
}

.icon-wrapper img {
  display: inline-block;
  border-radius: 4px;
  max-width: 300px;
}

/* Map */
.map-wrapper {
  margin-top: var(--spacing-md);
  border-radius: 4px;
  overflow: hidden;
}

/* Footer */
footer {
  position: relative;
  background-color: var(--primary);
  color: white;
  padding: var(--spacing-lg) 0 var(--spacing-md);
  text-align: center;
}

.scroll-top {
  background: none;
  border: 2px solid white;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  margin: 0 auto var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.scroll-top:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-3px);
}

.footer-content {
  text-align: center;
}

.footer-image-desktop {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 1;
}

.footer-image-mobile {
  display: none;
}

.footer-image img {
  width: 96px;
  height: auto;
  border-radius: 4px;
}

.footer-text {
  font-size: 14px;
  margin-bottom: var(--spacing-sm);
  line-height: 1.8;
}

.copyright {
  font-size: 14px;
  margin-bottom: 0;
}

.copyright a {
  color: #c6c0c1;
  text-decoration: none;
  transition: var(--transition);
}

.copyright a:hover {
  color: white;
  text-decoration: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  html {
    scroll-padding-top: 100px;
  }

  #header {
    height: 100px;
  }
}

@media (max-width: 992px) {
  :root {
    --nav-height: auto;
    --spacing-xl: 60px;
    --spacing-lg: 40px;
  }

  html {
    scroll-padding-top: 100px;
  }

  .nav-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .logo-img {
    width: 200px;
    height: auto;
  }

  /* Shrinking navbar for tablets */
  #main-nav.scrolled .logo-img {
    width: 150px;
    height: auto;
  }

  #main-nav.scrolled .title-main {
    font-size: 18px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: var(--spacing-sm);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu a {
    width: 100%;
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
  }

  #header {
    height: 180px;
  }

  h2.section-heading {
    font-size: 1.75rem;
  }

  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-sm);
  }

  .cv-links {
    flex-direction: column;
    gap: 0;
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .cv-link {
    width: 100%;
    border-bottom: 1px solid #e5e5e5;
    border-left: 3px solid transparent;
    padding: 15px;
    white-space: normal;
    justify-content: flex-start;
  }

  .cv-link:hover,
  .cv-link.active {
    border-bottom-color: #e5e5e5;
    border-left-color: var(--primary);
  }

  .cv-link span:first-child {
    font-size: 13px;
  }

  .cv-link span:nth-child(2) {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  :root {
    --spacing-md: 30px;
    --spacing-sm: 15px;
  }

  html {
    scroll-padding-top: 280px;
  }

  #header {
    height: 260px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .title-main {
    font-size: 20px;
  }

  .title-doctors {
    font-size: 14px;
  }

  .nav-menu a {
    font-size: 16px;
  }

  .praxis-columns {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .praxis-image img {
    max-width: 100%;
  }

  .footer-image-desktop {
    display: none;
  }

  .footer-image-mobile {
    display: flex;
    justify-content: center;
    margin: var(--spacing-md) auto 0;
    text-align: center;
  }

  .footer-image-mobile img {
    display: block;
    margin: 0 auto;
  }

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

  .cv-table {
    font-size: 14px;
  }

  .cv-label {
    width: 30%;
  }

  section {
    padding: var(--spacing-lg) 0;
  }
}

@media (max-width: 480px) {
  html {
    scroll-padding-top: 320px;
  }

  #header {
    height: 300px;
  }

  h2.section-heading {
    font-size: 1.5rem;
  }

  .logo-img {
    width: 150px;
  }

  .cv-table td {
    padding: var(--spacing-xs);
  }

  .cv-label {
    font-size: 13px;
  }

  ul {
    margin-left: var(--spacing-sm);
  }
}
