/*
Theme Name: CodeGrinders Blog
Description: A custom WordPress theme for CodeGrinders blog with ACF integration and modern design
Version: 1.0
Author: CodeGrinders
Text Domain: codegrinders-blog
*/

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #d84040;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #b03030;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    background: #fffffff2;
    border-bottom: 1px solid #0000001a;
    box-shadow: 0 4px 20px #0000001a;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.site-logo {
    color: #d84040;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: auto;
    text-decoration: none;
    transition: all 0.2s linear;
    font-family: Poppins,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;
}

.site-logo:hover {
    color: #b03030;
    transform: scale(1.05);
}

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

.main-navigation a {
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: #d84040;
}

/* Blog Listing Styles */
.blog-listing {
    padding: 3rem 0;
}

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

.blog-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.5rem;
}

.blog-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.blog-card-excerpt {
    color: #666;
    margin-bottom: 1rem;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
}

.blog-card-date {
    font-weight: 500;
}

.blog-card-category {
    background: #d84040;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Single Post Styles */
.single-post {
    padding: 0;
}

.post-header {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
}

/* Two Column Layout */
.post-two-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 3rem 0;
    align-items: start;
}

.post-content-column {
    order: 1;
}

.post-image-column {
    order: 2;
    position: sticky;
    top: 100px;
}

.post-content {
    line-height: 1.8;
}

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

/* Featured Image Styles */
.post-featured-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

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

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

.post-featured-image-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.placeholder-content {
    text-align: center;
}

.placeholder-content p {
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Code Snippet Styles */
.code-snippet-section {
    margin: 3rem 0;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.code-snippet-section h3 {
    margin: 0;
    padding: 1.5rem 1.5rem 0;
    color: #333;
}

.code-snippet-container {
    margin-top: 1rem;
}

.code-snippet-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-button.active {
    color: #d84040;
    border-bottom-color: #d84040;
    background: #f8f9fa;
}

.tab-button:hover {
    color: #d84040;
    background: #f8f9fa;
}

.code-snippet-content {
    position: relative;
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

/* Code Display */
.tab-content pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tab-content code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-family: inherit;
}

/* Code Preview Frame */
.code-preview-frame {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
    overflow: auto;
}

.code-preview-frame iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 4px;
}

/* CTA Section Styles */
.cta-section {
    background: radial-gradient(ellipse at 70% 30%, #ff3c3c59 0, #0000 60%), radial-gradient(ellipse at 60% 0, #5000ff40 0, #0000 70%), radial-gradient(ellipse at 20% 80%, #7800b459 0, #0000 70%), radial-gradient(ellipse at 100% 100%, #ff78001f 0, #0000 70%), linear-gradient(135deg, #0d0c1d, #1a1333);
    color: #fff;
    padding: 100px 0;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.cta-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.cta-btn {
    background: white;
    color: #d84040;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid white;
}

.cta-btn:hover {
    background: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.cta-btn.primary {
    background: #0000;
    border: 2px solid #fff;
    border-radius: 0;
    box-shadow: none;
    color: #fff;
}

.cta-btn.primary:hover {
    background: #fff;
    box-shadow: none;
    color: #131313;
}

.cta-btn svg {
    transition: transform 0.3s ease;
}

.cta-btn:hover svg {
    transform: translateX(5px);
}

/* Footer */
.site-footer {
    background: #181f2c;
    color: #fff;
    padding: 2rem 0;
    margin-top: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #fff;
    text-decoration: underline;
}

.footer-links a:hover {
    color: #d84040;
}

/* Footer Menu Styles */
.footer-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-menu li {
    margin: 0;
}

.footer-menu a {
    color: #fff;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.footer-menu a:hover {
    color: #d84040;
}

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

.hamburger-line {
    width: 25px;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: #d84040;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #d84040;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

.back-to-top:hover {
    background: #b03030;
    transform: translateY(-2px);
}

/* Blog Card Animations */
.blog-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Blog Card Image Placeholder */
.blog-card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
}

/* Reading Time Styles */
.blog-card-reading-time {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.5rem;
}

.reading-time-icon {
    margin-right: 0.25rem;
}

/* Post Navigation */
.post-navigation {
    margin: 3rem 0;
    padding: 2rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-previous,
.nav-next {
    flex: 1;
}

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

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #d84040;
}

/* Post Tags Container */
.post-tags-container {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid #eee;
}

.post-tags-container h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Post Author Bio */
.post-author-bio {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #d84040;
}

.post-author-bio h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .main-navigation.mobile-menu-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
    }
    
    .main-navigation li {
        border-bottom: 1px solid #eee;
    }
    
    .main-navigation a {
        display: block;
        padding: 1rem 2rem;
    }
    
    .header-content {
        flex-direction: row;
        gap: 0;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav-next {
        text-align: center;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Mobile Two Column Layout */
    .post-two-column-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .post-content-column {
        order: 2;
    }
    
    .post-image-column {
        order: 1;
        position: static;
    }
    
    .post-featured-image-placeholder {
        height: 300px;
    }
    
    /* Mobile Code Snippet */
    .code-snippet-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        text-align: center;
        border-bottom: none;
        border-right: 2px solid transparent;
    }
    
    .tab-button.active {
        border-right-color: #d84040;
        border-bottom-color: transparent;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .tab-content pre {
        font-size: 0.8rem;
        padding: 1rem;
    }
    
    /* Mobile CTA Section */
    .cta-section {
        padding: 3rem 0;
        margin-top: 3rem;
    }
    
    .cta-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .cta-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

/* ACF Custom Fields Styling */
.acf-field {
    margin-bottom: 1.5rem;
}

.acf-field-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.acf-field-content {
    color: #666;
}

/* Custom ACF Fields for Blog Posts */
.post-featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.post-summary {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #d84040;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.post-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
}

.post-tag:hover {
    background: #d84040;
    color: #fff;
} 

ul, ol {
	padding-left: 20px;
}