/* 
 * Blog Styles - RCR Digital
 * Shared styles for blog index and single post pages
 */

/* ========================================
   CSS VARIABLES (match your site)
   ======================================== */
:root {
    --brand-primary: #2C5EB0;
    --brand-secondary: #7DACFB;
    --brand-accent: #930108;
    --brand-light: #BFD6FD;
    --brand-dark: #272D36;
    --brand-gray-light: #F5F7FA;
    --brand-gray: #525C6E;
    --white: #FFFFFF;
}

/* ========================================
   BLOG LAYOUT - 2/3 Content + 1/3 Sidebar
   ======================================== */
.blog-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Desktop: Side by side layout */
@media (min-width: 1024px) {
    .blog-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    
    /* Content takes 2/3 of the width */
    .blog-content {
        flex: 0 0 65%;
        max-width: 65%;
        order: 1;
    }
    
    /* Sidebar takes 1/3 of the width */
    .blog-sidebar {
        flex: 0 0 32%;
        max-width: 32%;
        order: 2;
        position: sticky;
        top: 100px;
    }
}

/* Mobile: Stack vertically, sidebar first */
@media (max-width: 1023px) {
    .blog-content {
        order: 2;
        width: 100%;
    }
    
    .blog-sidebar {
        order: 1;
        width: 100%;
    }
}

/* Sidebar spacing */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========================================
   BLOG POSTS GRID (Index Page)
   ======================================== */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   FEATURED IMAGE
   ======================================== */
.featured-image-container {
    max-width: 1200px;
    margin: 0 auto;
}

.featured-image-container img {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
}

/* ========================================
   BLOG CARDS
   ======================================== */
.blog-card {
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s;
    text-decoration: none;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

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

.blog-card h3,
.blog-card h4 {
    color: var(--brand-dark);
    transition: color 0.2s;
}

.blog-card:hover h3,
.blog-card:hover h4 {
    color: var(--brand-primary);
}

/* Placeholder for posts without featured image */
.blog-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-dark));
}

/* Related posts grid (on single post page) */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   PAGINATION
   ======================================== */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.blog-pagination a,
.blog-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.blog-pagination a {
    background: var(--white);
    color: var(--brand-gray);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
}

.blog-pagination a:hover {
    background: var(--brand-primary);
    color: var(--white);
}

.blog-pagination .active {
    background: var(--brand-primary);
    color: var(--white);
}

/* ========================================
   PROSE / CONTENT STYLING
   ======================================== */
.prose {
    line-height: 1.8;
    color: var(--brand-dark);
}

.prose h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-dark);
    margin: 2rem 0 1rem;
    border-left: 4px solid var(--brand-primary);
    padding-left: 1rem;
}

.prose h3 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--brand-dark);
    margin: 1.5rem 0 0.75rem;
}

.prose h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand-dark);
    margin: 1.25rem 0 0.5rem;
}

.prose p {
    margin-bottom: 1.25rem;
    color: var(--brand-gray);
}

.prose ul,
.prose ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    color: var(--brand-gray);
}

.prose ul li {
    list-style-type: disc;
}

.prose ol li {
    list-style-type: decimal;
}

.prose blockquote {
    border-left: 4px solid var(--brand-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--brand-gray-light);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: var(--brand-gray);
}

.prose a {
    color: var(--brand-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.prose a:hover {
    color: var(--brand-dark);
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.prose strong {
    font-weight: 600;
    color: var(--brand-dark);
}

.prose code {
    background: var(--brand-gray-light);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.9em;
    color: var(--brand-primary);
}

.prose pre {
    background: var(--brand-dark);
    color: var(--white);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ========================================
   TAG PILLS
   ======================================== */
.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: var(--brand-light);
    color: var(--brand-primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.tag-pill:hover {
    background: var(--brand-primary);
    color: var(--white);
}

/* ========================================
   SIDEBAR CARDS
   ======================================== */
.sidebar-card {
    background: var(--white);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    padding: 1.5rem;
}

.sidebar-card h3 {
    color: var(--brand-dark);
}

.sidebar-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-card li {
    padding: 0.25rem 0;
}

.sidebar-card a {
    color: var(--brand-gray);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-card a:hover {
    color: var(--brand-primary);
}

/* ========================================
   CTA BOX
   ======================================== */
.cta-box {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    color: var(--white);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.cta-box h3 {
    color: var(--white);
}

.cta-box p {
    color: var(--brand-light);
}

.cta-box a {
    display: inline-block;
    background: var(--white);
    color: var(--brand-primary);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.cta-box a:hover {
    background: var(--brand-gray-light);
}

/* ========================================
   LINE CLAMP UTILITY
   ======================================== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   GALLERY STYLING
   ======================================== */
.gallery-thumb {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 0.5rem;
    overflow: hidden;
}

.gallery-thumb:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 15px -3px rgba(0,0,0,0.15);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 1024px) {
    .featured-image-container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .prose h2 {
        font-size: 1.5rem;
    }
    
    .prose h3 {
        font-size: 1.2rem;
    }
    
    .cta-box {
        text-align: center;
    }
    
    .cta-box a {
        width: 100%;
        display: block;
        text-align: center;
    }
}
