/**
 * تهران وان — گالری اقامتگاه ([tehranone_property_gallery])
 * تصویر بزرگ + بندانگشتی‌ها، و لایت‌باکس با پیکان‌ها و نوار تصاویر کوچک.
 *
 * نکته: کیت المنتور روی هر button استایل عمومی می‌گذارد؛ پس مقادیر ظاهری
 * دکمه‌ها با !important صفر شده‌اند (همان روش search-form.css).
 */

.tng {
    --tng-radius: 16px;
    --tng-line: var(--tn-line, #EDEAE3);
    --tng-green: var(--tn-green, #0F5446);
    --tng-gold: var(--tn-gold, #C8A15A);
    --tng-empty: var(--tn-cream-2, #F4EFE6);
    --tng-ease: var(--tn-ease, cubic-bezier(.16, 1, .3, 1));
    direction: rtl;
    display: grid;
    /* نسبت مرجع (اتاقک): تصویر بزرگ ≈ ۱.۲۵ برابر عرض ستون بندانگشتی‌ها */
    grid-template-columns: 1.25fr 1fr;
    gap: 10px;
    width: 100%;
}

/* کانتینر گالری در قالب یک فلکس‌باکس wrap است؛ ویجت شورت‌کد باید تمام عرض را بگیرد
   (در حالت قدیمیِ قالب، ویجت یک لایه تودرتو و داخل کانتینرهای کوچک می‌نشیند) */
#gallery .e-con,
#gallery .elementor-widget-shortcode {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

.tng__hero,
.tng__thumb {
    position: relative;
    display: block;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: var(--tng-radius) !important;
    background: var(--tng-empty) !important;
    box-shadow: none !important;
    line-height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
    cursor: zoom-in;
}

/* ارتفاع هیرو تعیین‌کنندهٔ ارتفاع ردیف است؛ با ۳:۲ چهار بندانگشتی ۲×۲
   به کادرهای افقیِ هم‌اندازه می‌رسند (اندازه‌گیری‌شده: ۲۱۱×۱۷۶ = ۱.۲ ، مثل مرجع) */
.tng__hero {
    aspect-ratio: 3 / 2;
}

.tng__hero img,
.tng__thumb img {
    display: block;
    width: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform .55s var(--tng-ease);
}

/* تصویر بزرگ و بندانگشتی‌ها: نسبت خودِ تصویر = نسبت کادر، پس با cover دقیقاً پر می‌شود.
   (درصد ارتفاع داخل کادری که ارتفاعش از محتوا می‌آید حل نمی‌شود و تصویر با نسبت اصلی می‌نشیند) */
.tng__hero img {
    height: auto;
    aspect-ratio: 3 / 2;
}

.tng__thumb img {
    height: auto;
    aspect-ratio: 6 / 5;
}

.tng__hero:hover img,
.tng__thumb:hover img {
    transform: scale(1.05);
}

.tng__hero:focus-visible,
.tng__thumb:focus-visible {
    outline: 3px solid var(--tng-green);
    outline-offset: 3px;
}

.tng__side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    align-content: start;
    gap: 10px;
    min-height: 0;
}

/* هر چهار کادر دقیقاً هم‌اندازه؛ نسبت، ارتفاع قطعی می‌سازد تا تصویر با cover پر کند
   (بدون ارتفاع قطعی، height:100% روی img حل نمی‌شود و تصویر با نسبت خودش می‌نشیند) */
.tng__side .tng__thumb {
    aspect-ratio: 6 / 5;
    border-radius: 14px !important;
}

/* آخرین بندانگشتی + شمار عکس‌های اقامتگاه (مثل مرجع) */
.tng__thumb--more::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 24, 21, .52);
    transition: background .3s var(--tng-ease);
}

.tng__thumb--more:hover::after {
    background: rgba(10, 24, 21, .38);
}

.tng__thumb,
.tng__thumb--more,
.tng__thumb--video {
    overflow: hidden;
}
.tng {
    contain: layout paint;
}

.tng__more {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    color: #fff;
    line-height: 1.15;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}

.tng__more b {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .2px;
}

.tng__more span {
    margin-top: 3px;
    font-size: 12.5px;
    font-weight: 600;
    opacity: .95;
}

/* ── لایت‌باکس ───────────────────────────────────────────── */
.tngl {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 16px;
    direction: rtl;
}

.tngl[hidden] {
    display: none !important;
}

.tngl__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 13, .93);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.tngl__box {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: min(1080px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 10px 14px 14px;
    border-radius: 18px;
    background: rgba(20, 28, 25, .55);
}

/* ردیف بالای کادر: دکمهٔ بستن، بیرون از تصویر */
.tngl__head {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end; /* RTL: سمت چپ */
}

.tngl__stage {
    display: grid;
    place-items: center;
    flex: 1 1 auto;
    min-height: 0;
}

.tngl__img {
    display: block;
    max-width: 100%;
    max-height: min(66vh, 700px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, .04);
}

.tngl__close,
.tngl__nav {
    display: grid !important;
    place-items: center;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    line-height: 1 !important;
    cursor: pointer;
    color: var(--tng-green, #0F5446) !important;
    background-color: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5) !important;
    transition: transform .25s var(--tng-ease), background-color .25s var(--tng-ease);
}

.tngl__close:hover,
.tngl__nav:hover {
    background-color: #fff !important;
    transform: scale(1.07);
}

.tngl__close:focus-visible,
.tngl__nav:focus-visible {
    outline: 3px solid var(--tng-gold, #C8A15A);
    outline-offset: 2px;
}

.tngl__close {
    width: 36px !important;
    height: 36px !important;
}

/* پیکان‌ها: ته صفحه و روی دو طرف (هدف لمس بزرگ، هرگز روی تصویر نمی‌افتند) */
.tngl__nav {
    position: fixed;
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    z-index: 3;
    width: 52px !important;
    height: 52px !important;
}

.tngl__nav--prev {
    right: 14px;
}

.tngl__nav--next {
    left: 14px;
}

/* نوار تصاویر کوچک زیر تصویر بزرگ */
.tngl__thumbs {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
    /* فاصلهٔ دو طرف = جای پیکان‌های ثابتِ ته صفحه، تا روی بندانگشتی‌ها نیفتند */
    padding: 4px 64px;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    /* وسط‌چین وقتی همه جا می‌شوند؛ با سرریز، از ابتدا چیده می‌شوند (safe) */
    justify-content: center;
    justify-content: safe center;
}

.tngl__thumbs::-webkit-scrollbar {
    height: 5px;
}

.tngl__thumbs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .28);
    border-radius: 3px;
}

