/* =========================================================================
 * Attorna — Single Case Study (detail page)
 * Design tokens mirror .cs-section / .lsp-article (cream base, gold accent).
 * ========================================================================= */

.csp-article {
    --csp-ink:      #1c1c1c;
    --csp-gold:     #a38753;
    --csp-gold-d:   #8a7143;
    --csp-bg:       #fbf8f2;
    --csp-line:     rgba(30, 28, 24, 0.12);

    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg,
            rgba(251, 248, 242, 0.99) 0%,
            rgba(251, 248, 242, 0.92) 100%
        );
    color: var(--csp-ink);
    direction: rtl;
    text-align: right;
    padding: 64px 0 88px;
    font-family: var(--font-family-base, 'IRANSans', Tahoma, sans-serif);
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}

.csp-article::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    height: 480px;
    background: radial-gradient(closest-side, rgba(163, 135, 83, 0.08), transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.csp-article .container {
    position: relative;
    z-index: 2;
    max-width: 920px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Watermark ---------- */
.csp-watermark {
    position: absolute;
    inset-inline: 0;
    top: 18px;
    transform: none;
    font-family: 'Jost', 'IRANSans', Tahoma, sans-serif;
    font-size: clamp(80px, 12vw, 150px);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(163, 135, 83, 0.07);
    line-height: 1;
    white-space: nowrap;
    text-align: center;
    pointer-events: none;
    user-select: none;
    overflow: hidden;
    z-index: 1;
}

/* ---------- Breadcrumb ---------- */
.csp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 36px;
    font-size: 14px;
    color: var(--text-secondary, #777);
    flex-wrap: wrap;
}

.csp-breadcrumb a {
    color: var(--text-secondary, #777);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.25s ease;
}
.csp-breadcrumb a:hover,
.csp-breadcrumb a:focus-visible {
    color: var(--csp-gold-d);
    text-decoration: none;
}
.csp-breadcrumb a i { font-size: 13px; }
.csp-breadcrumb__sep {
    color: var(--csp-gold);
    font-weight: 700;
}

/* ---------- Post header ---------- */
.csp-post__header {
    margin-bottom: 32px;
}

.csp-post__badge {
    display: inline-block;
    padding: 4px 14px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(163, 135, 83, 0.10);
    color: #b0892c;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.csp-post__title {
    margin: 0 0 18px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: clamp(28px, 4.2vw, 46px);
    line-height: 1.45;
    font-weight: var(--font-weight-bold, 700);
    color: var(--csp-ink);
    text-align: right;
}

.csp-post__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 15px;
    color: var(--text-secondary, #777);
}
.csp-post__meta i {
    color: var(--csp-gold);
    font-size: 14px;
}

/* ---------- Featured image ---------- */
.csp-post__thumb {
    margin: 0 0 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    line-height: 0;
}
.csp-post__thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---------- Content ---------- */
.csp-post__content {
    color: var(--csp-ink);
    font-size: 17px;
    line-height: 2;
    text-align: right;
}
.csp-post__content p { margin: 0 0 20px; }
.csp-post__content h2,
.csp-post__content h3,
.csp-post__content h4 {
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    color: var(--csp-ink);
    margin: 32px 0 14px;
    line-height: 1.5;
}
.csp-post__content h2 { font-size: 24px; }
.csp-post__content h3 { font-size: 20px; }
.csp-post__content h4 { font-size: 18px; }
.csp-post__content a {
    color: var(--csp-gold-d);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.csp-post__content a:hover { color: var(--csp-gold); }
.csp-post__content ul,
.csp-post__content ol {
    padding-inline-start: 24px;
    margin: 0 0 20px;
}
.csp-post__content li { margin-bottom: 8px; }
.csp-post__content blockquote {
    margin: 24px 0;
    padding: 8px 24px;
    border-inline-start: 3px solid var(--csp-gold);
    background: rgba(163, 135, 83, 0.06);
    border-radius: 6px;
    font-style: italic;
}
.csp-post__content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ---------- Empty-content notice ---------- */
.csp-post__empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 28px;
    background: #fff;
    border: 1px dashed var(--csp-line);
    border-radius: 8px;
    color: var(--text-secondary, #666);
    font-size: 15px;
}
.csp-post__empty i {
    font-size: 24px;
    color: var(--csp-gold);
    flex: 0 0 auto;
}
.csp-post__empty p { margin: 0; }

/* ---------- Related ---------- */
.csp-related {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--csp-line);
}

.csp-related__title {
    position: relative;
    margin: 0 0 24px;
    padding-top: 18px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: 22px;
    line-height: 1.4;
    font-weight: var(--font-weight-bold, 700);
    color: var(--csp-ink);
}
.csp-related__title::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--csp-gold) 0%, #d3bd8a 100%);
}

.csp-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.csp-related__card {
    display: block;
    background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
    border: 1px solid rgba(23, 20, 14, 0.06);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.csp-related__card:hover,
.csp-related__card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 18px 32px -18px rgba(23, 20, 14, 0.35);
    border-color: rgba(163, 135, 83, 0.30);
    text-decoration: none;
    color: inherit;
    outline: none;
}
.csp-related__card:focus-visible {
    outline: 2px solid var(--csp-gold-d);
    outline-offset: 2px;
}

.csp-related__media {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(150deg, #efe9dd 0%, #e5dcc9 100%);
}
.csp-related__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}
.csp-related__card:hover .csp-related__media img { transform: scale(1.06); }

.csp-related__title {
    display: block;
    padding: 12px 14px 14px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 600;
    color: var(--csp-ink);
    transition: color 0.25s ease;
}
.csp-related__card:hover .csp-related__title { color: var(--csp-gold-d); }

/* ---------- Back link ---------- */
.csp-back {
    margin-top: 48px;
    text-align: right;
}
.csp-back__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: var(--csp-gold);
    color: #fff;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-weight: var(--font-weight-bold, 700);
    font-size: 15px;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.25s ease, transform 0.25s ease;
}
.csp-back__btn:hover,
.csp-back__btn:focus-visible {
    background: var(--csp-gold-d);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
}
.csp-back__btn i {
    transition: transform 0.25s ease;
}
.csp-back__btn:hover i {
    transform: translateX(-4px);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .csp-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .csp-article { padding: 48px 0 64px; }
    .csp-article .container { padding: 0 16px; }
    .csp-post__content { font-size: 16px; }
    .csp-post__thumb { margin-bottom: 28px; }
    .csp-related__grid { grid-template-columns: 1fr; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .csp-back__btn,
    .csp-back__btn i,
    .csp-breadcrumb a,
    .csp-related__card,
    .csp-related__media img {
        transition: none !important;
    }
}
