/* sdamp.synlink:gallery.list — default template (task 14d-c-part2 redesign).
   Compound filter bar (no labels, no borders) + tile overlay caption. */

.sdamp-gallery {
    padding: 1.5rem 0;
    box-sizing: border-box;
}

.sdamp-gallery *,
.sdamp-gallery *::before,
.sdamp-gallery *::after {
    box-sizing: border-box;
}

.sdamp-gallery__empty {
    color: #777;
    text-align: center;
    padding: 3rem 1rem;
    font-size: 1rem;
}

/* task 14l — счётчик альбомов/фото над фильтр-баром */
.sdamp-gallery__stats {
    margin: 0 0 1rem;
    color: #777;
    font-size: 0.95rem;
}

/* ============================================================================
   Grid + tiles (overlay caption: title/date/foto-count поверх cover внизу)
   ============================================================================ */

/* task 17 A3: единый breakpoint 768px вместо 3-х независимых стадий (auto-fill
 * minmax(280px,1fr) → ≤600 minmax(170px,1fr) → ≤380 1fr → ≥900 3-col). Старая
 * лесенка давала «сжатый текст в плитке» на 600-900px из-за 2-col стадии.
 * Теперь: ≤768 → 1 col (mobile), ≥769 → 3 col fixed (desktop).
 */
.sdamp-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sdamp-gallery__tile {
    /* position: relative — anchor для fs-btn (task 17 C1, sibling of <a>). */
    position: relative;
    background: #1c1c1c;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: block;
}

.sdamp-gallery__tile:hover,
.sdamp-gallery__tile:focus-within {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transform: translateY(-2px);
}

.sdamp-gallery__link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.sdamp-gallery__link:hover,
.sdamp-gallery__link:focus {
    text-decoration: none;
    color: inherit;
}

.sdamp-gallery__cover {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sdamp-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}
.sdamp-gallery__tile:hover .sdamp-gallery__image { transform: scale(1.04); }
.sdamp-gallery__link:active { transform: scale(0.98); opacity: 0.92; }

.sdamp-gallery__placeholder {
    font-size: 3rem;
    opacity: 0.3;
    user-select: none;
    color: #fff;
}

/* task 17 C2: новая компоновка тайла.
 *   - .sdamp-gallery__meta-tl   — top-left, тёмная scrim-подложка, count+date+photographer
 *   - .sdamp-gallery__fs-btn    — top-right, scrim + ⤢, открывает lightbox (sibling <a>)
 *   - .sdamp-gallery__title-overlay — bottom, градиент, только title
 */

.sdamp-gallery__meta-tl {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    max-width: calc(100% - 4rem);  /* не наезжать на fs-btn TR */
    padding: 0.4rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.3;
    pointer-events: none;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
.sdamp-gallery__meta-tl .sdamp-gallery__count {
    color: #fff;
    font-weight: 600;
}
.sdamp-gallery__meta-tl .sdamp-gallery__date {
    color: rgba(255, 255, 255, 0.88);
}
.sdamp-gallery__meta-tl .sdamp-gallery__photographer {
    color: rgba(255, 255, 255, 0.82);
    font-style: italic;
    font-size: 0.78rem;
    margin-top: 0.05rem;
}

.sdamp-gallery__title-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3rem 1.1rem 1rem;
    color: #fff;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.45) 50%,
        rgba(0, 0, 0, 0.85) 100%
    );
    pointer-events: none;
}