.tngl__thumb {
    flex: 0 0 auto;
    width: 78px !important;
    height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 2px solid transparent !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .08) !important;
    box-shadow: none !important;
    line-height: 0 !important;
    min-height: 0 !important;
    overflow: hidden;
    opacity: .55;
    cursor: pointer;
    transition: opacity .25s var(--tng-ease), border-color .25s var(--tng-ease);
}

.tngl__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tngl__thumb:hover {
    opacity: .85;
}

.tngl__thumb.is-active {
    opacity: 1;
    border-color: var(--tng-gold, #C8A15A) !important;
}

body.tngl-open {
    overflow: hidden;
}

/* قفل اسکرول در سطح ریشه، تا نوار کنار صفحه هم برداشته شود */
html.tngl-open,
html.tngl-open body {
    overflow: hidden;
}

/* تبلت و موبایل: پیکان‌های ثابتِ ته صفحه فضا بگیرند و روی محتوا نیفتند */
@media (max-width: 1024px) {
    .tngl {
        padding: 14px 10px 80px;
    }
}

@media (max-width: 767px) {
    .tng {
        grid-template-columns: 1fr;
    }

    .tng__hero {
        aspect-ratio: 4 / 3;
    }

    .tng__hero img {
        aspect-ratio: 4 / 3;
    }

    /* در موبایل ارتفاع ستون کنار مشخص نیست؛ نسبت خود کادرها ارتفاع می‌سازد */
    .tng__side {
        grid-template-rows: none;
    }

    .tngl__box {
        padding: 8px 10px 10px;
        gap: 8px;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .tngl__img {
        max-height: 54vh;
    }

    .tngl__nav {
        width: 44px !important;
        height: 44px !important;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
    }

    .tngl__nav--prev {
        right: 12px;
    }

    .tngl__nav--next {
        left: 12px;
    }

    .tngl__thumbs {
        padding: 4px 54px;
    }

    .tngl__thumb {
        width: 64px !important;
        height: 46px !important;
    }
}

/* ── کادر ویدئو در گرید گالری ───────────────────────────── */
.tng__thumb--video {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 8px;
    place-items: center;
    background: #0E4D3C !important;
    cursor: pointer;
}
.tng__play {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .95);
    color: #0E4D3C;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5);
    transition: transform .25s var(--tng-ease), background-color .25s var(--tng-ease);
}
.tng__thumb--video:hover .tng__play {
    transform: scale(1.07);
    background: #fff;
}
.tng__video-label {
    position: relative;
    inset: auto;
    margin-top: 10px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    background: rgba(0, 0, 0, .55);
    padding: 3px 10px;
    border-radius: 999px;
    pointer-events: none;
    max-width: calc(100% - 20px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tng__more-video {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    background: rgba(14, 77, 60, .9);
    color: #fff;
    font-size: 11px !important;
    font-weight: 700;
    line-height: 1.2 !important;
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
}

/* ── مودال ویدئو ───────────────────────────────────────────── */
.tngv {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 16px;
    direction: rtl;
}
.tngv[hidden] {
    display: none !important;
}
.tngv__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 16, 13, .93);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.tngv__box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: min(960px, calc(100vw - 32px));
    background: #0b1512;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.tngv__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.tngv__title {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}
.tngv__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .94);
    color: #0F5446;
    cursor: pointer;
}
.tngv__stage {
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}
.tngv__stage iframe,
.tngv__stage video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ── ویدئو یکپارچه در لایت‌باکس گالری ── */
.tng__thumb--video{background-size:cover;background-position:center;min-height:120px;}
.tngl__stage{display:flex;align-items:center;justify-content:center;min-height:0;}
.tngl__stage img{max-width:100%;max-height:calc(100vh - 170px);object-fit:contain;}
.tngl__stage video{width:100%;max-height:calc(100vh - 170px);object-fit:contain;background:#000;}
.tngl__stage iframe{width:100%;height:100%;min-height:320px;border:0;}
.tngl__stage .tng__video{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#000;}
.tngl__thumb--video{position:relative;}
.tngl__thumb--video::before{content:'';position:absolute;inset:0;background:rgba(14,77,60,.4);z-index:1;}
.tngl__thumb--video::after{content:'';position:absolute;inset:0;margin:auto;width:34px;height:34px;background:rgba(255,255,255,.92) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%230E4D3C' d='M8 5v14l11-7z'/></svg>") center/14px no-repeat;border-radius:50%;z-index:2;}
.tngl__thumb--video img{position:relative;z-index:0;}

.tng__thumb--video{background-size:cover !important;background-position:center !important;background-repeat:no-repeat !important;min-height:120px !important;}

.tng__thumb--video{position:relative}
.tng__thumb--video video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:6px;background:#0E4D3C}
.tng__video-label{font-size:13px !important;padding:5px 12px !important;z-index:3 !important;box-shadow:0 1px 4px rgba(0,0,0,.35)}

.tngl__stage{aspect-ratio:16/9 !important;max-height:calc(100vh - 150px) !important;display:flex;align-items:center;justify-content:center;background:#000;width:100%}
.tngl__stage img.tngl__img{width:100% !important;height:100% !important;max-width:none !important;max-height:none !important;object-fit:contain}
.tngl__stage iframe,.tngl__stage video{width:100% !important;height:100% !important;min-height:0 !important;border:0;display:block}

/* â”€â”€ Ø¨Ø²Ø±Ú¯â€ŒÙ†Ù…Ø§ÛŒÛŒ Ù„Ø§ÛŒØªâ€ŒØ¨Ø§Ú©Ø³ (Ù…ÙˆØ¨Ø§ÛŒÙ„/Ø¯Ø³Ú©ØªØ§Ù¾) â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tngl__toggle {
    display: grid !important;
    place-items: center;
    width: 36px !important;
    height: 36px !important;
    margin: 0 0 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    color: var(--tng-green, #0F5446) !important;
    background-color: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .5) !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: transform .25s var(--tng-ease), background-color .25s var(--tng-ease);
}
.tngl__toggle:hover {
    background-color: #fff !important;
    transform: scale(1.07);
}
.tngl__toggle:focus-visible {
    outline: 3px solid var(--tng-gold, #C8A15A);
    outline-offset: 2px;
}
.tngl__head {
    gap: 8px;
}
/* Ø­Ø§Ù„Øª Ø¨Ø²Ø±Ú¯â€ŒÙ†Ù…Ø§ÛŒÛŒ: ØªØµÙˆÛŒØ± Ú©Ù„ Ú©Ø§Ø¯Ø± Ø±Ø§ Ù¾Ø± Ù…ÛŒâ€ŒÚ©Ù†Ø¯ */
.tngl--zoom .tngl__stage {
    position: relative;
    flex: 1 1 auto;
    height: min(64vh, calc(100vh - 150px));
    overflow: hidden;
}
.tngl--zoom .tngl__stage .tngl__img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 125% !important;
    height: 125% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    transform: translate(-50%, -50%);
    border-radius: 0;
    background: transparent;
    /* برای پن با لمس/ماوس: جلوگیری از اسکرول صفحه هنگام درگ */
    touch-action: none;
    cursor: grab;
    will-change: transform;
}

.tngl--zoom .tngl__stage .tngl__img.is-panning { cursor: grabbing; }

