/*
Theme Name: Docy Blog
Description: A custom WordPress theme inspired by Docy documentation layout, perfect for blogs and content sites.
Version: 1.0
Author: Your Name
*/

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light mode colors */
    --primary-color: #4f8ef7;
    --secondary-color: #6c757d;
    --text-color: #333333;
    --text-light: #6c757d;
    --bg-color: #ffffff;
    --sidebar-bg: #f8f9fa;
    --border-color: #e9ecef;
    --code-bg: #f8f9fa;
    --hover-color: #f1f5f9;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --bg-color: #0f172a;
    --sidebar-bg: #1e293b;
    --border-color: #334155;
    --code-bg: #1e293b;
    --hover-color: #334155;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styles */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.main-navigation a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a.current {
    color: var(--primary-color);
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 20px;
    width: 60px;
    height: 30px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle::after {
    transform: translateX(28px);
}

/* Breadcrumbs */
.breadcrumbs {
    background: var(--sidebar-bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumbs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.breadcrumbs ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--text-light);
    margin: 0 0.5rem;
}

/* Main Layout */
.site-main {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr 250px;
    gap: 2rem;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* Left Sidebar */
.sidebar-left {
    background: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid var(--border-color);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

.sidebar-section ul {
    list-style: none;
}

.sidebar-section li {
    margin-bottom: 0.5rem;
}

.sidebar-section a {
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    display: block;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.sidebar-section a:hover,
.sidebar-section a.active {
    background: var(--hover-color);
    color: var(--primary-color);
}

/* Content Area */
.content-area {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.2;
}

.post-meta {
    color: var(--text-light);
    font-size: 0.95rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

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

/* Post Content Styling */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    line-height: 1.3;
}

.post-content h2 {
    font-size: 1.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

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

.post-content p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

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

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--code-bg);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}

.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.post-content code {
    background: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', Monaco, 'Cascadia Code', monospace;
    font-size: 0.9em;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* Right Sidebar (TOC) */
.sidebar-right {
    background: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
    position: sticky;
    top: 120px;
    border: 1px solid var(--border-color);
}

.toc-section h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.25rem 0;
    display: block;
    transition: color 0.3s ease;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--primary-color);
}

.toc-list .toc-h3 {
    padding-left: 1rem;
    font-size: 0.85rem;
}

.toc-list .toc-h4 {
    padding-left: 2rem;
    font-size: 0.8rem;
}

/* Blog Posts Grid (for home page) */
.posts-grid {
    display: grid;
    gap: 2rem;
}

.post-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.post-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.post-card h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.post-card h2 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Footer */
.site-footer {
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .site-main {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .sidebar-left,
    .sidebar-right {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-navigation ul {
        gap: 1rem;
    }
    
    .site-main {
        padding: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .main-navigation ul {
        flex-direction: column;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .sidebar-left,
    .sidebar-right {
        padding: 1rem;
    }
}
/* Additional CSS to add to style.css for mobile responsiveness and extra features */

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-navigation {
    display: none;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

.mobile-navigation.active {
    display: block;
}

.mobile-navigation ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-navigation a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
    border-bottom: 1px solid var(--border-color);
}

/* Search Form Styles */
.header-search {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.1);
}

.search-field {
    border: none;
    background: none;
    padding: 0.5rem 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
    min-width: 200px;
}

.search-field:focus {
    outline: none;
}

.search-field::placeholder {
    color: var(--text-light);
}

.search-submit {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.search-submit:hover {
    color: var(--primary-color);
}

/* Post Navigation Styles */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

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

.post-tags a {
    background: var(--code-bg);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    display: inline-block;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.post-tags a:hover {
    background: var(--primary-color);
    color: white;
}

.nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.nav-previous,
.nav-next {
    padding: 1.5rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.nav-previous:hover,
.nav-next:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-previous a,
.nav-next a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

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

.nav-subtitle {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.nav-title {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Author Info Styles */
.author-info {
    text-align: center;
    padding: 1rem;
    background: var(--hover-color);
    border-radius: 8px;
}

.author-info img {
    border-radius: 50%;
    margin-bottom: 1rem;
}

.author-info h5 {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.author-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.author-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Social Share Styles */
.social-share {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.social-share a {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.social-share a:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Child Pages Grid */
.child-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.child-page-card {
    background: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.child-page-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.child-page-card h4 {
    margin-bottom: 0.5rem;
}

.child-page-card h4 a {
    color: var(--text-color);
    text-decoration: none;
}

.child-page-card h4 a:hover {
    color: var(--primary-color);
}

.child-page-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Pagination Styles */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination .page-numbers {
    display: flex;
    list-style: none;
    gap: 0.5rem;
}

.pagination .page-numbers li {
    margin: 0;
}

.pagination .page-numbers a,
.pagination .page-numbers span {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.pagination .page-numbers a:hover,
.pagination .page-numbers .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--sidebar-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.no-posts h2 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.no-posts p {
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Comments Styles */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.comment-list {
    list-style: none;
    margin-bottom: 2rem;
}

.comment {
    background: var(--sidebar-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.comment-meta {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.comment-author {
    font-weight: 600;
    color: var(--text-color);
}

/* Footer Enhancements */
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .sidebar-left,
    .sidebar-right,
    .site-header,
    .site-footer,
    .theme-toggle,
    .social-share {
        display: none;
    }
    
    .site-main {
        grid-template-columns: 1fr;
        max-width: none;
    }
    
    .content-area {
        border: none;
        box-shadow: none;
    }
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        display: none;
    }
    
    .header-search {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .search-field {
        min-width: 150px;
    }
    
    .nav-links {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .social-share {
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .site-branding {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .child-pages-grid {
        grid-template-columns: 1fr;
    }
    
    .search-field {
        min-width: 120px;
    }
}
