/* Стили раздела «Альбом памяти»: бенто-сетка работ клиентов, карточка, лайтбокс.
   Вынесены из инлайнового <style> в index.html 09.08, когда тот же раздел понадобился
   посадочной raskrasit-foto.html. Копировать блок второй раз не стали: две копии
   разъезжаются, а сверять их нечем (прецедент albums-section.css).
   Разметку наполняет initMemoryAlbum из design.js. */
.memory-album {
  padding: 80px 0 60px;
  background: var(--bg-alt);
}
.memory-album .container { margin-bottom: 36px; }
/* Бенто-коллаж: размер плитки задаёт 6-цикл nth-child; сумма ячеек цикла = 20
   (5 полных рядов на 4 колонках) — без дыр ТОЛЬКО при числе карточек, кратном 6.
   Пагинация в design.js держит limit=12 под эту кратность; хвост в самом конце
   списка (total не кратен 6) остаётся рваным — это принятая цена масонри.
   Фото кропится под слот (object-position выше центра — лица), полный кадр в лайтбоксе. */
.memory-bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 130px;
  grid-auto-flow: dense;
  gap: 14px;
}
.memory-card {
  position: relative;
  grid-row: span 2;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  cursor: default;
}
.memory-bento .memory-card:nth-child(6n+2) { grid-column: span 2; grid-row: span 3; }
.memory-bento .memory-card:nth-child(6n+4) { grid-row: span 3; }
.memory-bento .memory-card:nth-child(6n+5) { grid-row: span 3; }
.memory-bento .memory-card:nth-child(6n)   { grid-column: span 2; grid-row: span 2; }
.memory-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.memory-card-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.60), rgba(0,0,0,0));
  pointer-events: none;
}
.memory-card-comment {
  font-size: 13px;
  line-height: 1.45;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 2px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.memory-card-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.memory-empty {
  grid-column: 1 / -1;
  padding: 40px 20px;
  color: var(--muted);
  opacity: 0.6;
  font-size: 15px;
}
/* Лайтбокс альбома памяти */
.ma-lb-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  z-index: 4000; padding: 16px;
  animation: maFade 150ms ease-out;
}
@keyframes maFade { from { opacity: 0 } to { opacity: 1 } }
.ma-lb-box {
  position: relative;
  max-width: 520px; width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 20px 20px 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  animation: maPop 160ms ease-out;
}
@keyframes maPop { from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.ma-lb-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none;
  font-size: 18px; color: var(--muted);
  cursor: pointer; line-height: 1;
  padding: 4px 6px;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.ma-lb-close:hover { opacity: 1; }
.ma-lb-img {
  width: 100%; border-radius: 10px;
  object-fit: cover; display: block;
}
.ma-lb-comment {
  font-size: 16px; line-height: 1.55;
  color: var(--fg);
  text-align: center; margin: 0;
}
.ma-lb-meta {
  font-size: 13px; color: var(--muted);
  opacity: 0.6; text-align: center;
}
.memory-album-more {
  text-align: center;
  margin-top: 24px;
}
.btn-more {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--fg);
  padding: 10px 28px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.btn-more:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 600px) {
  .memory-album { padding: 60px 0 40px; }
  .memory-bento {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 110px;
    gap: 8px;
  }
  /* мобильный цикл: 16 ячеек = 8 полных рядов на 2 колонках, тоже без дыр.
     6n задан явно (те же спаны, что на десктопе) — не полагаемся на каскад */
  .memory-bento .memory-card:nth-child(6n+2) { grid-column: span 2; grid-row: span 2; }
  .memory-bento .memory-card:nth-child(6n+4) { grid-row: span 2; }
  .memory-bento .memory-card:nth-child(6n+5) { grid-row: span 2; }
  .memory-bento .memory-card:nth-child(6n)   { grid-column: span 2; grid-row: span 2; }
  .memory-card { border-radius: 10px; }
}
