/* ==========================================================================
   BLOG CONTENT — wspólne style treści artykułu
   Używane w: TinyMCE, podgląd admina, strona blog-single.php
   Klasa kontenera: .blog-content
   ========================================================================== */

.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-dark, #0f1219);
    font-family: var(--font-body, "Outfit", sans-serif);
    overflow: visible;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.blog-content h2 {
    font-size: 1.8rem;
    font-family: var(--font-head, "Outfit", sans-serif);
    font-weight: 700;
    color: var(--color-dark, #0f1219);
    margin: 50px 0 20px;
    clear: both;
}

.blog-content h3 {
    font-size: 1.4rem;
    font-family: var(--font-head, "Outfit", sans-serif);
    font-weight: 700;
    color: var(--color-dark, #0f1219);
    margin: 40px 0 15px;
    clear: both;
}

.blog-content p {
    margin-bottom: 25px;
    overflow: visible;
    clear: none !important;
}

.blog-content [style*="text-align: center"],
.blog-content [style*="text-align:center"],
.blog-content .aligncenter {
    text-align: center;
}

.blog-content [style*="text-align: right"],
.blog-content [style*="text-align:right"],
.blog-content .alignright {
    text-align: right;
}

.blog-content [style*="text-align: justify"],
.blog-content [style*="text-align:justify"],
.blog-content .alignjustify {
    text-align: justify;
}

/* Nagłówek pojedynczego wpisu bloga */
.blog-article-header {
    text-align: center;
    margin-bottom: 32px;
}

.blog-article-header .section-title-lg,
.blog-article-header .hero-lead,
.blog-article-header .section-label {
    text-align: center;
}

.blog-article-header .section-label {
    display: block;
}

.blog-article-meta {
    font-size: 0.85rem;
    color: rgba(15, 18, 25, 0.55);
    margin-bottom: 32px;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    clear: both;
}

.blog-content table td,
.blog-content table th {
    border: 1px solid #cbd5e1;
    padding: 10px 14px;
    text-align: left;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 25px;
    padding-left: 20px;
}

.blog-content li {
    margin-bottom: 10px;
}

.blog-content blockquote {
    border-left: 4px solid var(--color-accent-2, #6a0dad);
    padding-left: 25px;
    margin: 40px 0;
    font-style: italic;
    color: var(--color-accent-1, #6a0dad);
    font-size: 1.2rem;
    clear: both;
}

.blog-content a {
    color: var(--color-accent-2, #6a0dad);
    text-decoration: underline;
}

.blog-content figure {
    margin: 0;
}

.blog-content figcaption {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin-top: 8px;
    font-style: italic;
    clear: both;
}

/* Nadpisanie globalnego img { display:block; max-width:100% } ze style.css */
.single-post-container .blog-content img.img-wrap-left,
.single-post-container .blog-content img.img-wrap-right {
    max-width: 45%;
    height: auto;
}

.blog-content img.img-wrap-left,
.blog-content img.img-wrap-right {
    max-width: 45%;
}

/* --- Legacy wrapper (stare wpisy) — bez siatki, tylko clearfix --- */
.blog-float-wrap {
    width: 100%;
    margin-bottom: 25px;
    overflow: hidden;
}

.blog-float-wrap::after {
    content: '';
    display: table;
    clear: both;
}

.blog-float-clear {
    clear: both;
    width: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    display: block;
}

/* --- Układ 2 kolumn (opcjonalny, zaawansowany) --- */
.blog-cols-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 25px;
    align-items: start;
    clear: both;
}

.blog-cols-2 .blog-col {
    min-width: 0;
}

.blog-cols-2 .blog-col p:last-child {
    margin-bottom: 0;
}

.blog-cols-2 .blog-col-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
}

.blog-cols-image-right {
    grid-template-columns: 1.1fr 0.9fr;
}

.blog-cols-image-left {
    grid-template-columns: 0.9fr 1.1fr;
}

.blog-float-wrap p {
    margin-bottom: 15px;
}

/* --- Opływanie tekstu — klasyczny float (edytor + strona) --- */
.blog-content img.img-wrap-left,
.blog-content figure.img-wrap-left,
.blog-content .img-layout-left {
    float: left;
    display: block;
    margin: 4px 25px 15px 0;
    max-width: 45%;
    height: auto;
    clear: none;
}

.blog-content img.img-wrap-right,
.blog-content figure.img-wrap-right,
.blog-content .img-layout-right {
    float: right;
    display: block;
    margin: 4px 0 15px 25px;
    max-width: 45%;
    height: auto;
    clear: none;
}

.blog-content figure.img-wrap-left img,
.blog-content figure.img-wrap-right img {
    width: 100%;
    height: auto;
    display: block;
    float: none;
    margin: 0;
    max-width: 100%;
}

.blog-content img.img-wrap-center,
.blog-content figure.img-wrap-center,
.blog-content .img-layout-center {
    display: block;
    float: none;
    max-width: 80%;
    margin: 30px auto;
    clear: both;
    height: auto;
}

.blog-content img.img-wrap-block,
.blog-content .img-layout-full {
    display: block;
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 30px 0;
    clear: both;
    height: auto;
}

.blog-content .img-layout-duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 30px 0;
    clear: both;
}

.blog-content .img-layout-duo img {
    width: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 4/3;
    float: none;
    margin: 0;
    max-width: 100%;
}

.blog-content .video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 30px 0;
    clear: both;
}

.blog-content .video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Clearfix na końcu treści */
.blog-content::after {
    content: '';
    display: table;
    clear: both;
}

/* TinyMCE — body edytora */
body.mce-content-body.blog-content,
.mce-content-body.blog-content {
    padding: 24px 20px;
    font-size: 17.6px;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
}

/* Tryb bloków — niewidoczne ramki akapitów w edytorze (jak w podglądzie) */
.mce-content-body.blog-editor-blocks > p,
.mce-content-body.blog-editor-blocks > h2,
.mce-content-body.blog-editor-blocks > h3,
.mce-content-body.blog-editor-blocks > blockquote,
.mce-content-body.blog-editor-blocks > ul,
.mce-content-body.blog-editor-blocks > ol,
.mce-content-body.blog-editor-blocks > figure,
.mce-content-body.blog-editor-blocks > .video-embed {
    border: 1px dashed rgba(106, 13, 173, 0.18);
    border-radius: 4px;
    padding: 6px 10px;
    margin-left: 0;
    margin-right: 0;
    position: relative;
    overflow: visible;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.mce-content-body.blog-editor-blocks > img.img-wrap-left,
.mce-content-body.blog-editor-blocks > img.img-wrap-right {
    float: left;
    display: block;
    margin: 4px 25px 15px 0;
    max-width: 45%;
    height: auto;
    clear: none;
}

.mce-content-body.blog-editor-blocks > img.img-wrap-right {
    float: right;
    margin: 4px 0 15px 25px;
}

.mce-content-body.blog-editor-blocks img.img-wrap-left,
.mce-content-body.blog-editor-blocks img.img-wrap-right {
    outline: 1px dashed rgba(0, 71, 171, 0.35);
    outline-offset: 3px;
    cursor: grab;
}

.mce-content-body.blog-editor-blocks img.blog-img-dragging {
    opacity: 0.55;
    cursor: grabbing !important;
    outline: 2px solid #6a0dad !important;
    outline-offset: 2px;
}

.mce-content-body.blog-editor-blocks .blog-img-drop-marker {
    height: 4px;
    background: #6a0dad;
    margin: 6px 0;
    border-radius: 2px;
    pointer-events: none;
}

.mce-content-body.blog-editor-blocks .blog-drop-target {
    border-color: rgba(106, 13, 173, 0.55) !important;
    background: rgba(106, 13, 173, 0.06) !important;
}

.mce-content-body.blog-editor-blocks::after {
    content: '';
    display: table;
    clear: both;
}

.mce-content-body.blog-editor-blocks > p:hover,
.mce-content-body.blog-editor-blocks > h2:hover,
.mce-content-body.blog-editor-blocks > h3:hover,
.mce-content-body.blog-editor-blocks > blockquote:hover,
.mce-content-body.blog-editor-blocks > .blog-block-active {
    border-color: rgba(106, 13, 173, 0.45);
    background: rgba(106, 13, 173, 0.03);
    box-shadow: 0 0 0 1px rgba(106, 13, 173, 0.06);
}

.mce-content-body.blog-editor-blocks > p::before,
.mce-content-body.blog-editor-blocks > h2::before,
.mce-content-body.blog-editor-blocks > h3::before {
    position: absolute;
    top: -9px;
    left: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(106, 13, 173, 0.75);
    padding: 1px 6px;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    font-family: system-ui, sans-serif;
    line-height: 1.4;
}

.mce-content-body.blog-editor-blocks > p::before { content: 'Akapit'; }
.mce-content-body.blog-editor-blocks > h2::before { content: 'Nagłówek H2'; }
.mce-content-body.blog-editor-blocks > h3::before { content: 'Nagłówek H3'; }

.mce-content-body.blog-editor-blocks > .blog-cols-2::before {
    content: '2 kolumny';
    background: rgba(106, 13, 173, 0.85);
}

.mce-content-body.blog-editor-blocks .blog-float-clear {
    clear: both;
    height: auto;
    min-height: 20px;
    margin: 10px 0;
    border-top: 1px dashed #cbd5e1;
    position: relative;
}

.mce-content-body.blog-editor-blocks .blog-float-clear::after {
    content: '— koniec opływania: tekst poniżej na pełną szerokość —';
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    text-align: center;
    color: #94a3b8;
    padding: 6px 0 0;
    font-family: system-ui, sans-serif;
}

.mce-content-body.blog-editor-blocks .blog-cols-2 {
    border: 1px dashed rgba(106, 13, 173, 0.28);
    border-radius: 4px;
    padding: 12px;
    background: rgba(106, 13, 173, 0.02);
}

.mce-content-body.blog-editor-blocks .blog-col {
    border: 1px dashed rgba(106, 13, 173, 0.15);
    border-radius: 3px;
    padding: 8px 10px;
    min-height: 48px;
}

.mce-content-body.blog-editor-blocks > .blog-cols-2:hover,
.mce-content-body.blog-editor-blocks > .blog-cols-2.blog-block-active {
    border-color: rgba(106, 13, 173, 0.45);
    background: rgba(106, 13, 173, 0.03);
    box-shadow: 0 0 0 1px rgba(106, 13, 173, 0.06);
}

.blog-section-toolbar {
    display: none !important;
}

.mce-content-body.blog-editor-blocks .blog-section-toolbar {
    display: flex !important;
}

.mce-content-body.blog-editor-blocks .blog-cols-2,
.mce-content-body.blog-editor-blocks .img-layout-duo,
.mce-content-body.blog-editor-blocks .video-embed {
    position: relative;
}

.mce-content-body.blog-editor-blocks .blog-section-toolbar {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 20;
    display: flex;
    gap: 6px;
    pointer-events: auto;
    font-family: system-ui, sans-serif;
}

.mce-content-body.blog-editor-blocks .blog-section-toolbar button {
    appearance: none;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 18, 25, 0.15);
}

.mce-content-body.blog-editor-blocks .blog-section-delete-text-btn {
    background: #fff;
    color: #475569;
    border: 1px solid #cbd5e1 !important;
}

.mce-content-body.blog-editor-blocks .blog-section-delete-text-btn:hover {
    background: #f8fafc;
    color: #0f1219;
}

.mce-content-body.blog-editor-blocks .blog-section-delete-btn {
    background: #dc2626;
    color: #fff;
}

.mce-content-body.blog-editor-blocks .blog-section-delete-btn:hover {
    background: #b91c1c;
}

.mce-content-body.blog-editor-blocks > p:hover::before,
.mce-content-body.blog-editor-blocks > h2:hover::before,
.mce-content-body.blog-editor-blocks > h3:hover::before,
.mce-content-body.blog-editor-blocks > .blog-block-active::before {
    opacity: 1;
}

.mce-content-body.blog-content img[data-mce-selected] {
    outline: 3px solid #6a0dad;
    outline-offset: 2px;
}

/* Mobile */
@media (max-width: 768px) {
    .blog-content {
        font-size: 1rem;
        line-height: 1.7;
    }

    .blog-content img.img-wrap-left,
    .blog-content img.img-wrap-right,
    .blog-content figure.img-wrap-left,
    .blog-content figure.img-wrap-right,
    .blog-content .img-layout-left,
    .blog-content .img-layout-right,
    .blog-float-wrap > img {
        float: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 0 15px 0 !important;
    }

    .blog-float-wrap {
        overflow: visible;
    }

    .blog-content img.img-wrap-left,
    .blog-content img.img-wrap-right {
        float: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 0 15px 0 !important;
    }

    .blog-content .img-layout-duo {
        grid-template-columns: 1fr;
    }

    .blog-cols-2 {
        grid-template-columns: 1fr !important;
    }
}
