/* --------------------------------------------------
   نمایش فضاها (Rooms Reel)
   -------------------------------------------------- */

/* ═══ تنظیمات ═══ */
.trr {
  --room-name: clamp(2.25rem, 4.2vw, 3.75rem);   /* اندازه نام فضا */
  --shade: linear-gradient(to left, rgba(8, 11, 27, .78), rgba(8, 11, 27, .22) 46%, transparent 72%);   /* سایه‌ی کنار متن */
  --shade-bottom: linear-gradient(to top, rgba(8, 11, 27, .72), transparent 42%);   /* سایه‌ی پایین تصویر */
  --line: rgba(255, 255, 255, .14);   /* خط‌های ظریف */
  --tile-radius: 22px;   /* گردی کاشی‌های نمای کلی */
  --tile-row: 230px;   /* ارتفاع هر ردیف کاشی‌ها */
  --shadow-tile-hover: 0 0 0 1px rgba(193, 138, 255, .55), 0 30px 70px -30px rgba(146, 61, 255, .8);   /* هاله کاشی در هاور */
  --wrap: 1280px;   /* پهنای محتوای نمای کلی */
}

/* فقط نقطه‌ی فهرست‌ها برداشته می‌شود؛ فاصله‌ها را هر فهرست خودش تعیین می‌کند */
.trr .trr ol,
.trr .trr ul {
  list-style: none;
}

.trr .trr-img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

/* ═══ حالت ساده (بدون انیمیشن): فضاها زیر هم ═══ */
.trr .trr-intro,
.trr .trr-rail,
.trr .trr-ui {
  display: none;
}

.trr .trr-list {
  display: grid;
  gap: 20px;
  max-inline-size: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.trr .trr-room {
  position: relative;
  min-block-size: 480px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 28px;
  isolation: isolate;
}

.trr .trr-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.trr .trr-room::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--shade-bottom), var(--shade);
  pointer-events: none;
}

.trr .trr-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-inline-size: 540px;
  padding: 40px;
}

/* ═══ حالت سینمایی (با اسکرول) ═══ */
.trr.is-live .trr-stage {
  position: relative;
  block-size: 100vh;
  block-size: 100svh;
  overflow: hidden;
}

.trr.is-live .trr-intro {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
}

/* قاب تصویر معماری که باز می‌شود */
.trr .trr-intro-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  box-shadow: 0 50px 120px -40px rgba(146, 61, 255, .55);
  will-change: transform;
}

.trr .trr-intro-frame .trr-img {
  will-change: transform;
}

/* راهنمای «وارد شوید» روی تصویر اول */
.trr .trr-hint {
  position: absolute;
  inset-block-end: 9%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 100px;
  background: rgba(12, 16, 38, .5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-family: var(--trw-body-font);
  font-size: .9375rem;
  color: #FFFFFF;
  white-space: nowrap;
}

.trr .trr-hint span {
  direction: ltr;
  font-size: .75rem;
  letter-spacing: .2em;
  color: var(--trw-lighter-primary);
}

.trr.is-live .trr-list {
  position: absolute;
  inset: 0;
  display: block;
  max-inline-size: none;
  margin: 0;
  padding: 0;
}

.trr.is-live .trr-room {
  position: absolute;
  inset: 0;
  min-block-size: 0;
  border-radius: 0;
  visibility: hidden;
}

.trr.is-live .trr-media .trr-img {
  will-change: transform;
}

.trr.is-live .trr-copy {
  position: absolute;
  inset-inline-start: max(24px, calc((100vw - var(--wrap)) / 2 + 20px));
  inset-block-end: 12vh;
  padding: 0;
}


/* نام لاتین با یک خط نور */
.trr .trr-en {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  direction: ltr;
  font-family: var(--trw-body-font);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: lowercase;
  color: var(--trw-lighter-primary);
}

.trr .trr-en::before {
  content: "";
  inline-size: 36px;
  block-size: 1px;
  background: linear-gradient(90deg, transparent, var(--trw-secondary));
}

.trr .trr-name {
  margin: 0;
  font-family: var(--trw-head-font);
  font-size: var(--room-name);
  font-weight: 900;
  line-height: 1.3;
  color: #FFFFFF;
  text-shadow: 0 8px 40px rgba(8, 11, 27, .7);
}

.trr .trr-desc {
  margin: 0;
  font-family: var(--trw-body-font);
  font-size: 1.0625rem;
  line-height: 2;
  color: rgba(245, 244, 255, .82);
}

/* لینک «مشاهده جزئیات»: کپسول شیشه‌ای، در هاور کاشی گرادیانت از پایین بالا می‌چرخد */
.trr .trr-link {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-block-start: 8px;
  padding: 11px 20px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 100px;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  perspective: 400px;
  font-family: var(--trw-body-font);
  font-size: .9375rem;
  font-weight: 600;
  color: #FFFFFF;
  text-decoration: none;
  transition: border-color .4s ease, box-shadow .5s ease, transform .5s var(--trw-ease);
}

.trr .trr-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--trw-grad);
  transform-origin: 50% 100%;
  transform: rotateX(-95deg);
  opacity: 0;
  transition: transform .55s cubic-bezier(.3, .7, .3, 1.15), opacity .35s ease;
}

