/* ========== Detail pages (project + article) ========== */
/* کانواس مشترک در site-dark.css است؛ کارت‌های مرتبط از portfolio-page.css (پروژه) یا article-page.css (مقاله) می‌آید */

.pd {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 44px 0 88px;
    color: #fff;
}

.pd__glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(95px);
    pointer-events: none;
}

.pd__glow--1 {
    width: 460px;
    height: 460px;
    top: -170px;
    right: -130px;
    background: var(--page-blue);
    opacity: .35;
}

.pd__glow--2 {
    width: 420px;
    height: 420px;
    bottom: -140px;
    left: -120px;
    background: var(--page-blue);
    opacity: .4;
}

.pd__inner {
    position: relative;
    z-index: 1;
}

/* ---- breadcrumb (بازنویسی استایل کامپوننت مشترک) ---- */

.pd__crumbs {
    margin-bottom: 26px;
}

.pd__crumbs .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 12px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--page-line);
    list-style: none;
    font-size: 13.5px;
}

.pd__crumbs .breadcrumb-item + .breadcrumb-item::before {
    content: "‹";
    color: rgba(255, 255, 255, .3);
    padding: 0 8px;
    float: none;
}

.pd__crumbs .breadcrumb-item a {
    text-decoration: none;
    transition: color .3s ease;
}

.pd__crumbs .breadcrumb-item a span,
.pd__crumbs .breadcrumb-item span {
    font-size: 13.5px !important;
    color: rgba(255, 255, 255, .7) !important;
    font-weight: 700;
    transition: color .3s ease;
}

.pd__crumbs .breadcrumb-item a:hover span {
    color: var(--page-orange) !important;
}

.pd__crumbs .breadcrumb-item.active {
    color: var(--page-orange);
    font-weight: 700;
}

/* ---- layout ---- */

.pd__layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    align-items: start;
    gap: 30px;
}

.pd__main {
    min-width: 0;
}

/* ---- head ---- */

.pd__head {
    margin-bottom: 24px;
}

.pd__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.9;
    border: 1px solid transparent;
}

.pd__status.is-processing {
    background: rgba(253, 182, 20, .14);
    border-color: rgba(253, 182, 20, .5);
    color: var(--page-orange-soft);
}

.pd__status.is-done {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.pd__status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pd__status.is-processing .pd__status-dot {
    animation: pd-blink 1.6s ease-in-out infinite;
}

@keyframes pd-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.pd__title {
    margin: 16px 0 10px;
    font-size: clamp(25px, 3vw, 36px);
    font-weight: 800;
    line-height: 1.55;
    color: #fff;
}

.pd__lead {
    margin: 0;
    color: var(--page-muted);
    font-size: 15.5px;
    line-height: 2;
}

.pd__rule {
    display: block;
    width: 62px;
    height: 3px;
    margin-top: 18px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--page-orange), rgba(253, 182, 20, 0));
}

/* ---- cover ---- */

.pd__cover {
    position: relative;
    margin: 0 0 26px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--page-line);
    box-shadow: 0 30px 60px -40px rgba(0, 0, 0, .85);
    background: #12151d;
}

.pd__cover img {
    display: block;
    width: 100% !important;
    height: auto;
    max-width: none;
}

/* ---- content (HTML بدنه از ادمین) ---- */

.pd__content {
    padding: 30px 32px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .045) 0%, rgba(0, 0, 0, .18) 100%);
    border: 1px solid var(--page-line);
    color: rgba(255, 255, 255, .78);
    font-size: 15px;
    line-height: 2.2;
}

.pd__content > *:first-child {
    margin-top: 0;
}

.pd__content > *:last-child {
    margin-bottom: 0;
}

.pd__content p {
    margin: 0 0 18px;
    text-align: justify;
}

.pd__content h1,
.pd__content h2,
.pd__content h3,
.pd__content h4 {
    margin: 30px 0 14px;
    color: #fff;
    font-weight: 800;
    line-height: 1.7;
}