.sdamp-gallery__title {
    margin: 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Fullscreen button — task 17 C1. Sibling of <a>, абсолютно поверх tile TR.
 * Site-template sdamp.ru button reset нужен (рассмотрено в errors-log 2026-05-13
 * — global button rule с pill-фоном + transition транзишены). */
.sdamp-gallery__tile .sdamp-gallery__fs-btn,
.sdamp-gallery__tile .sdamp-gallery__fs-btn:hover,
.sdamp-gallery__tile .sdamp-gallery__fs-btn:focus,
.sdamp-gallery__tile .sdamp-gallery__fs-btn:active,
.sdamp-gallery__tile .sdamp-gallery__fs-btn:disabled {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.55) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 4 !important;
    backdrop-filter: blur(2px) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    transition: background 0.15s ease !important;
    font-family: inherit !important;
    text-transform: none !important;
}
.sdamp-gallery__tile .sdamp-gallery__fs-btn:hover,
.sdamp-gallery__tile .sdamp-gallery__fs-btn:focus {
    background: rgba(0, 0, 0, 0.75) !important;
    color: #fff !important;
}
.sdamp-gallery__tile .sdamp-gallery__fs-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85) !important;
}
.sdamp-gallery__tile .sdamp-gallery__fs-btn::before,
.sdamp-gallery__tile .sdamp-gallery__fs-btn::after {
    content: none !important;
    display: none !important;
}
.sdamp-gallery__tile .sdamp-gallery__fs-btn svg {
    width: 22px !important;
    height: 22px !important;
    display: block !important;
    fill: none !important;
    stroke: currentColor !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)) !important;
}
.sdamp-gallery__tile .sdamp-gallery__fs-btn:active {
    transform: scale(0.92) !important;
}

/* ============================================================================
   Lazy-load sentinel + loader
   ============================================================================ */

.sdamp-gallery__sentinel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    margin: 1rem 0 0.25rem;
    color: #888;
}
.sdamp-gallery__sentinel[hidden] { display: none; }

.sdamp-gallery__loader {
    display: inline-block;
    font-size: 1.4rem;
    opacity: 0.55;
    animation: sdamp-gallery-pulse 1.4s ease-in-out infinite;
}

@keyframes sdamp-gallery-pulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50%      { opacity: 0.85; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
    .sdamp-gallery__loader { animation: none; }
}

/* ============================================================================
   Paginator
   ============================================================================ */

.sdamp-gallery__paginator {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin: 1.75rem 0 0.5rem;
    padding: 0;
}
.sdamp-gallery__paginator[hidden] { display: none; }

.sdamp-gallery__paginator-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid #d6d6d6;
    border-radius: 4px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sdamp-gallery__paginator-link:hover,
.sdamp-gallery__paginator-link:focus {
    background: #f3f3f3;
    border-color: #b0b0b0;
    color: #111;
    text-decoration: none;
    outline: none;
}
.sdamp-gallery__paginator-link:focus-visible {
    box-shadow: 0 0 0 2px rgba(10, 100, 164, 0.35);
}
.sdamp-gallery__paginator-link.is-current {
    background: #0a64a4;
    border-color: #0a64a4;
    color: #fff;
    pointer-events: none;
    cursor: default;
}
.sdamp-gallery__paginator-link--prev,
.sdamp-gallery__paginator-link--next {
    font-size: 1.15rem;
    padding: 0.3rem 0.7rem;
}

/* ============================================================================
   Filter bar (task 14d-c-part2 redesign — compound rounded box).

   Структура:
     .sdamp-filters                 — form wrapper (margin: 0 0 1.5rem)
     .sdamp-filters__bar            — single rounded white container
       .sdamp-filters__cell--author — <select> + reset ×
       .sdamp-filters__cell--period — icon-btn + chip-если-выбран + popover
       .sdamp-filters__cell--search — <input search>

   Палитра — neutral (background white, border #d6d6d6, text #2a1f17). Цвета
   обсуждаемы — приоритет на структуру, не на акценты.
   ============================================================================ */

.sdamp-filters {
    margin: 0 0 1.5rem;
}

/* Site-template sdamp.ru ставит свой button skin (тёмный фон + box-shadow +
   red hover oval) И italic + text-shadow на текстовых элементах — нейтрализуем
   всё это для наших button'ов и cell-текстов внутри фильтра.
   Конкретные стили ниже переопределяют — все с !important для победы над
   специфичностью site-template. */