.trr .trr-link:hover,
.trr .trr-link:focus-visible {
  border-color: transparent;
  box-shadow: 0 18px 40px -16px rgba(216, 59, 255, .8);
  transform: translateY(-2px);
}

.trr .trr-link:hover::before,
.trr .trr-link:focus-visible::before {
  transform: rotateX(0);
  opacity: 1;
}

.trr .trr-link svg {
  inline-size: 18px;
  block-size: 18px;
  transition: transform .5s var(--trw-ease);
}

.trr .trr-link:hover svg {
  transform: translateX(-4px);
}

/* فهرست فضاها کنار صفحه (فقط دسکتاپ) */
.trr.is-live .trr-rail {
  position: absolute;
  inset-inline-end: max(24px, calc((100vw - var(--wrap)) / 2 + 20px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background: rgba(12, 16, 38, .42);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.trr .trr-dot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border: 0;
  background: none;
  font-family: var(--trw-body-font);
  font-size: .8125rem;
  color: rgba(245, 244, 255, .55);
  cursor: pointer;
  transition: color .4s ease;
}


/* خط کوچک کنار هر نام که برای فضای فعلی بلند و رنگی می‌شود */
.trr .trr-dot::after {
  content: "";
  inline-size: 14px;
  block-size: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .25);
  transition: inline-size .5s var(--trw-ease), background-color .4s ease;
}

.trr .trr-dot:hover,
.trr .trr-dot:focus-visible,
.trr .trr-dot.is-on {
  color: #FFFFFF;
}

.trr .trr-dot.is-on::after {
  inline-size: 34px;
  background: var(--trw-secondary);
  box-shadow: 0 0 12px rgba(216, 59, 255, .9);
}

/* نوار پیشرفت */
.trr.is-live .trr-ui {
  position: absolute;
  inset-block-end: 32px;
  left: max(24px, calc((100vw - var(--wrap)) / 2 + 20px));
  display: flex;
  align-items: center;
  gap: 16px;
  direction: ltr;
}



.trr .trr-bar {
  position: relative;
  inline-size: 160px;
  block-size: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}

.trr .trr-bar i {
  position: absolute;
  inset: 0;
  background: var(--trw-grad);
  transform-origin: left;
  transform: scaleX(0);
}

/* ═══ نمای کلی فضاهای منتخب ═══ */
.trr .trr-all-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 88px 0 28px;
  font-family: var(--trw-head-font);
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  color: #FFFFFF;
}

.trr .trr-all-title span {
  direction: ltr;
  font-family: var(--trw-body-font);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .2em;
  color: var(--trw-light-primary);
}

.trr .trr-all {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--tile-row);
  gap: 16px;
  max-inline-size: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.trr .trr-tile--big {
  grid-column: span 2;
  grid-row: span 2;
}

/* کاشی پهن */
.trr .trr-tile--wide {
  grid-column: span 2;
}

.trr .trr-tile a {
  position: relative;
  isolation: isolate;
  display: block;
  block-size: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--tile-radius);
  color: #FFFFFF;
  text-decoration: none;
  transition: box-shadow .6s ease, transform .6s var(--trw-ease);
}

