
.fg-side-inner{ width: 100%; margin-left: 0; margin-right: 0; }

/* Debug borders removed for production */

/* ===== FACHGEBIETE TWO-COLUMN GRID ===== */
/* JS-based tab system with .active class */

/* Reset button styles for nav buttons */
.fg-nav button.fg-link {
  background: none;
  border: none;
  text-align: left;
  font-family: inherit;
  font-weight: inherit;  /* Prevent browser UA bold default on <button> */
  font-size: inherit;
  cursor: pointer;
  padding: 0;
}

/* Page-specific overrides to match the live (Flutter) layout */
body.page-fachgebiete {

  --fg-gap: var(--fg-text-left-pad);
  --fg-side-w: var(--fg-list-w);
}

/* Flutter-aligned Fachgebiete typography (web/pages/fachgebiete.dart) */
body.page-fachgebiete .fg-side .fg-title {
  height: 40px; /* headlineFachgebieteContainerHeight */
  display: flex;
  align-items: center;
  margin: 0;
  font-size: calc(var(--fs-base) * 1.3); /* scaleFactor: 1.3 = 19.5px */
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-body);
  line-height: var(--lh-body);
  color: var(--red);  /* Always red headline */
}

body.page-fachgebiete .fg-link {
  height: 32px; /* listContainerElementHeight */
  display: flex;
  align-items: center;
  font-size: var(--fs-base);
  line-height: 1;
}

body.page-fachgebiete .fg-article h3 {
  height: 32px; /* listContainerElementHeight */
  display: flex;
  align-items: center;
  margin: 0;
  font-size: var(--fs-base);
  line-height: 1;
}

body.page-fachgebiete .fg-article p {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text-color);
  letter-spacing: var(--ls-body);
}

body.page-fachgebiete .content-container {
  justify-content: flex-start;
  overflow: hidden;
  position: relative;
  /* Keep the standard 65vh percentage height */
  height: var(--content-h);
}

body.page-fachgebiete .fg-grid {
  width: 100%;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;   /* children size to natural height so grid can overflow */
  font-size: var(--fs-base);
  gap: var(--fg-gap);
  padding: 0;
  padding-top: var(--fg-pad-top);  /* vertically center nav list in available space */
  padding-bottom: 40px;            /* room below last item */
  padding-right: 20px;     /* space for scrollbar thumb */
  box-sizing: border-box;
  transform: none;
  /* Fill 100% of the content-container so overflow stays contained */
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-fachgebiete .fg-grid::-webkit-scrollbar {
  display: none;
}

/* Screen-edge custom scrollbar — same pattern as Kanzlei page */
body.page-fachgebiete .custom-scrollbar {
  position: fixed;
  top: var(--appbar-h);
  right: 0;
  height: calc(100vh - var(--appbar-h));
  width: 16px;
  z-index: 900;
}

body.page-fachgebiete .custom-scrollbar.is-hidden {
  display: none;
}

body.page-fachgebiete .custom-scrollbar__track {
  height: 100%;
  width: 100%;
  position: relative;
  background: rgba(0, 0, 0, 0.08);
}

body.page-fachgebiete .custom-scrollbar__thumb {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0;
  border-radius: 0;
  background: var(--grey);
  cursor: grab;
}

body.page-fachgebiete .custom-scrollbar.is-dragging .custom-scrollbar__thumb {
  cursor: grabbing;
}

body.page-fachgebiete .fg-body {
  width: var(--fg-text-w);
  display: flex;
  flex-direction: column;
  overflow: visible;
  /* Offset to align with nav items (after 40px title) */
  margin-top: 40px;
  padding-right: 12vw;     /* Pull text away from right edge */
  box-sizing: border-box;
  position: relative;
  /* Use flex-start so the body grows with its content and contributes to
     fg-grid's scrollHeight.  min-height keeps the column at least as tall
     as the visible area (minus the 40px title offset).  */
  align-self: flex-start;
  min-height: calc(100% - 40px);
}



body.page-fachgebiete .fg-side {
  width: var(--fg-list-w);
  margin-left: var(--fg-left-pad);
  padding-top: 0;
  position: relative;
  top: auto;
}

/* Desktop: grid scrolls whole container — nav list just flows to natural height */
body.page-fachgebiete .fg-nav-scroll {
  overflow: visible;
}

body.page-fachgebiete .fg-article {
  min-height: 100%;   /* fill visible area when short, grow when long */
}

body.page-fachgebiete .fg-article p {
  flex: 1;
}



.fg-side {
  flex-shrink: 0;
  width: var(--fg-side-w);
  position: sticky;
  top: 0;
}



.fg-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.fg-link {
  color: var(--grey);
  text-decoration: none;
  font-size: var(--fs-base);
  letter-spacing: var(--ls-body);
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.fg-link:hover {
  color: var(--red);
}

/* Active state for nav buttons */
.fg-link.active {
  color: var(--red);
}

/* Content area - flexible height */
.fg-body {
  flex: 1;
  position: relative;
  min-width: 0;
  padding-top: 0;
}

/* Articles shown/hidden via display */
.fg-article {
  display: none;
}

/* Article scroll container — on desktop, grid scrolls; on mobile, override below */
.fg-article-scroll {
  flex: 1;
  min-height: 0;
  overflow: visible;
}

/* Hide all content divs by default (show via :checked selector below) */
.fg-article-scroll > div {
  display: none;
}

.fg-article h3 {
  color: var(--red);
  font-weight: var(--fw-regular);
  font-size: var(--fs-base);
  height: 32px;            /* Match nav link height */
  display: flex;
  align-items: center;
  margin: 0;
  line-height: 1;
}

.fg-article p {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  margin: 0;
  color: var(--text-color);
  letter-spacing: var(--ls-body);
}

/* Show active article */
.fg-article.active {
  display: flex;
  flex-direction: column;
}
