:root {
  --primary: #a2ae41; /* Primary brand green */
  --primary-600: #8b953a; /* darker */
  --primary-50: #f2f4e0; /* light tint */
  --accent: #b7c052; /* accent in same hue */
  --bg: #ffffff;
  --text: #1b1b1b;
  --muted: #5a5a5a;
  --border: #e6e6e6;
  --card-grad-top: rgba(162, 174, 65, 0.10);
  --card-grad-bottom: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; max-width: 100%; overflow-x: hidden; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; color: var(--text); background: var(--bg); line-height: 1.6; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; width: auto; height: auto; padding: 8px 12px; background: var(--primary); color: #fff; }

.topline { background: linear-gradient(90deg, var(--primary-50), #fff); color: var(--text); font-size: 16px; }
.topline-inner { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.brand img { width: 28px; height: 28px; }
.topline-right { display: flex; gap: 16px; }
.topline .emergency strong, .topline .kvb strong { color: var(--primary); }
/* Ticker */
.ticker { width: 100%; max-width: 700px; overflow: hidden; white-space: nowrap; position: relative; }
.ticker span { display: inline-block; padding-left: 100%; animation: marquee 18s linear infinite; color: var(--text); }
.ticker span.highlight { font-weight: 800; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

.nav { border-bottom: 1px solid var(--border); background: #fff; position: sticky; top: 0; z-index: 20; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; flex-wrap: wrap; }
.nav-brand { font-weight: 700; color: var(--text); text-decoration: none; }
.nav-toggle { display: none; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; row-gap: 8px; }
.nav-links a { color: var(--text); text-decoration: none; padding: 8px 6px; border-radius: 8px; white-space: nowrap; }
.nav-links a:hover, .nav-links a:focus { background: var(--primary-50); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); background: #fff; border-radius: 8px; }
  .nav-links { display: none; flex-direction: column; width: 100%; padding: 12px 0; }
  .nav-links.open { display: flex; }
}

/* Make topline wrap nicely on small screens */
@media (max-width: 640px) {
  .topline-inner { flex-wrap: wrap; gap: 6px 12px; }
  .topline-left, .topline-right { flex: 1 1 100%; }
  .topline-right { justify-content: center; flex-wrap: wrap; text-align: center; }
}

.hero { background: linear-gradient(180deg, var(--primary-50), #fff); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: -40% -10% auto -10%; height: 120%; background: radial-gradient(60% 60% at 10% 10%, rgba(162,174,65,0.20), transparent 60%); pointer-events: none; }
.hero-inner { padding: 48px 0 32px; display: grid; grid-template-columns: 1fr; gap: 24px; }
.brand-lockup { box-sizing: border-box; width: 100%; }
.brand-cta .btn { height: 42px; padding: 0 16px; display: inline-flex; align-items: center; }
.hero h1 { margin: 0 0 8px; line-height: 1.2; }
.subtitle { color: var(--muted); margin: 0 0 16px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.doctolib-badge img { height: 36px; width: auto; vertical-align: middle; }
.green-note { margin-top: 16px; color: var(--muted); }

.hero-content { display: flex; flex-direction: column; align-items: center; text-align: center; }
/* Modern brand lockup */
.hero-content.modern { align-items: stretch; text-align: left; }
.brand-lockup { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 14px; background: rgba(255,255,255,0.7); backdrop-filter: saturate(140%) blur(6px); border: 1px solid rgba(0,0,0,0.06); }
.brand-mark { height: 88px; width: auto; max-width: 260px; border-radius: 0; background: transparent; padding: 0; box-shadow: none; display: block; }
.brand-text { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.eyebrow { font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary-600); font-weight: 700; }
.headline { font-size: 28px; line-height: 1.15; margin: 0; }
.subheadline { color: var(--muted); font-size: 15px; }
.brand-cta { display: flex; align-items: center; justify-self: end; }
.brand-cta .btn { white-space: nowrap; margin-left: 4px; }
@media (max-width: 800px) {
  .brand-lockup { grid-template-columns: 1fr; text-align: center; gap: 12px; padding: 14px; }
  .hero-content.modern { text-align: center; }
  .brand-mark { margin: 0 auto; height: 72px; width: auto; max-width: 70%; }
  .headline { font-size: 24px; }
  .brand-cta { justify-content: center; justify-self: center; }
  .brand-cta .btn { margin-left: 0; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #ffffff; color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; text-decoration: none; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: all 0.2s ease; }
.btn:hover { background: #fafafa; box-shadow: 0 3px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; border: none; }
.btn-primary:hover { background: var(--primary-600); box-shadow: 0 4px 16px rgba(162,174,65,0.25); }

.section { padding: 48px 0; }
.section.alt { background: #fafafa; }
.section-header { margin-bottom: 20px; position: relative; }
.section-header h2 { position: relative; display: inline-block; }
.section-header h2::after { content: ""; position: absolute; left: 0; right: -8px; bottom: -6px; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--accent)); opacity: 0.6; }
.section-header h2 { margin: 0 0 6px; }
.muted { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--card-grad-top), var(--card-grad-bottom));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  min-width: 0;
  word-wrap: break-word;
}
.card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.10); border-color: #ddd; transform: translateY(-1px); }
.card h3 { margin-top: 0; }

@media (max-width: 1020px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
}

.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 1020px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* Slightly stronger gradient for news cards */
.news-item { background: linear-gradient(180deg, rgba(162,174,65,0.16), rgba(162,174,65,0.04), #fff); }

/* Alternate cards in alt sections get inverted subtle gradient */
.section.alt .card { background: linear-gradient(180deg, #fff, rgba(162,174,65,0.14), rgba(162,174,65,0.06)); }

/* Full-Width Banner with extended background */
.banner { position: relative; overflow: hidden; margin: 32px 0; }
.banner-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-size: cover; background-position: center; background-repeat: no-repeat; opacity: 0.1; transition: opacity 0.3s ease; }
.banner .container { position: relative; z-index: 2; }
.banner-content { position: relative; max-width: 100%; margin: 0 auto; }
.banner-image { width: 100%; height: auto; display: block; border-radius: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); transition: all 0.3s ease; }
.banner-image:hover { transform: scale(1.02); box-shadow: 0 12px 48px rgba(0,0,0,0.16); }

/* Mobile Anpassungen für das Banner */
@media (max-width: 640px) {
  .banner { margin: 24px 0; }
  .banner-image { border-radius: 12px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
  .banner-image:hover { transform: scale(1.01); box-shadow: 0 6px 24px rgba(0,0,0,0.12); }
}

.news-item .date { font-size: 14px; color: var(--muted); }
.news-item .links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; background: #fff3e0; color: #e65100; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid #ffcc80; }

/* Wichtig badge scroll effect */
.wichtig-badge {
  transition: all 0.3s ease;
  position: relative;
}

.wichtig-active {
  transform: scale(1.1);
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  box-shadow: 0 2px 8px rgba(230, 81, 0, 0.3);
  border-color: #ff9800;
  animation: wichtigePulse 2s ease-in-out infinite;
}

@keyframes wichtigePulse {
  0%, 100% {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.3);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.4);
  }
}

/* subtle animated accent for buttons */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent); transform: translateX(-100%); transition: transform 500ms ease; }
.btn-primary:hover::after { transform: translateX(100%); }

.note { border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.note summary { cursor: pointer; font-weight: 600; }

.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1020px) { .team-grid { grid-template-columns: 1fr; } }
.person .photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: 50% 20%; /* keep faces in view */
  border-radius: 10px;
  border: 1px solid var(--border);
}
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.media-grid.small img { height: 120px; object-fit: cover; width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.media-inline img { width: 100%; max-width: 680px; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.logo-inline { height: 18px; width: auto; vertical-align: middle; }

/* Responsive news images */
.news-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-top: 8px;
}

/* Galerie entfernt */

.footer { border-top: 1px solid var(--border); background: #fff; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }
.footer-nav { display: flex; gap: 14px; }
.footer a { color: var(--text); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* Skeletons for initial loading */
.skeleton { background: linear-gradient(90deg, #eee, #f7f7f7, #eee); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 12px; }
.skeleton.title { height: 20px; width: 70%; margin-bottom: 12px; }
.skeleton.line { height: 12px; width: 100%; margin-bottom: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Accessibility */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Calendar */
.calendar { border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: #fff; max-width: 100%; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calendar-title { font-weight: 800; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.calendar-weekdays { font-size: 12px; color: var(--muted); margin-bottom: 6px; text-align: center; font-weight: 600; }
.calendar-day { border: 1px solid var(--border); border-radius: 12px; padding: 6px; min-height: 85px; position: relative; background: #fff; display: grid; grid-template-rows: auto 1fr auto; gap: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); transition: all 0.2s ease; cursor: pointer; text-align: center; }
.calendar-day:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: #ddd; transform: translateY(-1px); }
.calendar-day.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(162,174,65,0.25) inset, 0 2px 8px rgba(162,174,65,0.10); background: var(--primary-50); }
.calendar-day.today:hover { border-color: var(--primary-600); box-shadow: 0 0 0 2px rgba(162,174,65,0.35) inset, 0 4px 16px rgba(162,174,65,0.15); }
.calendar-day.today .date { color: var(--primary-600); font-weight: 800; background: rgba(162,174,65,0.18); padding: 3px 8px; border-radius: 10px; display: inline-block; }
.calendar-day .date { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.calendar-open { position: relative; height: 6px; background: #e5efd0; border-radius: 999px; overflow: hidden; margin: 1px 0; }
.calendar-open .bar { position: absolute; top: 0; bottom: 0; background: var(--primary); border-radius: 999px; opacity: 0.9; }
.calendar-closed { position: relative; height: 6px; background: #ffe5e5; border-radius: 999px; margin: 1px 0; }
.calendar-hours { font-size: 11px; color: var(--text); line-height: 1.3; }
.calendar-upcoming { margin-top: 8px; font-size: 14px; }
.calendar-upcoming .item { display: flex; gap: 8px; align-items: center; }
.calendar-upcoming .dot { width: 8px; height: 8px; background: var(--primary); border-radius: 50%; display: inline-block; }

/* Responsive calendar adjustments */
@media (max-width: 640px) {
  .calendar { padding: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .calendar-day { padding: 5px; min-height: 75px; gap: 2px; border-radius: 10px; }
  .calendar-day .date { font-size: 10px; padding: 2px 4px; }
  .calendar-weekdays { font-size: 10px; }
  .calendar-hours { font-size: 10px; }
  .calendar-upcoming { font-size: 13px; }
  /* Use flexible column widths to fill available space */
  .calendar-weekdays, .calendar-grid { grid-template-columns: repeat(5, 1fr); gap: 3px; }
}

@media (max-width: 480px) {
  .calendar { padding: 8px; }
  .calendar-day { padding: 3px; min-height: 60px; border-radius: 8px; }
  .calendar-day .date { font-size: 9px; padding: 1px 3px; border-radius: 6px; }
  .calendar-weekdays { font-size: 9px; }
  .calendar-hours { font-size: 9px; }
  .calendar-upcoming { font-size: 12px; }
  /* Use flexible columns on very small phones too */
  .calendar-weekdays, .calendar-grid { grid-template-columns: repeat(5, 1fr); gap: 2px; }
}

/* 3D Cube Carousel Styles */
.cube-carousel {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 30px auto;
  perspective: 800px;
  perspective-origin: center center;
  z-index: 20;
}

.cube-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* keep square and scale with parent */
  margin: 0 auto;
  transform-style: preserve-3d;
  z-index: 1;
  cursor: grab;
  transition: transform 0.2s ease;
  user-select: none;
  overflow: hidden; /* keep frame static */
  border: 2px solid #e0e0e0; /* static frame */
  border-radius: 10px;
  background: #ffffff;
}

.cube-container:hover { transform: none; }

.cube-container:active {
  cursor: grabbing;
}

.cube {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms ease-out, scale 600ms ease-out;
  transform-origin: center center;
  z-index: 1;
}

.cube-face {
  position: absolute;
  width: 100%;
  height: 100%;
  background: white;
  border: none; /* remove per-image border */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  backface-visibility: hidden;
  transform-origin: center center;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  left: 50%;
  top: 50%;
}

/* Faces should not steal pointer events so arrows and drag work */
.cube-face,
.cube-face img {
  pointer-events: none;
}

.cube-face:nth-child(1) {
  /* First face at 0° */
}

.cube-face:nth-child(2) {
  /* Second face at 180° */
}

.cube-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
  transition: transform 0.3s ease;
  max-width: 100%;
  max-height: 100%;
}

.cube-face:hover img {
  transform: scale(1.02);
}

/* Removed duplicate nav-btn styles - using the ones defined below */

.carousel-indicators {
  display: none; /* Hide the blue indicator buttons */
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #007bff;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: #007bff;
}

.indicator:hover {
  transform: scale(1.2);
}

.indicator:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
  .cube-container { width: 100%; }
  .cube-face { width: 100%; height: 100%; }

  .cube-carousel {
    max-width: 400px;
  }
  
  .nav-btn {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .cube-container { width: 100%; }
  .cube-face { width: 100%; height: 100%; }

  .cube-carousel {
    max-width: 320px;
  }

  .nav-btn {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  .nav-prev {
    left: 8px;
  }
  
  .nav-next {
    right: 8px;
  }
}

/* Ensure carousel doesn't interfere with surrounding text */
.news-item .cube-carousel {
  margin: 30px 0;
  position: relative;
  z-index: 1;
}

.news-item .content {
  position: relative;
  z-index: 10;
}

/* Carousel Navigation Styles */
.cube-container {
  position: relative;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.25); /* subtle backdrop for visibility */
  color: white;
  border: none;
  width: 64px;
  height: 64px;
  cursor: pointer;
  font-size: 42px; /* classic < and > look */
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  z-index: 2000; /* above cube */
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  pointer-events: auto;
}

.nav-btn:hover { opacity: 0.9; }
.nav-btn:focus { outline: none; }
.nav-prev { left: 12px; }
.nav-next { right: 12px; }

.carousel-indicators { display: none; }

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #007bff;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: #007bff;
}

.indicator:hover {
  transform: scale(1.2);
}

.indicator:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

