/*
    صفحه‌های ساخته‌شده در پنل (Pages/SitePage) — سه قالب: ساده، لندینگ، با ستون کناری.
    متن صفحه با کلاس prose از content.css می‌آید (مشترک با نوشته‌ها).
    بدون جاوااسکریپت؛ انیمیشن ورود فقط CSS و برای کاربرانی که «کاهش حرکت» را روشن کرده‌اند خاموش است.
*/

.pg {
    --pg-red: #d71921;
    --pg-red-d: #a8131a;
    --pg-ink: #16191d;
    --pg-ink-2: #3a3f4a;
    --pg-lo: #6b7280;
    --pg-line: #e6e8eb;
    --pg-soft: #f6f7f9;
    --pg-ease: cubic-bezier(.16, 1, .3, 1);
    direction: rtl;
    color: var(--pg-ink);
    padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

    .pg *, .pg *::before, .pg *::after { box-sizing: border-box; }

.pg-shell {
    width: min(1340px, 100%);
    margin-inline: auto;
    padding-inline: clamp(16px, 3vw, 32px);
}

.pg-shell--narrow { width: min(880px, 100%); }
/*.pg-shell--wide { width: min(1180px, 100%); }*/

/* ═══════════ مسیر صفحه ═══════════ */
.pg-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 0;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    font-size: .8rem;
    color: var(--pg-lo);
}

    .pg-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
    .pg-crumbs li + li::before { content: "/"; margin-inline: 8px; color: #c3c8cf; }
    .pg-crumbs a { color: inherit; text-decoration: none; transition: color .2s; }
    .pg-crumbs a:hover { color: var(--pg-red); }
    .pg-crumbs [aria-current] { color: var(--pg-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

/* ═══════════ نوار عنوان (ساده و ستون‌دار) ═══════════ */
.pg-head {
    position: relative;
    overflow: hidden;
    padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(1.75rem, 4.5vw, 3rem);
    background:
        radial-gradient(600px 220px at 0% 0%, rgba(215, 25, 33, .07), transparent 70%),
        linear-gradient(180deg, #fafbfc 0%, var(--pg-soft) 100%);
    border-bottom: 1px solid var(--pg-line);
}

    /* خط باریک قرمز برند بالای عنوان */
    .pg-head::before {
        content: "";
        position: absolute;
        inset-inline: 0;
        top: 0;
        height: 3px;
        background: linear-gradient(90deg, transparent, var(--pg-red) 30%, var(--pg-red) 70%, transparent);
        opacity: .85;
    }

.pg-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--pg-red);
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}

    .pg-kicker::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }

.pg-title {
    margin: 0;
    font-size: clamp(1.6rem, 3.6vw, 2.5rem);
    font-weight: 900;
    line-height: 1.45;
    letter-spacing: -.015em;
    text-wrap: balance;
}

.pg-lead {
    margin: 12px 0 0;
    max-width: 62ch;
    color: var(--pg-ink-2);
    font-size: clamp(.98rem, 1.6vw, 1.08rem);
    line-height: 2;
}

/* ═══════════ بدنه ═══════════ */
.pg-body { padding-top: clamp(1.5rem, 4vw, 2.5rem); }

/* تصویر شاخص روی لبه‌ی نوار عنوان (قالب ساده) */
.pg-cover {
    margin: 0 0 clamp(1.5rem, 3.5vw, 2.25rem);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--pg-soft);
    box-shadow: 0 18px 40px -22px rgba(22, 25, 29, .35);
}

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

.pg--standard.has-cover .pg-head { padding-bottom: clamp(4rem, 9vw, 6.5rem); }
.pg--standard.has-cover .pg-body { margin-top: calc(-1 * clamp(3rem, 7vw, 5rem)); position: relative; padding-top: 0; }

/* ═══════════ دکمه‌ها ═══════════ */
.pg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 26px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: .95rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .25s, color .25s, border-color .25s, transform .25s var(--pg-ease), box-shadow .25s;
}

    .pg-btn:focus-visible { outline: 3px solid rgba(215, 25, 33, .35); outline-offset: 2px; }

