/* ============================================================
 * Atlas block — masonry grid + filter chips
 * Связан с atlas-block.php / atlas-block.js
 * Использует CSS-переменные темы softstyle (см. assets/css/style.css :root)
 * ============================================================ */

.atlas { padding: 60px 0; background: var(--white); }

.atlas .container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

.atlas__head {
    display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.atlas__head h2,
.atlas__head .h2-like {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 36px; font-weight: 500; line-height: normal;
    color: var(--black); margin: 0; display: inline;
}
.atlas__counter {
    font-family: "Montserrat", sans-serif;
    font-size: 16px; font-weight: 500; color: var(--ss-accent);
    letter-spacing: 0.02em;
}

/* ---- Filters --------------------------------------------------- */
.atlas__filters {
    display: flex; flex-wrap: wrap; gap: 8px 10px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--grey2);
}
.atlas__filters-group {
    display: inline-flex; flex-wrap: wrap; gap: 8px;
    padding-left: 14px; margin-left: 4px;
    border-left: 1px solid var(--grey2);
}
.atlas__filters-group:first-of-type { border-left: 0; padding-left: 0; margin-left: 0; }

.atlas-chip {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; padding: 0 18px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px; font-weight: 500; line-height: 1;
    color: var(--black);
    background: var(--grey);
    border: 1px solid var(--grey2);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}
.atlas-chip:hover { border-color: var(--ss-accent); color: var(--ss-accent); }
.atlas-chip.is-active {
    background: var(--ss-accent);
    border-color: var(--ss-accent);
    color: var(--white);
}
.atlas-chip--reset {
    background: transparent; border-color: var(--black2); color: var(--black2);
    margin-left: auto;
}
.atlas-chip--reset:hover { background: var(--black2); color: var(--white); }

/* ---- Masonry grid --------------------------------------------- */
.atlas__grid {
    column-count: 3;
    column-gap: 20px;
}
@media (max-width: 1199px) { .atlas__grid { column-count: 2; } }
@media (max-width: 767px)  { .atlas__grid { column-count: 1; } }

.atlas-card {
    position: relative;
    margin: 0 0 20px;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    overflow: hidden;
    background: var(--grey);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.atlas-card.is-hidden-pagination,
.atlas-card.is-hidden-filter { display: none; }
.atlas-card.is-fading { opacity: 0; }

.atlas-card img {
    display: block;
    width: 100%; height: auto;
    transition: transform 0.4s ease;
}
.atlas-card:hover img { transform: scale(1.03); }
.atlas-card:hover { box-shadow: 0 12px 28px rgba(34, 34, 34, 0.18); }

.atlas-card figcaption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 14px 16px;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 14px; font-weight: 500; line-height: 1.3;
    color: var(--white);
    background: linear-gradient(180deg, rgba(10, 50, 49, 0) 0%, rgba(10, 50, 49, 0.78) 100%);
    transform: translateY(8px); opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}
.atlas-card:hover figcaption,
.atlas-card:focus-within figcaption { transform: translateY(0); opacity: 1; }

@media (max-width: 767px) {
    .atlas-card figcaption { transform: none; opacity: 1; }
}

/* ---- "Показать ещё" ------------------------------------------ */
.atlas__more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.atlas__more.is-hidden { display: none; }
/* override .btn-white-transparent — в atlas фон белый, поэтому белая рамка+текст невидимы */
.atlas .atlas__more.btn,
.atlas .atlas__more.btn-white-transparent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 260px;
    height: 52px;
    padding: 0 36px;
    background: transparent;
    border: 1px solid var(--black, #222);
    color: var(--black, #222) !important;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 2px;
    cursor: pointer;
    transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}
.atlas .atlas__more.btn:hover,
.atlas .atlas__more.btn-white-transparent:hover {
    background: var(--black, #222);
    color: #fff !important;
    border-color: var(--black, #222);
}
.atlas .atlas__more.btn:before,
.atlas .atlas__more.btn:after,
.atlas .atlas__more.btn-white-transparent:before,
.atlas .atlas__more.btn-white-transparent:after { display: none; }
.atlas__more span[data-more-count] { font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 767px) {
    .atlas .atlas__more.btn,
    .atlas .atlas__more.btn-white-transparent { min-width: 0; width: 100%; height: 48px; padding: 0 24px; font-size: 12px; }
}

.atlas__empty {
    text-align: center;
    margin-top: 32px;
    font-family: "Roboto", Arial, sans-serif;
    color: var(--black);
}

/* ---- Mobile padding ------------------------------------------ */
@media (max-width: 767px) {
    .atlas { padding: 40px 0; }
    .atlas__head h2,
    .atlas__head .h2-like { font-size: 26px; }
    .atlas__filters-group { border-left: 0; padding-left: 0; margin-left: 0; }
}

/* Счётчик в чипе — полупрозрачный, маленький */
.atlas-chip__count { opacity: 0.55; font-weight: 400; margin-left: 2px; font-size: 12px; }
.atlas-chip.is-active .atlas-chip__count { opacity: 0.8; }

/* ---- Clickable card button (2026-04-17 v1.1 — lead-magnet) ---- */
.atlas-card__btn {
    display: block; width: 100%; padding: 0; margin: 0; border: 0;
    background: transparent; color: inherit; font: inherit;
    text-align: left; cursor: pointer; position: relative;
}
.atlas-card__btn:focus-visible { outline: 2px solid var(--ss-accent); outline-offset: 2px; }

.atlas-card__btn::before {
    content: ""; position: absolute; inset: 0;
    background: rgba(10, 50, 49, 0.35); opacity: 0;
    transition: opacity 0.25s ease; pointer-events: none; z-index: 1;
}
.atlas-card__btn:hover::before,
.atlas-card__btn:focus-visible::before { opacity: 1; }

.atlas-card__cta {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    padding: 10px 18px;
    font-family: "Montserrat", sans-serif;
    font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
    color: var(--white); background: var(--ss-accent);
    border-radius: 2px; white-space: nowrap;
    opacity: 0; transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none; z-index: 2;
    box-shadow: 0 6px 18px rgba(10, 50, 49, 0.35);
}
.atlas-card__btn:hover .atlas-card__cta,
.atlas-card__btn:focus-visible .atlas-card__cta {
    opacity: 1; transform: translate(-50%, -50%) scale(1);
}

.atlas-card figcaption { z-index: 2; }

@media (hover: none) { .atlas-card__cta { display: none; } }

/* Кнопка «Показать ещё» не скрывалась после показа всех работ.
   Правило .atlas .atlas__more.btn-white-transparent (три класса, вес 0-3-0)
   с display:inline-flex перебивало .atlas__more.is-hidden (два класса).
   Поднимаем вес правила скрытия. Исправлено 2026-07-29. */
.atlas .atlas__more.btn.is-hidden,
.atlas .atlas__more.btn-white-transparent.is-hidden { display: none; }
