/* ==========================================================================
   Tabb Health Media - Design System & Modern Editorial Styles
   Color Palette: Deep Slate Teal (#0f766e), Mint Sage (#f0fdf4), Charcoal (#1e293b), Coral Accent (#f43f5e)
   Typography: Vazirmatn (Persian RTL)
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --primary: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #14b8a6;
    --primary-subtle: #f0fdfa;
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --accent-warm: #d97706;
    --accent-coral: #e11d48;
    --accent-badge: #e0f2fe;
    --accent-badge-text: #0369a1;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07);
    --container-max: 1240px;
}

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

html {
    direction: rtl;
    text-align: right;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.8;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease, opacity 0.15s ease;
}

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

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

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    border-bottom: 1px solid #f1f5f9;
    padding: 8px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-symbol {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.4rem;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.25);
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

.brand-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-search form {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 9999px;
    padding: 6px 14px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.header-search form:focus-within {
    background: #ffffff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.header-search input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    width: 220px;
    direction: rtl;
}

.header-search button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
}

/* Topic Bar / Navigation */
.topic-nav {
    background: var(--bg-surface);
    border-top: 1px solid #f8fafc;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.topic-nav::-webkit-scrollbar {
    height: 3px;
}

.topic-nav::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
}

.topic-nav-list {
    display: flex;
    list-style: none;
    gap: 8px;
    padding: 10px 0;
}

.topic-nav-link {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-main);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.topic-nav-link:hover, .topic-nav-link.active {
    background-color: var(--primary-subtle);
    color: var(--primary-dark);
}

/* ==========================================================================
   Homepage Modules
   ========================================================================== */

.hero-lead-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 28px;
    margin-bottom: 40px;
}

.card-lead-story {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.card-lead-story .img-wrap {
    height: 380px;
    overflow: hidden;
    position: relative;
    background-color: #e2e8f0;
}

.card-lead-story .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card-lead-story:hover .img-wrap img {
    transform: scale(1.03);
}

.card-lead-story .story-content {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.badge-category {
    display: inline-block;
    background-color: var(--primary-subtle);
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.card-lead-story h2 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.5;
    margin-bottom: 12px;
    color: var(--text-main);
}

.card-lead-story p.lead-text {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
}

.meta-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-subtle);
    border-top: 1px solid #f1f5f9;
    padding-top: 14px;
}

.meta-author {
    font-weight: 600;
    color: var(--text-main);
}

/* Secondary stories column */
.secondary-stories {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-compact {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-compact:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-compact .thumb {
    width: 100px;
    height: 85px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background-color: #e2e8f0;
}

.card-compact .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-compact .details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-compact h3 {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 6px;
}

/* Section block styling */
.section-block {
    margin-bottom: 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 10px;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary);
    border-radius: 2px;
}

.section-view-all {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
}

.articles-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card-standard {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-standard:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-standard .img-wrap {
    height: 190px;
    overflow: hidden;
    background-color: #e2e8f0;
}

.card-standard .img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.card-standard:hover .img-wrap img {
    transform: scale(1.04);
}

.card-standard .card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-standard h3 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 10px;
    color: var(--text-main);
}

.card-standard p.excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 14px;
}

/* ==========================================================================
   Article Single Page (The Core Product)
   ========================================================================== */

.article-layout {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 36px;
    margin-top: 24px;
    margin-bottom: 60px;
}

.article-main {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-subtle);
    margin-bottom: 18px;
}

.article-headline {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.5;
    color: #0f172a;
    margin-bottom: 16px;
}

.article-lead {
    font-size: 1.15rem;
    line-height: 1.85;
    color: #334155;
    font-weight: 500;
    margin-bottom: 24px;
    padding-right: 14px;
    border-right: 4px solid var(--primary-light);
}

.article-trust-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 14px 18px;
    background-color: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #edf2f7;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.article-featured-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 32px;
    background-color: #e2e8f0;
}

.article-featured-image img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.article-featured-image figcaption {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: #f8fafc;
    border-top: 1px solid var(--border-subtle);
}

/* Article Body Typography (High Readability) */
.article-prose {
    font-size: 1.12rem;
    line-height: 2.1;
    color: #1e293b;
}

.article-prose p {
    margin-bottom: 1.6em;
}

.article-prose h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 2.2em;
    margin-bottom: 0.8em;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.article-prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 1.8em;
    margin-bottom: 0.6em;
}

.article-prose ul, .article-prose ol {
    margin-bottom: 1.6em;
    padding-right: 28px;
}

.article-prose li {
    margin-bottom: 0.6em;
}

.article-prose blockquote {
    margin: 2em 0;
    padding: 16px 24px;
    background-color: var(--primary-subtle);
    border-right: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.article-prose img {
    margin: 2em auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.article-prose figure {
    margin: 2em 0;
    text-align: center;
}

.article-prose figcaption {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* YMYL Medical Disclaimer Box */
.medical-disclaimer-box {
    margin-top: 40px;
    padding: 20px 24px;
    background-color: #fffbeb;
    border: 1px solid #fef3c7;
    border-right: 4px solid var(--accent-warm);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.8;
    color: #78350f;
}

.medical-disclaimer-box h4 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: #92400e;
}

/* Scientific References */
.scientific-references-box {
    margin-top: 30px;
    padding: 20px 24px;
    background-color: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
}

.scientific-references-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

/* Article Sidebar */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-widget {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
    color: var(--text-main);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 50px 0 24px 0;
    margin-top: 60px;
    border-top: 4px solid var(--primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 992px) {
    .hero-lead-grid {
        grid-template-columns: 1fr;
    }
    .articles-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .article-layout {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .articles-grid-3 {
        grid-template-columns: 1fr;
    }
    .header-main-inner {
        flex-direction: column;
        gap: 16px;
    }
    .header-search input {
        width: 100%;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .article-main {
        padding: 20px 16px;
    }
    .article-headline {
        font-size: 1.5rem;
    }
}
