/* ============================================================
   KUBAWEB.DEV | PORADNIK | LISTA ARTYKUŁÓW
   Osobny arkusz dla widoku kategorii w Helix Ultimate.
   Zakres: tylko kategorie zawierające .kw-guide-category.
   Sprawdzona struktura szablonu:
   .blog > .category-desc .kw-guide-category
   .blog > .article-list > .row > .col-lg-* > .article
   .article > .article-body > .article-header / .article-introtext
   ============================================================ */

/* 1. Siatka: niezależna od podziału na wiersze generowanego przez Helix. */
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) {
  --kw-list-orange: #ff8000;
  --kw-list-hover: #ffa236;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px !important;
  align-items: stretch;
  margin: 42px 0 56px !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) > .row {
  display: contents !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) > .row > [class*="col-"] {
  width: auto !important;
  max-width: none !important;
  flex: none !important;
  min-width: 0;
  padding: 0 !important;
  display: flex;
}

/* 2. Karta artykułu. */
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0 !important;
  padding: 30px !important;
  background: linear-gradient(145deg, #202020 0%, #151515 100%) !important;
  border: 1px solid #343434 !important;
  border-radius: 17px !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article:hover {
  transform: translateY(-4px);
  border-color: #ff8000 !important;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .14) !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-body,
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-introtext {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

/* 3. Tytuł. */
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-header {
  margin: 0 0 17px !important;
  padding: 0 !important;
  border: 0 !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-header :is(h2, h3, h4) {
  margin: 0 !important;
  padding: 0 !important;
  color: #fff !important;
  font-size: clamp(21px, 1.65vw, 26px) !important;
  font-weight: 800 !important;
  line-height: 1.32 !important;
  letter-spacing: -.025em;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-header a {
  color: #fff !important;
  text-decoration: none !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-header a:hover,
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-header a:focus-visible {
  color: #ff8000 !important;
}

/* 4. Autor, data i kategoria. */
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-info {
  margin: 0 0 22px !important;
  padding: 0 0 18px !important;
  border-bottom: 1px solid #3c3c3c;
  color: #bcbcbc !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-info :is(a, span, time, dd, dt, li) {
  color: #bcbcbc !important;
  font-size: inherit !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-info a:hover {
  color: #ff8000 !important;
}

/* 5. Zajawka. */
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-introtext > :is(p, div):not(.readmore) {
  margin: 0 0 18px !important;
  color: #d0d0d0 !important;
  font-size: 15.5px !important;
  font-weight: 400;
  line-height: 1.78 !important;
}

/* 6. Link „Czytaj więcej” – przycisk przy dole karty.
   Oryginalny tekst pozostaje w HTML (np. dla czytników ekranu). */
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore {
  margin: auto 0 0 !important;
  padding: 24px 0 0 !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 45px;
  max-width: 100%;
  padding: 12px 19px !important;
  border: 1px solid #ff8000 !important;
  border-radius: 9px !important;
  background: #ff8000 !important;
  color: #161616 !important;
  font-size: 0 !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: background-color .2s ease, border-color .2s ease;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a :is(span, strong, small, i) {
  font-size: 0 !important;
  line-height: 0 !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a::before {
  content: "Czytaj artykuł";
  display: inline-block;
  font-size: 14px !important;
  line-height: 1.4;
  white-space: nowrap;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a::after {
  content: "↗";
  font-size: 19px !important;
  line-height: 1;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a:hover,
.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a:focus-visible {
  background: #ffa236 !important;
  border-color: #ffa236 !important;
  color: #161616 !important;
}

.blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 3px;
}

/* 7. Układ responsywny. */
@media (max-width: 1100px) {
  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px !important;
  }
}

@media (max-width: 700px) {
  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px !important;
    margin: 30px 0 42px !important;
  }

  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article {
    padding: 25px 22px !important;
    border-radius: 14px !important;
  }

  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article-header :is(h2, h3, h4) {
    font-size: 23px !important;
  }

  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .article,
  .blog:has(.kw-guide-category) .article-list:not(.articles-leading):not(.grid) .readmore a {
    transition: none !important;
    transform: none !important;
  }
}
