/**
 * Dropmazter Blog Styles
 * Dark theme matching the main site aesthetic
 */

/* ================================
   CSS Variables
   ================================ */
:root {
    --blog-bg: #0a0a0a;
    --blog-surface: #141414;
    --blog-surface-hover: #1a1a1a;
    --blog-border: #2a2a2a;
    --blog-text: #e5e5e5;
    --blog-text-muted: #888;
    --blog-text-dim: #666;
    --blog-accent: #ffe68c;
    /* Dropmazter yellow */
    --blog-accent-hover: #ffe68c;
    --blog-purple: #ffe68c;
    --blog-link: #ffe68c;
    --blog-card-bg: #111111;
    --blog-radius: 12px;
    --blog-radius-sm: 8px;
    --blog-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --blog-transition: 0.2s ease;
    --blog-max-width: 1400px;
    --blog-content-width: 1000px;
}

/* ================================
   Base Styles
   ================================ */
.blog-container {
    background: var(--blog-bg);
    min-height: 100vh;
    color: var(--blog-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
}

.blog-wrapper {
    max-width: var(--blog-max-width);
    margin: 0 auto;
    padding: 2rem;
}

.blog-main-content {
    display: flex;
    gap: 2rem;
}

.blog-main-content,
.blog-article-container {
    justify-content: center;
}

.blog-articles-area {
    flex: 1;
    min-width: 0;
}

/* Keep main areas centered even when alone */
.blog-articles-area,
.blog-article-main {
    margin-left: auto;
    margin-right: auto;
}

/* Hard-center the entire blog page area */
.blog-page-container {
    width: 100%;
    display: flex;
    justify-content: center;
}


/* Your template uses this wrapper, make it a real centered container */
.blog-wrapper {
    width: min(var(--blog-max-width), calc(100% - 4rem));
    margin: 0 auto;
}

/* Single article view: center the main article column */
.blog-article-container {
    width: min(var(--blog-max-width), calc(100% - 4rem));
    margin: 0 auto;
    justify-content: center;
    /* <- this is the missing piece */
}

/* Keep the article itself as a centered readable column */
.blog-article-main {
    width: 100%;
    max-width: var(--blog-content-width);
}

/* Extra safety: if sidebar doesn't exist or is display:none, remove the "left feel" */
.blog-main-content:has(.blog-sidebar[style*="display: none"]),
.blog-article-container:not(:has(.blog-sidebar)) {
    justify-content: center;
}

.blog-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* ================================
   Header
   ================================ */
.blog-header {
    margin-bottom: 3rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--blog-text);
}

.blog-header-subtitle {
    color: var(--blog-text-muted);
    font-size: 1.1rem;
}

/* ================================
   Featured Article (Hero)
   ================================ */
.blog-featured {
    margin-bottom: 3rem;
}

.blog-featured-card {
    display: flex;
    background: var(--blog-surface);
    border-radius: var(--blog-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
}

.blog-featured-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--blog-shadow);
}

.blog-featured-image {
    width: 55%;
    position: relative;
    overflow: hidden;
}

.blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 350px;
}

