/* ============================================================
 * Digital Presence Engine (DPE)
 * themes/professional/style.css — قالب Professional (Public Site)
 * ============================================================
 * RTL, Responsive, Modern SaaS Design
 * فونت system-ui، رنگ‌بندی آبی نیوی + accent آبی روشن،
 * Layout عریض، حس کسب‌وکار و حرفه‌ای
 *
 * نسخه: 1.1 — 2026-09-27 (Phase PX Units — تبدیل کامل rem به px)
 *      بر پایه 1.0 (Phase 2.30)
 * ⚠️ همه چیز با px — نه rem
 */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.7;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

a { color: #1e40af; text-decoration: none; }
a:hover { color: #0ea5e9; }

img { max-width: 100%; display: block; }

/* ========== Container ========== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== Header ========== */
.site-header {
    background: #ffffff;
    color: #0f172a;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-brand-mark {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1e40af 0%, #0ea5e9 100%);
    flex-shrink: 0;
}

.site-brand-mark-small {
    width: 24px;
    height: 24px;
    border-radius: 5px;
}

.site-title {
    font-weight: 800;
    font-size: 18px;
    color: #0f172a !important;
    letter-spacing: -0.3px;
}

.site-title:hover { color: #1e40af !important; }

.site-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}

.site-nav a {
    color: #475569;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
    background: #f1f5f9;
    color: #1e40af;
}

.site-nav a.is-active {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 700;
}

/* ========== Main ========== */
.site-main {
    flex: 1;
    padding: 48px 0 64px;
}

/* ============================================================
 * Hero Section
 * ============================================================ */
.section-hero {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #0ea5e9 100%);
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: right;
    border-left: 6px solid #0ea5e9;
    box-shadow: 0 20px 50px rgba(30, 64, 175, 0.15);
}

.section-hero .hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.section-hero .hero-bg.has-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,23,42,0.85) 0%, rgba(15,23,42,0.6) 60%, rgba(15,23,42,0.3) 100%);
    pointer-events: none;
}

.section-hero .hero-bg:not(.has-overlay)::after {
    display: none;
}

.hero-button-wrap {
    margin-top: 26px;
}

.hero-button {
    display: inline-block;
    padding: 13px 32px;
    background: #0ea5e9;
    color: #ffffff !important;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
    border: none;
}

.hero-button:hover {
    background: #0284c7;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.5);
}

.section-hero .hero-inner {
    position: relative;
    z-index: 1;
    padding: 64px 48px;
    color: #ffffff;
    max-width: 680px;
}

.section-hero .hero-title {
    font-size: 38px;
    margin-bottom: 16px;
    color: #ffffff;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.section-hero .hero-subtitle {
    font-size: 18px;
    color: #e0f2fe;
    line-height: 1.8;
}

.section-hero.section-hero-disabled {
    min-height: 220px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.section-hero.section-hero-disabled .hero-inner {
    padding: 48px 32px;
}

/* ========== Sections عمومی ========== */
.section {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 28px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.section:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.section-title {
    font-size: 24px;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 3px solid #0ea5e9;
    border-image: linear-gradient(90deg, #1e40af, #0ea5e9) 1;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.section-content {
    color: #334155;
    line-height: 1.9;
    font-size: 16px;
}

.section-content p { margin-bottom: 14px; }
.section-content p:last-child { margin-bottom: 0; }

.section-placeholder {
    color: #94a3b8;
}

/* ========== Posts List ========== */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 8px;
}

.post-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border-right: 4px solid #0ea5e9;
}

.section-posts .post-card {
    padding: 28px;
    background: #ffffff;
}

.post-card:hover {
    border-color: #0ea5e9;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.12);
}

.post-cover {
    margin: -1px -1px 18px;
    overflow: hidden;
}

.section-posts .post-cover {
    margin: -28px -28px 18px;
}

.post-cover img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 280px;
    object-fit: cover;
}

.post-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: #0f172a;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-posts .post-card {
    padding: 0;
    background: #ffffff;
}

.section-posts .post-card .post-title {
    padding: 22px 26px 0;
}


/* 🆕 FIX: برای همه‌ی post-card ها (نه فقط .section-posts) */
.post-list .post-card .post-title {
    padding: 24px 26px 0;
}

.section-posts .post-card .post-date,
.section-posts .post-card .post-excerpt,
.post-list .post-card .post-date,
.post-list .post-card .post-excerpt {
    padding: 0 26px;
}

.section-posts .post-card .post-excerpt {
    padding-bottom: 22px;
}

