/* === Studio hero (фото зала на фоне) === */
.studio-hero {
    position: relative;
    min-height: 70vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 140px 0 60px;
    color: #ffffff;
    overflow: hidden;
}

.studio-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.85) 100%);
}

.studio-hero__inner {
    position: relative;
    z-index: 1;
}

.studio-back-link {
    position: absolute;
    top: 100px;
    left: 32px;
    z-index: 2;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: color 0.25s ease;
}

.studio-back-link:hover {
    color: #ffffff;
}

/* Бейдж площади — как «степень» в верхнем правом углу названия */
.studio-hero__area {
    display: inline-block;
    /* Сбрасываем дефолтное смещение <sup> и выравниваем самостоятельно */
    vertical-align: baseline;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.5px;
    text-transform: none;
    white-space: nowrap;
    /* Поджимаем верх к самой верхней точке letter cap */
    margin-top: 0.1em;
}

.studio-hero__title {
    display: inline-flex;
    align-items: flex-start;        /* бейдж прижат к верху названия */
    flex-wrap: wrap;
    column-gap: 14px;
    row-gap: 8px;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 800;
    letter-spacing: 4px;
    line-height: 1;
    margin-bottom: 14px;
    color: #ffffff;
}

.studio-hero__subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 32px;
}

.studio-hero__cta {
    display: inline-flex !important;
}

/* На странице зала шапка тёмная над фото — переопределяем цвет */
.page-studio .site-header:not(.scrolled) .logo,
.page-studio .site-header:not(.scrolled) .nav a,
.page-studio .site-header:not(.scrolled) .nav-dropdown__trigger,
.page-studio .site-header:not(.scrolled) .menu-toggle {
    color: #ffffff;
}

/* === Слайдер галереи (вверху страницы) === */
.studio-slider-section {
    padding: 22px 0 30px;
}

.studio-slider {
    position: relative;
    width: 100%;
    min-width: 0;
}

.studio-slider__stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
}

.studio-slider__main {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}

.studio-slider__counter {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 12px;
    background: rgba(0,0,0,0.55);
    color: #ffffff;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 20px;
    pointer-events: none;
}

.studio-slider__zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.studio-slider__zoom:hover { background: rgba(0,0,0,0.75); }

.studio-slider__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    padding-bottom: 4px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.15s ease, transform 0.15s ease;
}
.studio-slider__nav:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.05);
}
.studio-slider__nav--prev { left: 14px; }
.studio-slider__nav--next { right: 14px; }

.studio-slider__thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding: 4px 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.2) transparent;
}
.studio-slider__thumbs::-webkit-scrollbar { height: 6px; }
.studio-slider__thumbs::-webkit-scrollbar-track { background: transparent; }
.studio-slider__thumbs::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 3px;
}

.studio-slider__thumb {
    flex-shrink: 0;
    width: 110px;
    height: 74px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-soft);
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.studio-slider__thumb:hover {
    opacity: 0.95;
    transform: translateY(-2px);
}
.studio-slider__thumb.is-active {
    opacity: 1;
    border-color: var(--accent);
}
.studio-slider__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* === Секция доп. услуг на всю ширину === */
.studio-services-section {
    background: var(--bg-soft);
    padding: 60px 0 80px;
    border-top: 1px solid var(--border);
    overflow-x: hidden;          /* страховка от горизонтального скролла */
}

.studio-services-section .container {
    max-width: var(--max-width);
}

.studio-services-section__title {
    text-align: left !important;
    margin-bottom: 24px !important;
    font-size: clamp(28px, 3vw, 36px) !important;
}

/* === Двухколоночный sticky-layout: слайдер слева, контент справа === */
.studio-layout {
    padding: 50px 0 60px;
}

/* На странице зала контейнер шире обычного — больше места для фото */
.studio-layout .container {
    max-width: 1640px;
}

.studio-layout__grid {
    display: grid;
    /* Слева — галерея (1fr), справа — текст: фикс. ширина, но не больше 50%.
       minmax(0, 1fr) — иначе img расширяет колонку больше доступного места. */
    grid-template-columns: minmax(0, 1fr) min(50%, 480px);
    gap: 50px;
    align-items: start;          /* критично для sticky */
}

.studio-layout__media,
.studio-layout__content {
    min-width: 0;                /* страховка от переполнения */
}

.studio-layout__media {
    /* Слайдер «залипает» при скролле, пока виден правый столбец.
       top отступает на высоту шапки + небольшой буфер */
    position: sticky;
    top: 90px;
    align-self: start;
}

.studio-layout__content > * + * { margin-top: 14px; }

.studio-layout__title {
    font-size: clamp(28px, 3vw, 36px);
    margin: 32px 0 16px !important;
    text-align: left !important;
}

.studio-subhead {
    font-size: 22px;
    font-weight: 800;
    margin: 48px 0 16px;
    letter-spacing: -0.5px;
}

/* === Prose (формат описаний из БД) === */
.studio-prose {
    color: var(--text);
    font-size: 16px;
    line-height: 1.7;
}

.studio-prose p {
    margin-bottom: 16px;
}

