/* ============================================================
   ГБУЗ «Областной перинатальный центр» — типовая контентная страница
   Стили: чистый CSS3, mobile-first, @layer, light-dark()
   ============================================================ */

@layer components {

  /* ============================================================
     СТРАНИЦА
     ============================================================ */
  .page {
    padding-block: var(--sp-3) var(--sp-6);
  }

  /* ============================================================
     ХЛЕБНЫЕ КРОШКИ
     ============================================================ */
  .breadcrumbs {
    margin-bottom: var(--sp-1);
    font-size: .9rem;
    color: var(--muted);
  }
  .breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
  }
  .breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }
  .breadcrumbs__item + .breadcrumbs__item::before {
    content: "";
    display: inline-block;
    width: 0.7em;
    height: 0.7em;
    background: currentColor;
    opacity: 0.55;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .breadcrumbs__item a { color: var(--muted); }
  .breadcrumbs__item a:hover { color: var(--accent); }
  .breadcrumbs__item[aria-current="page"] {
    color: var(--fg);
    font-weight: 200;
    opacity: .7;
  }

  /* ============================================================
     ЗАГОЛОВОК СТРАНИЦЫ
     ============================================================ */
  .page-head {
    margin-bottom: var(--sp-5);
  }
  .page-head__eyebrow {
    font-size: var(--fs-meta);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: var(--sp-2);
  }
  .page-head__title {
    font-family: var(--font-display);
    font-size: var(--fs-display);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.08;
    text-wrap: balance;
  }
  .page-head__lead {
    margin-top: var(--sp-3);
    font-size: var(--fs-lead);
    font-weight: 200;
    color: var(--muted);
  }

  /* ============================================================
     РАСКЛАДКА: ПОДРАЗДЕЛЫ + КОНТЕНТ
     ============================================================ */
  .page__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--sp-4);
    align-items: start;
  }

  @media (min-width: 1024px) {
    .page__layout {
      grid-template-columns: 340px 1fr;
      gap: var(--sp-5);
    }
  }

  /* ============================================================
     ПОДРАЗДЕЛЫ (боковая навигация, native details/summary)
     ============================================================ */
  .subnav {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-4);
    overflow: hidden;
  }

  .subnav__list { display: flex; flex-direction: column; }

  .subnav__item + .subnav__item { border-top: 1px solid var(--border); }

  .subnav__group { display: block; }

  .subnav__summary {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
    padding-inline-end: 0.5rem;
  }
  .subnav__summary-link {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.85rem var(--sp-2) 0.85rem var(--sp-3);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--fg);
    transition: background-color 0.18s ease, color 0.18s ease;
  }
  .subnav__summary-link:hover {
    color: var(--accent);
  }
  .subnav__toggle {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-1);
    color: var(--muted);
    transition: background-color 0.18s ease, color 0.18s ease;
  }
  .subnav__toggle:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }
  .subnav__caret {
    width: 1.1em;
    height: 1.1em;
    flex: none;
    transition: transform 0.2s ease;
  }
  .subnav__group.is-open .subnav__caret { transform: rotate(180deg); }

  .subnav__sublist {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0 0.5rem;
    background: var(--secondary);
  }
  .subnav__sublist[hidden] { display: none; }
  .subnav__sublink {
    display: block;
    padding: 0.55rem var(--sp-3) 0.55rem 1.75rem;
    font-size: 0.9rem;
    font-weight: 200;
    color: var(--fg);
    border-inline-start: 2px solid transparent;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
  }
  .subnav__sublink:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border-inline-start-color: var(--accent);
  }

  .subnav__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem var(--sp-3);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--fg);
    transition: background-color 0.18s ease, color 0.18s ease;
  }
  .subnav__link:hover {
    background: var(--accent-soft);
    color: var(--accent);
  }

  .subnav__summary-link.is-active,
  .subnav__link.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
  }
  .subnav__sublink.is-active {
    color: var(--accent);
    background: var(--accent-soft);
    border-inline-start-color: var(--accent);
    font-weight: 600;
  }

  @media (min-width: 1024px) {
    .subnav { position: sticky; top: var(--sp-3); }
  }

  /* ============================================================
     КОНТЕНТ (типографика)
     ============================================================ */
  .article {
    min-width: 0;
  }

  .article__section + .article__section {
    margin-top: var(--sp-5);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border);
  }

  .article__section {
    scroll-margin-top: var(--sp-4);
  }

  .article h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: var(--sp-3);
  }
  .article h3 {
    font-size: var(--fs-h3);
    margin-bottom: var(--sp-2);
  }
  .article p {
    margin-bottom: var(--sp-3);
    color: var(--fg);
    font-weight: 300;
  }
  .article p:last-child { margin-bottom: 0; }
  .article a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }
  .article a:hover { color: var(--accent-hover); }
  .article strong { font-weight: 600; }

  /* ============================================================
     СПИСКИ
     ============================================================ */
  .article__list {
    margin: 0 0 var(--sp-3);
    padding-inline-start: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .article__list li {
    font-weight: 300;
    color: var(--fg);
    padding-inline-start: 0.25rem;
  }
  .article__list li::marker { color: var(--accent); font-weight: 600; }

  .article__list--ordered { list-style: decimal; }

  /* ============================================================
     ТАБЛИЦЫ
     ============================================================ */
  .table-wrap {
    margin-bottom: var(--sp-3);
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-2);
  }
  .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 560px;
  }
  .table__caption {
    padding: var(--sp-2) var(--sp-3);
    text-align: start;
    font-weight: 600;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
    background: var(--secondary);
    caption-side: top;
  }
  .table th,
  .table td {
    padding: 0.7rem var(--sp-3);
    text-align: start;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }
  .table thead th {
    font-weight: 600;
    font-size: var(--fs-meta);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: var(--surface);
  }
  .table tbody tr:last-child td { border-bottom: none; }
  .table tbody tr:hover { background: var(--secondary); }
  .table tbody td { font-weight: 300; color: var(--fg); }

}
