/* ==========================================================================
   IGA ARTICLE SYSTEM — igameble.pl
   Wersja: 2.0 | Data: 2025-02-06
   Loaded by Content Bridge plugin on single posts.
   ========================================================================== */

/* ---------- ZMIENNE GLOBALNE ---------- */
:root {
  --iga-accent: #b08d57;
  --iga-accent-2: #2f3a40;
  --iga-soft: #f6f2ec;
  --iga-text: #1e1f21;
  --iga-border: rgba(0, 0, 0, 0.08);
  --iga-radius: 14px;
  --iga-gap: 14px;
}

/* ---------- WRAPPER ARTYKUŁU ---------- */
.iga-article {
  color: var(--iga-text);
  line-height: 1.78;
  font-size: 1rem;
}
.iga-article h2 {
  margin: 1.6em 0 0.6em;
  font-size: 1.45em;
  color: var(--iga-accent-2);
}
.iga-article h3 {
  margin: 1.2em 0 0.4em;
  font-size: 1.15em;
}
.iga-article p {
  margin: 0.7em 0;
}
.iga-article a {
  color: var(--iga-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.iga-article a:hover {
  color: var(--iga-accent-2);
}

/* ---------- SCROLL OFFSET (sticky header) ---------- */
.iga-article h2[id] {
  scroll-margin-top: 80px;
}
@media (min-width: 768px) {
  .iga-article h2[id] {
    scroll-margin-top: 110px;
  }
}

/* ---------- SPIS TREŚCI (TOC) ---------- */
.iga-toc {
  background: #F4F9FC;
  border: 1px solid #dce8f0;
  border-left: 5px solid #293292;
  padding: 16px 20px;
  border-radius: var(--iga-radius);
  margin: 10px 0;
}
.iga-toc strong,
.iga-toc b {
  display: block;
  margin-bottom: 6px;
  font-size: 1.05em;
}
.iga-toc ul {
  margin: 0.4em 0 0;
  padding-left: 18px;
  list-style: none;
}
.iga-toc li {
  margin: 0.3em 0;
  position: relative;
  padding-left: 20px;
}
.iga-toc li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #293292;
  font-size: 0.85em;
}
.iga-toc a {
  text-decoration: none;
  color: var(--iga-accent-2);
}
.iga-toc a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  color: #293292;
}

/* ---------- CALLOUTY ---------- */
.iga-callout {
  background: #fff;
  padding: 18px 20px 18px 50px;
  border-radius: 12px;
  margin: 24px 0;
  position: relative;
  border: 1.5px solid var(--iga-border);
}
.iga-callout::before {
  position: absolute;
  left: 16px;
  top: 18px;
  font-size: 1.2em;
  line-height: 1;
}
.iga-callout strong:first-child,
.iga-callout b:first-child {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Wskazówka — żółty/amber */
.iga-callout--tip {
  border-color: #e5a90a;
  background: #fffbeb;
}
.iga-callout--tip::before {
  content: "💡";
}
.iga-callout--tip strong:first-child,
.iga-callout--tip b:first-child {
  color: #92610a;
}

/* Uwaga / Ostrzeżenie — czerwony */
.iga-callout--warn {
  border-color: #e04545;
  background: #fef2f2;
}
.iga-callout--warn::before {
  content: "⚠️";
}
.iga-callout--warn strong:first-child,
.iga-callout--warn b:first-child {
  color: #991b1b;
}

/* Inspiracja — zielony */
.iga-callout--inspiration {
  border-color: #16a34a;
  background: #f0fdf4;
}
.iga-callout--inspiration::before {
  content: "🌿";
}
.iga-callout--inspiration strong:first-child,
.iga-callout--inspiration b:first-child {
  color: #166534;
}

/* Pro / Porada — akcentowy */
.iga-callout--pro {
  border-color: #2a7;
  background: rgba(34, 170, 119, 0.06);
}
.iga-callout--pro::before {
  content: "✅";
}

/* Fakt / Ciekawostka — kolory jak spis treści */
.iga-callout--fact {
  border-color: #293292;
  background: #F4F9FC;
}
.iga-callout--fact::before {
  content: "ℹ️";
}
.iga-callout--fact strong:first-child,
.iga-callout--fact b:first-child {
  color: #293292;
}

/* Informacja — niebieski (breadcrumbs) */
.iga-callout--info {
  border-color: #293292;
  background: #F4F9FC;
}
.iga-callout--info::before {
  content: "ℹ️";
}
.iga-callout--info strong:first-child,
.iga-callout--info b:first-child {
  color: #293292;
}

/* ---------- CHECKLIST ---------- */
.iga-checklist {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--iga-border);
  padding: 14px 16px;
  border-radius: var(--iga-radius);
  margin: var(--iga-gap) 0;
}
.iga-checklist ul {
  margin: 0.2em 0;
  padding-left: 0;
  list-style: none;
}
.iga-checklist li {
  margin: 0.4em 0;
  padding-left: 24px;
  position: relative;
}
.iga-checklist li::before {
  content: "☑";
  position: absolute;
  left: 0;
  color: var(--iga-accent);
  font-size: 1.1em;
}