.sdamp-filters button,
.sdamp-filters button:hover,
.sdamp-filters button:focus,
.sdamp-filters button:active,
.sdamp-filters button:disabled,
.sdamp-filters button[disabled] {
    background: transparent !important;
    background-image: none !important;
    background-color: transparent !important;
    color: inherit !important;
    border: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    min-width: 0 !important;
    width: auto !important;
    font-family: inherit !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-style: normal !important;
    /* Site-template на hover вешает transform/animation/transition — глушим
       чтобы не мерцал размер. */
    transform: none !important;
    animation: none !important;
    filter: none !important;
}
.sdamp-filters,
.sdamp-filters * {
    font-style: normal !important;
    text-shadow: none !important;
}

/* Site-template добавляет ::before/::after с icon-content и/или background-image
   на наших button'ах (виден дубль × у крестиков). Полностью убираем pseudo-elements. */
.sdamp-filters button::before,
.sdamp-filters button::after,
.sdamp-filters .sdamp-filters__cell-reset::before,
.sdamp-filters .sdamp-filters__cell-reset::after,
.sdamp-filters .sdamp-filters__period-chip-reset::before,
.sdamp-filters .sdamp-filters__period-chip-reset::after,
.sdamp-filters .sdamp-filters__period-close::before,
.sdamp-filters .sdamp-filters__period-close::after,
.sdamp-filters .sdamp-filters__period-cell::before,
.sdamp-filters .sdamp-filters__period-cell::after {
    content: none !important;
    display: none !important;
    background: none !important;
    background-image: none !important;
}

.sdamp-filters__bar {
    display: flex;
    align-items: stretch;
    background: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    overflow: visible;  /* popover может вылезать за границы */
    min-height: 54px;
}

.sdamp-filters__cell {
    position: relative;
    display: flex;
    align-items: center;
    border-right: 1px solid #ececec;
    min-width: 0;
}

.sdamp-filters__cell:last-child {
    border-right: 0;
}

/* --- Cell: author -------------------------------------------------------- */

.sdamp-filters__cell--author {
    flex: 0 0 auto;
    padding: 0 1rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 320px;
}

select.sdamp-filters__select {
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    border: 0;
    background: transparent;
    color: #2a1f17;
    font: inherit;
    font-size: 1.05rem;
    line-height: 1.2;
    padding: 0.8rem 1rem 0.8rem 1.5rem;
    flex: 0 0 auto;
    min-width: 180px;
    max-width: 100%;
    min-height: 54px;
    cursor: pointer;
    outline: none;
}

select.sdamp-filters__select:focus { outline: none; }

/* Site-template sdamp.ru подгружает jQuery-jqselect, который оборачивает любой
   <select> своим skin-wrapper'ом (jq-selectbox) с hardcoded placeholder "Выберите...".
   Отключаем skin на наших фильтрах — восстанавливаем native поведение через CSS. */
.sdamp-filters .jq-selectbox {
    display: block !important;
    position: relative !important;
    z-index: auto !important;
    width: 100%;
}
.sdamp-filters .jq-selectbox > .jq-selectbox__select,
.sdamp-filters .jq-selectbox > .jq-selectbox__dropdown {
    display: none !important;
}
.sdamp-filters .jq-selectbox > select.sdamp-filters__select {
    position: static !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    min-height: 54px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0.8rem 1rem 0.8rem 1.5rem !important;
    left: auto !important;
    top: auto !important;
    pointer-events: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    flex: 0 0 auto !important;
}
/* JQ skin копирует класс sdamp-filters__select на wrapper-div. Чтобы div НЕ
   получил padding/min-height/etc от .sdamp-filters__select правила, специфицируем
   правила на select.sdamp-filters__select. А wrapper-стили задаём здесь. */
.sdamp-filters .jq-selectbox.sdamp-filters__select,
.sdamp-filters div.sdamp-filters__select.jq-selectbox {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    width: max-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}

.sdamp-filters__cell--author.has-value .sdamp-filters__select {
    padding-right: 2.2rem;  /* место под × reset */
}

