/* Target Website Theme - Navigation and Color Scheme */

/* CSS Custom Properties matching target website */
:root {
  --primary-blue: #2c5aa0;
  --primary-blue-dark: #1e3f73;
  --primary-blue-light: #4a7bc8;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-light: #999999;
  --background-primary: #ffffff;
  --background-secondary: #f8f9fa;
  --border-color: #e0e0e0;
  --hover-background: #f0f4f8;
}

/* Dark mode variables */
:root[data-theme="dark"] {
  --primary-blue: #4a7bc8;
  --primary-blue-dark: #2c5aa0;
  --primary-blue-light: #6b9eff;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-light: #999999;
  --background-primary: #2a2a2a;
  --background-secondary: #363636;
  --border-color: #484848;
  --hover-background: #404040;
}

/* Body styling to use CSS variables */
body {
  background: var(--background-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

/* Mobile body - minimal padding */
@media (max-width: 768px) {
  body {
    padding: 0;
  }
}

/* Smooth transitions for theme switching */
:root, :root[data-theme="dark"] {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark mode box shadow enhancement */
:root[data-theme="dark"] header {
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Dark mode cover image adjustments */
:root[data-theme="dark"] .cover-hero::after {
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.2) 100%);
}

:root[data-theme="dark"] nav a:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

:root[data-theme="dark"] .theme-link:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

:root[data-theme="dark"] .nav-mobile a:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

:root[data-theme="dark"] #theme-toggle-mobile:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Cover image hero section */
.cover-hero {
  position: relative;
  width: 100%;
  height: 45vh;
  min-height: 200px;
  max-height: 600px;
  overflow: hidden;
  margin-bottom: 2rem;
}

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

.cover-hero:hover img {
  transform: scale(1.02);
}

/* Dark overlay for better text readability when needed */
.cover-hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.1) 100%);
  pointer-events: none;
}