/* ---------- TABELA ---------- */
/* Wrapper z klasą iga-table */
.iga-table {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: var(--iga-radius);
  margin: var(--iga-gap) 0;
  -webkit-overflow-scrolling: touch;
}
.iga-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  background: #fff;
}
.iga-table th {
  text-align: left;
  background: #fff;
  border-bottom: 2px solid var(--iga-accent);
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.92em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--iga-accent-2);
}
.iga-table td {
  border-bottom: 1px solid #c8cdd5;
  padding: 12px 14px;
  vertical-align: top;
}
.iga-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}
.iga-table tr:last-child td {
  border-bottom: 0;
}
.iga-table tr:hover td {
  background: rgba(176, 141, 87, 0.06);
}

/* Tabele bez wrappera (bezpośrednio w artykule) */
.iga-article > table,
.iga-article table:not(.iga-table table) {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin: var(--iga-gap) 0;
  border: 1px solid #e5e7eb;
  border-radius: var(--iga-radius);
  overflow: hidden;
}
.iga-article > table th,
.iga-article table:not(.iga-table table) th {
  text-align: left;
  background: #fff;
  border-bottom: 2px solid var(--iga-accent);
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.92em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--iga-accent-2);
}
.iga-article > table td,
.iga-article table:not(.iga-table table) td {
  border-bottom: 1px solid #c8cdd5;
  padding: 12px 14px;
  vertical-align: top;
}
.iga-article > table tbody tr:nth-child(even) td,
.iga-article table:not(.iga-table table) tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.02);
}
.iga-article > table tr:last-child td,
.iga-article table:not(.iga-table table) tr:last-child td {
  border-bottom: 0;
}
.iga-article > table tr:hover td,
.iga-article table:not(.iga-table table) tr:hover td {
  background: rgba(176, 141, 87, 0.06);
}

/* Tabela: mobile card layout (wymaga data-label na td) */
@media (max-width: 700px) {
  .iga-table table {
    min-width: 0;
  }
  .iga-table table,
  .iga-table thead,
  .iga-table tbody,
  .iga-table th,
  .iga-table td,
  .iga-table tr {
    display: block;
  }
  .iga-table thead {
    display: none;
  }
  .iga-table tr {
    border-bottom: 1px solid var(--iga-border);
    padding: 12px 14px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  }
  .iga-table td {
    border: 0;
    padding: 6px 0;
  }
  .iga-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: var(--iga-accent-2);
    display: inline;
  }
}