.pd__content h1 { font-size: 1.5rem; }
.pd__content h2 { font-size: 1.32rem; }
.pd__content h3 { font-size: 1.16rem; }
.pd__content h4 { font-size: 1.05rem; }

.pd__content a {
    color: var(--page-orange);
    text-decoration: none;
    border-bottom: 1px solid rgba(253, 182, 20, .35);
    transition: border-color .3s ease;
}

.pd__content a:hover {
    border-color: var(--page-orange);
}

.pd__content ul,
.pd__content ol {
    margin: 0 0 18px;
    padding-right: 22px;
}

.pd__content li {
    margin-bottom: 8px;
}

.pd__content img,
.pd__content iframe,
.pd__content video {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
}

.pd__content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.pd__content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    border-right: 3px solid var(--page-orange);
    border-radius: 0 10px 10px 0;
    background: rgba(253, 182, 20, .06);
    color: rgba(255, 255, 255, .8);
}

.pd__content table {
    width: 100%;
    margin: 18px 0;
    border-collapse: collapse;
    font-size: 14px;
}

.pd__content th,
.pd__content td {
    padding: 10px 12px;
    border: 1px solid var(--page-line);
    text-align: right;
}

.pd__content th {
    background: rgba(255, 255, 255, .05);
    color: #fff;
}

/* ---- section titles ---- */

.pd__section-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.7;
}

.pd__section-title::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 12px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--page-orange), rgba(253, 182, 20, 0));
}

/* ---- gallery ---- */

.pd__gallery {
    margin-top: 40px;
}

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

.pd__thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    padding: 0 0 70%;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--page-line);
    background: #12151d;
    cursor: zoom-in;
    transition: border-color .35s ease, transform .4s cubic-bezier(.22, .7, .2, 1);
}

.pd__thumb:hover {
    border-color: rgba(253, 182, 20, .45);
    transform: translateY(-4px);
}

.pd__thumb img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.22, .7, .2, 1);
}

.pd__thumb:hover img {
    transform: scale(1.08);
}

.pd__thumb-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(18, 21, 31, .7);
    border: 1px solid rgba(253, 182, 20, .45);
    opacity: 0;
    transition: opacity .35s ease;
}

.pd__thumb-icon::before,
.pd__thumb-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--page-orange);
    transform: translate(-50%, -50%);
}

.pd__thumb-icon::before {
    width: 12px;
    height: 2px;
}

.pd__thumb-icon::after {
    width: 2px;
    height: 12px;
}

.pd__thumb:hover .pd__thumb-icon {
    opacity: 1;
}

/* ---- lightbox ---- */

.pd__lightbox {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(9, 11, 17, .92);
    backdrop-filter: blur(6px);
}

.pd__lightbox[hidden] {
    display: none;
}

.pd__lightbox img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 12px;
    box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9);
}

.pd__lightbox-close {
    position: absolute;
    top: 20px;
    left: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease;
}

.pd__lightbox-close:hover {
    background: rgba(253, 182, 20, .16);
    border-color: var(--page-orange);
    color: var(--page-orange);
}

/* ---- sidebar ---- */

.pd__side {
    position: sticky;
    top: 20px;
}

.pd__card {
    padding: 26px 24px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .05) 0%, rgba(0, 0, 0, .2) 100%);
    border: 1px solid var(--page-line);
    box-shadow: 0 26px 50px -36px rgba(0, 0, 0, .8);
}

.pd__card-title {
    margin: 0 0 18px;
    font-size: 1.08rem;
    font-weight: 800;
    color: #fff;
}

.pd__specs {
    margin: 0 0 20px;
}

.pd__specs > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, .1);
}

.pd__specs > div:last-child {
    border-bottom: 0;
}

.pd__specs dt {
    margin: 0;
    color: rgba(255, 255, 255, .5);
    font-size: 13px;
    font-weight: 600;
}

