/* ============================================
   STARTSEITE (HOME PAGE) STYLES
   ============================================ */

/* Desktop: content-container centres the wrapper */
body.page-home .content-container {
  justify-content: center;
  align-items: stretch; /* content-wrapper must fill full height for scroll chain to work */
  overflow: hidden; /* scroll lives inside .home-scroll */
}

/* content-wrapper fills the full container height so home-scroll can centre */
body.page-home .content-wrapper {
  height: 100%;
  max-height: none;
  padding: 0;
  overflow: hidden; /* scroll lives inside .home-scroll */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch; /* stretch so home-scroll expands to full wrapper height */
  min-height: 0;
}

/* Dedicated scroll container — mirrors .kanzlei-scroll */
body.page-home .home-scroll {
  flex: 1;
  height: auto;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;

  /* Ensure the last line can clear the lower edge at max scroll */
  padding: 0 0 var(--pad-lg);
  box-sizing: border-box;

  /* Hide native scrollbar — custom scrollbar renders at the screen edge */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Inner wrapper handles vertical centering (Kontakt-style) */
body.page-home .home-scroll-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

/* DEBUG: layout visualisation (enabled by body.debug-layout) */
body.page-home.debug-layout .content-container {
  background: color-mix(in srgb, var(--red) 10%, var(--mid));
}

body.page-home.debug-layout .content-wrapper {
  background: color-mix(in srgb, var(--grey) 10%, transparent);
  outline: 2px solid var(--grey);
  outline-offset: -2px;
}

body.page-home.debug-layout .home-scroll {
  background: color-mix(in srgb, var(--appbar) 12%, transparent);
  outline: 2px solid var(--appbar);
  outline-offset: -2px;
}

body.page-home.debug-layout .home-scroll-inner {
  background: color-mix(in srgb, var(--mid) 55%, transparent);
  outline: 2px dashed var(--red);
  outline-offset: -2px;
}

body.page-home .home-scroll::-webkit-scrollbar {
  display: none;
}

/* ===== HOME CUSTOM SCROLLBAR (screen edge, like Kanzlei) ===== */
body.page-home .custom-scrollbar {
  position: fixed;
  top: var(--appbar-h);
  right: 0;
  height: calc(100vh - var(--appbar-h));
  width: 16px;
  z-index: 900;
  display: block !important;
  pointer-events: auto !important;
}

body.page-home .custom-scrollbar.is-hidden {
  display: none !important;
  pointer-events: none !important;
}

body.page-home .custom-scrollbar__track {
  height: 100%;
  width: 100%;
  position: relative;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.08);
}

body.page-home .custom-scrollbar__thumb {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0;
  border-radius: 0;
  background: var(--grey);
  opacity: 1;
  cursor: grab;
  touch-action: none;
}

body.page-home .custom-scrollbar.is-dragging .custom-scrollbar__thumb {
  cursor: grabbing;
  opacity: 0.85;
}

body.page-home .custom-scrollbar__thumb:hover,
body.page-home .custom-scrollbar__thumb:focus-visible {
  opacity: 0.85;
}

/* Override global content-wrapper > * bottom margin for the inner children */
body.page-home .home-scroll-inner > * {
  margin-bottom: 0;
}

body.page-home .home-scroll-inner > :last-child {
  padding-bottom: 0;
}

body.page-home .intro-text {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text-color);
  letter-spacing: var(--ls-body);
}

body.page-home .contact-section {
  display: flex;
  flex-direction: column;
  padding: var(--pad-lg) 0;  /* Flutter: paddingLarge(20) */
}

body.page-home .contact-section p {
  margin: 0;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  color: var(--text-color);
}

body.page-home .contact-row {
  display: flex;
  align-items: baseline;
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
}

body.page-home .contact-label {
  font-weight: var(--fw-regular);
  width: 50px;  /* Flutter: Container(width: 50.0) */
  flex-shrink: 0;
}

body.page-home .contact-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: var(--fw-regular);
}

body.page-home .contact-link:hover {
  color: var(--text-color);
  text-decoration: underline;
}

body.page-home .address-section {
  display: flex;
  flex-direction: column;
}

body.page-home .address-section p {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text-color);
  margin: 0;
}

@media (max-width: 799px) {
  /* Narrow screens: use the same reduced content width as before */
  body.page-home .content-wrapper {
    width: 90%;  /* Flutter: SizedBox(width: screenWidth * 0.9) */
  }
}

@media (max-width: 799px) {
  /* Small viewport height/width: keep inner scroller filling available area */
  body.page-home .content-wrapper {
    height: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0;
  }

  body.page-home .home-scroll {
    padding: 0 0 var(--pad-lg);
  }

  body.page-home .intro-text {
    font-size: var(--fs-base);
    line-height: var(--lh-body);
  }

  body.page-home .contact-section p,
  body.page-home .contact-row,
  body.page-home .contact-link {
    font-size: var(--fs-base);
    line-height: var(--lh-body);
  }
}

