/* ============================================
   SOWA KSIĘGOWA – Blog / Article page styles
   Loaded on ALL blog subpages (listing + articles).
   Uses the same design system as styles.css (white body,
   dark header via inline critical CSS in each page).
   ============================================ */

html { scroll-behavior: smooth; }

/* ─────────────────────────────────────────────
   BLOG LISTING – category filter chips
   ───────────────────────────────────────────── */
.blog-filter-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 4px 14px;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.blog-filter-link:hover,
.blog-filter-link--active {
    color: var(--gold);
    border-color: rgba(184, 150, 12, 0.4);
}

.blog-card--placeholder {
    opacity: 0.4;
    pointer-events: none;
}

/* ─────────────────────────────────────────────
   ARTICLE HERO – intentionally dark section
   (matches the dark .hero on the main page)
   ───────────────────────────────────────────── */
.article-hero {
    background: linear-gradient(135deg, #0d1b2a 0%, #091018 100%);
    padding: 3.5rem 0 3rem;
    border-bottom: 1px solid rgba(184, 150, 12, 0.15);
}

/* Breadcrumb – on dark hero background → light text */
.article-breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.78rem;
    color: var(--gray-400);
    margin-bottom: 1.5rem;
}

.article-breadcrumb a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}

.article-breadcrumb a:hover {
    color: var(--gold-light);
}

.article-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.article-hero__category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
    background: rgba(184, 150, 12, 0.12);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid rgba(184, 150, 12, 0.25);
}

/* Date / read time – on dark hero */
.article-hero__date,
.article-hero__read {
    font-size: 0.82rem;
    color: var(--gray-400);
}

.article-hero__title {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}

/* Lead text – on dark hero */
.article-hero__lead {
    font-size: 1.08rem;
    color: var(--gray-400);
    line-height: 1.75;
    max-width: 780px;
}

/* ─────────────────────────────────────────────
   ARTICLE THUMBNAIL
   ───────────────────────────────────────────── */
.article-thumbnail {
    margin: 2.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Banner layout: flag bg + overlay + owl + text */
.article-thumbnail__banner {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    background: #012169;
    display: block;
}

/* UK flag fills entire banner */
.article-thumbnail__flag {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Gradient: dark on left (text), fades to transparent right (owl) */
.article-thumbnail__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 5, 30, 0.88) 0%,
        rgba(0, 5, 30, 0.70) 40%,
        rgba(0, 5, 30, 0.25) 70%,
        rgba(0, 5, 30, 0.10) 100%
    );
}

/* Owl – pinned to right bottom, tall */
.article-thumbnail__owl {
    position: absolute;
    right: 6%;
    bottom: 0;
    height: 98%;
    width: auto;
    z-index: 2;
    filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.55));
}

/* Text block – left side */
.article-thumbnail__label {
    position: absolute;
    left: 7%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    line-height: 1;
}

.article-thumbnail__label-top {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: clamp(1rem, 2.5vw, 1.75rem);
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.1em;
}

.article-thumbnail__label-main {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 700;
    color: #D4AF37;
    text-shadow: 0 0 50px rgba(212, 175, 55, 0.45);
    line-height: 0.95;
    margin-bottom: 0.15em;
}

.article-thumbnail__label-sub {
    font-size: clamp(0.6rem, 1.4vw, 0.88rem);
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* Caption – on light bg */
.article-thumbnail__caption {
    background: var(--bg-light);
    padding: 0.6rem 1.25rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    border-top: 1px solid var(--border-light);
}

@media (max-width: 640px) {
    .article-thumbnail__banner {
        aspect-ratio: 16 / 8;
    }

    .article-thumbnail__owl {
        height: 80%;
        right: 2%;
    }

    .article-thumbnail__label {
        left: 5%;
    }
}

/* ─────────────────────────────────────────────
   ARTICLE LAYOUT
   ───────────────────────────────────────────── */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    padding: 2rem 0 5rem;
    align-items: start;
}

/* ─────────────────────────────────────────────
   TABLE OF CONTENTS – light theme
   ───────────────────────────────────────────── */
.article-toc {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--gold);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 3rem;
}

.article-toc__title {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.article-toc__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    counter-reset: toc-counter;
}

