/*
 * Dopracowanie wizualne — styl zbliżony do FHIR Implementation Guide.
 * Tabele struktury (Structure/Snapshot) i ogólna czytelność.
 */

/* Szerokość spisu treści (boczny pasek nawigacji) — węższy niż domyślne 12.1rem */
.md-sidebar,
.md-sidebar.md-sidebar--primary,
.md-sidebar[data-md-type="navigation"] {
  width: 10rem !important;
  min-width: 10rem !important;
  max-width: 10rem !important;
  flex: 0 0 10rem !important;
}
.md-sidebar.md-sidebar--secondary,
.md-sidebar[data-md-type="toc"] {
  width: 9rem !important;
  min-width: 9rem !important;
  max-width: 9rem !important;
  flex: 0 0 9rem !important;
}
@media screen and (min-width: 76.25em) {
  .md-sidebar,
  .md-sidebar.md-sidebar--primary,
  .md-sidebar[data-md-type="navigation"] {
    width: 10rem !important;
    flex: 0 0 10rem !important;
  }
  .md-sidebar.md-sidebar--secondary,
  .md-sidebar[data-md-type="toc"] {
    width: 9rem !important;
    flex: 0 0 9rem !important;
  }
}
/* Kontener nawigacji — ograniczenie szerokości wewnętrznego scroll */
.md-sidebar__inner {
  width: 100% !important;
  max-width: 100% !important;
}
/* Tytuły w nawigacji mogą się łamać zamiast rozciągać pasek */
.md-sidebar--primary .md-nav__link,
.md-sidebar--primary .md-nav__title {
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.35;
}

/* Niezależny scroll paneli bocznych na desktopie.
   Dzięki temu przewijanie lewego menu nie czeka na koniec przewijania treści. */
@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-sidebar__scrollwrap,
  .md-sidebar--secondary .md-sidebar__scrollwrap {
    max-height: calc(100vh - 4.8rem);
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-bottom: 4rem;
    box-sizing: border-box;
  }

  .md-sidebar,
  .md-sidebar--primary,
  .md-sidebar--secondary {
    z-index: 1;
  }

  .md-footer,
  .md-footer-meta {
    position: relative;
    z-index: 2;
  }
}

/* Tabele w sekcjach Structure / Snapshot */
.md-typeset table:not([class]) {
  border-collapse: collapse;
  font-size: 0.85rem;
}

.md-typeset table:not([class]) th {
  background-color: var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.05));
  font-weight: 600;
  padding: 0.5em 0.75em;
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.1));
}

.md-typeset table:not([class]) td {
  padding: 0.4em 0.75em;
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.1));
}

.md-typeset table:not([class]) tr:nth-child(even) {
  background-color: var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.03));
}

/* Nagłówki sekcji modeli (EodCustomer, EodBufferDocument…) */
.md-typeset h2 {
  border-bottom: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.1));
  padding-bottom: 0.25em;
  margin-top: 1.5em;
}

/* Linki do JSON Schema — delikatne wyróżnienie */
.md-typeset a[href$=".schema.json"] {
  font-family: var(--md-code-font-family);
  font-size: 0.9em;
}
