/**
 * Blog Archive and Single Post Styling
 * 
 * Styles for blog listing, grid layout, pagination, and individual post pages
 * Works with WordPress Loop and template hierarchy
 */

/* ============================================
   BLOG HERO SECTION
   ============================================ */

.blog-hero {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4rem 2rem;
    padding-top 8rem !important;
    text-align: center;
    margin-bottom: 3rem;
}

.blog-hero-content {
    max-width: 900px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-hero h1 .highlight {
    background: linear-gradient(135deg, #D4AF37, #E8C766);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   BLOG CONTAINER & LAYOUT
   ============================================ */

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

/* ============================================
   POSTS GRID LAYOUT
   ============================================ */

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

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

/* ============================================
   POST CARD STYLING
   ============================================ */

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.post-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #0A1628 0%, #1B2B44 100%);
}

.post-card-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    z-index: 1;
}

.post-card-image-placeholder img {
    max-width: 60%;
    height: auto;
}

.post-card-snippet-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 2;
}

.post-card-snippet-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-snippet-preview img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-meta {
    margin-bottom: 0.75rem;
}

.post-category {
    display: inline-block;
    background: linear-gradient(135deg, #D4AF37, #E8C766);
    color: #0A1628;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.post-card-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0A1628;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    flex-grow: 1;
}

.post-card-content h3 a {
    color: #0A1628;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card-content h3 a:hover {
    color: #D4AF37;
}

.post-card-content p {
    color: #5a5a5a;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #D4AF37;
    text-decoration: none;
    font-weight: 600;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 0.75rem;
}

.read-more svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: transform 0.3s ease;
}

.read-more:hover svg {
    transform: translateX(4px);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    color: #0A1628;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(.active) {
    border-color: #D4AF37;
    color: #D4AF37;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #D4AF37, #E8C766);
    color: #0A1628;
    border-color: #D4AF37;
}

.pagination-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   BLOG SINGLE POST STYLING
   ============================================ */

.blog-single-post .article-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 2rem 4rem;
}

.breadcrumb {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #5a5a5a;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #1B2B44;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #D4AF37;
}

.breadcrumb span {
    color: #ccc;
}

.article-category {
    display: inline-block;
    background: linear-gradient(135deg, #D4AF37, #E8C766);
    color: #0A1628;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.article-title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    color: #0A1628;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #5a5a5a;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1.5rem;
}

.featured-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    max-height: 400px;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   ARTICLE CONTENT STYLING
   ============================================ */

.article-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #1a1a1a;
    margin-bottom: 2rem;
}

.article-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0A1628;
    margin: 2rem 0 1rem;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0A1628;
    margin: 1.5rem 0 0.75rem;
    line-height: 1.3;
}

.article-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0A1628;
    margin: 1.25rem 0 0.5rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content strong {
    color: #0A1628;
    font-weight: 700;
}

.article-content em,
.article-content i {
    font-style: italic;
    color: #5a5a5a;
}

.article-content a {
    color: #D4AF37;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: #E8C766;
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-left: 1.75rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    color: #1a1a1a;
}

.article-content blockquote {
    border-left: 4px solid #D4AF37;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f9f9f9;
    font-style: italic;
    color: #5a5a5a;
}

.article-content code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #d14;
}

.article-content pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-left: 4px solid #D4AF37;
}

/* Custom content boxes */
.template-box,
.callout,
.formula-box,
.product-highlight {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #eee;
}

.template-box {
    border-left: 4px solid #D4AF37;
}

.callout {
    background: linear-gradient(135deg, #0A1628, #1B2B44);
    border-left: 4px solid #D4AF37;
    color: rgba(255, 255, 255, 0.95);
}

.callout strong {
    color: #D4AF37;
}

.callout p {
    color: rgba(255, 255, 255, 0.95);
}

.formula-box {
    background: linear-gradient(135deg, #F5E6B8, #FAF9F6);
    border-left: 4px solid #D4AF37;
}

.product-highlight {
    background: linear-gradient(135deg, #F5E6B8, #FAF9F6);
    border: 2px solid #D4AF37;
    text-align: center;
}

.product-highlight h3 {
    color: #0A1628;
    margin-bottom: 1rem;
}

/* ============================================
   ARTICLE CTA SECTION
   ============================================ */

.article-cta {
    background: linear-gradient(135deg, #0A1628, #1B2B44);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 3rem 0;
    text-align: center;
    color: white;
}

.article-cta h3 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.article-cta p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #D4AF37, #E8C766);
    color: #0A1628;
    padding: 0.85rem 1.75rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: linear-gradient(135deg, #E8C766, #D4AF37);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(212, 175, 55, 0.3);
}

.cta-button svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* ============================================
   AUTHOR BOX
   ============================================ */

.author-box {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    display: flex;
    gap: 1.5rem;
    border: 1px solid #eee;
}

.author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0A1628, #1B2B44);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar svg {
    width: 40px;
    height: 40px;
    fill: #D4AF37;
}

.author-info h4 {
    font-weight: 700;
    color: #0A1628;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.author-title {
    color: #D4AF37;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.author-info p {
    color: #5a5a5a;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .author-avatar {
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .blog-hero {
        padding: 2.5rem 1.5rem;
        padding-top: 5rem;
    }
    
    .blog-container {
        padding: 0 1.5rem 2rem;
    }
    
    .blog-single-post .article-container {
        padding: 0 1.5rem 2rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-cta {
        padding: 1.5rem;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

:root.dark-mode .posts-grid,
:root.dark-mode .blog-single-post {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --text-primary: #e8eaed;
    --text-secondary: #b0b3b8;
}

:root.dark-mode .post-card {
    background: #1a1f2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

:root.dark-mode .post-card-content h3,
:root.dark-mode .post-card-content h3 a,
:root.dark-mode .article-title,
:root.dark-mode .article-content h2,
:root.dark-mode .article-content h3 {
    color: #e8eaed;
}

:root.dark-mode .post-card-content p,
:root.dark-mode .article-content p,
:root.dark-mode .article-meta,
:root.dark-mode .author-info p {
    color: #b0b3b8;
}

:root.dark-mode .breadcrumb a {
    color: #e8eaed;
}

:root.dark-mode .article-content a {
    color: #f4d56d;
}

:root.dark-mode .author-box {
    background: #1a1f2e;
    border-color: #2a2f3f;
}

:root.dark-mode .callout {
    background: linear-gradient(135deg, #1a1f2e, #252c3d);
}

:root.dark-mode .template-box {
    background: #1a1f2e;
    border-color: #2a2f3f;
}