/* Sekcja „Programy” — karta katalogowa produktu. Ładowana tylko na /programy/ i podstronach. */

.pg { --pg-rule: #d9dee5; --pg-code: #0d2238; --pg-code-text: #d7e6f5; }
.pg .container { max-width: 1120px; }

/* ---------- nagłówek ---------- */
.pg-head { padding: 6rem 0 2rem; background: var(--bg-secondary); border-bottom: 1px solid var(--pg-rule); }
.pg-head h1 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.15; max-width: 22ch; margin: .6rem 0 1rem; }
.pg-head--wide h1 { max-width: 26ch; }
.pg-lead { font-size: 1.1rem; line-height: 1.65; color: var(--text-secondary); max-width: 62ch; }
.pg-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- układ strony programu: treść + panel ---------- */
.pg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 3rem; padding: 2.5rem 0 4rem; align-items: start; }
@media (max-width: 960px) { .pg-layout { grid-template-columns: 1fr; gap: 2rem; } .pg-side { order: -1; } }

.pg-shot { margin: 0 0 2.5rem; }
.pg-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--pg-rule); border-radius: 4px; box-shadow: 0 1px 2px rgba(13,34,56,.08); }
.pg-shot figcaption { margin-top: .6rem; font-size: .88rem; color: var(--text-secondary); }

.pg-main { min-width: 0; }
.pg-main > section { margin-bottom: 3rem; scroll-margin-top: 5.5rem; }
.pg-main h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 1rem; padding-top: 1.25rem; border-top: 1px solid var(--pg-rule); }
.pg-main h3 { font-size: 1.05rem; margin: 1.5rem 0 .35rem; }
.pg-main p, .pg-main li { line-height: 1.75; max-width: 70ch; }
.pg-main p { margin: 0 0 1rem; }
.pg-main ul { margin: 0 0 1rem 1.25rem; }
.pg-main li { margin-bottom: .45rem; }
.pg-main a { color: var(--accent-blue); }

/* ---------- panel specyfikacji ---------- */
.pg-side { position: sticky; top: 5.5rem; }
@media (max-width: 960px) { .pg-side { position: static; } }
.pg-spec { border: 1px solid var(--pg-rule); border-radius: 4px; background: #fff; }
.pg-spec h2 { font-size: 1rem; margin: 0; padding: .85rem 1rem; border-bottom: 1px solid var(--pg-rule); background: var(--bg-secondary); }
.pg-spec dl { margin: 0; padding: 0 1rem; }
.pg-spec dl > div { padding: .7rem 0; border-bottom: 1px solid var(--bg-tertiary); }
.pg-spec dl > div:last-child { border-bottom: 0; }
.pg-spec dt { font-size: .8rem; color: var(--text-secondary); margin-bottom: .1rem; }
.pg-spec dd { margin: 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
.pg-spec .pg-actions { margin: 0; padding: 1rem; border-top: 1px solid var(--pg-rule); flex-direction: column; }
.pg-spec .btn { width: 100%; text-align: center; }
.pg-files { list-style: none; margin: 0; padding: 0 1rem 1rem; font-size: .88rem; }
.pg-files li { margin: 0 0 .5rem; }
.pg-files small { display: block; color: var(--text-secondary); }

.pg-toc { margin-top: 1.25rem; font-size: .92rem; }
.pg-toc h2 { font-size: .95rem; margin: 0 0 .5rem; }
.pg-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--pg-rule); }
.pg-toc a { display: block; padding: .3rem .85rem; color: var(--text-secondary) !important; text-decoration: none; }
.pg-toc a:hover { color: var(--accent-blue) !important; border-left-color: var(--accent-blue); }
@media (max-width: 960px) { .pg-toc { display: none; } }

