/* Saabsa Blog — layout inspired by blog.patientree.com */

:root {
    --blog-bg: #f8fafc;
    --blog-surface: #ffffff;
    --blog-text: #0f172a;
    --blog-muted: #64748b;
    --blog-border: #e2e8f0;
    --blog-accent: #0F3D6E;
    --blog-accent-hover: #0a2d52;
    --blog-accent-soft: #e8f0f8;
    --blog-orange: #F26A21;
    --blog-max: 720px;
    --blog-wide: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.blog-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
    color: var(--blog-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Reset browser default link styling inside blog content */
.blog-page .blog-main a:link,
.blog-page .blog-main a:visited {
    text-decoration: none;
}

.blog-page .blog-main a:hover {
    text-decoration: none;
}

/* Header */
.blog-header {
    background: var(--blog-surface);
    border-bottom: 1px solid var(--blog-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.blog-header-inner {
    max-width: var(--blog-wide);
    margin: 0 auto;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-logo svg {
    height: 2.5rem;
    width: auto;
    display: block;
}

@media (min-width: 640px) {
    .blog-logo svg {
        height: 3rem;
    }
}

.blog-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.blog-nav a {
    color: var(--blog-muted);
    text-decoration: none;
    transition: color 0.15s;
}

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

.blog-nav-cta {
    background: linear-gradient(135deg, var(--blog-accent) 0%, var(--blog-orange) 100%);
    color: #fff !important;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
}

.blog-nav-cta:hover {
    opacity: 0.92;
}

/* Main */
.blog-main {
    max-width: var(--blog-wide);
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

.blog-page-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    color: var(--blog-text);
}

@media (min-width: 640px) {
    .blog-page-title {
        font-size: 3rem;
    }
}

/* Featured article — Patientree-style hero */
.blog-featured {
    display: grid;
    gap: 1.75rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--blog-border);
}

@media (min-width: 768px) {
    .blog-featured {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 2.5rem;
    }
}

.blog-featured-image {
    display: block;
    border-radius: 1rem;
    overflow: hidden;
    background: #e5e7eb;
    aspect-ratio: 4 / 3;
}

.blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-featured-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blog-accent-soft) 0%, #fef3e8 100%);
}

.blog-featured-body {
    max-width: 36rem;
}

.blog-featured-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--blog-text);
}

@media (min-width: 640px) {
    .blog-featured-title {
        font-size: 1.875rem;
    }
}

@media (min-width: 1024px) {
    .blog-featured-title {
        font-size: 2.125rem;
    }
}

.blog-featured-excerpt {
    color: #4b5563;
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-read-more {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    border: 1px solid #111827;
    border-radius: 9999px;
    color: #111827 !important;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.blog-read-more:link,
.blog-read-more:visited {
    color: #111827 !important;
    text-decoration: none !important;
}

.blog-read-more:hover {
    background: #111827;
    color: #fff !important;
    border-color: #111827;
}

/* Toolbar: topics + search (Patientree-style) */
.blog-toolbar {
    margin-bottom: 2rem;
}

.blog-toolbar-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blog-muted);
    margin-bottom: 0.75rem;
}

.blog-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.blog-topic-btn {
    appearance: none;
    border: 1px solid var(--blog-border);
    background: var(--blog-surface);
    color: var(--blog-text);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.blog-topic-btn:hover {
    border-color: var(--blog-accent);
    color: var(--blog-accent);
}

.blog-topic-btn.active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.blog-search-wrap {
    position: relative;
}

.blog-search-wrap label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blog-muted);
    margin-bottom: 0.5rem;
}

.blog-search {
    width: 100%;
    max-width: none;
    padding: 0.75rem 1.125rem;
    font-family: inherit;
    font-size: 0.9375rem;
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    background: var(--blog-surface);
    color: var(--blog-text);
}

/* Article grid — Patientree-style cards */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem 1.5rem;
}

@media (min-width: 640px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem 1.75rem;
    }
}

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

.blog-card-image {
    display: block;
    border-radius: 1rem;
    overflow: hidden;
    background: #e5e7eb;
    aspect-ratio: 16 / 10;
    margin-bottom: 1rem;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

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

.blog-card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blog-accent-soft) 0%, #fef3e8 100%);
}

.blog-card-body {
    flex: 1;
}

.blog-card-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .blog-card-title {
        font-size: 1.2rem;
    }
}

.blog-card-title a {
    color: inherit;
    text-decoration: none !important;
}

.blog-card-title a:link,
.blog-card-title a:visited {
    color: inherit;
    text-decoration: none !important;
}

.blog-card-title a:hover {
    color: var(--blog-accent);
}

.blog-card-date {
    font-size: 0.875rem;
    color: #9ca3af;
}

.blog-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--blog-muted);
}

.blog-empty.hidden {
    display: none;
}

/* Resources strip */
.blog-resources {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--blog-border);
}

.blog-resources h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.blog-resources > p {
    color: var(--blog-muted);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

.blog-resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.blog-resource-links a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 0.5rem;
    color: var(--blog-accent);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.blog-resource-links a:hover {
    border-color: var(--blog-accent);
    background: var(--blog-accent-soft);
}

/* Post page */
.blog-post-main {
    max-width: var(--blog-max);
    margin: 0 auto;
    padding: 2rem 1.25rem 4rem;
}

.blog-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--blog-accent);
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
}

.blog-back:hover {
    text-decoration: underline;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--blog-muted);
    margin-bottom: 1rem;
}

.blog-post-category {
    background: var(--blog-accent-soft);
    color: var(--blog-accent);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
}

.blog-post-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    color: var(--blog-text);
}

@media (min-width: 640px) {
    .blog-post-title {
        font-size: 2.5rem;
    }
}

.blog-post-hero {
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 2rem;
    background: var(--blog-border);
}

.blog-post-hero img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.blog-post-credit {
    background: #1e293b;
    color: #94a3b8;
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
}

.blog-post-credit a {
    color: #fff;
}

.blog-post-article {
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: 0.75rem;
    padding: 1.75rem 1.5rem;
}

@media (min-width: 640px) {
    .blog-post-article {
        padding: 2.25rem 2rem;
    }
}

/* Article prose */
.blog-content {
    line-height: 1.75;
    font-size: 1.0625rem;
    color: #334155;
}

.blog-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--blog-text);
    letter-spacing: -0.02em;
}

.blog-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--blog-text);
}

.blog-content p {
    margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
    margin: 0 0 1rem 1.25rem;
}

.blog-content li {
    margin-bottom: 0.35rem;
}

.blog-content a {
    color: var(--blog-accent);
    text-decoration: underline;
}

.blog-content code {
    background: #f1f5f9;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.blog-content pre {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.blog-content blockquote {
    border-left: 3px solid var(--blog-accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--blog-muted);
    font-style: italic;
}

/* Footer */
.blog-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 3rem 1.25rem 2rem;
    margin-top: 2rem;
}

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

.blog-footer-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .blog-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.blog-footer-brand {
    font-weight: 700;
    color: #fff;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.blog-footer-tagline {
    color: #cbd5e1;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.blog-footer-desc {
    font-size: 0.875rem;
    line-height: 1.6;
}

.blog-footer h3 {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.blog-footer ul {
    list-style: none;
}

.blog-footer li {
    margin-bottom: 0.4rem;
}

.blog-footer a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
}

.blog-footer a:hover {
    color: #fff;
}

.blog-footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8125rem;
}

.blog-footer-bottom a {
    color: #94a3b8;
}

.blog-footer-bottom a:hover {
    color: #fff;
}