.article-toc__list li a {
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    padding: 0.2rem 0 0.2rem 0.75rem;
    border-left: 2px solid transparent;
    margin-left: -0.75rem;
}

.article-toc__list li a:hover {
    color: var(--gold);
    border-left-color: var(--gold);
}

/* ─────────────────────────────────────────────
   ARTICLE CONTENT – white body, dark text
   Uses --text-secondary (#525252) as per styles.css
   ───────────────────────────────────────────── */
.article-content {
    min-width: 0;
}

.article-section {
    margin-bottom: 3rem;
}

.article-section h2 {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--gold);
    padding-bottom: 0.75rem;
    line-height: 1.35;
}

.article-section h3 {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.75rem 0 0.75rem;
}

/* Main body text – #525252 = --text-secondary = --gray-600 */
.article-section p {
    color: var(--text-secondary);
    line-height: 1.85;
    margin-bottom: 1.1rem;
    font-size: 0.97rem;
}

.article-section ul,
.article-section ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
}

.article-section li {
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 0.97rem;
    margin-bottom: 0.5rem;
}

.article-section li strong,
.article-section strong {
    color: var(--text-primary);
    font-weight: 700;
}

.article-section em {
    color: var(--gold);
    font-style: italic;
}

/* Links in content */
.article-section a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.article-section a:hover {
    color: var(--gold-dark);
}

/* ─────────────────────────────────────────────
   HIGHLIGHT BOXES – light gold-tint background
   ───────────────────────────────────────────── */
.article-highlight {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--gold-subtle);
    border: 1px solid rgba(184, 150, 12, 0.2);
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    padding: 1.1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.article-highlight strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.article-highlight__icon {
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.article-highlight__icon svg {
    width: 20px;
    height: 20px;
    color: var(--gold);
}

.article-highlight--gold {
    background: rgba(184, 150, 12, 0.08);
    border-color: rgba(184, 150, 12, 0.3);
    border-left-color: var(--gold-light);
}

.article-highlight--warning {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
    border-left-color: #dc2626;
}

.article-highlight--warning .article-highlight__icon svg {
    color: #dc2626;
}

.article-highlight--warning strong {
    color: #991b1b;
}

/* ─────────────────────────────────────────────
   ARTICLE SUMMARY – light card
   ───────────────────────────────────────────── */
.article-summary {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-top: 3px solid var(--gold);
    border-radius: 8px;
    padding: 2rem;
}

.article-summary h2 {
    border-top: none;
    padding-top: 0;
    font-size: 1.3rem;
}

/* ─────────────────────────────────────────────
   CTA BOX – gold-tinted, light
   ───────────────────────────────────────────── */
.article-cta {
    background: linear-gradient(135deg, var(--gold-muted), var(--gold-subtle));
    border: 1px solid rgba(184, 150, 12, 0.3);
    border-radius: 10px;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
}

.article-cta__content h3 {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.article-cta__content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   SIDEBAR – light theme
   ───────────────────────────────────────────── */
.article-sidebar {
    position: sticky;
    top: calc(80px + 1.5rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 1.25rem;
}

.sidebar-widget--cta {
    background: var(--gold-subtle);
    border-color: rgba(184, 150, 12, 0.2);
}

.sidebar-widget__title {
    font-family: var(--font-heading, 'Libre Baskerville', Georgia, serif);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--gold);
}

.sidebar-widget p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.sidebar-widget__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-widget__list a {
    font-size: 0.86rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-widget__list a:hover {
    color: var(--gold);
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-widget {
        flex: 1 1 260px;
    }
}

@media (max-width: 640px) {
    .article-hero {
        padding: 2.5rem 0 2rem;
    }

    .article-hero__title {
        font-size: 1.6rem;
    }

    .article-cta {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .article-sidebar {
        flex-direction: column;
    }
}

/* ─────────────────────────────────────────────
   FOCUS STYLES (WCAG 2.4.7)
   ───────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
    border-radius: 3px;
}

.article-section a:focus-visible,
.article-toc__list li a:focus-visible,
.sidebar-widget__list a:focus-visible,
.blog-card__title a:focus-visible,
.blog-card__cta:focus-visible,
.blog-card__thumbnail:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 2px;
    border-radius: 2px;
}