/* ---------- KPI GRID ---------- */
.iga-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: var(--iga-gap) 0;
}
.iga-kpi {
  border: 1px solid var(--iga-border);
  border-radius: var(--iga-radius);
  padding: 14px 16px;
  background: #fff;
  text-align: center;
}
.iga-kpi strong {
  display: block;
  font-size: 1.3em;
  color: var(--iga-accent);
  margin-bottom: 4px;
}
.iga-kpi span {
  font-size: 0.88em;
  color: #666;
}
@media (max-width: 700px) {
  .iga-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- FAQ (accordion: <details>/<summary>) ---------- */
.iga-faq {
  border: 1px solid #dce8f0;
  border-radius: var(--iga-radius);
  background: #fff;
  padding: 0;
  margin: 28px 0 var(--iga-gap);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(41, 50, 146, 0.06);
}
.iga-faq > h2,
.iga-faq > h3 {
  background: linear-gradient(135deg, #F4F9FC 0%, #eef3fa 100%);
  margin: 0;
  padding: 18px 24px;
  font-size: 1.15em;
  color: #293292;
  border-bottom: 2px solid #293292;
  letter-spacing: 0.01em;
}
.iga-faq > h3::before {
  content: "❓ ";
  font-size: 1em;
}

/* Accordion item */
details.iga-faq__item {
  border-top: 1px solid #e5e7eb;
  padding: 0;
  margin: 0;
}
details.iga-faq__item:first-of-type {
  border-top: 0;
}
details.iga-faq__item summary {
  cursor: pointer;
  font-size: 1.02em;
  font-weight: 600;
  color: var(--iga-accent-2);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  user-select: none;
  transition: background 0.15s, padding-left 0.15s;
}
details.iga-faq__item summary:hover {
  background: rgba(41, 50, 146, 0.04);
  padding-left: 28px;
}
details.iga-faq__item summary::-webkit-details-marker {
  display: none;
}
details.iga-faq__item summary::after {
  content: "+";
  font-size: 1.2em;
  font-weight: 600;
  color: #fff;
  background: #293292;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  flex-shrink: 0;
  margin-left: 12px;
  transition: background 0.2s, transform 0.2s;
}
details.iga-faq__item summary:hover::after {
  background: #1e2570;
  transform: scale(1.1);
}
details[open].iga-faq__item summary::after {
  content: "\2212"; /* minus sign */
  background: var(--iga-accent);
}
details[open].iga-faq__item summary {
  background: rgba(41, 50, 146, 0.03);
  border-bottom: 1px solid #e5e7eb;
}
details.iga-faq__item p,
details.iga-faq__item .iga-faq__answer {
  margin: 0;
  padding: 16px 24px;
  color: #444;
  line-height: 1.75;
  background: #fafbfd;
}
details.iga-faq__item ul,
details.iga-faq__item ol {
  margin: 0;
  padding: 10px 24px 16px 44px;
  color: #444;
  background: #fafbfd;
}
details.iga-faq__item li {
  margin: 4px 0;
}
/* Last item rounded bottom */
details.iga-faq__item:last-child p,
details.iga-faq__item:last-child .iga-faq__answer,
details.iga-faq__item:last-child ul,
details.iga-faq__item:last-child ol {
  border-radius: 0 0 var(--iga-radius) var(--iga-radius);
}

/* Backward compat: old <div class="iga-faq__item"><h3>/<p> format */
div.iga-faq__item {
  border-top: 1px solid var(--iga-border);
  padding-top: 12px;
  margin-top: 12px;
}
div.iga-faq__item:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
div.iga-faq__item h3 {
  margin: 0 0 6px;
  font-size: 1.05em;
  color: var(--iga-accent-2);
}
div.iga-faq__item p {
  margin: 0;
  color: #444;
}

/* ---------- HIGHLIGHT INLINE ---------- */
.iga-highlight {
  background: linear-gradient(180deg, transparent 55%, rgba(176, 141, 87, 0.28) 55%);
  padding: 0 0.15em;
  border-radius: 4px;
}

/* ---------- POWIĄZANE ARTYKUŁY ---------- */
.iga-related {
  border-top: 2px solid var(--iga-accent);
  padding: 18px 0 0;
  margin: 24px 0 var(--iga-gap);
}
.iga-related strong,
.iga-related b {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05em;
  color: var(--iga-accent-2);
}
.iga-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.iga-related li {
  margin: 8px 0;
  padding-left: 20px;
  position: relative;
}
.iga-related li::before {
  content: "📄";
  position: absolute;
  left: 0;
  font-size: 0.9em;
}
.iga-related a {
  font-weight: 600;
}
.iga-related .iga-related__desc {
  display: block;
  font-size: 0.88em;
  color: #666;
  margin-top: 2px;
}

/* ---------- CTA BOX ---------- */
.iga-cta {
  background: var(--iga-soft);
  border: 2px solid var(--iga-accent);
  border-radius: var(--iga-radius);
  padding: 20px 24px;
  margin: var(--iga-gap) 0;
  text-align: center;
}
.iga-cta a {
  display: inline-block;
  background: var(--iga-accent);
  color: #fff;
  padding: 10px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 10px;
  transition: background 0.2s;
}
.iga-cta a:hover {
  background: var(--iga-accent-2);
  color: #fff;
}

/* ---------- RANKING CARD ---------- */
.iga-ranking-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1.5px solid var(--iga-border);
  border-radius: var(--iga-radius);
  background: #fff;
  margin: 28px 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s;
}
.iga-ranking-card:hover {
  box-shadow: 0 4px 16px rgba(176, 141, 87, 0.12);
}
.iga-ranking-card__badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 44px;
  background: var(--iga-accent);
  color: #fff;
  font-size: 1.3em;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 0 var(--iga-radius) 0;
  z-index: 2;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.08);
}
.iga-ranking-card__image {
  flex: 0 0 280px;
  max-width: 280px;
  min-height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f8f6;
}
.iga-ranking-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}
.iga-ranking-card:hover .iga-ranking-card__image img {
  transform: scale(1.03);
}
.iga-ranking-card__body {
  flex: 1 1 0;
  padding: 20px 24px;
  min-width: 0;
}
.iga-ranking-card__body h2 {
  margin: 0 0 8px;
  font-size: 1.25em;
  color: var(--iga-accent-2);
  line-height: 1.3;
}
.iga-ranking-card__body h3 {
  margin: 0 0 8px;
  font-size: 1.15em;
  color: var(--iga-accent-2);
}
.iga-ranking-card__price {
  font-size: 1.35em;
  font-weight: 800;
  color: var(--iga-accent);
  margin-bottom: 10px;
}
.iga-ranking-card__body p {
  margin: 0 0 12px;
  color: #444;
  line-height: 1.65;
}
.iga-ranking-card__body .iga-callout {
  margin: 12px 0 0;
  padding: 12px 14px 12px 42px;
  font-size: 0.93em;
}
.iga-ranking-card__body .iga-callout ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.iga-ranking-card__body .iga-callout li {
  margin: 3px 0;
}
.iga-ranking-card__cta {
  flex: 0 0 100%;
  padding: 0 24px 20px;
  display: flex;
  justify-content: center;
}
.iga-ranking-card__cta a {
  display: inline-block;
  background: var(--iga-accent);
  color: #fff;
  padding: 10px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95em;
  transition: background 0.2s, transform 0.15s;
}
.iga-ranking-card__cta a:hover {
  background: var(--iga-accent-2);
  color: #fff;
  transform: translateY(-1px);
}

