/* =========================================================================
 * Attorna — Story / About Us Section (RTL)
 * Mirrors the design tokens of assets/css/expertise-section.css
 * ========================================================================= */

.story-section {
    --st-ink:        #1c1c1c;
    --st-ink-soft:   #5c564c;
    --st-gold:       #a38753;
    --st-gold-dark:  #8a7143;
    --st-bg:         #fbf8f2;
    --st-line:       rgba(30, 28, 24, 0.12);
    --st-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(--st-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;
}

/* ---------- Watermark ---------- */
.story-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(40px, 8vw, 96px);
    font-family: 'Jost', 'IRANSans', Tahoma, sans-serif;
    font-size: clamp(90px, 16vw, 200px);
    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;
    z-index: 0;
}

/* ---------- Layout: text (right in RTL) + media (left in RTL) ---------- */
.story-container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 64px;
    align-items: center;
}

/* ---------- Text column ---------- */
.story-text {
    position: relative;
}

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

.story-title {
    margin: 0 0 22px;
    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(--st-ink);
}

.story-desc {
    color: var(--st-ink-soft);
    text-align: justify;
    text-justify: inter-word;
}
.story-desc p {
    margin: 0 0 16px;
    line-height: 1.95;
    text-align: justify;
}
.story-desc p:last-child {
    margin-bottom: 0;
}

/* ---------- CTA button ---------- */
.story-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
    padding: 13px 30px;
    background: var(--st-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: none;
    border-radius: 999px;
    letter-spacing: 0.02em;
    box-shadow: 0 14px 28px -14px rgba(163, 135, 83, 0.6);
    transition: background-color 0.25s ease,
                transform 0.25s ease,
                box-shadow 0.25s ease;
    cursor: pointer;
}
.story-btn:hover,
.story-btn:focus-visible {
    background: var(--st-gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 32px -14px rgba(138, 113, 67, 0.55);
}
.story-btn:focus-visible {
    outline: 2px solid var(--st-gold-dark);
    outline-offset: 3px;
}

/* ---------- Media column: overlapping dual image ---------- */
.story-media {
    position: relative;
    padding: 24px 20px 96px 56px;
    min-height: 480px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.story-media__main {
    margin: 0;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--st-shadow);
    aspect-ratio: 4 / 5;
    background: linear-gradient(150deg, #efe9dd, #e5dcc9);
}
.story-media__main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.story-media__secondary {
    margin: 0;
    position: absolute;
    z-index: 2;
    left: -18px;
    bottom: 18px;
    width: 55%;
    max-width: 260px;
    border: 6px solid var(--st-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 40px -20px rgba(23, 20, 14, 0.35);
    background: linear-gradient(150deg, #efe9dd, #e5dcc9);
    aspect-ratio: 16 / 10;
}
.story-media__secondary img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================================================
 * Reveal animations (IntersectionObserver in story-section-reveal.js)
 * ========================================================================= */
.story-section .story-eyebrow,
.story-section .story-title,
.story-section .story-desc,
.story-section .story-btn,
.story-section .story-media {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}
.story-section.is-revealed .story-eyebrow {
    opacity: 1; transform: translateY(0); transition-delay: 0.04s;
}
.story-section.is-revealed .story-title {
    opacity: 1; transform: translateY(0); transition-delay: 0.12s;
}
.story-section.is-revealed .story-desc {
    opacity: 1; transform: translateY(0); transition-delay: 0.20s;
}
.story-section.is-revealed .story-btn {
    opacity: 1; transform: translateY(0); transition-delay: 0.28s;
}
.story-section.is-revealed .story-media {
    opacity: 1; transform: translateY(0); transition-delay: 0.10s;
}

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

/* Tablet: ≤ 991px → single column, media below text */
@media (max-width: 991px) {
    .story-section { padding: 72px 0 80px; }
    .story-container {
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 0 20px;
    }
    .story-text {
        text-align: center;
    }
    .story-eyebrow {
        justify-content: center;
    }
    .story-desc {
        max-width: 100%;
        text-align: justify;
    }
    .story-media {
        order: 1;
        padding: 16px 60px 130px 20px;
        min-height: 420px;
    }
    .story-media__main {
        aspect-ratio: 16 / 10;
        max-width: 560px;
    }
    .story-media__secondary {
        left: 4px;
        bottom: 8px;
        width: 48%;
        max-width: 220px;
        border-width: 5px;
    }
    .story-watermark { font-size: clamp(72px, 14vw, 140px); }
}

/* Mobile: ≤ 767px → full-width CTA, smaller secondary */
@media (max-width: 767px) {
    .story-section { padding: 56px 0 64px; }
    .story-container { padding: 0 14px; }
    .story-title { font-size: clamp(24px, 7.2vw, 32px); }
    .story-btn {
        width: 100%;
        max-width: 320px;
        padding: 14px 24px;
        font-size: 16px;
    }
    .story-media {
        padding: 8px 24px 100px 12px;
        min-height: 320px;
    }
    .story-media__main {
        aspect-ratio: 3 / 4;
        max-width: 320px;
    }
    .story-media__secondary {
        left: 0;
        width: 44%;
        max-width: 150px;
        border-width: 4px;
    }
    .story-watermark {
        font-size: 64px;
        padding-top: 24px;
    }
}

/* Respect reduced-motion: render final state immediately, no transitions */
@media (prefers-reduced-motion: reduce) {
    .story-section .story-eyebrow,
    .story-section .story-title,
    .story-section .story-desc,
    .story-section .story-btn,
    .story-section .story-media {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
