/* ============================================
   Masterpiece Designs — Blog Styles
   Matches the light, minimal theme of mstrpc.dev
   ============================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --bg-card-hover: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #111827;
    --accent-hover: #374151;
    --border: #e5e7eb;
    --font-heading: "Playfair Display", Georgia, serif;
    --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --max-width: 1200px;
    --content-width: 760px;
    --radius: 12px;
    --transition: 0.2s ease;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Blog Header / Nav ---------- */
.blog-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.blog-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-logo {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.blog-logo span {
    color: var(--text-secondary);
    font-weight: 400;
}

.blog-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.blog-nav a {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
    letter-spacing: 0.01em;
}

.blog-nav a:hover,
.blog-nav a.active {
    color: var(--text-primary);
}

/* ---------- Blog Hero (Listing Page) ---------- */
.blog-hero {
    text-align: center;
    padding: 6rem 2rem 3.5rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
    font-family: var(--font-heading);
    font-size: 3.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.15;
}

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

/* ---------- Blog Post Grid ---------- */
.blog-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db;
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-secondary);
}

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

.blog-card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-card-meta-details {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-card-tag {
    align-self: flex-start;
    background: #f3f4f6;
    color: #374151;
    padding: 0.2rem 0.65rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid var(--border);
}

.blog-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.65rem;
    letter-spacing: -0.01em;
}

.blog-card-title a {
    color: inherit;
}

.blog-card-title a:hover {
    color: #374151;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.blog-card-excerpt {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.blog-card-link {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.blog-card-link:hover {
    gap: 0.6rem;
}

.blog-card-link::after {
    content: "\2192";
    transition: margin-left var(--transition);
}

/* ---------- Blog Post (Single Article) ---------- */
.post-header {
    text-align: center;
    padding: 6rem 2rem 3rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
}

.post-header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
}

.post-tag {
    display: inline-block;
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.85rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.post-header h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-meta-divider {
    width: 3px;
    height: 3px;
    background: var(--text-muted);
    border-radius: 50%;
}

/* ---------- Post Content ---------- */
.post-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

.post-content h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.post-content h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-content p {
    margin-bottom: 1.4rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

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

.post-content li {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.post-content blockquote {
    border-left: 3px solid #d1d5db;
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-secondary);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content a {
    color: var(--accent);
    border-bottom: 1px solid rgba(79, 172, 254, 0.3);
    transition: border-color var(--transition);
}

.post-content a:hover {
    border-bottom-color: var(--accent);
}

.post-content img {
    border-radius: var(--radius);
    margin: 2rem 0;
}

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 3rem 0;
}

/* ---------- Post CTA Box ---------- */
.post-cta {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    text-align: center;
    margin-top: 3rem;
}

.post-cta h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.post-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 300;
}

.btn-primary,
a.btn-primary {
    display: inline-block;
    background: var(--text-primary);
    color: #ffffff !important;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    letter-spacing: 0.02em;
    transition:
        background var(--transition),
        transform var(--transition);
}

.btn-primary:hover,
a.btn-primary:hover {
    background: #374151;
    transform: translateY(-1px);
    color: #ffffff !important;
}

/* ---------- Blog Footer ---------- */
.blog-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
    text-align: center;
}

.blog-footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.blog-footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.blog-footer a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

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

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2.2rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        padding: 2rem 1.25rem 3rem;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-content {
        padding: 2rem 1.25rem 3rem;
    }

    .blog-nav {
        gap: 1rem;
    }

    .blog-header {
        padding: 1rem 1.25rem;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .blog-hero h1 {
        font-size: 1.75rem;
    }

    .post-header h1 {
        font-size: 1.6rem;
    }

    .blog-hero {
        padding: 3.5rem 1.25rem 2rem;
    }

    .post-header {
        padding: 3.5rem 1.25rem 2rem;
    }
}