/* Header and Navigation Styles */
header {
  background: var(--background-primary);
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 {
  margin: 0 0 1rem 0;
  padding: 0 1rem;
  font-size: 2rem;
  font-weight: 300;
  color: var(--primary-blue);
  letter-spacing: -0.5px;
}

/* Navigation Bar */
nav {
  background: var(--background-secondary);
  padding: 0;
  position: relative;
}

/* Desktop Navigation - Hidden on mobile */
.nav-desktop {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
}

.nav-mobile {
  display: none;
}

nav a {
  display: inline-block;
  padding: 0.75rem 1rem;
  margin: 0 0.25rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

nav a:hover {
  background: var(--primary-blue);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav a:first-child {
  margin-left: 1rem;
  font-weight: 700;
}

/* Active page styling */
nav a[href*="about"], nav a[href*="pictures"], nav a[href*="calendar"],
nav a[href*="map"], nav a[href*="contact"], nav a[href*="impressum"] {
  position: relative;
}

nav a[href*="about"]:hover, nav a[href*="pictures"]:hover,
nav a[href*="calendar"]:hover, nav a[href*="map"]:hover,
nav a[href*="contact"]:hover, nav a[href*="impressum"]:hover {
  background: var(--primary-blue-light);
  color: white;
}

/* Main content area - full width for dark background */
main {
  background: var(--background-primary);
  min-height: calc(100vh - 200px);
  padding: 0.5rem;
}

/* Mobile main - minimal padding */
@media (max-width: 768px) {
  main {
    padding: 0.25rem; /* Reduced from 0.5rem */
  }
}

/* Content wrapper - constrains text width for readability */
.content-wrapper {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0rem 1rem 1rem 1rem;
}

/* Content styling */
.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4,
.content-wrapper h5,
.content-wrapper h6 {
  margin-bottom: 1rem;
}

/* H2 titles get minimal top padding */
.content-wrapper h2 {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* First h2 gets minimal top padding */
.content-wrapper h2:first-child {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.content-wrapper p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.content-wrapper ul {
  list-style: none; /* remove normal bullets */
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.content-wrapper ul li {
  background: var(--background-secondary);
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  margin-bottom: 0;
}

.content-wrapper ul li::before {
  content: "✦";
  color: var(--primary-blue);
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

.content-wrapper ul li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue-light);
}

.content-wrapper ol {
  margin-bottom: 2.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.content-wrapper ol li {
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.content-wrapper ol li::marker {
  color: var(--primary-blue);
  font-weight: 700;
}

.content-wrapper blockquote {
  border-left: 4px solid var(--primary-blue);
  background: var(--hover-background);
  padding: 1.5rem 1.5rem;
  margin: 2rem 0;
  color: var(--primary-blue-dark);
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  font-style: italic;
  font-size: 1.1rem;
}

/* Cover image mobile responsive */
@media (max-width: 768px) {
  .cover-hero {
    height: 45vh;
    min-height: 150px;
    max-height: 450px;
  }
}

/* Mobile Icon Navigation */
@media (max-width: 768px) {
  /* Hide desktop navigation on mobile */
  .nav-desktop {
    display: none;
  }

  /* Show mobile icon navigation */
  .nav-mobile {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 0.5rem 0rem; /* Even smaller horizontal padding */
    background: var(--background-secondary);
    overflow-x: hidden; /* Start hidden, JS will enable when needed */
    overflow-y: hidden;
    gap: 0.1rem; /* Smaller gap between icons */
    min-height: 60px;
    position: relative;
  }

  .nav-mobile.nav-scrollable {
    overflow-x: auto;
  }

  /* Custom scrollbar styling */
  .nav-mobile.nav-scrollable::-webkit-scrollbar {
    height: 3px;
  }

  .nav-mobile.nav-scrollable::-webkit-scrollbar-track {
    background: transparent;
  }

  .nav-mobile.nav-scrollable::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 2px;
  }

  .nav-mobile.nav-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-primary);
  }

  .nav-mobile a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.4rem; /* Reduced horizontal padding */
    margin: 0 0.1rem; /* Smaller margins */
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    min-width: 50px; /* Slightly smaller */
    min-height: 50px;
    flex-shrink: 0; /* Prevent shrinking in flex container */
    white-space: nowrap;
  }

  .nav-mobile a:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .cover-hero:hover img {
    transform: scale(1.02);
  }

  .nav-mobile a:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
  }

  .nav-mobile a i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
    display: block;
  }

  /* Theme toggle in mobile navigation */
  #theme-toggle-mobile {
    position: static;
    transform: none;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0 0.1rem; /* Smaller margin to match other icons */
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-primary);
    min-width: 40px; /* Slightly smaller */
    min-height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  #theme-toggle-mobile:hover {
    background: var(--hover-background);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  header h1 {
    font-size: 1.5rem;
    text-align: center;
    padding: 0 0.5rem; /* Reduced horizontal padding */
  }

  /* Mobile content styling */
  .content-wrapper {
    padding: 0.5rem; /* Reduced from 1rem */
  }

  .content-wrapper h2 {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  .content-wrapper h2:first-child {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
  }
}

/* Theme toggle link */
.theme-link {
  display: inline-block;
  padding: 0.75rem 1rem;
  margin: 0 0.25rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 400;
  font-size: 0.95rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.theme-link:hover {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transform: translateY(-50%); /* Keep original positioning */
}

.theme-link:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Theme icon - single icon that changes */
.theme-icon::before {
  content: "🌙";
}

:root[data-theme="dark"] .theme-icon::before {
  content: "☀️";
}

/* Focus styles for accessibility */
nav a:focus {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* Accessibility: Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cover-hero img,
  .nav-mobile a,
  .theme-link,
  .theme-icon {
    transition: none;
  }

  .cover-hero:hover img {
    transform: none;
  }

  .nav-mobile a:hover {
    transform: none;
  }

  .theme-link:hover {
    transform: translateY(-50%);
  }
}