/* =========================================================
   ARTYKUŁ Z BOCZNĄ KOLUMNĄ — spis treści + zachęta „Cześć, tu Michał”
   Plik: assets/css/sections/article-aside.css
   Wzorzec: webmountain-ux/makieta-spis-tresci.html (system-strony.html, makieta „Artykuł”)
   Ładowany tylko na wpisach z wm_article_aside = 1 (inc/article-aside.php).
========================================================= */

.articleWithAside{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
}

/* Kotwice: nagłówek z małym oddechem od górnej krawędzi (menu nie jest przyklejone) */
.articleWithAside .wmContent h2,
#faq{
  scroll-margin-top: 24px;
}

/* ---------- Spis treści (wzorzec .toc) ---------- */
.toc{
  border: 1px solid var(--wm-forest-25);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  font-size: 13.5px;
}
.toc__title{
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wm-forest);
}
.toc__list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: toc;
}
.toc__list li{ counter-increment: toc; }
.toc__list a{
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 3px 8px 3px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 8px 8px 0;
  color: var(--wm-forest);
  text-decoration: none;
  line-height: 1.4;
}
.toc__list a::before{
  content: counter(toc);
  min-width: 1.4em;
  font-size: 12px;
  color: var(--wm-forest-75);
}
.toc__list a:hover{ color: var(--wm-neoblue); }
.toc__list a[aria-current="true"]{
  border-left-color: var(--wm-neoblue);
  background: var(--wm-neoblue-10);
  color: var(--wm-neoblue);
  font-weight: 600;
}
.toc__list a[aria-current="true"]::before{ color: var(--wm-neoblue); }

/* ---------- Zachęta „Cześć, tu Michał” (wzorzec .soft-cta) ---------- */
.softCta{
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--wm-forest);
  color: var(--wm-white);
}
.softCta__who{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}
.softCta__avatar{
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--wm-lime);
  display: grid;
  place-items: center;
}
.softCta__avatar img{ width: 22px; height: auto; }
.softCta p{
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--wm-white);
}
.softCta .btn{ justify-self: start; white-space: normal; text-align: center; }

/* W treści (telefon): po pierwszej pełnej sekcji, z oddechem */
.wmContent .softCta--inline{ margin: 32px 0; }
.wmContent .softCta--inline a.btn{ color: var(--wm-forest); }

/* ---------- Telefon i tablet: spis zwinięty, bez kolumny ---------- */
.articleWithAside__side{ display: none; }

.tocMobile{
  border: 1px solid var(--wm-forest-25);
  border-radius: var(--radius);
  margin-bottom: 28px;
  font-size: 14px;
}
.tocMobile summary{
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wm-forest);
}
.tocMobile summary::-webkit-details-marker{ display: none; }
.tocMobile__icon{
  color: var(--wm-neoblue);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
}
.tocMobile[open] .tocMobile__icon{ transform: rotate(45deg); }
.toc--mobile{
  border: 0;
  padding: 0 12px 14px;
}
/* Telefon: cele dotyku min. 44 px (BRANDBOOK §5) */
.toc--mobile .toc__list a{ min-height: 44px; }

/* ---------- Komputer: kolumna z boku, przyklejona w obrębie tekstu ---------- */
@media (min-width: 1024px){
  .articleWithAside{
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: start;
  }
  /* Cała kolumna (spis + zachęta) przyklejona i zawsze w całości na ekranie.
     Gdy ekran jest niski, przewija się sama lista spisu, a zachęta zostaje widoczna. */
  .articleWithAside__side{
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
  }
  .articleWithAside__side .toc{
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 0 1 auto;
  }
  .articleWithAside__side .toc__list{
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  .articleWithAside__side .softCta{ flex: none; }
  .tocMobile,
  .wmContent .softCta--inline{ display: none; }
}

@media (prefers-reduced-motion: no-preference){
  html{ scroll-behavior: smooth; }
}
