/* =========================================================================
 * Attorna — Take a Tour Video Hero Section (RTL)
 * Mirrors the design tokens of assets/css/story-section.css
 * ========================================================================= */

.tat-section {
    --tat-ink:        #f4f1ea;
    --tat-ink-soft:   rgba(236, 231, 220, 0.78);
    --tat-gold:       #B1976B;
    --tat-gold-dark:  #8f7a55;
    --tat-bg:         #141414;
    --tat-line:       rgba(177, 151, 107, 0.55);
    --tat-shadow:     0 40px 80px -32px rgba(0, 0, 0, 0.65);
    --tat-glass:      rgba(255, 255, 255, 0.10);

    position: relative;
    overflow: hidden;
    background: var(--tat-bg);
    color: var(--tat-ink);
    direction: rtl;
    text-align: center;
    padding: clamp(36px, 5vw, 56px) 0 clamp(44px, 6vw, 72px);
    font-family: var(--font-family-base, 'IRANSans', Tahoma, sans-serif);
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Background texture (inline-background image) ---------- */
.tat-bg {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.14;
    mix-blend-mode: luminosity;
    filter: grayscale(35%);
    pointer-events: none;
    z-index: 0;
}
.tat-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(177, 151, 107, 0.10), transparent 70%),
        linear-gradient(180deg, rgba(20, 20, 20, 0.6), rgba(20, 20, 20, 0.25) 40%, rgba(20, 20, 20, 0.85));
    z-index: 1;
    pointer-events: none;
}

/* ---------- Container ---------- */
.tat-container {
    position: relative;
    z-index: 2;
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ---------- Cover frame ---------- */
.tat-frame {
    position: relative;
    margin: 0 auto;
    max-width: 940px;
    z-index: 2;
}

.tat-frame img {
    width: 100%;
    height: clamp(240px, 36vw, 400px);
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 18px 18px 8px 8px;
    box-shadow: var(--tat-shadow);
}

.tat-frame__overlay {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background:
        radial-gradient(ellipse 60% 55% at 50% 55%, rgba(10, 10, 12, 0.15), transparent 75%),
        linear-gradient(180deg,
            rgba(16, 16, 18, 0.55) 0%,
            rgba(16, 16, 18, 0.28) 45%,
            rgba(16, 16, 18, 0.78) 100%);
    pointer-events: none;
    z-index: 3;
}

/* ---------- Overlapping card (play button + title + description) ---------- */
.tat-card {
    position: relative;
    z-index: 4;
    max-width: 720px;
    margin: calc(-1 * clamp(44px, 7vw, 72px)) auto 0;
    padding: clamp(22px, 4vw, 40px) clamp(20px, 5vw, 52px);
    background: linear-gradient(160deg, rgba(22, 22, 24, 0.92), rgba(16, 16, 18, 0.88));
    border: 1px solid rgba(177, 151, 107, 0.35);
    border-radius: 14px;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ---------- Play button ---------- */
.tat-play {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(72px, 12vw, 96px);
    height: clamp(72px, 12vw, 96px);
    margin-bottom: clamp(18px, 3vw, 28px);
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--tat-line);
    background: var(--tat-glass);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}
.tat-play:focus-visible {
    outline: 2px solid var(--tat-gold);
    outline-offset: 4px;
}
.tat-play img,
.tat-play svg {
    width: 42%;
    height: 42%;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* Pulse rings */
.tat-play .tat-play__ring {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1px solid rgba(177, 151, 107, 0.5);
    opacity: 0;
    animation: tat-pulse-ring 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}
.tat-play .tat-play__ring--2 {
    animation-delay: 1.2s;
}

@keyframes tat-pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.65;
    }
    70% {
        transform: scale(1.45);
        opacity: 0;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.tat-play:hover,
.tat-play:focus-visible {
    transform: scale(1.08);
    background: rgba(177, 151, 107, 0.22);
    border-color: var(--tat-gold);
    box-shadow: 0 0 0 10px rgba(177, 151, 107, 0.14),
                0 0 34px rgba(177, 151, 107, 0.4);
}
.tat-play:active {
    transform: scale(0.97);
}

/* ---------- Title & description ---------- */
.tat-title {
    margin: 0 0 14px;
    font-family: var(--font-family-heading, 'Jost', 'IRANSans', Tahoma, sans-serif);
    font-size: clamp(26px, 4vw, 42px);
    line-height: 1.35;
    font-weight: 700;
    color: var(--tat-ink);
    letter-spacing: 0.01em;
}
.tat-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 2px;
    margin: 18px auto 0;
    background: linear-gradient(90deg, transparent, var(--tat-gold), transparent);
}

.tat-desc {
    margin: 0 auto;
    max-width: 60ch;
    color: var(--tat-ink-soft);
    font-size: clamp(14.5px, 1.6vw, 17px);
    line-height: 2;
}
.tat-desc p {
    margin: 0 0 12px;
}
.tat-desc p:last-child {
    margin-bottom: 0;
}

/* =========================================================================
 * Lightbox modal
 * ========================================================================= */
.tat-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    direction: rtl;
}
.tat-modal.is-open {
    display: flex;
}

.tat-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 8, 10, 0.72);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.tat-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 1180px);
    max-height: 90vh;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.35s ease-out, transform 0.35s ease-out;
    will-change: transform, opacity;
}
.tat-modal.is-ready .tat-modal__dialog {
    opacity: 1;
    transform: scale(1);
}

.tat-modal__video {
    width: 100%;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.tat-modal__video video,
.tat-modal__video iframe {
    width: 100%;
    height: min(76vh, 720px);
    display: block;
    border: 0;
    background: #000;
}

.tat-modal__close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.tat-modal__close:hover,
.tat-modal__close:focus-visible {
    background: rgba(177, 151, 107, 0.85);
    border-color: var(--tat-gold);
    transform: scale(1.06);
}

/* Scroll lock */
html.tat-lock,
html.tat-lock body {
    overflow: hidden !important;
}

/* =========================================================================
 * Responsive breakpoints
 * ========================================================================= */
@media (max-width: 991px) {
    .tat-card {
        max-width: 640px;
    }
    .tat-frame img {
        border-radius: 14px 14px 6px 6px;
    }
}

@media (max-width: 767px) {
    .tat-section {
        padding: 40px 0 52px;
    }
    .tat-container {
        padding: 0 14px;
    }
    .tat-frame img {
        height: clamp(220px, 52vw, 300px);
    }
    .tat-card {
        margin-top: calc(-1 * clamp(36px, 9vw, 52px));
        padding: 20px 16px 24px;
        border-radius: 12px;
    }
    .tat-play {
        width: 68px;
        height: 68px;
    }
    .tat-modal__dialog {
        width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .tat-modal__video video {
        height: 82vh;
    }
}

/* Respect reduced motion: no pulse, no entry transitions */
@media (prefers-reduced-motion: reduce) {
    .tat-play .tat-play__ring {
        animation: none;
        opacity: 0;
    }
    .tat-play,
    .tat-play:hover,
    .tat-play:focus-visible {
        transition: none;
        transform: none;
    }
    .tat-modal__dialog {
        transition: none;
        opacity: 1;
        transform: none;
    }
}
