/* Дополнения к оформлению старой темы: то, что раньше делали модули Drupal */

/* карта в подвале */
.site-map { height: 400px; width: 100%; background: #eef1f4; }

/* сообщения формы заявки */
.lead-form-message { margin: 10px 0; font-size: 15px; }
.lead-form-message:empty { display: none; }
.lead-form-message--ok { color: #1b7f3b; font-weight: 600; padding: 20px 0; text-align: center; }
.lead-form-message--error { color: #c62828; }

/* просмотр картинок с масштабом */
.lightbox { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, .85);
    user-select: none; -webkit-user-select: none; }
.lightbox--open { display: block; }
.lightbox-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    overflow: hidden; touch-action: none; }
.lightbox-stage img { max-width: 90vw; max-height: 80vh; box-shadow: 0 0 30px rgba(0, 0, 0, .5);
    cursor: zoom-in; transform-origin: center center; will-change: transform; }
.lightbox--zoomed .lightbox-stage img { cursor: grab; }
.lightbox--dragging .lightbox-stage img { cursor: grabbing; }
.lightbox > button { position: absolute; z-index: 2; background: none; border: 0; color: #fff; cursor: pointer;
    font-size: 48px; line-height: 1; padding: 10px 18px; opacity: .8; }
.lightbox > button:hover { opacity: 1; }
.lightbox-close { top: 10px; right: 10px; }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox--single .lightbox-prev, .lightbox--single .lightbox-next { display: none; }
.lightbox-count { position: absolute; z-index: 2; top: 22px; left: 0; right: 0; text-align: center; color: #fff;
    font-size: 14px; pointer-events: none; }
.lightbox-toolbar { position: absolute; z-index: 2; bottom: 18px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 4px; padding: 6px 10px; border-radius: 6px; background: rgba(40, 40, 40, .8); }
.lightbox-toolbar button { background: none; border: 0; padding: 6px; cursor: pointer; opacity: .85; line-height: 0; }
.lightbox-toolbar button:hover { opacity: 1; }
.lightbox-toolbar svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 575.98px) {
    .lightbox-stage img { max-width: 100vw; max-height: 75vh; }
    .lightbox-prev, .lightbox-next { display: none; }
}

/*
 * Одинаковые блоки с картинками. Размер блока — как у стилей картинок старого сайта (aspect-ratio),
 * картинка ВПИСЫВАЕТСЯ в блок целиком (object-fit: contain) — ничего не обрезается, поля — белые.
 */
.catalog-teaser-image img,
.product-picture img,
.views-view-grid .node--view-mode-teaser .field--name-field-image img,
.node--type-event.node--view-mode-teaser .field--name-field-image img,
.node--type-article.node--view-mode-teaser .field--name-field-image img,
.paragraph--type--gallery-work .field__item img,
.node--view-mode-full .field--name-field-gallery .field__item img {
    display: block; width: 100%; height: auto; object-fit: contain; object-position: center; background: #fff;
}
.catalog-teaser-image img { aspect-ratio: 286 / 300; }                                   /* catalog_teaser */
.views-view-grid .node--type-client .field--name-field-image img { aspect-ratio: 258 / 200; }   /* client_logo */
.views-view-grid .node--type-partner .field--name-field-image img { aspect-ratio: 300 / 200; }  /* partner_logo */
.node--type-event.node--view-mode-teaser .field--name-field-image img { aspect-ratio: 720 / 470; }   /* event */
.node--type-article.node--view-mode-teaser .field--name-field-image img { aspect-ratio: 383 / 250; } /* article */
.node--view-mode-full:not(.service) .field--name-field-gallery .field__item img { aspect-ratio: 4 / 3; } /* галерея мероприятия */
.service .paragraph--type--gallery-work .field__item img { aspect-ratio: 390 / 520; }   /* gallery_work (главная) */
/* карточка товара: как у оригинала — картинка на всю рамку высотой 230 (на телефоне 150) */
.product-picture img { aspect-ratio: auto; height: 230px; }
@media (max-width: 500px) { .product-picture img { height: 150px; } }

/* заказчики и партнёры: карточки одной высоты в ряду, название под логотипом */
.views-view-grid .row > [class*="col-"] { display: flex; }
.views-view-grid .node--view-mode-teaser { display: flex; flex-direction: column; width: 100%; padding-bottom: 50px; }
.views-view-grid .node--view-mode-teaser .field--name-field-image { overflow: hidden; flex-shrink: 0; }
.views-view-grid .node--view-mode-teaser .title { margin-top: 12px; }

/* плитки и карточки каталога одной высоты в ряду */
.catalog-row { align-items: stretch; }
.catalog-col > .catalog-teaser, .catalog-col > .product-teaser { height: 100%; }

/* увеличение при наведении: главная картинка товара целиком в рамке */
.product-gallery-main { overflow: hidden; }
.product-gallery-main img, .product-gallery-thumb img { transition: transform .4s; }
