/* ============================================
   ARTICLE CONTENT — Strony artykułów
   Nadpisuje styl wszystkich artykułów (.article)
   ============================================ */

/* Reading progress bar (sticky na górze) */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #6ee089, #FF9240);
    width: 0%;
    z-index: 9999;
    transition: width 0.15s ease;
    box-shadow: 0 0 8px rgba(110, 224, 137, 0.4);
}

/* Container artykułu — wycentrowana treść max 800px dla czytelności */
main .article {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 28px;
}

/* Status badge nad tytułem */
.article-status-badge {
    font-size: 0.7rem;
    letter-spacing: 2px;
    font-family: 'Fira Code', monospace;
    font-weight: 700;
    margin-bottom: 12px;
    display: block;
}

.article-status-badge--tutorial { color: #6bcfff; }
.article-status-badge--walkthrough { color: #6ee089; }
.article-status-badge--reviewed { color: #9fef00; }

/* Tytuł artykułu — nadpisuje stary terminal-effect */
.article-title {
    font-size: 1.85rem !important;
    font-weight: 700 !important;
    color: #e8f5eb !important;
    font-family: 'Fira Code', monospace !important;
    line-height: 1.25 !important;
    margin-bottom: 14px !important;
}

.article-title .ascii-icon {
    display: none; /* ukrywamy stary [*] przy tytule */
}

.article-title .cyan-accent,
.article-title .accent {
    color: #FF9240 !important;
}

/* Article meta — pod tytułem, jedna linia */
.article-meta {
    display: flex !important;
    gap: 14px !important;
    font-size: 0.72rem !important;
    color: #4d9a5f !important;
    font-family: 'Fira Code', monospace !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    padding-bottom: 18px !important;
    border-bottom: 1px solid #1a3020 !important;
    margin-bottom: 28px !important;
}

.article-meta span {
    color: #4d9a5f;
}

.article-meta .reading-time {
    color: #4d9a5f;
}

/* Sub-title */
.article-subtitle {
    font-size: 1rem !important;
    color: #8acea8 !important;
    font-family: 'Fira Code', monospace !important;
    margin-bottom: 24px !important;
    font-style: italic;
}

/* Content paragraphs */
.article-content-full p,
.article p {
    font-size: 1rem;
    color: #c8e0d0;
    line-height: 1.8;
    margin-bottom: 16px;
}

/* Section titles (h2) — z # prefix */
.section-title {
    font-size: 1.2rem !important;
    color: #e8f5eb !important;
    font-family: 'Fira Code', monospace !important;
    margin: 36px 0 16px !important;
    letter-spacing: 1px !important;
    border: none !important;
    padding: 0 !important;
    text-shadow: none !important;
}

/* Ukrywamy stary [*] żółty przed sekcjami */
.section-title::before {
    content: '#' !important;
    color: #FF9240 !important;
    font-weight: 700 !important;
    margin-right: 8px !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    display: inline !important;
    font-size: 1.2rem !important;
}

/* Inline code */
.article code,
.article-content-full code {
    background: rgba(110, 224, 137, 0.1);
    color: #6ee089;
    padding: 1px 6px;
    border-radius: 2px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
    border: 1px solid rgba(110, 224, 137, 0.15);
}

/* Lists */
.article-content-full ul,
.article ul {
    margin: 12px 0 18px 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
}

.article-content-full ul li,
.article ul li {
    font-size: 0.95rem !important;
    color: #c8e0d0 !important;
    line-height: 1.75 !important;
    padding-left: 18px !important;
    position: relative !important;
    margin-bottom: 4px !important;
}

.article-content-full ul li::before,
.article ul li::before {
    content: '>' !important;
    position: absolute !important;
    left: 0 !important;
    color: #6ee089 !important;
    font-weight: 700 !important;
    background: none !important;
}

/* Links inside article */
.article-content-full a,
.article a {
    color: #FF9240;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 146, 64, 0.4);
    transition: all 0.2s;
}

.article-content-full a:hover,
.article a:hover {
    color: #6ee089;
    border-bottom-color: #6ee089;
}

/* ============================================
   CODE BLOCK — nowy styl
   ============================================ */
.code-block {
    position: relative;
    margin: 20px 0 !important;
    border-radius: 5px;
    isolation: isolate;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.code-block::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(
        135deg,
        rgba(255, 146, 64, 0.3) 0%,
        rgba(110, 224, 137, 0.2) 50%,
        rgba(107, 207, 255, 0.25) 100%
    );
    border-radius: 6px;
    filter: blur(10px);
    opacity: 0.3;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.code-block:hover::before {
    opacity: 0.55;
}

/* Wewnętrzny wrapper (dodawany przez JS) */
.code-block-inner {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    border-left: 3px solid #FF9240;
    background: rgba(10, 16, 10, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.code-block code,
.code-block pre {
    display: block;
    padding: 14px 18px;
    padding-right: 60px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #6ee089;
    line-height: 1.7;
    overflow-x: auto;
    background: none !important;
    border: none !important;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Copy button — pojawia się na hover */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.6rem;
    background: rgba(15, 26, 15, 0.85);
    color: #4d9a5f;
    border: 1px solid #1a3020;
    padding: 4px 10px;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    border-radius: 2px;
    letter-spacing: 1px;
    opacity: 0;
    transition: all 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2;
}

.code-block:hover .code-copy-btn {
    opacity: 1;
}

.code-copy-btn:hover {
    color: #6ee089;
    border-color: #6ee089;
}

.code-copy-btn.copied {
    color: #6ee089;
    border-color: #6ee089;
    opacity: 1 !important;
}

/* Language label — small, w prawym dolnym */
.code-lang-label {
    position: absolute;
    bottom: 6px;
    right: 12px;
    font-size: 0.55rem;
    color: #FF9240;
    font-family: 'Fira Code', monospace;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 2;
}

.code-block:hover .code-lang-label {
    opacity: 0.6;
}

/* ============================================
   IMAGE BLOCK — nowy styl dla .article-image
   ============================================ */
.article-image {
    position: relative;
    margin: 24px 0 !important;
    border-radius: 6px;
    isolation: isolate;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.article-image::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        135deg,
        rgba(110, 224, 137, 0.3) 0%,
        rgba(255, 146, 64, 0.2) 100%
    );
    border-radius: 8px;
    filter: blur(10px);
    opacity: 0.35;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.article-image:hover::before {
    opacity: 0.55;
}

.article-image-inner {
    position: relative;
    border: 1px solid #1a3020;
    border-radius: 6px;
    overflow: hidden;
    background: #0a100a;
}

.article-image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(
        to bottom,
        rgba(15, 26, 15, 0.95),
        rgba(15, 26, 15, 0.85)
    );
    border-bottom: 1px solid #1a3020;
}

.image-tag {
    font-size: 0.62rem;
    color: #6bcfff;
    font-family: 'Fira Code', monospace;
    letter-spacing: 1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #6bcfff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(107, 207, 255, 0.6);
}

.image-zoom-hint {
    font-size: 0.58rem;
    color: #4d9a5f;
    font-family: 'Fira Code', monospace;
    letter-spacing: 1px;
}

.article-image img {
    width: 100%;
    display: block;
    cursor: zoom-in;
    transition: transform 0.4s ease;
    margin: 0 !important;
    border: none !important;
}

.article-image:hover img {
    transform: scale(1.01);
}

.image-caption {
    padding: 10px 16px !important;
    background: rgba(15, 26, 15, 0.6) !important;
    border-top: 1px solid #1a3020 !important;
    font-size: 0.75rem !important;
    color: #8acea8 !important;
    font-family: 'Fira Code', monospace !important;
    font-style: italic !important;
    line-height: 1.5 !important;
    text-align: left !important;
    margin: 0 !important;
}

.image-caption::before {
    content: '// ';
    color: #4d9a5f;
    font-style: normal;
    font-weight: 600;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    main .article {
        margin: 24px auto;
        padding: 0 16px;
    }

    .article-title {
        font-size: 1.4rem !important;
    }

    .section-title {
        font-size: 1.05rem !important;
    }

    .code-block code,
    .code-block pre {
        font-size: 0.78rem;
        padding: 12px 14px;
        padding-right: 55px;
    }

    .article-content-full p,
    .article p {
        font-size: 0.93rem;
    }
}