/*
 * Complex (Цогцолбор) detail + index pages.
 * Layout primitives (.ub-page, .ub-container--wide, .ub-card) come from
 * base.css/components.css — keep complex-specific styles
 * here. Shared page hero/breadcrumb rules live in components.css; the detail
 * page owns .ub-complex__* content and the index owns .ub-complex-list*.
 */

/* ============================================================
   MAIN COLUMN — stacked content blocks with generous rhythm.
   ============================================================ */
.ub-complex__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(var(--ub-space-6xl), 7vw, var(--ub-space-7xl));
}

.ub-complex__block {
    display: flex;
    flex-direction: column;
    gap: var(--ub-space-2xl);
}

/* Section heading: small lotus mark + title — quiet, left-aligned. */
.ub-complex__block-head {
    display: flex;
    align-items: center;
    gap: var(--ub-space-l);
}

.ub-complex__block-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ub-size-icon-chip-sm);
    height: var(--ub-size-icon-chip-sm);
    flex-shrink: 0;
    border-radius: var(--ub-radius-pill);
    background: var(--ub-color-hover-tint);
    color: var(--ub-color-brand);
}

.ub-complex__block-title {
    font-family: var(--ub-font-display);
    font-size: var(--ub-text-2xl);
    font-weight: 600;
    color: var(--ub-color-heading);
    line-height: var(--ub-leading-display);
    letter-spacing: var(--ub-tracking-display);
    margin: 0;
}

/* ============================================================
   VIRTUAL TOUR — 16:9 with a content-safe floor, soft border + card shadow.
   ============================================================ */
.ub-complex__tour {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: var(--ub-size-deferred-embed-min);
    overflow: hidden;
    border-radius: var(--ub-radius-md);
    border: 1px solid var(--ub-color-divider);
    background-color: var(--ub-color-section-soft);
    box-shadow: var(--ub-shadow-card);
}

/* Empty state: no real tour to fill a 16:9 frame, so cap the height
   and let it read as an intentional notice rather than a vast blank. */
.ub-complex__tour--empty {
    aspect-ratio: auto;
    min-height: var(--ub-size-empty-panel);
}

.ub-complex__tour-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ub-complex__tour-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ub-space-l);
    background:
        radial-gradient(120% 120% at 50% 0%, var(--ub-color-hover-tint), transparent 60%),
        var(--ub-color-section-soft);
    color: var(--ub-color-body-muted);
    font-size: var(--ub-text-md);
    font-weight: 500;
    padding: var(--ub-space-2xl);
    text-align: center;
}

.ub-complex__tour-placeholder-icon {
    width: var(--ub-size-icon-chip-lg);
    height: var(--ub-size-icon-chip-lg);
    object-fit: contain;
    opacity: 0.55;
}

/* ============================================================
   ABOUT — calm, readable body block.
   ============================================================ */
.ub-complex__description {
    width: 100%;
    font-size: var(--ub-text-md);
    color: var(--ub-color-body);
    line-height: var(--ub-leading-body);
    margin: 0;
}

/* ============================================================
   EDITORIAL SECTIONS — image first in the DOM/mobile reading order, alternating
   image/text columns on wider screens.
   ============================================================ */
.ub-complex__editorial {
    display: flex;
    flex-direction: column;
    gap: clamp(var(--ub-space-5xl), 7vw, var(--ub-space-7xl));
}

.ub-complex__editorial-row {
    display: grid;
    gap: clamp(var(--ub-space-2xl), 4vw, var(--ub-space-5xl));
    align-items: center;
}

.ub-complex__editorial-media {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border-radius: var(--ub-radius-md);
    background: var(--ub-color-section-soft);
}

.ub-complex__editorial-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.ub-complex__editorial-copy {
    min-width: 0;
}

.ub-complex__editorial-title {
    margin: 0 0 var(--ub-space-l);
    color: var(--ub-color-heading);
    font-family: var(--ub-font-display);
    font-size: clamp(var(--ub-text-xl), 2.5vw, var(--ub-text-3xl));
    font-weight: 600;
    line-height: var(--ub-leading-display);
    letter-spacing: var(--ub-tracking-display);
}