.post-title a { color: inherit; }
.post-title a:hover { color: #1e40af; }

.post-date {
    display: block;
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 10px;
    font-weight: 500;
}

.post-excerpt {
    font-size: 15px;
    color: #475569;
    line-height: 1.85;
}

/* ========== Post Single ========== */
.post-single,
.page-single {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 40px;
    border: 1px solid #e2e8f0;
}

.post-cover-single {
    margin: -48px -40px 28px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.post-cover-single img {
    width: 100%;
    height: auto;
    display: block;
}

.post-single-title,
.page-single-title {
    font-size: 20px;
    color: #0f172a;
    margin-bottom: 14px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.5px;
    padding-bottom: 16px;
    border-bottom: 3px solid #0ea5e9;
}

.post-content,
.page-content,
.section-content {
    font-size: 16px;
    line-height: 1.9;
    color: #334155;
    margin: 28px 0;
}

.post-content p,
.page-content p,
.section-content p { margin-bottom: 18px; }

.post-content img,
.page-content img,
.section-content img { border-radius: 8px; margin: 18px 0; }

/* ============================================================
 * Rich Content: Headings / Lists / Quote / Links
 * ============================================================ */

.post-content h2, .page-content h2, .section-content h2 {
    font-size: 24px;
    color: #0f172a;
    margin: 32px 0 16px;
    font-weight: 800;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    letter-spacing: -0.3px;
    line-height: 1.4;
}

.post-content h3, .page-content h3, .section-content h3 {
    font-size: 20px;
    color: #0f172a;
    margin: 26px 0 14px;
    font-weight: 700;
    line-height: 1.4;
}

.post-content h4, .page-content h4, .section-content h4 {
    font-size: 18px;
    color: #1e40af;
    margin: 22px 0 10px;
    font-weight: 700;
    line-height: 1.4;
}

.post-content ul, .page-content ul, .section-content ul,
.post-content ol, .page-content ol, .section-content ol {
    padding-right: 28px;
    margin-bottom: 18px;
}

.post-content li, .page-content li, .section-content li {
    margin-bottom: 8px;
}

.post-content blockquote, .page-content blockquote, .section-content blockquote {
    border-right: 4px solid #0ea5e9;
    background: #f0f9ff;
    padding: 16px 24px;
    margin: 22px 0;
    color: #334155;
    border-radius: 0 8px 8px 0;
}

.post-content hr, .page-content hr, .section-content hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 32px 0;
}

.post-content a, .page-content a, .section-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #1e40af;
    font-weight: 500;
}

/* ============================================================
 * Rich Content: تصاویر داخل متن (Figure)
 * ============================================================ */

.post-content .dpe-figure,
.page-content .dpe-figure,
.section-content .dpe-figure {
    margin: 22px 0;
}

.post-content .dpe-figure img,
.page-content .dpe-figure img,
.section-content .dpe-figure img {
    border-radius: 8px;
    margin: 0;
    border: 1px solid #e2e8f0;
}

.post-content .dpe-figure figcaption,
.page-content .dpe-figure figcaption,
.section-content .dpe-figure figcaption {
    font-size: 14px;
    color: #94a3b8;
    text-align: center;
    margin-top: 10px;
}

.post-content .img-small,  .page-content .img-small,  .section-content .img-small  { max-width: 280px; }
.post-content .img-medium, .page-content .img-medium, .section-content .img-medium { max-width: 480px; }
.post-content .img-large,  .page-content .img-large,  .section-content .img-large  { max-width: 100%;  }
.post-content .img-full,   .page-content .img-full,   .section-content .img-full    { width: 100%;     }

.post-content .img-small img,
.post-content .img-medium img,
.page-content .img-small img,
.page-content .img-medium img,
.section-content .img-small img,
.section-content .img-medium img {
    width: 100%;
}

.post-content .align-center,
.page-content .align-center,
.section-content .align-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.post-content .align-right,
.page-content .align-right,
.section-content .align-right {
    float: right;
    margin: 0 0 18px 22px;
}

.post-content .align-left,
.page-content .align-left,
.section-content .align-left {
    float: left;
    margin: 0 22px 18px 0;
}

