/* ============================================================
   SEKCJA 1: TREŚĆ ARTYKUŁU (.blog-post-content)
   Stylowanie tekstu wewnątrz artykułu: typografia, listy,
   nagłówki, obrazki, video, cytaty, kod.
   NIE umieszczaj tu klas layoutu strony.
   ============================================================ */

/* === TYPOGRAFIA === */
.blog-post-content {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    line-height: 1.5;
    color: #222;
    overflow-wrap: break-word;
}

.blog-post-content p {
    margin-bottom: 0.75rem;
}

/* === NAGŁÓWKI === */
.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 700;
    color: #111;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-post-content h2 {
    font-size: 22px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}

.blog-post-content h3 { font-size: 19px; }
.blog-post-content h4 { font-size: 17px; }

/* === LINKI === */
.blog-post-content a {
    color: #1DA1F2;
    text-decoration: none;
    border-bottom: 1px solid rgba(29, 161, 242, 0.3);
    transition: border-color 0.15s ease;
}

.blog-post-content a:hover {
    background-color: rgba(29, 161, 242, 0.06);
    border-bottom-color: #1DA1F2;
}

/* === OBRAZKI (Wagtail figure/figcaption) === */
.blog-post-content figure {
    margin: 20px auto;
    text-align: center;
    width: 100%;
}

.blog-post-content figure img,
.blog-post-content img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.blog-post-content figcaption {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: rgba(0,0,0,0.45);
    font-style: italic;
    text-align: center;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Rozmiary obrazków */
.blog-post-content .richtext-image-container.small img  { max-width: 400px; }
.blog-post-content .richtext-image-container.medium img { max-width: 800px; }
.blog-post-content .richtext-image-container.large img  { max-width: 1200px; }

/* === LISTY === */
.blog-post-content ul {
    list-style-type: disc;
    margin: 0 0 0.75rem 1.5rem;
    padding: 0;
}

.blog-post-content ol {
    list-style-type: decimal;
    margin: 0 0 0.75rem 1.5rem;
    padding: 0;
}

.blog-post-content li {
    margin-bottom: 4px;
    line-height: 1.5;
}

.blog-post-content li > ul {
    list-style-type: circle;
    margin-top: 4px;
    margin-bottom: 2px;
}

/* === CYTATY === */
.blog-post-content blockquote {
    margin: 1rem 0;
    padding: 12px 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #1DA1F2;
    font-style: italic;
    color: #444;
    font-size: 15px;
}
.blog-post-content blockquote p {
    margin: 0;
    padding: 0;
}

/* === KOD === */
.blog-post-content code {
    background: #f4f4f4;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 13px;
    color: #c0392b;
}

.blog-post-content pre {
    background: #f4f4f4;
    padding: 14px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 16px 0;
}

.blog-post-content pre code {
    background: none;
    padding: 0;
    color: #333;
}

/* === SEPARATOR === */
.blog-post-content hr {
    margin: 1.5rem 0;
    border: none;
    height: 1px;
    background: #e5e7eb;
}

/* === VIDEO (YouTube/Vimeo) ===
   Wagtail renderuje: <p><div><iframe width="200" height="113" src="youtube.com/embed/...">
   Div nie ma klasy, iframe ma hardkodowane 200x113 — trzeba nadpisać przez src selector.
*/
.blog-post-content iframe[src*="youtube.com/embed"],
.blog-post-content iframe[src*="youtu.be"],
.blog-post-content iframe[src*="vimeo.com"] {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 1rem auto;
    border: 0;
    border-radius: 6px;
}

/* Twitter/X — zmniejsz margines (embed jest w <p> który już ma 0.75rem) */
.blog-post-content .twitter-tweet,
.blog-post-content blockquote.twitter-tweet {
    margin: 0.25rem auto !important;
    max-width: 500px !important;
}

/* ============================================================
   SEKCJA 2: LAYOUT STRONY POSTA
   Klasy pomocnicze dla elementów otaczających artykuł:
   typo-section, disclaimer, author, nawigacja prev/next itp.
   ============================================================ */

/* === ZGŁOŚ LITERÓWKĘ === */
.typo-section {
    margin-top: 1.5rem;
    text-align: right;
}

/* === DISCLAIMER === */
.disclaimer-container {
    margin-top: 2.5rem;
    padding: 1.25rem 1.5rem;
    background-color: #fefefe;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.disclaimer-header {
    font-size: 1rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disclaimer-main {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #374151;
    margin-bottom: 1rem;
}

.disclaimer-quote,
blockquote.disclaimer-quote,
.prose blockquote.disclaimer-quote {
    margin: 0;
    padding-left: 1rem;
    border-left: 3px solid #1DA1F2 !important;
    font-style: italic;
    font-size: 0.85rem;
    color: #6b7280 !important;
    background: none !important;
}

.disclaimer-main,
.prose .disclaimer-main {
    font-size: 0.875rem;
    line-height: 1.55;
    color: #374151;
    margin-bottom: 1rem;
}

/* === PUSTE AKAPITY (Wagtail/Draftail) === */
.blog-post-content p:empty {
    display: none;
}

/* ============================================================
   SEKCJA 3: SITE-WIDE
   Globalne style niezwiązane z blogiem.
   ============================================================ */

/* smooth scroll */
html {
    scroll-behavior: smooth;
}

/* === RESPONSIVE (blog post) === */
@media (max-width: 768px) {
    .blog-post-content {
        font-size: 15px;
    }

    .blog-post-content ul,
    .blog-post-content ol {
        margin-left: 1.25rem;
    }

    .blog-post-content blockquote {
        padding: 10px 14px;
    }
}

/* === PRINT === */
@media print {
    .blog-post-content {
        font-size: 11pt;
        color: black;
    }
    .blog-post-content figure img {
        box-shadow: none;
    }
}


/* Hamburger animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Forum & komentarze: obrazki i media ─────────────────────── */
.post-content img,
.comment-body img:not(.tweet-card img) {
    max-width: 512px;
    width: auto;
    height: auto;
    display: block;
    margin: 8px auto;
    border-radius: 6px;
    cursor: zoom-in;
}

.post-content .video-embed {
    max-width: 560px;
    margin: 8px 0;
}

.post-content .video-embed iframe {
    width: 100%;
    height: 315px;
    border-radius: 6px;
}

.post-content iframe[src*="soundcloud"] {
    max-width: 560px;
    display: block;
    margin: 8px 0;
}

/* ── Lightbox ─────────────────────────────────────────────────── */
#img-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
#img-lightbox.open {
    display: flex;
    animation: lb-fade .15s ease;
}
#img-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    cursor: default;
}
@keyframes lb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* ───────────────────────────────────────────────────────────── */

.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}


/* ── Blog post tables ──────────────────────────────────────── */
.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 1.5rem 0;
}
.blog-post-content table thead tr {
    background-color: #1d9bf0;
    color: #ffffff;
    text-align: left;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.blog-post-content table th,
.blog-post-content table td {
    padding: 0.6rem 0.9rem;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}
.blog-post-content table th {
    border-color: #1d9bf0;
    white-space: nowrap;
}
.blog-post-content table tbody tr:nth-child(even) {
    background-color: #f0f8ff;
}
.blog-post-content table tbody tr:hover {
    background-color: #e0f2fe;
}
.blog-post-content table td:first-child {
    font-weight: 600;
    color: #1e1e1e;
    white-space: nowrap;
}

