/**
 * Single Post Template Styles
 * Modern & Minimal Design
 */

/* Post Layout Container */
.post-layout-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Article Container */
.single-post-container {
    max-width: 850px;
    padding: 0;
}

/* Table of Contents Sidebar */
.post-toc-sidebar {
    position: relative;
}

.post-toc-sticky {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.post-toc-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: #55ddff;
    margin-bottom: 1.5rem;
}

.post-toc-nav {
    border-left: 2px solid rgba(85, 221, 255, 0.2);
}

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

.post-toc-list .nav-item {
    margin-bottom: 0.5rem;
}

.post-toc-list .nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0 0.4rem 1rem;
    display: block;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: all 0.3s ease;
    line-height: 1.4;
}

.post-toc-list .nav-link:hover {
    color: #55ddff;
    border-left-color: rgba(85, 221, 255, 0.5);
}

.post-toc-list .nav-link.active {
    color: #55ddff;
    border-left-color: #55ddff;
    font-weight: 600;
}

.post-toc-list .toc-item-h3 .nav-link {
    padding-left: 2rem;
    font-size: 0.85rem;
}

/* Custom scrollbar for TOC */
.post-toc-sticky::-webkit-scrollbar {
    width: 4px;
}

.post-toc-sticky::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.post-toc-sticky::-webkit-scrollbar-thumb {
    background: rgba(85, 221, 255, 0.3);
    border-radius: 2px;
}

.post-toc-sticky::-webkit-scrollbar-thumb:hover {
    background: rgba(85, 221, 255, 0.5);
}

/* Post Header */
.post-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.post-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #55ddff, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* Post Meta */
.post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta-item i {
    color: #55ddff;
}

/* Featured Image */
.post-featured-image {
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.post-featured-image:hover img {
    transform: scale(1.02);
}

/* Post Content */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
}

/* Override Bootstrap margins */
.post-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 600;
    margin-top: 3rem !important;
    margin-bottom: 1.2rem !important;
    color: #55ddff;
}

.post-content h2 {
    font-family: 'Inter', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-top: 3rem !important;
    margin-bottom: 1rem !important;
    color: #55ddff;
}

.post-content h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 2.5rem !important;
    margin-bottom: 0.8rem !important;
    color: #55ddff;
}

.post-content h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2rem !important;
    margin-bottom: 0.6rem !important;
}

.post-content h5 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.8rem !important;
    margin-bottom: 0.5rem !important;
}

.post-content h6 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
}

.post-content p {
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
}

.post-content a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 2px dotted rgba(85, 221, 255, 0.7);
    transition: all 0.3s ease;
    position: relative;
}

.post-content a:hover {
    color: #55ddff;
    border-bottom: 2px solid #55ddff;
}

.post-content a .external-link-icon {
    font-size: 0.7em;
    margin-left: 0.15em;
    opacity: 0.6;
    color: #55ddff;
    transition: all 0.3s ease;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: -0.05em;
}

.post-content a:hover .external-link-icon {
    opacity: 1;
    transform: translateX(2px);
}

.post-content ul,
.post-content ol {
    margin-top: 0 !important;
    margin-bottom: 1.5rem !important;
    padding-left: 2rem !important;
}

.post-content li {
    margin-bottom: 0.5rem !important;
}

.post-content blockquote {
    border-left: 4px solid #55ddff;
    padding-left: 1.5rem;
    margin: 2rem 0 !important;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0 !important;
}

.post-content pre {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem !important;
    overflow-x: auto;
    margin: 2rem 0 !important;
}

.post-content table {
    margin: 2rem 0 !important;
}

.post-content hr {
    margin: 3rem 0 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.post-content figure {
    margin: 2rem 0 !important;
}

.post-content figcaption {
    margin-top: 0.5rem !important;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
}

.post-content code {
    background-color: rgba(85, 221, 255, 0.1);
    color: #55ddff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.post-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* AI Disclaimer */
.ai-disclaimer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(85, 221, 255, 0.05), rgba(85, 221, 255, 0.02));
    border: 1px solid rgba(85, 221, 255, 0.2);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.ai-disclaimer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #55ddff, rgba(85, 221, 255, 0.3));
}

.ai-disclaimer-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(85, 221, 255, 0.15);
    border: 1px solid rgba(85, 221, 255, 0.3);
    border-radius: 50%;
    font-size: 1.5rem;
}

.ai-disclaimer-icon i {
    color: #55ddff;
}

.ai-disclaimer-content {
    flex: 1;
}

.ai-disclaimer-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    font-style: italic;
    color: #55ddff;
    margin: 0 0 0.8rem 0;
}

.ai-disclaimer-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* Post Footer */
.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Categories & Tags */
.post-categories,
.post-tags {
    margin-bottom: 1.5rem;
}

.post-categories-title,
.post-tags-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.8rem;
}

.post-categories-list,
.post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-category,
.post-tag {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: rgba(85, 221, 255, 0.1);
    color: #55ddff;
    border: 1px solid rgba(85, 221, 255, 0.3);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-category:hover,
.post-tag:hover {
    background-color: rgba(85, 221, 255, 0.2);
    border-color: #55ddff;
    transform: translateY(-2px);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: #55ddff;
    color: rgb(var(--bs-dark-rgb));
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(85, 221, 255, 0.3);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(85, 221, 255, 0.5);
}

.back-to-top i {
    color: rgb(var(--bs-dark-rgb));
    font-size: 1.2rem;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 3rem;
}

.nav-previous,
.nav-next {
    padding: 1.5rem;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.nav-previous:hover,
.nav-next:hover {
    background-color: rgba(85, 221, 255, 0.1);
    border-color: rgba(85, 221, 255, 0.3);
    transform: translateY(-3px);
}

.nav-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-title {
    color: white;
    font-weight: 600;
}

.nav-next {
    text-align: right;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .post-layout-container {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
    }

    .post-toc-sidebar {
        display: none;
    }

    .single-post-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .post-layout-container {
        padding: 2rem 1rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .post-meta {
        gap: 1rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.6rem;
    }

    .post-content h3 {
        font-size: 1.3rem;
    }

    .ai-disclaimer {
        flex-direction: column;
        gap: 1rem;
        padding: 1.2rem;
    }

    .ai-disclaimer-icon {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    .ai-disclaimer-title {
        font-size: 1rem;
    }

    .ai-disclaimer-content p {
        font-size: 0.9rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .nav-next {
        text-align: left;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .single-post-container {
        padding: 1.5rem 1rem;
    }

    .post-title {
        font-size: 1.6rem;
    }

    .post-header {
        margin-bottom: 2rem;
    }

    .post-meta {
        font-size: 0.85rem;
    }
}