.post-content .dpe-cta,
.page-content .dpe-cta,
.section-content .dpe-cta {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none !important;
    margin: 6px 4px;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.post-content .dpe-cta-primary,
.page-content .dpe-cta-primary,
.section-content .dpe-cta-primary {
    background: #1e40af;
    border: 2px solid #1e40af;
    color: #fff !important;
}
.post-content .dpe-cta-primary:hover,
.page-content .dpe-cta-primary:hover,
.section-content .dpe-cta-primary:hover {
    background: #0ea5e9;
    border-color: #0ea5e9;
}

.post-content .dpe-cta-outline,
.page-content .dpe-cta-outline,
.section-content .dpe-cta-outline {
    background: transparent;
    border: 2px solid #1e40af;
    color: #1e40af !important;
}
.post-content .dpe-cta-outline:hover,
.page-content .dpe-cta-outline:hover,
.section-content .dpe-cta-outline:hover {
    background: #1e40af;
    color: #fff !important;
}

/* ============================================================
 * دیوایدر — عمداً بدون وابستگی به wrapper تا در هر بخشی از صفحه کار کنه
 * ============================================================ */
div.dpe-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
div.dpe-divider.dpe-divider-sm { margin: 3cm 0; }
div.dpe-divider.dpe-divider-lg { margin: 5cm 0; }

div.dpe-divider > .dpe-divider-line {
    width: 28%;
    height: 1px;
    background: #0ea5e9;
    opacity: 0.45;
}

div.dpe-divider > .dpe-divider-icon {
    width: 6px;
    height: 6px;
    background: #0ea5e9;
    opacity: 0.6;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.post-content::after,
.page-content::after,
.section-content::after {
    content: '';
    display: table;
    clear: both;
}

/* ========== Welcome Box (Fallback) ========== */
.welcome-box {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    padding: 64px 40px;
    text-align: right;
    border-right: 6px solid #0ea5e9;
    margin-bottom: 28px;
}

.welcome-box h1 {
    font-size: 34px;
    color: #0f172a;
    margin-bottom: 14px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.welcome-box p {
    color: #475569;
    font-size: 17px;
    line-height: 1.8;
}

/* ========== Empty State ========== */
.empty-state {
    background: #ffffff;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    color: #94a3b8;
    border: 2px dashed #e2e8f0;
}

/* ========== Footer ========== */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 32px 0;
    font-size: 14px;
    margin-top: auto;
    border-top: 4px solid #0ea5e9;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #ffffff;
    font-size: 15px;
}

.footer-copy {
    color: #64748b;
}

.footer-copy .powered-by { color: #64748b; }
.footer-copy .powered-by a { color: #0ea5e9; font-weight: 600; }
.footer-copy .powered-by a:hover { color: #38bdf8; }

/* ============================================================
 * Social Links در فوتر
 * ============================================================ */

.site-social-wrap {
    display: flex;
    justify-content: center;
}

.site-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
}

.site-social-link {
    display: inline-flex;
    text-decoration: none;
}

.site-social-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.08);
    color: #7dd3fc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.site-social-link:hover .site-social-badge {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
    transform: translateY(-2px);
}

/* ========== Responsive ========== */

/* Tablet — 768px */
@media (max-width: 768px) {
    .container {
        padding: 0 18px;
    }

    .site-main {
        padding: 32px 0 48px;
    }

    .header-inner {
        flex-direction: column;
        gap: 14px;
    }

    .site-nav {
        justify-content: center;
        width: 100%;
        border-top: 1px solid #e2e8f0;
        padding-top: 12px;
    }

    .section {
        padding: 26px;
    }

    .section-hero {
        min-height: 280px;
        border-left-width: 4px;
    }

    .section-hero .hero-inner {
        padding: 44px 28px;
    }

    .section-hero .hero-title {
        font-size: 29px;
    }

    .section-hero .hero-subtitle {
        font-size: 16px;
    }

    .hero-button {
        padding: 11px 26px;
        font-size: 15px;
    }

    .welcome-box {
        padding: 44px 26px;
        border-right-width: 4px;
    }

    .welcome-box h1 {
        font-size: 27px;
    }

    .post-single,
    .page-single {
        padding: 32px 24px;
    }

    .post-cover-single {
        margin: -32px -24px 22px;
    }

    .post-single-title,
    .page-single-title {
        font-size: 27px;
    }

    .post-content .align-right,
    .post-content .align-left,
    .page-content .align-right,
    .page-content .align-left,
    .section-content .align-right,
    .section-content .align-left {
        float: none;
        margin: 0 0 18px;
        max-width: 100%;
    }

    .post-content .img-small,
    .post-content .img-medium,
    .page-content .img-small,
    .page-content .img-medium,
    .section-content .img-small,
    .section-content .img-medium {
        max-width: 100%;
    }
}

/* Mobile — 480px */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .site-title {
        font-size: 16px;
    }

    .site-nav a {
        padding: 7px 12px;
        font-size: 14px;
    }

    .section {
        padding: 22px;
        border-radius: 10px;
    }

    .section-title {
        font-size: 20px;
        padding-bottom: 10px;
    }

    .section-hero {
        min-height: 240px;
        border-radius: 10px;
    }

    .section-hero .hero-inner {
        padding: 36px 22px;
    }

    .section-hero .hero-title {
        font-size: 25px;
    }

    .hero-button {
        padding: 10px 22px;
        font-size: 14px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-single-title,
    .page-single-title {
        font-size: 23px;
    }

    .post-single,
    .page-single {
        padding: 26px 20px;
        border-radius: 10px;
    }

    .post-cover-single {
        margin: -26px -20px 18px;
    }

    .welcome-box {
        padding: 36px 22px;
        border-radius: 10px;
    }

    .welcome-box h1 {
        font-size: 23px;
    }

    .site-social-badge {
        width: 32px;
        height: 32px;
        font-size: 10px;
    }
}