/* ==========================================================================
   articles-front.css — token-skin for the Articles module front-end (ST9)
   --------------------------------------------------------------------------
   The Articles renderer (ArticlesRenderer.php) emits NEUTRAL, unstyled BEM
   classes (`.articles-grid`, `.article-card*`, `.articles-pagination*`) and
   the single-article view (blog-article.html / fallback) uses `.article-detail*`.
   This file re-skins them to the storefront's editorial look using ONLY the
   semantic `--shop-*` tokens — no hex, no raw px in spacing — so an accent
   theme-swap in the admin repaints the blog along with the rest of the site.

   Loaded as a standalone <link> AFTER storefront.css in the layout, so any
   (0,2,2) selector here wins ties against the base link-colour trap
   (`body.storefront a:not(.storefront-btn){color:inherit}`, storefront.css:27).
   ========================================================================== */

/* ---- Listing page lead (/blog header) ----------------------------------- */
.storefront-section__lead {
    max-width: 60ch;
    margin: var(--shop-s-4) auto 0;
    color: var(--shop-text-muted);
    font-size: var(--shop-text-lg);
    line-height: var(--shop-lh-relaxed);
}

/* ---- Listing grid (home teaser, /blog) ---------------------------------- */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--shop-s-8);
}
@media (min-width: 640px) {
    .articles-grid--cols-2,
    .articles-grid--cols-3,
    .articles-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
    .articles-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
    .articles-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Empty state ("Brak artykułów." placeholder from the renderer) — never shown.
   On the home teaser the whole section collapses so we don't render a heading
   above an empty grid. :has() unsupported → the placeholder simply stays hidden
   (graceful: no broken layout, just no teaser). */
.articles-grid--empty { display: none; }
.storefront-articles:has(.articles-grid--empty) { display: none; }

/* ---- Article card -------------------------------------------------------- */
.article-card { position: relative; }
.article-card__link {
    display: flex;
    flex-direction: column;
    gap: var(--shop-s-4);
    height: 100%;
    text-decoration: none;
    /* colour inherits ink via the base trap — card text reads as ink. */
}
.article-card__media {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--shop-bg-alt);
    border-radius: var(--shop-card-radius);
}
.article-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--shop-duration-slow) var(--shop-ease-out);
}
.article-card:hover .article-card__img { transform: scale(1.03); }
.article-card:hover .article-card__media { box-shadow: var(--shop-shadow-md); }

.article-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--shop-s-2);
}
.article-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--shop-s-3);
    color: var(--shop-text-muted);
    font-size: var(--shop-text-xs);
    letter-spacing: var(--shop-tracking-wide);
    text-transform: uppercase;
}
.article-card__tag {
    color: var(--shop-accent-hover);
    font-weight: var(--shop-weight-medium);
}
.article-card__title {
    margin: 0;
    font-family: var(--shop-font-display);
    font-weight: var(--shop-weight-regular);
    font-size: var(--shop-text-2xl);
    line-height: var(--shop-lh-snug);
}
.article-card__excerpt {
    margin: 0;
    color: var(--shop-text-muted);
    font-size: var(--shop-text-base);
    line-height: var(--shop-lh-relaxed);
}
.article-card__more {
    margin-top: var(--shop-s-1);
    color: var(--shop-accent-hover);
    font-size: var(--shop-text-sm);
    font-weight: var(--shop-weight-medium);
    letter-spacing: var(--shop-tracking-wide);
}
.article-card:hover .article-card__more {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* ---- Pagination ---------------------------------------------------------- */
.articles-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--shop-s-2);
    margin-top: var(--shop-s-12);
}
.articles-pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: var(--shop-s-2) var(--shop-s-3);
    border: 1px solid var(--shop-border);
    border-radius: var(--shop-radius-md);
    font-size: var(--shop-text-sm);
    text-decoration: none;
    transition: border-color var(--shop-duration-fast) var(--shop-ease-out),
                background var(--shop-duration-fast) var(--shop-ease-out);
}
.articles-pagination__link:hover {
    border-color: var(--shop-text);
    background: var(--shop-bg-alt);
}
/* Active page — cream fill + gold border + dark (visible) text, not a black
   pill. 3 classes (0,3,0) out-ranks the (0,2,2) link-colour trap. */
