/* «Кострома в картинах»: залы, стена, этикетки, просмотр */
.hall { padding-bottom: 34px; }
.hall + .hall { margin-top: 10px; }
.hall__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding-top: 30px; padding-bottom: 22px; flex-wrap: wrap; }
.hall__num { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 50%; background: var(--red); color: #FFFDF8; font-family: var(--font-display); font-size: 1.25rem; margin-bottom: 10px; }
.hall__head h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.1; margin: 0 0 8px; }
.hall__head p { max-width: 62ch; margin: 0; color: var(--muted); font-size: .98rem; line-height: 1.6; }
.hall__wall { position: relative; overflow: hidden; background: #16333D; background-image: radial-gradient(ellipse 60% 70% at 20% 0%, rgba(255, 236, 196, .16), transparent 70%), radial-gradient(ellipse 60% 70% at 80% 0%, rgba(255, 236, 196, .14), transparent 70%); padding: 54px 20px 46px; }
/* Развеска: все рамки одного размера висят по одной линии, подписи под ними — ровной строкой; неполный ряд стоит по центру */
.hall__row { display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center; gap: 30px 28px; max-width: 1240px; margin: 0 auto; }
.hall__floor { height: 22px; background: linear-gradient(180deg, #5B3F27, #3E2A19); border-top: 1px solid rgba(255, 255, 255, .08); }
.paint { margin: 0; flex: 0 1 clamp(220px, 21vw, 280px); display: flex; flex-direction: column; color: #F1E7D2; cursor: zoom-in; outline: none; }
.hall__row--few .paint { flex-basis: clamp(280px, 33vw, 440px); }
.paint__frame { display: block; padding: 9px; background: linear-gradient(135deg, #D9B65B, #8A6423 45%, #D9B65B 60%, #7A5819); box-shadow: 0 0 0 2px #4A3510, 0 22px 30px -10px rgba(0, 0, 0, .65), inset 0 0 0 1px rgba(255, 255, 255, .25); transition: transform .2s var(--ease), box-shadow .2s; }
/* паспарту: одинаковые поля вокруг любой картины — вертикальной или широкой */
.paint__mat { display: block; aspect-ratio: 5 / 4; padding: 7%; background: linear-gradient(135deg, #F2E9D5, #E6D9BC); box-shadow: inset 0 0 0 1px rgba(74, 53, 16, .25); }
.paint__mat img { width: 100%; height: 100%; object-fit: contain; background: #0E1C22; box-shadow: 0 0 0 1px rgba(36, 29, 22, .4), 0 8px 18px rgba(0, 0, 0, .28); }
.paint:hover .paint__frame, .paint:focus-visible .paint__frame { transform: translateY(-4px); box-shadow: 0 0 0 2px #4A3510, 0 30px 38px -10px rgba(0, 0, 0, .75), 0 0 0 4px rgba(228, 196, 118, .45); }
.paint__label { flex: 1 0 auto; margin-top: 16px; padding: 10px 12px; min-height: 112px; width: 100%; background: #F4EDDF; color: var(--ink); border-radius: 4px; font-size: .84rem; line-height: 1.35; text-align: center; }
.paint__label b { display: block; font-size: .88rem; }
.paint__label i { display: block; font-family: var(--font-read); }
.paint__label span { display: block; margin-top: 3px; color: var(--muted); font-size: .78rem; }
.hall__hint { margin: 18px auto 0; max-width: 1240px; text-align: center; font-size: .82rem; color: rgba(241, 231, 210, .7); }

/* Просмотр картины */
.lb { position: fixed; inset: 0; z-index: 900; display: none; background: rgba(9, 18, 22, .96); color: #F1E7D2; }
.lb.is-open { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.lb__stage { position: relative; display: grid; place-items: center; overflow: hidden; min-height: 0; touch-action: none; }
.lb__img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .25s var(--ease); transform-origin: center; cursor: zoom-in; user-select: none; -webkit-user-drag: none; }
.lb.is-zoom .lb__img { transform: scale(2.4); cursor: zoom-out; transition: none; }
.lb__bar { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: .82rem; color: rgba(241, 231, 210, .8); pointer-events: none; }
.lb__bar span { background: rgba(9, 18, 22, .7); padding: 5px 10px; border-radius: 999px; pointer-events: auto; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(241, 231, 210, .35); background: rgba(9, 18, 22, .6); color: #F1E7D2; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.lb__nav:hover { background: var(--red); border-color: var(--red); }
.lb__nav--prev { left: 14px; } .lb__nav--next { right: 14px; }
.lb__nav .ico { width: 22px; height: 22px; }
.lb__side { overflow: auto; padding: 26px 26px 30px; background: #102229; border-left: 1px solid rgba(241, 231, 210, .14); }
.lb__x { position: sticky; top: 0; float: right; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(241, 231, 210, .3); background: rgba(241, 231, 210, .08); color: #F1E7D2; display: grid; place-items: center; cursor: pointer; }
.lb__x:hover { background: var(--red); border-color: var(--red); }
.lb__kicker { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-2); }
.lb__title { color: var(--gold-2); font-family: var(--font-read); font-style: italic; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.18; margin: 8px 0 4px; }
.lb__artist { color: #F1E7D2; font-family: var(--font-display); font-size: 1.3rem; margin: 0 0 14px; }
.lb__meta { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 0 0 16px; font-size: .88rem; }
.lb__meta dt { color: rgba(241, 231, 210, .6); }
.lb__meta dd { margin: 0; }
.lb__text p { font-family: var(--font-read); font-size: 1rem; line-height: 1.7; margin: 0 0 12px; }
.lb__credit { margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(241, 231, 210, .2); font-size: .8rem; line-height: 1.5; color: rgba(241, 231, 210, .7); }
.lb__credit a { color: var(--gold-2); }
.lb__tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.lb__tools button { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(241, 231, 210, .3); background: transparent; color: #F1E7D2; font: 600 .82rem var(--font-ui); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.lb__tools button:hover { background: rgba(241, 231, 210, .12); }
.lb__tools .ico { width: 16px; height: 16px; }

.gal-nav { position: sticky; top: var(--header-h); z-index: 15; background: var(--paper); border-bottom: 1px solid var(--line); }
.gal-nav .chips { overflow-x: auto; scrollbar-width: none; }
.gal-intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gal-intro article { padding: 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.gal-intro .ico { width: 26px; height: 26px; color: var(--red); }
.gal-intro h3 { margin: 8px 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; }
.gal-intro p { margin: 0; font-size: .94rem; line-height: 1.6; color: var(--muted); }

@media (max-width: 900px) {
  .lb.is-open { grid-template-columns: 1fr; grid-template-rows: minmax(0, 52vh) minmax(0, 1fr); }
  .lb__side { border-left: 0; border-top: 1px solid rgba(241, 231, 210, .14); }
  .lb__nav { top: auto; bottom: 50px; transform: none; width: 40px; height: 40px; }
  .gal-intro { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .paint { flex-basis: clamp(200px, 29vw, 270px); }
}
@media (max-width: 640px) {
  .hall__wall { overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; padding: 34px 16px 30px; }
  .hall__row, .hall__row--few { flex-wrap: nowrap; justify-content: flex-start; gap: 18px; max-width: none; }
  .paint, .hall__row--few .paint { flex: none; width: 216px; }
  .paint__label { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .lb__img, .paint__frame { transition: none; }
}