.ub-complex__editorial-body {
    color: var(--ub-color-body);
    font-size: var(--ub-text-md);
    line-height: var(--ub-leading-body);
}

.ub-complex__editorial-body > :first-child {
    margin-top: 0;
}

.ub-complex__editorial-body > :last-child {
    margin-bottom: 0;
}

.ub-complex__editorial-body p,
.ub-complex__editorial-body ul,
.ub-complex__editorial-body ol {
    margin: 0 0 var(--ub-space-l);
}

.ub-complex__editorial-body ul,
.ub-complex__editorial-body ol {
    padding-inline-start: var(--ub-space-2xl);
}

.ub-complex__editorial-body a {
    color: var(--ub-color-brand);
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

@media (min-width: 768px) {
    .ub-complex__editorial-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ub-complex__editorial-row--reverse .ub-complex__editorial-media {
        grid-column: 2;
        grid-row: 1;
    }

    .ub-complex__editorial-row--reverse .ub-complex__editorial-copy {
        grid-column: 1;
        grid-row: 1;
    }
}

/* ============================================================
   MAP — standalone Google Maps embed below the location heading.
   ============================================================ */
.ub-complex__map {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: var(--ub-size-deferred-embed-min);
    border-radius: var(--ub-radius-sm);
    overflow: hidden;
    border: 1px solid var(--ub-color-divider);
}

.ub-complex__map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================================
   GALLERY — responsive grid of rounded photos with hover lift.
   ============================================================ */
.ub-complex__gallery-grid {
    display: grid;
    gap: var(--ub-space-xl);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .ub-complex__gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.ub-complex__gallery-item {
    position: relative;
    margin: 0;
    aspect-ratio: 4 / 3;
    border-radius: var(--ub-radius-md);
    overflow: hidden;
    background-color: var(--ub-color-section-soft);
    box-shadow: var(--ub-shadow-card);
    transition: transform var(--ub-transition-base),
                box-shadow var(--ub-transition-base);
}

.ub-complex__gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--ub-shadow-card-hover);
}

.ub-complex__gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--ub-transition-slow);
}

.ub-complex__gallery-item:hover .ub-complex__gallery-img {
    transform: scale(1.04);
}

.ub-complex__gallery-caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: var(--ub-space-2xl) var(--ub-space-l) var(--ub-space-l);
    font-size: var(--ub-text-sm);
    color: var(--ub-color-on-brand);
    line-height: var(--ub-leading-snug);
    background: linear-gradient(180deg, transparent, rgba(29, 29, 31, 0.72));
}

/* ============================================================
   COMPLEX LIST — index page cards.
   ============================================================ */
.ub-complex-list {
    display: grid;
    gap: var(--ub-space-3xl);
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .ub-complex-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.ub-complex-list__card {
    display: flex;
    flex-direction: column;
    background: var(--ub-color-white);
    border: 1px solid var(--ub-color-divider);
    border-radius: var(--ub-radius-md);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: var(--ub-shadow-card);
    transition: transform var(--ub-transition-base),
                box-shadow var(--ub-transition-base);
}

.ub-complex-list__card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ub-shadow-card-hover);
}

.ub-complex-list__cover {
    aspect-ratio: 16 / 9;
    background: var(--ub-color-section-soft) center / cover no-repeat;
}

/* No cover photo: instead of a flat cream rectangle, lay a faint, centered
   lotus watermark — same dignified empty-state treatment as the tour/hero
   placeholders. The pseudo-element keeps the cream background solid while
   only the lotus mark stays faint. */
.ub-complex-list__cover--empty {
    position: relative;
}

.ub-complex-list__cover--empty::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../../images/public/icons/lotus-2Rt0ZoN.png") center / 24% no-repeat;
    opacity: 0.18;
}

.ub-complex-list__body {
    padding: var(--ub-space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--ub-space-s);
}

.ub-complex-list__name {
    margin: 0;
    font-size: var(--ub-text-xl);
    font-weight: 600;
    color: var(--ub-color-heading);
}

.ub-complex-list__address {
    margin: 0;
    font-size: var(--ub-text-sm);
    color: var(--ub-color-body-muted);
    line-height: var(--ub-leading-snug);
}
