/* === SIDEBAR === */
.widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-gradient);
}

.widget-categories li {
    border-bottom: 1px solid var(--border-color);
}

.widget-categories li:last-child {
    border-bottom: none;
}

.widget-categories li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.widget-categories li a:hover {
    color: var(--accent-solid);
    padding-left: 0.5rem;
}

.widget-categories .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.popular-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-post-item:last-child {
    border-bottom: none;
}

.popular-post-thumb {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.popular-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-info .entry-title {
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-info .entry-title a {
    color: var(--text-primary);
}

.popular-post-info .entry-title a:hover {
    color: var(--accent-solid);
}

.popular-post-info .entry-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.widget-cta {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    text-align: center;
}

.widget-cta .widget-title {
    color: #fff;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.widget-cta .widget-title::after {
    background: #fff;
}

.widget-cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.widget-cta .btn-cta-widget {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    color: var(--accent-dark) !important;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-decoration: none;
}

.widget-cta .btn-cta-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.widget-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.widget-tags a {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.widget-tags a:hover {
    background: var(--accent-glow);
    color: var(--accent-solid);
    border-color: var(--accent-solid);
}

/* === SINGLE POST === */
.single-hero {
    position: relative;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    margin-bottom: 2rem;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
}

.single-hero-image {
    position: absolute;
    inset: 0;
}

.single-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 14, 23, 0.95) 0%, rgba(10, 14, 23, 0.4) 60%, transparent 100%);
}

.single-hero-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    width: 100%;
}

.single-hero .entry-title {
    font-size: 2.25rem;
    color: #fff;
    margin-bottom: 1rem;
    max-width: 800px;
}

.single-hero .entry-meta {
    color: rgba(255, 255, 255, 0.7);
}

/* Article Content */
.entry-content {
    max-width: 750px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.85;
}

.entry-content h2 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.entry-content a {
    color: var(--accent-solid);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.entry-content img {
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.entry-content blockquote {
    border-left: 4px solid var(--accent-solid);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-card);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
}

.entry-content blockquote p {
    margin-bottom: 0;
}

.entry-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
}

.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--accent-light);
}

.entry-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
}

.entry-content th,
.entry-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.entry-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

/* TOC */
.toc-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toc-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent-solid);
}

.toc-list {
    counter-reset: toc;
}

.toc-list li {
    counter-increment: toc;
    margin-bottom: 0.5rem;
}

.toc-list li a {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.25rem 0;
}

.toc-list li a::before {
    content: counter(toc) ".";
    color: var(--accent-solid);
    font-weight: 600;
    min-width: 20px;
}

.toc-list li a:hover,
.toc-list li a.active {
    color: var(--accent-solid);
    padding-left: 0.5rem;
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 2rem auto;
    max-width: 750px;
}

.social-share-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    cursor: pointer;
    text-decoration: none;
}

.share-btn:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
    background: var(--accent-glow);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin: 2.5rem auto;
    max-width: 750px;
}

.author-avatar {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    overflow: hidden;
    border: 3px solid var(--accent-solid);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info h4 {
    margin-bottom: 0.25rem;
}

.author-info .author-title {
    font-size: 0.875rem;
    color: var(--accent-solid);
    margin-bottom: 0.75rem;
}

.author-info .author-bio {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* === ARCHIVE === */
.archive-header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border-color);
}

.archive-header .archive-title {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

.archive-header .archive-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.archive-header .archive-count {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}

.pagination a:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
    background: var(--accent-glow);
}

.pagination .current {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
}

.pagination .dots {
    border: none;
    color: var(--text-muted);
}

/* === BREADCRUMB === */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--accent-solid);
}

.breadcrumb .separator {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.breadcrumb .current-item {
    color: var(--text-secondary);
}

/* === COMMENTS === */
.comments-area {
    max-width: 750px;
    margin: 3rem auto 0;
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.comment {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    margin-bottom: 1rem;
}

.comment .comment-avatar img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    font-size: 0.875rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

.comment .children {
    margin-left: 2rem;
    margin-top: 1rem;
}

/* Comment Form */
.comment-respond {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 2rem;
}

.comment-respond .comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.comment-form .form-group {
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--accent-solid);
}

.comment-form textarea {
    min-height: 140px;
    resize: vertical;
}

.comment-form .submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
}

.comment-form .submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* === FOOTER === */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2.5rem;
    padding: 4rem 0 2.5rem;
}

.footer-brand .site-logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.footer-social {
    display: flex;
    gap: 0.5rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
}

.footer-social a:hover {
    color: var(--accent-solid);
    border-color: var(--accent-solid);
    background: var(--accent-glow);
}

.footer-social a svg {
    width: 18px;
    height: 18px;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-col ul li a:hover {
    color: var(--accent-solid);
    padding-left: 0.5rem;
}

/* Newsletter */
.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
}

.newsletter-form input[type="email"]:focus {
    border-color: var(--accent-solid);
}

.newsletter-form button {
    padding: 0.75rem 1.25rem;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.newsletter-form button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Footer Bottom */
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-bottom a {
    color: var(--text-muted);
}

.footer-bottom a:hover {
    color: var(--accent-solid);
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 30px var(--accent-glow-strong);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

/* === 404 === */
.error-404 {
    text-align: center;
    padding: 5rem 0;
}

.error-404 .error-code {
    font-size: 8rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404 h1 {
    font-size: 1.875rem;
    margin-bottom: 1rem;
}

.error-404 p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 2rem;
}

.error-404 .btn-cta {
    font-size: 1rem;
    padding: 1rem 2rem;
}

/* === SEARCH RESULTS === */
.search-results-header {
    text-align: center;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.search-results-header h1 {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

.search-results-header .search-query {
    color: var(--accent-solid);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll:nth-child(2) {
    transition-delay: 0.1s;
}

.animate-on-scroll:nth-child(3) {
    transition-delay: 0.2s;
}

.animate-on-scroll:nth-child(4) {
    transition-delay: 0.3s;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .site-content {
        flex-direction: column;
    }

    .sidebar-area {
        width: 100%;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-card {
        min-height: 340px;
    }

    .hero-card .entry-title,
    .single-hero .entry-title {
        font-size: 1.875rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }

    .container {
        padding: 0 1rem;
    }

    .main-navigation {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-secondary);
        padding: 1.5rem;
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        z-index: 999;
        overflow-y: auto;
    }

    .main-navigation.active {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-menu li a {
        padding: 1rem;
        font-size: 1.125rem;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
        min-width: auto;
    }

    .menu-toggle {
        display: flex;
    }

    .btn-cta-header {
        display: none;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .hero-card {
        min-height: 280px;
    }

    .hero-card-content {
        padding: 1.5rem;
    }

    .hero-card .entry-title {
        font-size: 1.5rem;
    }

    .hero-card .entry-excerpt {
        display: none;
    }

    .single-hero {
        min-height: 280px;
    }

    .single-hero-content {
        padding: 1.5rem;
    }

    .single-hero .entry-title {
        font-size: 1.5rem;
    }

    .entry-content {
        font-size: 1rem;
    }

    .author-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .social-share {
        flex-wrap: wrap;
    }

    .error-404 .error-code {
        font-size: 5rem;
    }

    .back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 42px;
        height: 42px;
    }
}