/* assets/styles/content.css */

#blog-details.blog-details.section {
    padding-top: 24px;
    padding-bottom: 24px;
}

.blog-details .article-content {
    --content-title-font: var(--heading-font);
    --content-body-font: var(--default-font);
    --content-body-size: 15px;
    --content-body-line-height: 1.68;
    --content-body-color: #2f2542;
}

.tool-detail-row {
    align-items: flex-start;
}

.tool-detail-row > .tool-detail-main,
.tool-detail-row > .sidebar {
    min-width: 0;
}

.tool-detail-row .blog-details,
.tool-detail-row .blog-details > .container,
.tool-detail-row .article,
.tool-detail-row .article-content,
.tool-detail-row .article-content .content {
    max-width: 100%;
    min-width: 0;
}

.blog-details .article-content > :last-child {
    margin-bottom: 0;
}

.blog-details .article-content {
    padding: 0 1rem;
}

.blog-details .article-content .content-header {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.blog-details .article-content .content-header .title-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    color: color-mix(in srgb, var(--default-color), transparent 28%);
    font-family: var(--page-font);
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.4;
}

.blog-details .article-content .content-header .title-meta .category {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
}

.blog-details .article-content .content-header .title-meta .divider {
    color: color-mix(in srgb, var(--default-color), transparent 40%);
}

.blog-details .article-content .content-header .title-meta .reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: color-mix(in srgb, var(--default-color), transparent 12%);
}

.blog-details .article-content .content-header .title {
    max-width: 720px;
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
    color: var(--heading-color);
    font-family: var(--content-title-font);
    font-size: clamp(2.2rem, 4.6vw, 2.8rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: 0;
}

.blog-details .article-content .content-header .author-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
}

.blog-details .article-content .content-header .author-info .author-details {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blog-details .article-content .content-header .author-info .author-details .author-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.blog-details .article-content .content-header .author-info .author-details .info h4 {
    margin: 0;
    color: var(--heading-color);
    font-size: 1.1rem;
}

.blog-details .article-content .content-header .author-info .author-details .info .role {
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    font-size: 0.9rem;
}

.blog-details .article-content .content-header .author-info .post-meta {
    color: color-mix(in srgb, var(--default-color), transparent 30%);
    font-size: 0.95rem;
}

.blog-details .article-content .content-header .author-info .post-meta i {
    margin-right: 0.3rem;
}

.blog-details .article-content .content-header .author-info .post-meta .divider {
    margin: 0 0.75rem;
}

.tool-intro .tool-main-description {
    width: 100%;
    max-width: 860px;
    margin: 0;
    color: var(--content-body-color);
    font-family: var(--content-body-font);
    font-size: var(--content-body-size);
    font-weight: 400;
    line-height: var(--content-body-line-height);
    letter-spacing: 0;
    text-align: justify;
    text-justify: inter-word;
    text-wrap: pretty;
}

@media (min-width: 768px) {
    .tool-intro .tool-main-description {
        min-height: calc(1em * var(--content-body-line-height) * 3);
    }
}

@media (max-width: 767.98px) {
    #blog-details.blog-details.section {
        padding-top: 16px;
    }

    .blog-details .article-content {
        padding: 0;
    }

    .blog-details .article-content .content-header {
        margin-bottom: 2rem;
    }

    .blog-details .article-content .content-header .title-meta {
        font-size: 0.95rem;
    }

    .blog-details .article-content .content-header .title {
        font-size: clamp(2rem, 9vw, 2.35rem);
        line-height: 1.16;
    }

    .blog-details .article-content .content-header .author-info {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
        padding-bottom: 1.5rem;
    }

    .blog-details .article-content .content-header .author-info .author-details {
        gap: 0.9rem;
    }

    .blog-details .article-content .content-header .author-info .author-details .author-img {
        width: 44px;
        height: 44px;
    }

    .blog-details .article-content .content-header .author-info .author-details .info h4 {
        font-size: 1rem;
    }

    .blog-details .article-content .content-header .author-info .author-details .info .role,
    .blog-details .article-content .content-header .author-info .post-meta {
        font-size: 0.92rem;
        line-height: 1.45;
    }

    .blog-details .article-content .content-header .author-info .post-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .blog-details .article-content .content-header .author-info .post-meta .divider {
        margin: 0;
    }

    .tool-intro {
        margin-bottom: 1.5rem !important;
    }

    .tool-intro .tool-main-description {
        font-size: var(--content-body-size);
        line-height: var(--content-body-line-height);
        text-align: left;
        text-justify: auto;
        word-spacing: normal;
    }
}