.sdamp-filters .sdamp-filters__cell-reset {
    position: static !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    background: #58433E !important;
    background-color: #58433E !important;
    color: #fff !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 22px !important;
    max-width: 22px !important;
    height: 22px !important;
    max-height: 22px !important;
    min-height: 0 !important;
    flex: 0 0 22px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s !important;
}
.sdamp-filters .sdamp-filters__cell-reset:hover {
    background: #7d1818 !important;
    background-color: #7d1818 !important;
    color: #fff !important;
    width: 22px !important;
    height: 22px !important;
    padding: 0 !important;
}
.sdamp-filters .sdamp-filters__cell-reset svg { display: block; }
.sdamp-filters .sdamp-filters__cell-reset[hidden] { display: none !important; }

/* --- Cell: period -------------------------------------------------------- */

.sdamp-filters__cell--period {
    flex: 0 0 auto;
    padding: 0 0.4rem 0 0.6rem;
    gap: 0.5rem;
}

.sdamp-filters .sdamp-filters__period-icon-btn {
    color: #2a1f17 !important;
    cursor: pointer !important;
    padding: 0.8rem 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 54px !important;
    transition: color 0.15s, background 0.15s !important;
    border-radius: 0 !important;
}
.sdamp-filters .sdamp-filters__period-icon-btn:hover { background: #fafafa !important; color: #000 !important; }
.sdamp-filters .sdamp-filters__period-icon-btn:focus-visible { outline: 2px solid #0a64a4 !important; outline-offset: -2px !important; }

.sdamp-filters .sdamp-filters__cell--period.is-open .sdamp-filters__period-icon-btn {
    background: #f5f5f5 !important;
}

.sdamp-filters__period-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1ede4;
    color: #2a1f17;
    border-radius: 999px;
    padding: 0.4rem 0.55rem 0.4rem 1rem;
    font-size: 0.95rem;
    line-height: 1;
    margin-right: 0.6rem;
    white-space: nowrap;
}
.sdamp-filters__period-chip[hidden] { display: none; }

.sdamp-filters__period-chip-text {
    color: inherit;
}

.sdamp-filters .sdamp-filters__period-chip-reset {
    box-sizing: border-box !important;
    background: #58433E !important;
    background-color: #58433E !important;
    color: #fff !important;
    cursor: pointer !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 20px !important;
    max-width: 20px !important;
    height: 20px !important;
    max-height: 20px !important;
    min-height: 0 !important;
    flex: 0 0 20px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.15s !important;
    transform: none !important;
}
.sdamp-filters .sdamp-filters__period-chip-reset:hover {
    background: #7d1818 !important;
    background-color: #7d1818 !important;
    color: #fff !important;
    width: 20px !important;
    height: 20px !important;
    padding: 0 !important;
    transform: none !important;
}
.sdamp-filters .sdamp-filters__period-chip-reset svg { display: block; }

/* --- Cell: search -------------------------------------------------------- */

.sdamp-filters__cell--search {
    flex: 1 1 auto;
    padding: 0.55rem 0.7rem;
    display: flex;
    align-items: center;
}

.sdamp-filters__search-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.sdamp-filters .sdamp-filters__cell-reset--search,
.sdamp-filters .sdamp-filters__cell-reset--search:hover,
.sdamp-filters .sdamp-filters__cell-reset--search:focus,
.sdamp-filters .sdamp-filters__cell-reset--search:active {
    position: absolute !important;
    right: 0.6rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    z-index: 2 !important;
}

.sdamp-filters .sdamp-filters__input {
    -webkit-appearance: none !important;
    appearance: none !important;
    border: 1px solid transparent !important;
    background: #f8f5ef !important;
    background-color: #f8f5ef !important;
    color: #2a1f17 !important;
    font: inherit !important;
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
    padding: 0.65rem 2.6rem 0.65rem 1rem !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 42px !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
    outline: none !important;
    flex: 1 1 auto !important;
    transition: background 0.2s, box-shadow 0.2s !important;
}

/* Скрыть native search cancel button — используем кастомный × */
.sdamp-filters .sdamp-filters__input::-webkit-search-cancel-button,
.sdamp-filters .sdamp-filters__input::-webkit-search-decoration {
    -webkit-appearance: none !important;
    appearance: none !important;
    display: none !important;
}
.sdamp-filters .sdamp-filters__input:hover {
    background: #fff !important;
    background-color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10) !important;
}
.sdamp-filters .sdamp-filters__input:focus {
    background: #fff !important;
    background-color: #fff !important;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.06),
        inset 0 1px 6px rgba(0, 0, 0, 0.10),
        inset 0 0 12px rgba(0, 0, 0, 0.04) !important;
}

