/*
 * Blog Article — Structural Base
 * ---------------------------------------------------------------
 * Only layout, display, position, counters & responsive shell.
 * ALL visual styling (colors, sizes, shadows, radii, paddings)
 * is generated dynamically by generate_design_css() and emitted
 * inline via wp_add_inline_style(). Do not hardcode colors or
 * sizes here — override them in the Blog Layout admin screen
 * or in the Custom CSS field.
 * ---------------------------------------------------------------
 */

/* === Container ================================================ */
.blog-article-container { width: 100%; overflow: visible; }
.blog-article-body { overflow: visible; }
.blog-article-body img { width: 100%; height: auto; }

/* === Table of Contents — structure =========================== */
.blog-toc { overflow: hidden; }
.blog-toc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.blog-toc-title { flex: 1; }
.blog-toc-toggle {
    width: 20px;
    height: 20px;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}
.blog-toc-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 0.3s ease;
}
.blog-toc.is-collapsed .blog-toc-toggle::before {
    transform: translate(-50%, -35%) rotate(-135deg);
}
.blog-toc-body {
    transition: max-height 0.35s ease, opacity 0.25s ease;
    overflow: hidden;
}
.blog-toc.is-collapsed .blog-toc-body {
    max-height: 0 !important;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.blog-toc-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    counter-reset: toc-counter;
}
.blog-toc-item {
    list-style: none !important;
    counter-increment: toc-counter;
    padding: 0 !important;
    margin: 0 !important;
}
.blog-toc-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.blog-toc-item a::before {
    content: counter(toc-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* === Tables — structure ====================================== */
.table-container { width: 100%; overflow: hidden; }
.blog-article-body table { width: 100%; border-collapse: collapse; }
.blog-article-body table thead th { text-align: left; }

/* === Blockquote — structure ================================== */
.blog-article-body blockquote,
.blog-article-body blockquote.blog-quote { position: relative; }
.blog-article-body blockquote::before {
    content: '\201C';
    position: absolute;
    top: -8px;
    left: 16px;
    line-height: 1;
    font-family: Georgia, serif;
}
.blog-article-body blockquote p { position: relative; z-index: 1; }

/* === Lists — structure ======================================= */
.blog-check-list,
ul.blog-check-list,
.blog-numbered-list,
ol.blog-numbered-list {
    list-style: none !important;
    padding: 0 !important;
}
.blog-numbered-list,
ol.blog-numbered-list { counter-reset: blog-counter; }
.blog-check-list li,
ul.blog-check-list li,
.blog-numbered-list li,
ol.blog-numbered-list li {
    list-style: none !important;
    padding-left: 0 !important;
}
.blog-numbered-list li,
ol.blog-numbered-list li { counter-increment: blog-counter; }
.blog-check-list li::before,
ul.blog-check-list li::before {
    content: '\2713';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}
.blog-numbered-list li::before,
ol.blog-numbered-list li::before {
    content: counter(blog-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}

/* === Figure ================================================== */
.blog-figure { text-align: center; }
.blog-figure img { margin: 0 !important; }

/* === CTA Button — structure ================================== */
.blog-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    cursor: pointer;
}
.blog-article-body .blog-cta-button {
    display: block;
    width: fit-content;
    text-align: center;
}

/* === Divider ================================================= */
.blog-divider,
.blog-article-body hr { border: none; }

/* === Video =================================================== */
.blog-video-container {
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
}
.blog-video-container iframe,
.blog-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* === FAQ — structure ========================================= */
.blog-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}
.blog-faq-item {
    overflow: hidden;
    transition: all 0.3s ease;
    list-style: none;
}
.blog-faq-item summary {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    list-style: none;
}
.blog-faq-item summary::-webkit-details-marker { display: none; }
.blog-faq-item summary::after {
    content: '';
    position: relative;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-left: 16px;
    background-image:
        linear-gradient(currentColor, currentColor),
        linear-gradient(currentColor, currentColor);
    background-size: 100% 2px, 2px 100%;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.3s ease;
}
.blog-faq-item[open] summary::after { transform: rotate(45deg); }
.blog-faq-content p { margin: 0; }

/* === Responsive layout shifts ================================ */
@media (max-width: 767px) {
    /* Table: mobile card layout (layout only; visuals via inline CSS) */
    .table-container { border: none; border-radius: 0; overflow: visible; }
    .blog-article-body table { display: block; background: transparent; }
    .blog-article-body table thead { display: none; }
    .blog-article-body table tbody {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    .blog-article-body table tr {
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
    }
    .blog-article-body table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .blog-article-body table td::before {
        content: attr(data-label);
        display: inline-block;
    }
    .blog-article-body table td:not([data-label])::before { display: none; }
    .blog-article-body table td:first-child::before { display: none !important; }
}