.pg-btn--primary { background: var(--pg-red); color: #fff; box-shadow: 0 10px 24px -12px rgba(215, 25, 33, .7); }
.pg-btn--primary:hover { background: var(--pg-red-d); color: #fff; transform: translateY(-2px); }

.pg-btn--light { background: #fff; color: var(--pg-red); }
.pg-btn--light:hover { background: var(--pg-ink); color: #fff; }

/* ═══════════ لندینگ: تصویر بزرگ بالا ═══════════ */
.pg-hero {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: flex-end;
    min-height: clamp(380px, 64vh, 620px);
    padding-block: clamp(1.25rem, 3vw, 2rem) clamp(2.25rem, 6vw, 4rem);
    color: #fff;
    background:
        radial-gradient(900px 420px at 85% 10%, rgba(215, 25, 33, .35), transparent 65%),
        linear-gradient(135deg, #1d2127 0%, #0b0d10 100%);
    overflow: hidden;
}

    /* سایه‌ی تیره روی تصویر تا متن سفید همیشه خوانا باشد */
    .pg-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        background: linear-gradient(0deg, rgba(8, 10, 13, .88) 0%, rgba(8, 10, 13, .55) 45%, rgba(8, 10, 13, .2) 100%);
    }

.pg-hero-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-hero-inner { position: relative; width: min(1180px, 100%); }
.pg-hero .pg-crumbs ol { color: rgba(255, 255, 255, .7); }
.pg-hero .pg-crumbs li + li::before { color: rgba(255, 255, 255, .35); }
.pg-hero .pg-crumbs [aria-current] { color: #fff; }
.pg-hero .pg-crumbs a:hover { color: #fff; }
.pg-hero .pg-kicker { color: #ff6b71; }
.pg-hero .pg-title { max-width: 22ch; font-size: clamp(1.9rem, 4.6vw, 3.2rem); color: #fff !important; }
.pg-hero .pg-lead { color: rgba(255, 255, 255, .86); font-size: clamp(1rem, 1.8vw, 1.15rem); }

.pg--landing .pg-body { padding-top: clamp(2rem, 5vw, 3.5rem); }
.pg--landing .prose { max-width: 960px; }

/* نوار دکمه‌ی پایانی */
.pg-band {
    margin-top: clamp(2.5rem, 6vw, 4rem);
    background: linear-gradient(135deg, var(--pg-red) 0%, var(--pg-red-d) 100%);
    color: #fff;
}

.pg-band-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    padding-block: clamp(1.5rem, 4vw, 2.25rem);
}

.pg-band-title { margin: 0; font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 900; }
.pg-band .pg-btn--primary { background: #fff; color: var(--pg-red); box-shadow: none; }
.pg-band .pg-btn--primary:hover { background: var(--pg-ink); color: #fff; }

/* ═══════════ با ستون کناری ═══════════ */
.pg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
    padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.pg-main { min-width: 0; }

.pg-aside {
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pg-nav {
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.pg-nav-head {
    display: block;
    padding: 14px 18px;
    border-bottom: 1px solid var(--pg-line);
    background: var(--pg-soft);
    color: var(--pg-ink);
    font-weight: 900;
    text-decoration: none;
}

    .pg-nav ul { list-style: none; margin: 0; padding: 6px 0; }

    .pg-nav li a {
        position: relative;
        display: block;
        padding: 10px 18px;
        color: var(--pg-ink-2);
        font-size: .9rem;
        text-decoration: none;
        transition: background-color .2s, color .2s;
    }

        .pg-nav li a::before {
            content: "";
            position: absolute;
            inset-block: 8px;
            right: 0;
            width: 3px;
            border-radius: 3px 0 0 3px;
            background: var(--pg-red);
            transform: scaleY(0);
            transition: transform .25s var(--pg-ease);
        }

        .pg-nav li a:hover { background: #fdf6f6; color: var(--pg-red); }
        .pg-nav li a[aria-current="page"] { color: var(--pg-red); font-weight: 800; background: #fdf6f6; }
        .pg-nav li a[aria-current="page"]::before, .pg-nav li a:hover::before { transform: scaleY(1); }

    .pg-nav-head[aria-current="page"] { color: var(--pg-red); }

.pg-cta-card {
    position: relative;
    overflow: hidden;
    padding: 22px 20px;
    border-radius: 12px;
    background: linear-gradient(140deg, #1d2127 0%, #0b0d10 100%);
    color: #fff;
}

    .pg-cta-card::after {
        content: "";
        position: absolute;
        width: 160px;
        height: 160px;
        left: -50px;
        bottom: -70px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(215, 25, 33, .55), transparent 70%);
        pointer-events: none;
    }

.pg-cta-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 900; }
.pg-cta-text { margin: 0 0 16px; color: rgba(255, 255, 255, .75); font-size: .86rem; line-height: 1.9; }
.pg-cta-card .pg-btn { position: relative; z-index: 1; width: 100%; }

/* ═══════════ زیرصفحه‌ها ═══════════ */
.pg-children { margin-top: clamp(2.25rem, 5vw, 3.5rem); }

.pg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 1.25rem;
    font-weight: 900;
}

    .pg-section-title::before { content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--pg-red); }

.pg-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
    gap: 16px;
}

.pg-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pg-line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform .35s var(--pg-ease), box-shadow .35s var(--pg-ease), border-color .35s;
}

    .pg-card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 18px 36px -20px rgba(22, 25, 29, .35); }
    .pg-card:focus-visible { outline: 3px solid rgba(215, 25, 33, .35); outline-offset: 2px; }

.pg-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--pg-soft);
}

    .pg-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--pg-ease); }
    .pg-card:hover .pg-card-media img { transform: scale(1.05); }

.pg-card-label {
    position: absolute; z-index: 1; top: 10px; right: 10px;
    padding: 3px 9px; border-radius: 2px; border-right: 2px solid var(--pg-red);
    background: rgba(10, 12, 14, .62); color: #fff; font-size: .6rem; font-weight: 700; letter-spacing: .12em;
    direction: ltr; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pg-card-ph {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1d2127, #3a3f4a);
    color: rgba(255, 255, 255, .9);
    font-size: 2rem;
    font-weight: 900;
}

.pg-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.pg-card-title { font-weight: 800; line-height: 1.7; }
.pg-card-text { color: var(--pg-lo); font-size: .84rem; line-height: 1.9; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pg-card-more { margin-top: auto; padding-top: 4px; color: var(--pg-red); font-size: .82rem; font-weight: 800; }

/* ═══════════ انیمیشن ورود (فقط CSS، بدون پرش صفحه) ═══════════ */
@media (prefers-reduced-motion: no-preference) {
    .pg-in { animation: pgIn .8s var(--pg-ease) backwards; }
    .pg-kicker.pg-in { animation-delay: .05s; }
    .pg-title.pg-in { animation-delay: .1s; }
    .pg-lead.pg-in { animation-delay: .18s; }
    .pg-actions.pg-in { animation-delay: .26s; }
    .pg-cover.pg-in, .pg-nav.pg-in { animation-delay: .2s; }
    .prose.pg-in, .pg-cta-card.pg-in { animation-delay: .3s; }
    .pg-hero-img { animation: pgZoom 1.6s var(--pg-ease) backwards; }
}

@keyframes pgIn {
    from { opacity: 0; transform: translateY(14px); }
}

@keyframes pgZoom {
    from { transform: scale(1.06); }
}

/* ═══════════ واکنش‌گرا ═══════════ */
@media (max-width: 991.98px) {
    .pg-layout { grid-template-columns: minmax(0, 1fr); }
    .pg-aside { position: static; }
}

@media (max-width: 599.98px) {
    .pg-crumbs [aria-current] { max-width: 24ch; }
    .pg-hero { min-height: 420px; }
    .pg-btn { width: 100%; }
    .pg-band-inner { flex-direction: column; align-items: stretch; text-align: center; }
}
