/* =========================================================================
 * Attorna — Case Studies Section (RTL, Swiper)
 * Design tokens mirror assets/css/lawyer-team.css (cream base, gold accent)
 * ========================================================================= */

.cs-section {
    --cs-ink:       #1c1c1c;
    --cs-ink-soft:  #5c564c;
    --cs-gold:      #a38753;
    --cs-gold-dark: #8a7143;
    --cs-bg:        #fbf8f2;
    --cs-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(--cs-ink);
    direction: rtl;
    text-align: right;
    padding: 88px 0 96px;
    font-family: var(--font-family-base, 'IRANSans', Tahoma, sans-serif);
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}

/* Soft gold glow behind the header */
.cs-section::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;
}

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

/* ---------- Header block ---------- */
.cs-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
}

.cs-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    position: relative;
    z-index: 2;
    margin-bottom: 48px;
    text-align: right;
}

.cs-head__bar {
    display: block;
    width: 56px;
    height: 3px;
    margin-bottom: 12px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--cs-gold) 0%, #d3bd8a 100%);
}

.cs-title {
    margin: 0;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: clamp(28px, 3.6vw, 44px);
    line-height: 1.4;
    font-weight: var(--font-weight-bold, 700);
    color: var(--cs-ink);
    text-align: right;
}

.cs-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    color: var(--cs-ink);
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-weight: var(--font-weight-bold, 700);
    font-size: 15px;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.25s ease;
    white-space: nowrap;
    position: relative;
}
.cs-view-all::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--cs-gold-dark);
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.3s cubic-bezier(0.33, 1, 0.68, 1);
}
.cs-view-all:hover,
.cs-view-all:focus-visible {
    color: var(--cs-gold-dark);
    text-decoration: none;
}
.cs-view-all:hover::after,
.cs-view-all:focus-visible::after {
    transform: scaleX(1);
}
.cs-view-all__arrow {
    font-size: 15px;
    line-height: 1;
    transition: transform 0.25s ease;
}
.cs-view-all:hover .cs-view-all__arrow {
    transform: translateX(-4px);
}

/* =========================================================================
 * Swiper + Cards
 * ========================================================================= */
.cs-swiper {
    position: relative;
    width: 100%;
    z-index: 2;
}

.cs-swiper__wrapper {
    display: flex;
    width: 100%;
}

.cs-swiper__slide {
    width: 100%;
    height: auto;
}

.cs-card {
    display: block;
    background: linear-gradient(180deg, #ffffff 0%, #fbf8f2 100%);
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 18px 36px -22px rgba(23, 20, 14, 0.35),
                0 0 0 1px rgba(23, 20, 14, 0.04);
    text-decoration: none;
    color: inherit;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.cs-card:hover,
.cs-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 36px 56px -22px rgba(23, 20, 14, 0.45),
                0 0 0 1px rgba(163, 135, 83, 0.18);
    text-decoration: none;
    color: inherit;
}
.cs-card:focus-visible {
    outline: 2px solid var(--cs-gold-dark);
    outline-offset: 3px;
}

.cs-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: linear-gradient(150deg, #efe9dd 0%, #e5dcc9 100%);
}
.cs-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}
.cs-card:hover .cs-card__media img {
    transform: scale(1.05);
}

.cs-card__title {
    margin: 14px 14px 6px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: 1.05rem;
    line-height: 1.75;
    font-weight: var(--font-weight-bold, 700);
    color: var(--cs-ink);
}

.cs-card__badge {
    display: inline-block;
    margin: 0 14px 16px;
    padding: 3px 0;
    color: #b0892c;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* =========================================================================
 * Navigation buttons (RTL: right chevron = older/prev, left = newer/next)
 * ========================================================================= */
.cs-nav {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-top: 32px;
}

.cs-nav__btn {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid var(--cs-line);
    background: #fff;
    color: var(--cs-gold);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: background-color 0.25s ease, color 0.25s ease,
                border-color 0.25s ease, transform 0.25s ease;
}
.cs-nav__btn:hover,
.cs-nav__btn:focus-visible {
    background: var(--cs-gold);
    border-color: var(--cs-gold);
    color: #fff;
    transform: translateY(-2px);
}
.cs-nav__btn:focus-visible {
    outline: 2px solid var(--cs-gold-dark);
    outline-offset: 3px;
}
.cs-nav__btn.is-disabled,
.cs-nav__btn:disabled {
    opacity: 0.35;
    pointer-events: none;
    background: #fff !important;
    color: var(--cs-gold) !important;
    transform: none !important;
}

/* Keep Swiper's own disabled class in sync */
.cs-nav__btn.swiper-button-disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* =========================================================================
 * Responsive
 * ========================================================================= */
@media (max-width: 768px) {
    .cs-section { padding: 72px 0 80px; }
    .cs-container { padding: 0 18px; }
    .cs-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .cs-section { padding: 56px 0 64px; }
    .cs-container { padding: 0 14px; }
    .cs-watermark { font-size: clamp(3rem, 14vw, 5rem); }
    .cs-title { font-size: clamp(24px, 7.2vw, 32px); }
    .cs-nav { margin-top: 24px; }
    .cs-nav__btn { width: 42px; height: 42px; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .cs-card,
    .cs-view-all,
    .cs-nav__btn,
    .cs-card__media img {
        transition: none !important;
    }
}