.pd__specs dd {
    margin: 0;
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    text-align: left;
}

.pd__specs dd a {
    color: var(--page-orange);
    text-decoration: none;
    transition: opacity .3s ease;
}

.pd__specs dd a:hover {
    opacity: .8;
    text-decoration: none;
}

.pd__card-note {
    margin: 0 0 20px;
    color: var(--page-muted);
    font-size: 13.5px;
    line-height: 2;
}

.pd__link-back {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: rgba(255, 255, 255, .55);
    font-size: 13px;
    text-decoration: none;
    transition: color .3s ease;
}

.pd__link-back:hover {
    color: var(--page-orange);
    text-decoration: none;
}

/* ---- button ---- */

.pd__btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 13px 24px;
    border-radius: 999px;
    border: 1px solid rgba(253, 182, 20, .55);
    background: rgba(253, 182, 20, .08);
    color: var(--page-orange);
    font-size: 14.5px;
    font-weight: 800;
    text-decoration: none;
    transition: color .35s ease, border-color .35s ease, transform .4s cubic-bezier(.22, .7, .2, 1), box-shadow .45s ease;
}

.pd__btn::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(90deg, #e5a000, var(--page-orange) 55%, var(--page-orange-soft));
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform .5s cubic-bezier(.22, .7, .2, 1);
}

.pd__btn:hover,
.pd__btn:focus-visible {
    color: #1a1305;
    border-color: var(--page-orange);
    transform: translateY(-3px);
    box-shadow: 0 18px 34px -18px rgba(253, 182, 20, .65);
    text-decoration: none;
}

.pd__btn:hover::before,
.pd__btn:focus-visible::before {
    transform: scaleX(1);
}

.pd__btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform .4s cubic-bezier(.22, .7, .2, 1);
}

.pd__btn:hover .pd__btn-arrow {
    transform: translateX(-6px);
}

/* ---- comments (بازنویسی استایل کامپوننت مشترک) ---- */

.pd__comments {
    margin-top: 40px;
    padding: 30px 32px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .045) 0%, rgba(0, 0, 0, .18) 100%);
    border: 1px solid var(--page-line);
}

.pd__comments > .card,
.pd__comments .card-body,
.pd__comments .tab-content,
.pd__comments .tab-pane {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 !important;
    margin: 0;
}

/* تیتر «نظرات و سوالات» هم‌شکل تیتر بخش‌های دیگر */
.pd__comments .card-title {
    margin: 0 0 24px !important;
    font-size: 1.3rem !important;
    font-weight: 800;
    color: #fff;
    text-align: right !important;
}

.pd__comments .card-title::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    margin-top: 12px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--page-orange), rgba(253, 182, 20, 0));
}

/* ستون داخلی کامپوننت مشترک، تمام عرض پنل شود */
.pd__comments .col-md-8 {
    flex: 0 0 100%;
    max-width: 100%;
}

.pd__comments form {
    padding: 22px;
    border-radius: 14px;
    background: rgba(18, 21, 31, .35);
    border: 1px solid var(--page-line);
}

.pd__comments .control-label {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
    font-weight: 700;
}

.pd__comments .control-label .text-danger {
    color: rgba(253, 182, 20, .85) !important;
    font-size: 12.5px;
    font-weight: 600;
}

.pd__comments textarea.form-control {
    min-height: 130px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(18, 21, 31, .55);
    border: 1px solid var(--page-line);
    color: #fff;
    font-size: 14px;
    line-height: 2;
    resize: vertical;
    transition: border-color .3s ease, box-shadow .3s ease;
}

.pd__comments textarea.form-control::placeholder {
    color: rgba(255, 255, 255, .35);
}

.pd__comments textarea.form-control:focus {
    outline: 0;
    background: rgba(18, 21, 31, .7);
    border-color: rgba(253, 182, 20, .5);
    box-shadow: 0 0 0 3px rgba(253, 182, 20, .12);
    color: #fff;
}