.articles-pagination .articles-pagination__link.is-active {
    background: var(--shop-bg-alt);
    border-color: var(--shop-accent);
    color: var(--shop-text);
    font-weight: var(--shop-weight-medium);
}

/* ---- Single article (blog-article.html / renderer fallback) -------------- */
.article-detail {
    max-width: 72ch;
    margin-inline: auto;
}
.article-detail__breadcrumb {
    margin-bottom: var(--shop-s-6);
    color: var(--shop-text-muted);
    font-size: var(--shop-text-xs);
    letter-spacing: var(--shop-tracking-wide);
    text-transform: uppercase;
}
.article-detail__breadcrumb a { text-decoration: none; }
.article-detail__breadcrumb a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.article-detail__header { margin-bottom: var(--shop-s-8); }
.article-detail__eyebrow {
    display: block;
    margin-bottom: var(--shop-s-3);
    color: var(--shop-accent-hover);
    font-size: var(--shop-text-xs);
    font-weight: var(--shop-weight-medium);
    letter-spacing: var(--shop-tracking-widest);
    text-transform: uppercase;
}
.article-detail__title {
    margin: 0;
    font-family: var(--shop-font-display);
    font-weight: var(--shop-weight-regular);
    font-size: var(--shop-text-5xl);
    line-height: var(--shop-lh-tight);
}
.article-detail__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--shop-s-3);
    margin-top: var(--shop-s-4);
    color: var(--shop-text-muted);
    font-size: var(--shop-text-sm);
    letter-spacing: var(--shop-tracking-wide);
    text-transform: uppercase;
}
.article-detail__cover {
    margin-top: var(--shop-s-8);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--shop-bg-alt);
    border-radius: var(--shop-card-radius);
}
.article-detail__cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-detail__content {
    margin-top: var(--shop-s-8);
    color: var(--shop-text);
    font-size: var(--shop-text-lg);
    line-height: var(--shop-lh-relaxed);
}
.article-detail__content > :first-child { margin-top: 0; }
.article-detail__content p { margin: 0 0 var(--shop-s-5); }
.article-detail__content h2 {
    margin: var(--shop-s-10) 0 var(--shop-s-4);
    font-family: var(--shop-font-display);
    font-weight: var(--shop-weight-regular);
    font-size: var(--shop-text-3xl);
    line-height: var(--shop-lh-snug);
}
.article-detail__content h3 {
    margin: var(--shop-s-8) 0 var(--shop-s-3);
    font-size: var(--shop-text-xl);
    font-weight: var(--shop-weight-semi);
}
.article-detail__content ul,
.article-detail__content ol { margin: 0 0 var(--shop-s-5); padding-left: var(--shop-s-6); }
.article-detail__content li { margin-bottom: var(--shop-s-2); }
.article-detail__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--shop-card-radius);
}
.article-detail__content blockquote {
    margin: var(--shop-s-6) 0;
    padding-left: var(--shop-s-5);
    border-left: 2px solid var(--shop-accent);
    color: var(--shop-text-muted);
    font-family: var(--shop-font-display);
    font-size: var(--shop-text-xl);
    line-height: var(--shop-lh-relaxed);
}
/* Content links stay ink (via the trap) + underlined for editorial calm; only
   the underline tints gold on hover (text-decoration-color isn't trapped). */
.article-detail__content a {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
.article-detail__content a:hover { text-decoration-color: var(--shop-accent); }
.article-detail__footer {
    margin-top: var(--shop-s-12);
    padding-top: var(--shop-s-6);
    border-top: 1px solid var(--shop-border-subtle);
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .article-card__img,
    .article-card:hover .article-card__img { transition: none; transform: none; }
}