/* Ranking card: responsive */
@media (max-width: 700px) {
  .iga-ranking-card {
    flex-direction: column;
  }
  .iga-ranking-card__image {
    flex: 0 0 auto;
    max-width: 100%;
    min-height: 180px;
    max-height: 260px;
  }
  .iga-ranking-card__body {
    padding: 16px 18px;
  }
  .iga-ranking-card__cta {
    padding: 0 18px 16px;
    justify-content: stretch;
  }
  .iga-ranking-card__cta a {
    width: 100%;
    text-align: center;
  }
}

/* ---------- RANKING DETAILS (50/50: Zalety + Cechy) ---------- */
.iga-ranking-details {
  display: flex;
  gap: 16px;
  margin: 14px 0 28px;
  align-items: stretch;
}
.iga-ranking-details > .iga-callout {
  flex: 1 1 50%;
  margin: 0;
  min-width: 0;
}
.iga-ranking-details > .iga-table {
  flex: 1 1 50%;
  margin: 0;
  min-width: 0;
}
.iga-ranking-details > .iga-table table {
  min-width: 0;
  height: 100%;
}
@media (max-width: 700px) {
  .iga-ranking-details {
    flex-direction: column;
  }
  .iga-ranking-details > .iga-callout,
  .iga-ranking-details > .iga-table {
    flex: 1 1 auto;
  }
}