.sdamp-filters .sdamp-filters__input::placeholder {
    color: rgba(42, 31, 23, 0.42);
}

.sdamp-filters__input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background:
        linear-gradient(45deg, transparent 6px, currentColor 6px, currentColor 8px, transparent 8px),
        linear-gradient(-45deg, transparent 6px, currentColor 6px, currentColor 8px, transparent 8px);
    color: #888;
    cursor: pointer;
    opacity: 0.7;
}
.sdamp-filters__input::-webkit-search-cancel-button:hover { opacity: 1; color: #333; }

/* ============================================================================
   Period popover (year-grid → month-grid)
   ============================================================================ */

.sdamp-filters__period-pop {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    min-width: 280px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
    padding: 1rem 1.1rem 0.9rem;
    z-index: 50;
}
.sdamp-filters__period-pop[hidden] { display: none; }

.sdamp-filters .sdamp-filters__period-close {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 5 !important;
    box-sizing: border-box !important;
    color: #888 !important;
    font-size: 1.4rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 28px !important;
    max-width: 28px !important;
    height: 28px !important;
    max-height: 28px !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: background 0.15s, color 0.15s !important;
    transform: none !important;
}
.sdamp-filters .sdamp-filters__period-close:hover {
    background: #f1f1f1 !important;
    color: #333 !important;
    width: 28px !important;
    height: 28px !important;
    transform: none !important;
    padding: 0 !important;
}

.sdamp-filters__period-heading,
.sdamp-filters__period-subheading {
    font-size: 0.9rem;
    color: #2a1f17;
    text-align: center;
    font-weight: 600;
    margin: 0 1.5rem 0.75rem;
    line-height: 1.3;
}

.sdamp-filters__period-subheading {
    font-weight: 500;
    color: rgba(42, 31, 23, 0.65);
    margin-top: 0.1rem;
    margin-bottom: 0.85rem;
}

.sdamp-filters__period-year-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #2a1f17;
    text-align: center;
    margin: 0 1.5rem 0.2rem;
    cursor: pointer;
    user-select: none;
    line-height: 1.3;
}
.sdamp-filters__period-year-heading:hover { color: #7d1818; }

.sdamp-filters__period-grid {
    display: grid;
    gap: 0.35rem 0.5rem;
}

.sdamp-filters__period-grid--year {
    grid-template-columns: repeat(3, 1fr);
    /* >12 cells → scroll. Высота на 4 row (48px*4 + gaps) */
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.2rem;
}

.sdamp-filters__period-grid--month {
    grid-template-columns: repeat(3, 1fr);
}

.sdamp-filters .sdamp-filters__period-cell {
    color: #2a1f17 !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    padding: 0.55rem 0.4rem !important;
    border-radius: 6px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    transition: background 0.12s, color 0.12s !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
}
.sdamp-filters .sdamp-filters__period-cell:hover:not([disabled]) {
    background: #f1ede4 !important;
    color: #7d1818 !important;
}
.sdamp-filters .sdamp-filters__period-cell.is-selected {
    background: #2a1f17 !important;
    color: #fff !important;
}
.sdamp-filters .sdamp-filters__period-cell.is-disabled,
.sdamp-filters .sdamp-filters__period-cell[disabled],
.sdamp-filters button.sdamp-filters__period-cell:disabled {
    background: transparent !important;
    background-color: transparent !important;
    color: rgba(42, 31, 23, 0.30) !important;
    font-weight: 500 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.sdamp-filters__period-cell--year {
    font-variant-numeric: tabular-nums lining-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ============================================================================
   Mobile responsive (task 17 A1 + A3): единая точка 768px для filter+grid.
   Mockup priangle:
     ┌──────────────────────────────────┐
     │ [Фотограф ▼]              [📅]  │  row 1: author + period icon
     │ [Поиск...]                       │  row 2: search full-width
     │  [Выбрано: июнь 2023  ✕]         │  chip ниже box-а (если period active)
     │  [grid 1 col тайлы]              │
   Period-chip / period-pop остаются внутри cell--period в DOM, но на mobile
   позиционируются абсолютно относительно __bar (cell теряет position:relative).
   ============================================================================ */

@media (max-width: 768px) {
    /* Grid — 1 колонка, узкий gap. */
    .sdamp-gallery__grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .sdamp-gallery__paginator {
        gap: 0.3rem;
        margin: 1.25rem 0 0.5rem;
    }
    .sdamp-gallery__paginator-link {
        min-width: 2.1rem;
        min-height: 2.1rem;
        padding: 0.3rem 0.45rem;
        font-size: 0.9rem;
    }

    /* Filter form — место под chip когда period выбран. .has-period добавляет JS
       (см. template script) при изменении state + server-side на initial render. */
    .sdamp-filters.has-period {
        margin-bottom: 4rem;
    }

    /* Filter bar — 2-row grid layout по mockup. position:relative — anchor для
       абсолютно-позиционированных chip и pop (cell--period теряет relative). */
    .sdamp-filters__bar {
        display: grid !important;
        position: relative;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "author period"
            "search search";
        border-radius: 12px;
        min-height: 0;
    }
    .sdamp-filters__cell {
        position: static !important;
        border-right: 0;
        border-bottom: 0;
        min-width: 0;
    }
    .sdamp-filters__cell--author {
        grid-area: author;
        max-width: none;
        /* padding-right: 0.8rem — симметрично padding-left иконки календаря в cell--period,
           native select arrow отодвигается от vertical separator (priangle feedback 2026-05-15). */
        padding: 0 0.8rem 0 0;
        /* Vertical separator между «Фотограф» и календарём. */
        border-right: 1px solid #ececec;
        border-bottom: 1px solid #ececec;
        overflow: hidden;
    }
    /* Author select растягивается на всю ширину cell → native arrow уезжает к правому
       краю; симметрично иконке календаря относительно vertical separator. */
    .sdamp-filters__cell--author > select.sdamp-filters__select,
    .sdamp-filters__cell--author .jq-selectbox > select.sdamp-filters__select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 1.2rem !important;
        padding-right: 0.8rem !important;
        box-sizing: border-box !important;
    }
    .sdamp-filters .jq-selectbox.sdamp-filters__select,
    .sdamp-filters div.sdamp-filters__select.jq-selectbox {
        width: 100% !important;
    }
    .sdamp-filters__cell--period {
        grid-area: period;
        /* Симметричный padding относительно separator — calendar icon равноудалён
           от separator (так же как arrow от separator слева). */
        padding: 0 0.8rem;
        border-bottom: 1px solid #ececec;
        justify-content: center;
    }
    .sdamp-filters__cell--search {
        grid-area: search;
        padding: 0.55rem 0.7rem;
    }

    /* Period chip — absolute под bar (cell теперь static → chip relative to bar).
       priangle feedback 2026-05-15: chip ниже от bar (визуально равноудалён),
       левый край на линии с box left edge. */
    .sdamp-filters__period-chip {
        position: absolute !important;
        top: calc(100% + 1rem) !important;
        left: 0 !important;
        right: auto !important;
        margin: 0 !important;
        z-index: 6;
    }

    /* Period popover — full-width под bar на mobile. */
    .sdamp-filters__period-pop {
        top: calc(100% + 0.4rem) !important;
        left: 0.5rem !important;
        right: 0.5rem !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    /* Search input — компактнее в высоту. */
    .sdamp-filters .sdamp-filters__input {
        min-height: 38px !important;
        font-size: 1rem !important;
    }
}
