/* Blog MATT (16.11.2026): lista wpisów, wpis ze spisem treści (wzór: atelierduszy.pl), podobne wpisy. */

/* ── Lista ── */
.blog-siatka { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.blog-karta { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); min-width: 0; }
.blog-karta-zdjecie { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--surface-2); }
.blog-karta-zdjecie img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blog-karta-tresc { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.blog-karta time { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.blog-karta h2, .blog-karta h3 { margin: 8px 0 12px; font-size: 1.3rem; line-height: 1.25; }
.blog-karta h2 a, .blog-karta h3 a { text-decoration: none; color: inherit; }
.blog-karta h2 a:hover, .blog-karta h3 a:hover { text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.blog-karta p { margin: 0 0 18px; color: var(--muted); font-size: 1rem; }
.blog-karta .text-link { margin-top: auto; }
.blog-karta-wyrozniona { grid-column: 1 / -1; display: grid; grid-template-columns: 1.25fr 1fr; }
.blog-karta-wyrozniona .blog-karta-zdjecie { position: relative; aspect-ratio: auto; min-height: 360px; }
.blog-karta-wyrozniona .blog-karta-zdjecie img { position: absolute; inset: 0; }
.blog-karta-wyrozniona .blog-karta-tresc { padding: clamp(28px, 4vw, 48px); justify-content: center; }
.blog-karta-wyrozniona h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.blog-strony { margin-top: 44px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.blog-strony .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); background: var(--white); color: var(--ink); font-weight: 600; text-decoration: none; transition: background-color .2s; }
.blog-strony a.page-numbers:hover { background: var(--surface-2); }
.blog-strony .current { background: var(--ink); border-color: var(--ink); color: var(--white); }
.blog-strony .dots { border-color: transparent; background: none; }

/* ── Wpis ── */
.blog-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; color: var(--brand); font-weight: 700; }
.blog-meta span { color: rgba(255, 255, 255, .7); font-weight: 500; }
.blog-wpis .article-header h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); line-height: 1.12; }
.blog-wpis-tresc > :first-child { margin-top: 0; }
.blog-wpis-tresc p, .blog-wpis-tresc li { color: var(--ink-2); }
.blog-wpis-tresc ul, .blog-wpis-tresc ol { padding-left: 1.3em; }
.blog-wpis-tresc li { margin: 6px 0; }
.blog-wpis-tresc li::marker { color: var(--brand-strong); font-weight: 700; }
.blog-wpis-tresc h4 { margin: 26px 0 8px; font-size: 1.2rem; }
.blog-wpis-tresc img { max-width: 100%; height: auto; }
.blog-wpis-tresc figure { margin: 34px 0; }
.blog-wpis-tresc figcaption { margin-top: 8px; color: var(--muted); font-size: .9rem; }
.blog-wpis-tresc blockquote, .blog-wpis-tresc .wp-block-quote { margin: 30px 0; padding: 18px 24px; border-left: 4px solid var(--brand); background: var(--white); }
.blog-wpis-tresc table { width: 100%; border-collapse: collapse; margin: 26px 0; font-size: 1rem; }
.blog-wpis-tresc th, .blog-wpis-tresc td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.blog-wpis-tresc th { background: var(--surface-2); }
.blog-wpis-tresc .wp-block-table { overflow-x: auto; }
.blog-wpis-tresc :is(h2, h3)[id] { scroll-margin-top: calc(var(--header, 88px) + 84px); }
.blog-wpis-tresc a { color: inherit; text-decoration-color: var(--brand-strong); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ── Spis treści: karta nad treścią, rozwijana, domyślnie otwarta ── */
.spis { margin: 0 0 48px; padding: 20px 22px; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--brand); }
.spis summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; list-style: none; }
.spis summary::-webkit-details-marker { display: none; }
.spis-tytul { font-weight: 800; font-size: 1.35rem; color: var(--ink); }
.spis-znak { width: 24px; height: 24px; flex: none; color: var(--brand-strong); transition: transform .25s ease; }
.spis details:not([open]) .spis-znak { transform: rotate(-90deg); }
.spis ol { margin: 10px 0 4px; padding-left: 1.6em; display: grid; gap: 7px; font-size: 1.02rem; line-height: 1.45; }
.spis li { padding-left: 4px; }
.spis li::marker { color: var(--brand-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.spis li.spis-pod { margin-left: 1.1em; list-style: circle; font-size: .96rem; }
.spis a { color: var(--ink); font-weight: 500; text-decoration: none; }
.spis a:hover { text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
@media (min-width: 760px) { .spis { padding: 26px 34px; } }

/* ── Przyklejony pasek spisu (spis.js) ── */
.spis-pasek { position: fixed; top: calc(var(--header, 88px) + 8px); left: 0; right: 0; z-index: 25; padding: 0 16px; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.spis-pasek.widoczny { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s linear 0s; }
.spis-pasek-karta { pointer-events: auto; max-width: 850px; margin: 0 auto; background: color-mix(in oklch, var(--white) 95%, transparent); -webkit-backdrop-filter: saturate(1.2) blur(12px); backdrop-filter: saturate(1.2) blur(12px); border: 1px solid var(--line); border-top: 3px solid var(--brand); box-shadow: 0 16px 36px -20px rgba(8, 19, 35, .45); overflow: hidden; }
.spis-pasek-przycisk { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 16px 8px 20px; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ink); }
.spis-pasek-etykieta { flex: none; font-weight: 800; font-size: 1.05rem; }
.spis-pasek-biezacy { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .95rem; font-weight: 500; color: var(--ink-2); }
.spis-pasek-nr { color: var(--brand-strong); font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; }
.spis-pasek .spis-znak { transform: none; }
.spis-pasek.otwarty .spis-znak { transform: rotate(180deg); }
.spis-pasek-lista { display: grid; gap: 2px; margin: 0; padding: 0 12px 0 2.6em; max-height: 0; overflow: auto; overscroll-behavior: contain; font-size: .98rem; line-height: 1.4; transition: max-height .4s cubic-bezier(.45, .05, .25, 1), padding .4s cubic-bezier(.45, .05, .25, 1); }
.spis-pasek.otwarty .spis-pasek-lista { max-height: min(62vh, 520px); max-height: min(62dvh, 520px); padding: 2px 12px 14px 2.6em; }
.spis-pasek-lista li::marker { color: var(--brand-strong); font-weight: 700; font-variant-numeric: tabular-nums; }
.spis-pasek-lista li.spis-pod { margin-left: 1.1em; list-style: circle; }
.spis-pasek-lista a { display: block; padding: 8px 10px; color: var(--ink); text-decoration: none; transition: background-color .2s; }
.spis-pasek-lista a:hover { background: var(--surface-2); }
.spis-pasek-lista li.biezacy > a { background: color-mix(in oklch, var(--brand) 22%, transparent); font-weight: 700; }
@media (max-width: 559px) { .spis-pasek { padding: 0 10px; } .spis-pasek-etykieta { display: none; } .spis-pasek-przycisk { padding-left: 16px; } }

/* ── Podobne ── */
.blog-podobne { background: var(--surface-2); }
.blog-podobne-naglowek { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.blog-podobne-naglowek h2 { margin: 0; }

@media (max-width: 1000px) {
  .blog-siatka { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-karta-wyrozniona { grid-template-columns: 1fr; }
  .blog-karta-wyrozniona .blog-karta-zdjecie { min-height: 0; aspect-ratio: 16 / 9; }
  .blog-karta-wyrozniona .blog-karta-zdjecie img { position: static; }
}
@media (max-width: 640px) {
  .blog-siatka { grid-template-columns: 1fr; gap: 18px; }
  .blog-karta-tresc { padding: 20px; }
  .spis { margin-bottom: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .spis-znak, .spis-pasek, .spis-pasek-lista { transition: none; }
}
@media print { .spis-pasek, .blog-podobne { display: none; } }
