/* =========================================================================
 * Attorna — Our Expertise / Legal Practice Areas Section (RTL)
 * Design tokens inherited from variables.css
 * Sits directly below the 3-column features-section on a warm cream ground
 * ========================================================================= */

.expertise-section {
    --ex-ink:        #1c1c1c;
    --ex-ink-soft:   #5c564c;
    --ex-gold:       #a38753;
    --ex-gold-dark:  #8a7143;
    --ex-bg:         #fbf8f2;
    --ex-line:       rgba(30, 28, 24, 0.12);
    --ex-shadow:     0 30px 60px -28px rgba(23, 20, 14, 0.30);

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

/* ---------- Watermark: giant semi-transparent text behind the header ---------- */
.expertise-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(40px, 8vw, 90px);
    font-family: 'Jost', 'IRANSans', Tahoma, sans-serif;
    font-size: clamp(120px, 20vw, 260px);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(29, 29, 29, 0.035);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
}

.expertise-container {
    position: relative;
    z-index: 2;
}

/* ---------- Section header ---------- */
.expertise-header {
    margin: 0 0 48px;
    max-width: none;
    text-align: right;
    padding: 0 8px;
}

.expertise-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: var(--font-weight-medium, 500);
    color: var(--ex-gold);
    letter-spacing: 0.02em;
}
.expertise-eyebrow::before {
    content: "";
    width: 38px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

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

/* ---------- Grid: 3 columns (desktop) / 2 (tablet) / 1 (mobile) ---------- */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 34px;
}

/* ---------- Card ---------- */
.expertise-card {
    display: flex;
    flex-direction: column;
    text-align: right;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background-color .3s ease;
}

.expertise-card:hover {
    background: rgba(163, 135, 83, 0.035);
}

/* Media: rounded, 16/10 aspect, hover zoom */
.expertise-card__media {
    display: block;
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: var(--ex-shadow);
    aspect-ratio: 16 / 10;
    background: linear-gradient(150deg, #efe9dd, #e5dcc9);
}
.expertise-card__media::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(29,29,29,0.18) 100%);
    pointer-events: none;
    z-index: 1;
}
.expertise-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease, opacity .25s ease;
    will-change: transform;
}
.expertise-card__media:hover img {
    transform: scale(1.03);
}
.expertise-card__media:focus-visible {
    outline: 2px solid var(--ex-gold-dark);
    outline-offset: 3px;
    border-radius: 14px;
}

/* Title below the image */
.expertise-card__title {
    margin: 0 0 10px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: 1.12rem;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.75;
    color: var(--ex-ink);
}

/* Small accent-colored "اطلاعات بیشتر" CTA link */
.expertise-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    color: var(--ex-gold);
    font-size: 0.92rem;
    font-weight: var(--font-weight-medium, 500);
    text-decoration: none;
    letter-spacing: 0.02em;
    padding-bottom: 2px;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 1.5px;
    background-repeat: no-repeat;
    background-position: right bottom;
    transition: color .25s ease, background-size .3s ease;
}
.expertise-card__cta::after {
    content: "";
    width: 14px;
    height: 1px;
    background: currentColor;
    opacity: .6;
    transform: translateX(2px);
}
.expertise-card__cta:hover {
    color: var(--ex-gold-dark);
    background-size: 100% 1.5px;
    text-decoration: none;
}
.expertise-card__cta:focus-visible {
    outline: 2px solid var(--ex-gold-dark);
    outline-offset: 3px;
}

/* =========================================================================
 * Responsive breakpoints
 * ========================================================================= */

/* Tablet: ≤ 991px → 2 columns */
@media (max-width: 991px) {
    .expertise-section { padding: 72px 0 80px; }
    .expertise-container { padding: 0 12px; }
    .expertise-header {
        max-width: none;
        margin-bottom: 40px;
    }
    .expertise-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
    .expertise-watermark { font-size: clamp(100px, 16vw, 180px); }
}

/* Mobile: ≤ 767px → 1 column */
@media (max-width: 767px) {
    .expertise-section { padding: 56px 0 64px; }
    .expertise-header { margin-bottom: 32px; text-align: right; }
    .expertise-eyebrow { justify-content: flex-start; }
    .expertise-eyebrow::before { width: 28px; }
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .expertise-card {
        padding: 4px 0;
        max-width: 480px;
        margin: 0 auto;
    }
    .expertise-card__title {
        font-size: 1.05rem;
        text-align: center;
    }
    .expertise-card__cta {
        justify-content: center;
    }
    .expertise-watermark {
        font-size: 90px;
        padding-top: 28px;
    }
}

/* Respect reduced-motion: disable micro animations */
@media (prefers-reduced-motion: reduce) {
    .expertise-card__media img,
    .expertise-card__cta {
        transition: none;
    }
    .expertise-card__media:hover img {
        transform: none;
    }
}
