/* Галерея gizoom.online — палитра как у сайта. */
:root {
  color-scheme: dark;
  --bg: #11110f; --panel: #191916; --line: #343026; --line-soft: #25231e;
  --text: #e8dfce; --muted: #aaa18f; --dim: #777061;
  --accent: #d3ad55; --accent-hot: #f0d27a; --accent-dark: #8d6b2e;
  --serif: Georgia, "Times New Roman", serif; --max: 1360px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--serif); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-hot); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Верхняя строка (закреплённая) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 11, 10, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__inner {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 0;
}
.topbar__brand { font-family: var(--serif); font-size: 16px; letter-spacing: 0.02em; color: var(--text); }
.topbar__brand:hover { color: var(--accent-hot); text-decoration: none; }
.topbar__links { margin-left: auto; display: flex; gap: 22px; font-size: 15px; }
.topbar__links a { color: var(--muted); transition: color 0.18s ease; }
.topbar__links a:hover { color: var(--accent-hot); text-decoration: none; }
.topbar__links a.is-active {
  background: linear-gradient(100deg, var(--accent-dark), var(--accent-hot) 42%, #fff1a3 50%, var(--accent) 64%, var(--accent-dark));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: topbar-shimmer 4.5s linear infinite;
}
@keyframes topbar-shimmer { to { background-position: 220% center; } }

.g-main { max-width: var(--max); margin: 0 auto; padding: 30px 22px 10px; }
.g-main h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 8px;
  background: linear-gradient(100deg, var(--accent-dark), var(--accent-hot) 42%, #fff1a3 50%, var(--accent) 64%, var(--accent-dark));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.g-lead { color: var(--muted); margin: 0 0 22px; }
.g-empty { color: var(--dim); }

/* Фильтры по книгам */
.g-filters { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 34px; }
.g-chip {
  font: inherit; font-size: 13px; cursor: pointer;
  color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 15px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.g-chip span { color: var(--dim); }
.g-chip:hover { color: var(--accent-hot); border-color: var(--accent-dark); }
.g-chip.is-active { color: #11110f; background: var(--accent); border-color: var(--accent); }
.g-chip.is-active span { color: #4a3a13; }

.g-book { margin: 0 0 42px; scroll-margin-top: 70px; }
.g-book h2 {
  font-size: 1.4rem; color: var(--accent); margin: 0 0 16px;
  border-bottom: 1px solid var(--line-soft); padding-bottom: 8px;
}
.g-count { color: var(--dim); font-size: 0.8rem; }

.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.g-tile {
  display: block; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 10px;
  border: 1px solid var(--line-soft); background: var(--panel); cursor: zoom-in;
}
.g-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.g-tile:hover img { transform: scale(1.05); }
.g-extra { display: none; }
.g-book.is-open .g-extra { display: block; }

.g-more {
  font: inherit; margin-top: 16px; cursor: pointer;
  color: var(--accent-hot); background: transparent;
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 18px;
  transition: border-color 0.18s ease;
}
.g-more:hover { border-color: var(--accent-dark); }
.g-book.is-open .g-more { display: none; }

.g-foot { max-width: var(--max); margin: 40px auto 0; padding: 18px 22px; border-top: 1px solid var(--line-soft); color: var(--dim); font-size: 0.92rem; }

/* Лайтбокс */
.lb { position: fixed; inset: 0; background: rgba(8, 8, 7, 0.94); display: flex; align-items: center; justify-content: center; z-index: 50; }
.lb[hidden] { display: none; }
.lb-img { max-width: 92vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6); }
.lb-close, .lb-nav {
  position: absolute; background: rgba(25, 25, 22, 0.7); color: var(--text);
  border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
  width: 48px; height: 48px; font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.lb-close:hover, .lb-nav:hover { color: var(--accent-hot); border-color: var(--accent); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .lb-nav { width: 40px; height: 40px; }
  .topbar__links { gap: 14px; font-size: 14px; }
  .g-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