.pd__comments .btn.royal {
    padding: 12px 34px;
    border-radius: 999px;
    border: 1px solid var(--page-orange);
    /* .royal در custom-style با !important تعریف شده است */
    background-color: var(--page-orange) !important;
    color: #1a1305 !important;
    font-size: 14.5px !important;
    font-weight: 800;
    transition: transform .35s ease, box-shadow .4s ease, background .3s ease;
}

.pd__comments .btn.royal:hover {
    background-color: var(--page-orange-soft) !important;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -16px rgba(253, 182, 20, .7);
}

/* هر نظر */
.pd__comments form + .card,
.pd__comments .card .card {
    margin: 16px 0 0 !important;
    padding: 18px 20px !important;
    border-radius: 14px;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--page-line);
    box-shadow: none;
    color: rgba(255, 255, 255, .82);
}

.pd__comments .card .card .card {
    margin-top: 14px !important;
    background: rgba(253, 182, 20, .05);
    border-color: rgba(253, 182, 20, .22);
}

.pd__comments .card .card span {
    color: rgba(255, 255, 255, .5);
    font-size: 12.5px;
}

.pd__comments .card .card p {
    margin: 12px 0 0 !important;
    color: rgba(255, 255, 255, .85);
    font-size: 14.5px !important;
    line-height: 2.1;
    text-align: right !important;
}

/* ---- related ---- */

.pd__related {
    margin-top: 60px;
}

.pd__related-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
}

.pd__related-all {
    color: var(--page-orange);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .3s ease;
}

.pd__related-all:hover {
    opacity: .8;
    text-decoration: none;
}

.pd__related .pf__grid,
.pd__related .ar__grid {
    grid-template-columns: repeat(3, 1fr);
}

/* برچسب دسته‌بندی بالای عنوان مقاله */
.pd__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(253, 182, 20, .1);
    border: 1px solid rgba(253, 182, 20, .4);
    color: var(--page-orange);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.9;
}

/* ردیف متادیتای بالای مقاله */
.pd__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
    color: rgba(255, 255, 255, .55);
    font-size: 13px;
    font-weight: 600;
}

.pd__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pd__meta-item svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: rgba(253, 182, 20, .75);
}

.pd__meta-sep {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .25);
}

/* ---- reveal ---- */

[data-pd-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity .7s cubic-bezier(.22, .7, .2, 1) var(--pd-delay, 0ms),
        transform .7s cubic-bezier(.22, .7, .2, 1) var(--pd-delay, 0ms);
    will-change: opacity, transform;
}

[data-pd-reveal].is-in {
    opacity: 1;
    transform: translateY(0);
}

/* ---- responsive ---- */

@media (max-width: 991.98px) {
    .pd {
        padding: 32px 0 64px;
    }
    .pd__layout {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .pd__side {
        position: static;
    }
    .pd__content {
        padding: 24px 20px;
    }
    .pd__related .pf__grid,
    .pd__related .ar__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pd__gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .pd {
        padding: 24px 0 48px;
    }
    .pd__crumbs .breadcrumb {
        padding: 10px 14px;
        border-radius: 12px;
        font-size: 12.5px;
    }
    .pd__content {
        padding: 20px 16px;
        font-size: 14.5px;
    }
    .pd__comments {
        padding: 20px 16px;
    }
    .pd__comments form {
        padding: 16px 14px;
    }
    .pd__comments .btn.royal {
        width: 100%;
    }
    .pd__related .pf__grid,
    .pd__related .ar__grid,
    .pd__gallery-grid {
        grid-template-columns: 1fr;
    }
    .pd__lightbox {
        padding: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-pd-reveal],
    .pd__btn,
    .pd__btn::before,
    .pd__btn-arrow,
    .pd__thumb,
    .pd__thumb img {
        transition: none !important;
    }
    [data-pd-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }
    .pd__status-dot {
        animation: none !important;
    }
}