.trr .trr-tile .trr-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  transition: transform 1.4s var(--trw-ease);
}

.trr .trr-tile a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(8, 11, 27, .9), rgba(8, 11, 27, .1) 60%);
}

.trr .trr-tile a:hover,
.trr .trr-tile a:focus-visible {
  box-shadow: var(--shadow-tile-hover);
  transform: translateY(-4px);
}

.trr .trr-tile a:hover .trr-img {
  transform: scale(1.08);
}


.trr .trr-tile-copy {
  position: absolute;
  inset-inline: 18px;
  inset-block-end: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trr .trr-tile-copy small {
  direction: ltr;
  text-align: end;
  font-family: var(--trw-body-font);
  font-size: .6875rem;
  letter-spacing: .16em;
  text-transform: lowercase;
  color: var(--trw-lighter-primary);
}

.trr .trr-tile-copy strong {
  font-family: var(--trw-head-font);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.5;
}

.trr .trr-tile--big .trr-tile-copy strong {
  font-size: 1.875rem;
}

@media (prefers-reduced-motion: reduce) {
  .trr .trr-link,
  .trr .trr-link::before,
  .trr .trr-tile a,
  .trr .trr-tile .trr-img {
    transition: none;
  }
}

/* ─── تبلت ─── */
@media (max-width: 1024px) {
  .trr {
    --tile-row: 210px;
  }

  .trr.is-live .trr-rail {
    display: none;
  }

  .trr .trr-all {
    grid-template-columns: repeat(2, 1fr);
  }

  .trr .trr-tile--big {
    grid-row: span 1;
  }

  .trr .trr-tile--wide {
    grid-column: span 1;
  }

  /* در دو ستون، اگر آخرین کاشی تنها ماند، تمام‌عرض شود تا ردیف آخر خالی نماند */
  .trr .trr-all:has(.trr-tile--big:first-child) .trr-tile:last-child:nth-child(even),
  .trr .trr-all:not(:has(.trr-tile--big:first-child)) .trr-tile:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

/* ─── موبایل ─── */
@media (max-width: 767px) {
  .trr {
    --tile-row: 168px;
    --tile-radius: 18px;
    /* در موبایل متن روی نیمه‌ی پایین تصویر است؛ سایه‌ی پایین بلندتر تا متن روی هر تصویری خوانا بماند */
    --shade-bottom: linear-gradient(to top, rgba(8, 11, 27, .94), rgba(8, 11, 27, .6) 42%, transparent 68%);
  }

  .trr .trr-room {
    min-block-size: 440px;
  }

  .trr .trr-room::after {
    background: linear-gradient(to top, rgba(8, 11, 27, .95) 8%, rgba(8, 11, 27, .55) 45%, transparent 75%);
  }

  .trr .trr-copy {
    padding: 24px 18px;
  }

  .trr.is-live .trr-copy {
    inset-inline: 18px;
    inset-block-end: 9vh;
  }

  .trr .trr-desc {
    font-size: .9375rem;
    line-height: 1.95;
  }

  .trr.is-live .trr-ui {
    inset-block-start: 92px;
    inset-block-end: auto;
    left: 18px;
  }

  .trr .trr-bar {
    inline-size: 90px;
  }

  .trr .trr-hint {
    font-size: .8125rem;
  }

  .trr .trr-all-title {
    margin-block-start: 56px;
    font-size: 1.375rem;
  }

  .trr .trr-all {
    gap: 10px;
    padding-inline: 15px;
  }

  .trr .trr-tile-copy {
    inset-inline: 12px;
    inset-block-end: 10px;
  }

  .trr .trr-tile-copy strong {
    font-size: 1rem;
  }

  .trr .trr-tile--big .trr-tile-copy strong {
    font-size: 1.375rem;
  }
}

/* ═══ دکمه‌ی «مشاهده تمام اتاق‌ها» زیر نمای کلی ═══ */
.trr-more {
  display: flex;
  justify-content: center;
  margin-block-start: 36px;
  padding: 0 20px;
}

/* پین می‌شود؛ transition پیش‌فرض المنتور نباید جابه‌جایی پین را نشان دهد */
.pin-spacer > .trr-stage,
.trr-stage {
  transition: none !important;
}