/* ---------- zadania: tabela „Chcę zrobić → jak” ---------- */
.pg-tasks { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
.pg-tasks th, .pg-tasks td { text-align: left; vertical-align: top; padding: .85rem 1rem .85rem 0; border-bottom: 1px solid var(--pg-rule); line-height: 1.6; }
.pg-tasks thead th { font-size: .85rem; color: var(--text-secondary); font-weight: 600; border-bottom: 2px solid var(--pg-rule); }
.pg-tasks tbody th { font-weight: 600; width: 34%; }
.pg-tasks td a, .pg-tasks th a { font-weight: 600; }
@media (max-width: 640px) {
  .pg-tasks thead { display: none; }
  .pg-tasks, .pg-tasks tbody, .pg-tasks tr, .pg-tasks th, .pg-tasks td { display: block; width: 100%; }
  .pg-tasks tr { padding: .75rem 0; border-bottom: 1px solid var(--pg-rule); }
  .pg-tasks th, .pg-tasks td { border: 0; padding: 0 0 .3rem; }
}

/* ---------- kod ---------- */
.pg-code { margin: .75rem 0 1.25rem; padding: 1rem 1.15rem; background: var(--pg-code); color: var(--pg-code-text); border-radius: 4px; overflow-x: auto;
           font: .86rem/1.7 ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; tab-size: 4; }
.pg-code code { background: none; color: inherit; padding: 0; font: inherit; white-space: pre; }

/* ---------- uwaga o zapisie ---------- */
.pg-warn { border-left: 3px solid var(--accent-blue); background: var(--bg-secondary); padding: .9rem 1.1rem; margin: 1rem 0 0; border-radius: 0 4px 4px 0; }
.pg-warn p { margin: 0; }

/* ---------- FAQ ---------- */
.pg-faq details { border-bottom: 1px solid var(--pg-rule); }
.pg-faq details:first-of-type { border-top: 1px solid var(--pg-rule); }
.pg-faq summary { cursor: pointer; padding: 1rem 2rem 1rem 0; font-weight: 600; line-height: 1.5; list-style: none; position: relative; }
.pg-faq summary::-webkit-details-marker { display: none; }
.pg-faq summary::after { content: '+'; position: absolute; right: .25rem; top: .85rem; font-size: 1.3rem; font-weight: 400; color: var(--text-secondary); }
.pg-faq details[open] summary::after { content: '\2212'; }
.pg-faq summary:focus-visible, .pg a:focus-visible, .pg .btn:focus-visible { outline: 3px solid var(--accent-blue-light); outline-offset: 2px; }
.pg-faq details p { padding: 0 0 1.1rem; margin: 0; }

/* ---------- hub: lista programów (wiersze, nie karty) ---------- */
.pg-find { padding: 2.5rem 0 1rem; }
.pg-find h2, .pg-list h2, .pg-compare h2, .pg-hubfaq h2 { font-size: 1.5rem; margin: 0 0 .5rem; }
.pg-find > .container > p { color: var(--text-secondary); margin: 0 0 1.25rem; max-width: 62ch; }

.pg-list { padding: 2rem 0; }
.pg-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2.5rem; padding: 2.5rem 0; border-top: 1px solid var(--pg-rule); align-items: center; }
.pg-row:first-of-type { margin-top: 1rem; }
@media (max-width: 860px) { .pg-row { grid-template-columns: 1fr; gap: 1.25rem; } }
.pg-row img { display: block; width: 100%; height: auto; border: 1px solid var(--pg-rule); border-radius: 4px; }
.pg-row h3 { font-size: 1.4rem; margin: 0 0 .25rem; }
.pg-row h3 a { color: var(--text-primary) !important; text-decoration: none; }
.pg-row h3 a:hover { color: var(--accent-blue) !important; }
.pg-row .pg-meta { color: var(--text-secondary); font-size: .9rem; margin: 0 0 .8rem; font-variant-numeric: tabular-nums; }
.pg-row p { line-height: 1.7; margin: 0 0 1rem; max-width: 56ch; }

.pg-compare { padding: 2rem 0; }
.pg-tablewrap { overflow-x: auto; }
.pg-cmp { width: 100%; min-width: 640px; border-collapse: collapse; font-size: .95rem; }
.pg-cmp th, .pg-cmp td { text-align: left; padding: .75rem 1rem .75rem 0; border-bottom: 1px solid var(--pg-rule); vertical-align: top; line-height: 1.5; }
.pg-cmp thead th { border-bottom: 2px solid var(--pg-rule); font-size: .95rem; }
.pg-cmp tbody th { font-weight: 600; width: 26%; }
.pg-cmp .pg-tak { font-weight: 600; }
.pg-cmp .pg-nie { color: var(--text-muted); }

.pg-hubfaq { padding: 2rem 0 4rem; }
.pg-hubfaq .pg-faq { max-width: 760px; margin-top: 1rem; }

/* ---------- pokrewne ---------- */
.pg-related { padding: 2.5rem 0 4rem; background: var(--bg-secondary); border-top: 1px solid var(--pg-rule); }
.pg-related h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.pg-related ul { list-style: none; margin: 0 0 1.75rem; padding: 0; }
.pg-related li { padding: .55rem 0; border-bottom: 1px solid var(--pg-rule); max-width: 760px; }
.pg-related li span { display: block; color: var(--text-secondary); font-size: .92rem; }

@media (prefers-reduced-motion: reduce) { .pg * { transition: none !important; scroll-behavior: auto !important; } }

/* Podpisy tabel dla czytników ekranu (rdzeń WP jest u nas wyłączony, więc klasa nie istnieje w motywie). */
.pg .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
