/* img start*/
/* ── Centered Image Shortcode ── */
.sc-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem auto;
    width: 100%;
}

.sc-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sc-image-img {
    display: block;
    max-width: 100%;
    /* never overflows on small screens */
    object-fit: cover;
}

.sc-image-rounded {
    border-radius: 10px;
}

.sc-image-caption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}

/* img end*/

/* code start */
/* ── Code Block Shortcode ── */
.sc-code-block {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 1.5rem auto;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sc-code-header {
    background-color: #333;
    color: #fff;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    border-bottom: 1px solid #e0e0e0;
}

.sc-code-language {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4db8ff;
}

.sc-code-title {
    color: #e0e0e0;
    font-style: italic;
}

.sc-code-pre {
    margin: 0;
    padding: 1rem;
    background-color: #2d2d2d;
    color: #f8f8f2;
    overflow-x: visible;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: 'Inconsolata', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sc-code-pre code {
    font-family: 'Inconsolata', 'Monaco', 'Courier New', monospace;
    color: #f8f8f2;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Syntax highlighting classes */
.sc-code-pre code.language-plaintext {
    color: #f8f8f2;
}

.sc-code-pre code.language-go {
    color: #f8f8f2;
}

.sc-code-pre code.language-bash {
    color: #a1efe4;
}

.sc-code-pre code.language-python {
    color: #f8f8f2;
}

.sc-code-pre code.language-javascript {
    color: #f8f8f2;
}

/* code end */

/* table of contents start */
/* ── Table of Contents (Accordion) ── */

.toc-container {
    background-color: transparent;
    border-radius: 8px;
    margin: 2rem 0rem;
}

.toc-toggle {
    width: 100%;
    padding: 0.5rem;
    background-color: #2d3748;
    color: #e2e8f0;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.toc-toggle:hover {
    background-color: #374151;
}

.toc-toggle-icon {
    transition: transform 0.3s;
    display: inline-block;
}

.toc-toggle.collapsed .toc-toggle-icon {
    transform: rotate(-180deg);
}

.toc-nav {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.toc-nav.collapsed {
    max-height: 0;
}

.toc-list {
    list-style: none;
    padding: 0.5rem 1rem;
    margin: 0;
}

.toc-sublist {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0;
}

.toc-item {
    margin: 0.3rem 0;
    list-style: none;
}

.toc-link {
    color: #cbd5e0;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    padding: 0.25rem 0;
}

.toc-link:hover {
    color: #63b3ed;
    text-decoration: underline;
}

/* table of contents end */

/* tags start */
/* ── Tags Styling ── */
.tags-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag-chip {
    display: inline-block;
    background: linear-gradient(135deg, #4db8ff 0%, #45a8ff 100%);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tag-chip:hover {
    background: linear-gradient(135deg, #45a8ff 0%, #3d98ff 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.post-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #4a5568;
    color: #cbd5e0;
}

.post-tags strong {
    color: #e2e8f0;
    margin-right: 0.5rem;
}

/* Top tags on homepage */
.top-tags-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #4a5568;
}

.top-tags-section h2 {
    color: #e2e8f0;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.top-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.top-tag-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #667eea;
    color: #fff;
    padding: 0.2rem 1rem;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.top-tag-link:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.top-tag-link:hover .tag-name {
    color: #4db8ff;
    font-weight: 600;
    font-size: 1rem;
}

.tag-badge {
    background-color: rgba(255, 255, 255, 0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tags taxonomy page */
.taxonomy-page {
    width: 100%;
}

.taxonomy-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #4a5568;
}

.taxonomy-header h1 {
    color: #e2e8f0;
}

.tags-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.tag-item {
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.tag-item:hover {
    background: #374151;
    border-color: #4db8ff;
    box-shadow: 0 4px 8px rgba(77, 184, 255, 0.2);
    transform: translateY(-2px);
}

.tag-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.tag-name {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.tag-count {
    background-color: #4a5568;
    color: #a1efe4;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tagged-posts {
    margin-top: 3rem;
}

.tag-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #4a5568;
}

.tag-section-title {
    color: #a1efe4;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.posts-list li {
    margin: 0.5rem 0;
    justify-content: space-between;
    align-items: center;
}

.posts-list a {
    color: #4db8ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.posts-list a:hover {
    color: #fff;
    text-decoration: underline;
}

.post-date {
    color: #a0aec0;
    font-size: 0.85rem;
    margin-left: 1rem;
}

/* Responsive tags layout */
@media (max-width: 640px) {
    .tags-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .tag-item {
        padding: 0.75rem;
    }

    .tag-name {
        font-size: 0.9rem;
    }

    .top-tags {
        gap: 0.5rem;
    }

    .top-tag-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }

    .tag-badge {
        font-size: 0.7rem;
        padding: 0.05rem 0.4rem;
    }

    .posts-list li {
        flex-direction: column;
        align-items: flex-start;
    }

    .post-date {
        margin-left: 0;
        margin-top: 0.3rem;
    }
}

@media (min-width: 640px) and (max-width: 768px) {
    .tags-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .top-tags {
        gap: 0.6rem;
    }
}

@media (min-width: 768px) {
    .tags-chips {
        gap: 0.75rem;
    }

    .top-tags {
        gap: 1rem;
    }
}

/* tags end */