/* =========================================================
   CONTENT SECTION CARDS
   ========================================================= */

.content-card {
    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 14px;
    padding: 16px 22px 22px;
    margin: 22px 0;
    font-family: var(--default-font);
}

.content-card > *:first-child {
    margin-top: 0 !important;
}

.content-card h2 {
    margin-top: 0 !important;
    padding-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e8eef5;
    color: #2d465e;
    font-family: var(--content-title-font);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
}

.content-card h3 {
    color: #2d465e;
    font-family: var(--content-title-font);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.55;
    margin-top: 18px;
    margin-bottom: 8px;
}

/* =========================================================
   1. FAQ ACCORDION
   ========================================================= */

.faq-accordion {
    margin-top: 20px;
}

.faq-item {
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #ffffff;
    margin-bottom: 14px;
    overflow: hidden;
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 16px 18px;
    font-size: 17px;
    font-family: var(--content-title-font);
    font-weight: 700;
    color: #2d465e;
    line-height: 1.6;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 10px;
    color: #475569;
    transition: transform 0.2s ease;
}

.faq-item[open] summary::before {
    transform: rotate(90deg);
}

.faq-answer {
    padding: 0 18px 18px;
    color: #475569;
    font-size: var(--content-body-size);
    font-family: var(--content-body-font);
    line-height: var(--content-body-line-height);
    text-align: justify;
    text-justify: inter-word;
}


/* =========================================================
   2. MARKDOWN CONTENT - BASE TYPOGRAPHY
   ========================================================= */

.markdown-content {
    margin-top: 28px;
    color: #334155;
    font-size: var(--content-body-size);
    font-family: var(--content-body-font);
    line-height: var(--content-body-line-height);
}

.markdown-content > *:first-child {
    margin-top: 0;
}

.markdown-content > *:last-child {
    margin-bottom: 0;
}

.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: #2d465e;
    font-family: var(--content-title-font);
    font-weight: 700;
    line-height: 1.35;
    margin-top: 32px;
    margin-bottom: 14px;
}

.markdown-content h2 {
    font-size: 30px;
    margin-top: 40px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.markdown-content h3 {
    font-size: 16px;
    margin-top: 18px;
    margin-bottom: 8px;
    line-height: 1.55;
}

.markdown-content p {
    margin-bottom: 18px;
    color: var(--content-body-color);
    font-family: var(--content-body-font);
    font-size: var(--content-body-size);
    line-height: var(--content-body-line-height);
    max-width: 860px;
    text-align: justify;
    text-justify: inter-word;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 18px;
    padding-left: 22px;
    color: var(--content-body-color);
    font-size: var(--content-body-size);
    font-family: var(--content-body-font);
    line-height: var(--content-body-line-height);
}

.markdown-content li {
    margin-bottom: 10px;
    color: var(--content-body-color);
    font-size: var(--content-body-size);
    font-family: var(--content-body-font);
    line-height: var(--content-body-line-height);
    text-align: left;
    text-justify: auto;
    word-spacing: normal;
}

.markdown-content li p {
    text-align: left;
    text-justify: auto;
    word-spacing: normal;
}

.markdown-content > [class*="-markdown-card"] li,
.markdown-content > [class*="-markdown-card"] li p {
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    text-align: left;
    text-justify: auto;
    word-spacing: normal;
}

.markdown-content :not(pre) > code {
    background: #f3f4f6;
    color: #334155;
    padding: 2px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875em;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}


/* =========================================================
   3. TERMINAL-STYLE CODE BLOCKS
   ========================================================= */

.markdown-content pre {
    position: relative;
    background: #081226;
    background-image: linear-gradient(to right, transparent 0, transparent 100%);
    background-repeat: no-repeat;
    color: #e5e7eb;
    border-radius: 18px;
    padding: 56px 20px 20px;
    margin: 18px 0 24px;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.18);
    box-sizing: border-box;
    text-rendering: optimizeLegibility;
    font-variant-ligatures: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.markdown-content pre::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: #050b16;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px 18px 0 0;
}