.studio-prose ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.studio-prose ul li {
    position: relative;
    padding: 10px 0 10px 28px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.studio-prose ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18px;
    width: 14px;
    height: 2px;
    background: var(--accent);
}

.studio-prose ul li:last-child {
    border-bottom: none;
}

/* === Доп. услуги: переоформление таблицы из БД под наш дизайн === */
.studio-prose--services {
    overflow-x: hidden;
}

.studio-prose--services table {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    border-collapse: collapse;
    border-spacing: 0 !important;
    background: var(--bg-soft);
    border-radius: 8px;
    overflow: hidden;
    /* fixed-layout — колонки не расширяются под содержимое, текст переносится */
    table-layout: fixed;
}

.studio-prose--services table tr,
.studio-prose--services table .TableGray {
    background: transparent !important;
    transition: background 0.15s ease;
}

.studio-prose--services table tr:hover {
    background: var(--accent-soft) !important;
}

.studio-prose--services table td {
    padding: 14px 20px !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 15px;
    color: var(--text);
    text-align: left !important;
    vertical-align: middle !important;
    line-height: 1.45;
    /* Принудительный перенос длинных слов/строк */
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal !important;
}

/* Левая колонка (название услуги) — забирает основную ширину */
.studio-prose--services table td:first-child {
    width: 65% !important;
}

/* Вторая колонка — цена/значение, выравнивание справа.
   Не nowrap! — если длинный текст («За попередньою домовленістю»), он переносится. */
.studio-prose--services table td:nth-child(2),
.studio-prose--services table td:last-child {
    text-align: right !important;
    font-weight: 700;
    color: var(--accent);
    width: 35% !important;
}

/* Последняя строка — без нижней границы */
.studio-prose--services table tr:last-child td {
    border-bottom: none !important;
}

/* === Price card === */
.price-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
}

.price-card__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 24px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.price-row:last-of-type {
    border-bottom: none;
    margin-bottom: 16px;
}

.price-row__label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-row__hours {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.75;
    font-weight: 400;
}

.price-row__value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.price-row__value small {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 6px;
}

.price-card__cta {
    display: flex !important;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(8, 8, 8, 0.78);
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: lbFade 0.25s ease;
}

/* HTML-атрибут hidden должен убирать лайтбокс — иначе display: flex его перебивает */
.lightbox[hidden] {
    display: none !important;
}

@keyframes lbFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox__modal {
    position: relative;
    width: 100%;
    max-width: 1100px;
    max-height: 88vh;
    background: #111111;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
    animation: lbZoom 0.3s ease;
}

@keyframes lbZoom {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox__stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 64px 8px;
    min-height: 0;
    position: relative;
    background: #0c0c0c;
}

.lightbox__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.lightbox__counter {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    letter-spacing: 1px;
    font-weight: 500;
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    z-index: 2;
    
}

.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

.lightbox__close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 24px;
    line-height: 1;
}

.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;
    padding-bottom: 4px;
}

.lightbox__nav:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

/* Полоса миниатюр */
.lightbox__thumbs {
    flex-shrink: 0;
    height: 96px;
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.lightbox__thumbs::-webkit-scrollbar { height: 6px; }
.lightbox__thumbs::-webkit-scrollbar-track { background: transparent; }
.lightbox__thumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.lightbox__thumb {
    flex-shrink: 0;
    width: 110px;
    height: 82px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    opacity: 0.5;
    transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

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

.lightbox__thumb:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

.lightbox__thumb.is-active {
    opacity: 1;
    border-color: var(--accent);
}

/* === Адаптив для лайтбокса и слайдера === */
@media (max-width: 900px) {
    .lightbox { padding: 16px; }
    .lightbox__modal { max-height: 92vh; border-radius: 8px; }
    .lightbox__stage { padding: 48px 16px 8px; }
    .lightbox__nav { width: 38px; height: 38px; font-size: 24px; }
    .lightbox__nav--prev { left: 8px; }
    .lightbox__nav--next { right: 8px; }
    .lightbox__close { top: 8px; right: 8px; width: 34px; height: 34px; font-size: 22px; }
    .lightbox__thumbs { height: 80px; padding: 10px 12px; }
    .lightbox__thumb { width: 80px; height: 60px; }

    .studio-slider__stage { aspect-ratio: 4 / 3; }
    .studio-slider__nav { width: 38px; height: 38px; font-size: 24px; }
    .studio-slider__thumb { width: 80px; height: 60px; }
}

@media (max-width: 480px) {
    .lightbox { padding: 8px; }
    .lightbox__thumbs { height: 68px; }
    .lightbox__thumb { width: 64px; height: 48px; }

    .studio-slider__thumb { width: 64px; height: 48px; }
}

/* === Адаптив layout зала === */
@media (max-width: 900px) {
    .studio-layout {
        padding: 40px 0 60px;
    }
    .studio-layout__grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .studio-layout__media {
        position: static;          /* отменяем sticky на узких экранах */
    }
}

@media (max-width: 480px) {
    .studio-hero {
        min-height: 55vh;
        padding: 120px 0 40px;
    }
    .studio-hero__title { font-size: 36px; letter-spacing: 2px; }
}