.blog-featured-content {
    width: 45%;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured-categories {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.blog-category-tag {
    font-size: 0.85rem;
    color: var(--blog-purple);
    font-weight: 500;
}

.blog-category-tag:not(:last-child)::after {
    content: '·';
    margin-left: 0.75rem;
    color: var(--blog-text-dim);
}

.blog-featured-meta {
    color: var(--blog-text-dim);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-featured-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    color: var(--blog-text);
}

.blog-featured-subtitle {
    font-size: 1.1rem;
    color: var(--blog-text-muted);
    margin-bottom: 1rem;
}

.blog-featured-excerpt {
    color: var(--blog-text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* ================================
   Article Grid
   ================================ */
.blog-section-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--blog-text);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ================================
   Article Card
   ================================ */
.blog-card {
    background: var(--blog-card-bg);
    border-radius: var(--blog-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
    display: flex;
    flex-direction: column;
}

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

.blog-card-image {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: var(--blog-surface);
}

.blog-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.blog-card-meta {
    color: var(--blog-text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.blog-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    color: var(--blog-text);
}

.blog-card-subtitle {
    font-size: 0.95rem;
    color: var(--blog-accent);
    margin-bottom: 0.75rem;
}

.blog-card-excerpt {
    color: var(--blog-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: auto;
}

/* ================================
   Sidebar
   ================================ */
.blog-sidebar-widget {
    background: var(--blog-surface);
    border-radius: var(--blog-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-sidebar-widget h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--blog-text);
}

.blog-promo-card {
    text-align: center;
}

.blog-promo-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    opacity: 0.9;
}

.blog-promo-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.blog-promo-text {
    color: var(--blog-text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.blog-promo-btn {
    display: inline-block;
    background: var(--blog-accent);
    color: #000;
    padding: 0.75rem 2rem;
    border-radius: var(--blog-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: background var(--blog-transition);
    width: 100%;
    box-sizing: border-box;
}

.blog-promo-btn:hover {
    background: var(--blog-accent-hover);
}

/* ================================
   Single Article Page
   ================================ */
.blog-article-container {
    display: flex;
    gap: 2rem;
}

.blog-article-main {
    flex: 1;
    max-width: var(--blog-content-width);
}

.blog-article-header {
    margin-bottom: 2rem;
}

.blog-article-categories {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.blog-article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.blog-article-subtitle {
    font-size: 1.35rem;
    color: var(--blog-accent);
    margin-bottom: 1rem;
}

.blog-article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--blog-text-muted);
    font-size: 0.95rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--blog-border);
}

.blog-article-author {
    font-weight: 500;
    color: var(--blog-text);
}

/* Article Content */
.blog-article-content {
    margin-top: 2rem;
}

.blog-article-content::after {
    content: '';
    display: table;
    clear: both;
}

.blog-text {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.blog-text strong {
    color: var(--blog-text);
    font-weight: 600;
}

.blog-text em {
    font-style: italic;
}

.blog-text u {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blog-heading {
    margin: 2.5rem 0 1rem 0;
    color: var(--blog-text);
    font-weight: 600;
}

h2.blog-heading {
    font-size: 1.75rem;
}

h3.blog-heading {
    font-size: 1.4rem;
}

h4.blog-heading {
    font-size: 1.15rem;
}

.blog-list {
    margin: 1rem 0 1.5rem 1.5rem;
    padding: 0;
}

.blog-list li {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.blog-indent {
    border-left: 3px solid var(--blog-accent);
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    background: var(--blog-surface);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--blog-radius-sm) var(--blog-radius-sm) 0;
}

.blog-indent p {
    margin: 0.5rem 0;
    color: var(--blog-text);
}

.blog-indent p strong {
    color: var(--blog-accent);
}

/* Article Images */
.blog-image {
    border-radius: var(--blog-radius-sm);
    max-width: 100%;
    height: auto;
}

.blog-image.hero {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--blog-radius);
    margin-bottom: 2rem;
}

.blog-image.full-width {
    width: 100%;
}

.blog-image.inline {
    margin-bottom: 1rem;
}

.blog-figure {
    margin: 2rem 0;
}

.blog-figure.full-width {
    margin: 2.5rem 0;
}

.blog-figure figcaption,
.image-caption {
    text-align: center;
    color: var(--blog-text-muted);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    font-style: italic;
}

.blog-images-side-by-side {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.blog-images-side-by-side .blog-figure {
    margin: 0;
}

.blog-images-side-by-side img {
    width: 100%;
    border-radius: var(--blog-radius-sm);
}

/* Share & Tags */
.blog-article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--blog-border);
}

.blog-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.blog-share-label {
    color: var(--blog-text-muted);
    font-size: 0.95rem;
}

.blog-share-buttons {
    display: flex;
    gap: 0.5rem;
}

.blog-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blog-text-muted);
    text-decoration: none;
    transition: all var(--blog-transition);
}

.blog-share-btn:hover {
    background: var(--blog-surface-hover);
    color: var(--blog-text);
    border-color: var(--blog-text-dim);
}

/* Related Articles */
.blog-related {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--blog-border);
}

.blog-related-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
}

.blog-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* ================================
   Responsive Design
   ================================ */
@media (max-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-sidebar {
        width: 280px;
    }
}

@media (max-width: 992px) {
    .blog-main-content {
        flex-direction: column;
    }

    .blog-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .blog-featured-card {
        flex-direction: column;
    }

    .blog-featured-image,
    .blog-featured-content {
        width: 100%;
    }

    .blog-featured-image img {
        min-height: 250px;
    }

    .blog-article-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .blog-wrapper {
        padding: 1rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        grid-template-columns: 1fr;
    }

    .blog-featured-title {
        font-size: 1.5rem;
    }

    .blog-article-title {
        font-size: 1.75rem;
    }

    .blog-images-side-by-side {
        grid-template-columns: 1fr;
    }

    .blog-related-grid {
        grid-template-columns: 1fr;
    }

    .blog-article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ================================
   Placeholder Images (for demo)
   ================================ */
.blog-placeholder-img {
    background: linear-gradient(135deg, var(--blog-surface) 0%, var(--blog-surface-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blog-text-dim);
    font-size: 0.9rem;
}