/* ============================================================
   SoftwarePedia — sekcje dodatkowe: FAQ, glosariusz, galeria,
   karty artykulow, strona 404.

   Powstal 2026-09-10 ze scalenia blokow <style> powielonych
   w 1041 stronach (7 wariantow, 1042 bloki, ~11 kB duplikatu).
   Zrodlo prawdy jest tutaj — nie wklejaj tych regul z powrotem
   do <style> w stronach.

   Serwis ma DWA pokolenia markupu sekcji i oba sa aktywne:
     - nowsze:  <details class="faq__item">, .glossary (652 strony)
     - starsze: .faq-list/.faq-item, .glos-list/.glos-item (382 strony)
   Reguly obu pokolen sa nizej obok siebie. Nie zamieniaj jednego
   pokolenia na drugie — patrz AUDIT-AGENT-PROMPT.md, sekcja 2.
   ============================================================ */

/* ── Wspolna oprawa sekcji (pokolenie nowsze) ───────────────── */
.faq-section,
.glossary-section,
.gallery-section {
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
  border-top: 1px solid var(--line);
}
.faq-section .section-title,
.glossary-section .section-title,
.gallery-section .section-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-strong);
  margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.faq-section .section-title::before,
.glossary-section .section-title::before,
.gallery-section .section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.25em;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.faq-section .section-title::before     { background: var(--brand-500); }
.glossary-section .section-title::before { background: var(--amber); }
.gallery-section .section-title::before  { background: var(--ink-400); }

/* ── FAQ — pokolenie nowsze (<details class="faq__item">) ───── */
.faq {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  max-width: var(--container-narrow);
}
.faq__item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease),
              box-shadow  var(--dur) var(--ease);
}
.faq__item:hover { border-color: var(--brand-300); }
.faq__item[open] {
  border-color: var(--brand-400);
  box-shadow: var(--sh-sm), 0 0 0 3px var(--brand-50);
}
.faq__q {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-strong);
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
  line-height: 1.4;
}
.faq__q::marker,
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "";
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--brand-100);
  border-radius: 50%;
  /* strzalka jako data-URI — tu nie da sie uzyc var(), kolor wpisany wprost */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23C24304' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-size: 100%;
  transition: transform var(--dur) var(--ease), background-color var(--dur);
}
.faq__item[open] .faq__q::after {
  transform: rotate(180deg);
  background-color: var(--brand-200);
}
.faq__a {
  padding: 0 1.4rem 1.25rem;
  color: var(--text-muted);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  border-top: 1px solid var(--line);
  margin-top: 0;
}

/* ── FAQ — pokolenie starsze (.faq-list / .faq-item) ────────── */
.faq-list { display: flex; flex-direction: column; gap: var(--sp-4); }
.faq-item { border-left: 3px solid var(--brand-500); padding-left: var(--sp-4); }
.faq-q    { font-size: var(--fs-md); font-weight: 600; margin: 0 0 var(--sp-2); }
.faq-a    { margin: 0; color: var(--text-2); }

/* ── Glosariusz — pokolenie nowsze (.glossary) ──────────────── */
.glossary-section { background: var(--bg-soft); }
.glossary {
  display: grid;
  grid-template-columns: minmax(10rem, 22%) 1fr;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.glossary__term,
.glossary__def {
  padding: .85rem 1.2rem;
  font-size: var(--fs-sm);
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
  margin: 0;
}
.glossary__term:last-of-type,
.glossary__def:last-of-type { border-bottom: none; }
.glossary__term {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--accent-text);
  background: var(--bg-tint);
  border-right: 1px solid var(--line-2);
  display: flex;
  align-items: flex-start;
}
.glossary__def {
  color: var(--text);
  background: var(--bg);
}
@media (max-width: 600px) {
  .glossary { grid-template-columns: 1fr; }
  .glossary__term {
    border-right: none;
    border-bottom: none;
    padding-bottom: .2rem;
    background: var(--bg-soft-2);
  }
  .glossary__def { padding-top: .35rem; }
}

/* ── Glosariusz — pokolenie starsze (.glos-list) ────────────── */
.glos-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.glos-item { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4); }
.glos-term { font-weight: 700; font-size: var(--fs-sm); color: var(--accent-text); margin: 0 0 var(--sp-2); }
.glos-def  { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }

/* ── Galeria — domyslnie wariant nowszy (miniatury 200 px) ──── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.gallery-item {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-sm);
  background: var(--bg-soft);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.gallery-item:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.gallery-item a { display: block; }
.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: opacity var(--dur);
}
.gallery-item:hover img { opacity: .92; }
.gallery-item figcaption {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* ── Galeria — 29 stron ze starszym markupem zachowuje
      naturalna wysokosc miniatur (bez przycinania kadru).
      Modyfikator dodany do .gallery-grid na tych stronach. ──── */
.gallery-grid--natural {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-4);
}
.gallery-grid--natural .gallery-item {
  margin: 0;
  box-shadow: none;
  background: var(--surface-2);
  transition: none;
}
.gallery-grid--natural .gallery-item:hover {
  box-shadow: none;
  transform: none;
}
.gallery-grid--natural .gallery-item img {
  height: auto;
  object-fit: initial;
  transition: opacity .2s;
}
.gallery-grid--natural .gallery-item:hover img { opacity: 1; }
.gallery-grid--natural .gallery-item a:hover img { opacity: .85; }

/* ── Karty artykulow (indeksy kategorii) ────────────────────── */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-5);
}
.art-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.art-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  border-color: var(--brand-300);
}
.art-card h3 { font-size: var(--fs-md); line-height: var(--lh-snug); color: var(--text-strong); margin: 0; }
.art-card p  { font-size: var(--fs-sm); color: var(--text-muted); line-height: var(--lh-body); margin: 0; flex: 1; }
.art-card .link-arrow {
  font-size: var(--fs-sm);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
}
.art-card .link-arrow svg { width: 16px; height: 16px; }
.art-card__tag {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: .08em;
  color: var(--accent-text);
  text-transform: uppercase;
}

/* Spis tresci uzywa szerszej siatki i wiekszego oddechu w karcie */
.art-grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.art-grid--wide .art-card { padding: var(--sp-6); }

.cat-nav { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* ── Strona 404 ─────────────────────────────────────────────── */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-10) var(--gutter);
}
.error-page__num {
  font-family: var(--font-display);
  font-size: clamp(5rem, 4rem + 5vw, 9rem);
  font-weight: 700;
  line-height: 1;
  color: var(--brand-500);
  margin-bottom: var(--sp-4);
}
.error-page__title { font-size: var(--fs-xl); color: var(--text-strong); margin-bottom: var(--sp-3); }
.error-page__text  { color: var(--text-muted); max-width: 36rem; margin: 0 auto var(--sp-7); }