.markdown-content pre::after {
    content: "";
    position: absolute;
    top: 14px;
    left: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow:
        18px 0 0 #febc2e,
        36px 0 0 #28c840,
        195px 0 0 transparent;
}

.markdown-content pre::marker {
    content: "";
}

.markdown-content pre .terminal-title {
    display: none;
}

.markdown-content pre code {
    display: block;
    position: relative;
    background: transparent;
    color: inherit;
    padding: 0 90px 0 0;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.8;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
}

.markdown-content pre code::before {
    content: "user@host:~$ ";
    color: #86efac;
}

.markdown-content pre > code::after {
    content: "user@host:~/projects";
    position: absolute;
    top: -43px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    opacity: 0.95;
    white-space: nowrap;
    pointer-events: none;
}


/* =========================================================
   4. COPY BUTTON FOR CODE BLOCKS
   ========================================================= */

.markdown-content pre > .markdown-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.88);
    color: #e5e7eb;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 6px 14px rgba(2, 6, 23, 0.22);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.markdown-content pre > .markdown-copy-btn:hover,
.markdown-content pre > .markdown-copy-btn:focus,
.markdown-content pre > .markdown-copy-btn:focus-visible {
    background: rgba(30, 41, 59, 0.96);
    border-color: rgba(148, 163, 184, 0.38);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
    outline: none;
}

.markdown-content pre > .markdown-copy-btn.copied {
    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;
}


/* =========================================================
   5. GLOSSARY TABLE / MARKDOWN TABLES
   ========================================================= */

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 28px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.markdown-content thead th {
    background: #f8fbff;
    color: #2d465e;
    font-family: var(--default-font);
    font-weight: 700;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #dbe4ee;
    font-size: 14px;
    line-height: 1.5;
}

.markdown-content tbody td {
    padding: 14px 16px;
    border-top: 1px solid #edf2f7;
    color: #475569;
    vertical-align: top;
    font-size: 15px;
    font-family: var(--default-font);
    line-height: 1.75;
}

.markdown-content tbody tr:nth-child(even) {
    background: #fcfdff;
}

.markdown-content tbody td:first-child {
    width: 30%;
    font-weight: 600;
    color: #334e68;
    font-size: 15px;
}


/* =========================================================
   6. LINKS / REFERENCES
   ========================================================= */

.markdown-content a {
    color: #2563eb;
    text-decoration: none;
    word-break: break-word;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content ul li a {
    font-weight: 500;
}


/* =========================================================
   7. RESPONSIVE
   ========================================================= */

@media (max-width: 767px) {
    .markdown-content {
        font-size: var(--content-body-size);
        line-height: var(--content-body-line-height);
    }

    .markdown-content h2 {
        font-size: 24px;
    }

    .markdown-content h3 {
        font-size: 20px;
    }

    .markdown-content p {
        font-size: var(--content-body-size);
        line-height: var(--content-body-line-height);
        text-align: left;
        text-justify: auto;
        word-spacing: normal;
    }

    .faq-answer {
        text-align: left;
        text-justify: auto;
        word-spacing: normal;
    }

    .markdown-content pre {
        padding: 52px 16px 16px;
        border-radius: 16px;
    }

    .markdown-content pre::before {
        height: 34px;
        border-radius: 16px 16px 0 0;
    }

    .markdown-content pre > code {
        font-size: 13px;
        padding-right: 78px;
    }

    .markdown-content pre > code::after {
        top: -39px;
        font-size: 11px;
        line-height: 1;
    }

    .markdown-copy-btn {
        top: 42px;
        right: 12px;
        font-size: 11px;
        padding: 6px 9px;
    }
}
