/* Галерея — тот же визуальный ритм, что у каталогов гайдов и новостей. */
.gl-wrap { width: min(1200px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 72px; }
.gl-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.gl-kicker { margin: 0 0 11px; color: var(--gold); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gl-head h1 { margin: 0; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem, 5.4vw, 3.1rem); font-weight: 700; line-height: 1.08; letter-spacing: -.01em; }
.gl-head h1 span { color: var(--gold); }
.gl-lead { max-width: 690px; margin: 10px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
.gl-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.gl-stat { display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(11,19,32,.72); color: var(--muted); font-size: .86rem; backdrop-filter: blur(8px); }
.gl-stat i { color: var(--gold); }
.gl-stat b { color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.gl-upload { flex: 0 0 auto; margin-bottom: 2px; white-space: nowrap; }

.gl-tools { position: sticky; top: 72px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: rgba(10,16,26,.82); backdrop-filter: blur(16px) saturate(1.2); }
.gl-tools-title { display: inline-flex; align-items: center; gap: 9px; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: .98rem; font-weight: 700; }
.gl-tools-title i { color: var(--gold); }
.gl-sort { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.025); }
.gl-sort a { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 700; text-decoration: none; cursor: pointer; transition: color var(--tr), background var(--tr); }
.gl-sort a:hover { color: #fff; }
.gl-sort a.is-on { background: rgba(245,204,0,.13); color: var(--gold); }
.gl-sort a:focus-visible, .gl-like:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 16px; align-items: stretch; }
.gl-grid.is-loading { opacity: .55; pointer-events: none; }
.gl-card { --gl-accent: var(--gold); position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.02)); backdrop-filter: blur(14px); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); transition: transform var(--tr), border-color var(--tr), background var(--tr); }
.gl-card[data-pack="terrafirmagreg"] { --gl-accent: #18d98a; }
.gl-card[data-pack="gto"] { --gl-accent: #e0a030; }
.gl-card[data-pack="stoneblock"] { --gl-accent: #c98aff; }
.gl-card[data-pack="aeronautics"] { --gl-accent: #5fb0ff; }
.gl-card[data-pack="star-technology"] { --gl-accent: #ff9f43; }
.gl-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.17); background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.028)); }
.gl-img { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #0b1320; }
.gl-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,10,18,.35), transparent 36%, rgba(5,10,18,.1)); pointer-events: none; }
.gl-preview { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.gl-preview img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gl-preview:hover img { transform: scale(1.04); }
.gl-preview:focus-visible, .gl-open:focus-visible, .gl-detail-link:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.gl-tag { position: absolute; z-index: 1; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 6px; max-width: calc(100% - 66px); padding: 5px 10px; border: 1px solid color-mix(in srgb, var(--gl-accent) 34%, transparent); border-radius: 999px; background: rgba(8,14,24,.88); color: var(--gl-accent); font-size: .71rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(10px); }
.gl-open { position: absolute; z-index: 2; top: 12px; right: 12px; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: rgba(8,14,24,.75); color: #fff; font-size: 1.1rem; font-weight: 700; text-decoration: none; opacity: .75; transition: opacity var(--tr), transform var(--tr); }
.gl-card:hover .gl-open { opacity: 1; transform: translate(2px,-2px); }
.gl-body { display: flex; flex: 1; flex-direction: column; gap: 9px; min-width: 0; padding: 16px 18px 15px; }
.gl-title { margin: 0; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 1.07rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gl-detail-link { color: inherit; text-decoration: none; }
.gl-detail-link:hover { color: var(--gold); }
.gl-card:hover .gl-title { color: var(--gold); }
.gl-desc { margin: 0; color: #8ea2b6; font-size: .85rem; line-height: 1.55; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gl-foot { display: flex; align-items: center; gap: 9px; min-width: 0; margin-top: auto; padding-top: 13px; padding-right: 60px; border-top: 1px solid rgba(255,255,255,.06); }
.gl-avatar { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: color-mix(in srgb, var(--gl-accent) 13%, #0b1320); color: var(--gl-accent); font-family: 'Space Grotesk', sans-serif; font-size: .82rem; font-weight: 800; text-transform: uppercase; }
.gl-author { display: block; min-width: 0; color: #c6d2df; font-size: .78rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-date { display: block; color: var(--faint); font-size: .72rem; line-height: 1.4; }
.gl-like { position: absolute; right: 16px; bottom: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 50px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: rgba(255,255,255,.04); color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.gl-like:hover { border-color: rgba(224,64,96,.45); color: #ff7f98; }
.gl-like.on { border-color: rgba(224,64,96,.4); background: rgba(224,64,96,.14); color: #ff7f98; }
.gl-empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 9px; padding: 55px 20px; border: 1px dashed rgba(255,255,255,.12); border-radius: 16px; color: var(--muted); text-align: center; }
.gl-empty i { color: var(--gold); font-size: 1.5rem; }
.gl-empty b { color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.gl-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 7px; margin-top: 26px; }
.gl-pages:empty { display: none; }
.gl-pages a, .gl-page-dots { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.04); color: #c6d2df; font-size: .85rem; font-weight: 700; text-decoration: none; }
.gl-pages a:hover, .gl-pages a.is-on { border-color: rgba(245,204,0,.5); background: rgba(245,204,0,.13); color: var(--gold); }
.gl-pages a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.gl-pages .gl-page-arrow { padding: 0 13px; }
.gl-page-dots { border-color: transparent; background: transparent; }

.gl-lightbox[hidden] { display: none; }
.gl-lightbox { position: fixed; inset: 0; z-index: 230; display: grid; place-items: center; padding: 20px; background: rgba(3,8,16,.9); backdrop-filter: blur(12px); }
.gl-lightbox-panel { position: relative; width: min(1200px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: #111b2a; box-shadow: 0 30px 80px rgba(0,0,0,.6); overflow: hidden; }
.gl-lightbox-panel > img { display: block; width: 100%; min-height: 0; max-height: calc(100dvh - 116px); object-fit: contain; background: #080e18; }
.gl-lightbox-close { position: absolute; z-index: 1; top: 12px; right: 12px; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(8,14,24,.9); color: #fff; cursor: pointer; }
.gl-lightbox-close:hover { color: var(--gold); }
.gl-lightbox-caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; color: #fff; font-size: .9rem; font-weight: 700; }
.gl-lightbox-caption a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; color: var(--gold); font-size: .82rem; text-decoration: none; }
.gl-lightbox-caption a:hover { text-decoration: underline; }
.gl-lightbox-close:focus-visible, .gl-lightbox-caption a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.ask-box { position: fixed; inset: 0; z-index: 240; display: none; place-items: center; padding: 24px; background: rgba(6,10,18,.82); backdrop-filter: blur(6px); }
.ask-box.show { display: grid; }
.ask-card { width: min(460px, 100%); max-height: min(90vh, 760px); overflow-y: auto; border: 1px solid var(--border); border-radius: 18px; background: #111b2a; padding: 24px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.ask-card h3 { margin: 0 0 6px; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; }
.ask-card p { margin: 0 0 16px; color: var(--muted); font-size: .86rem; line-height: 1.55; }
.ask-card input, .ask-card select, .ask-card textarea { display: block; width: 100%; box-sizing: border-box; margin: 10px 0 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--s2); color: #fff; font: inherit; font-size: .9rem; outline: none; }
.ask-card select { color-scheme: dark; }
.ask-card select option { background: #172231; color: #f4f7fb; }
.ask-card textarea { min-height: 86px; resize: vertical; }
.ask-card input:focus, .ask-card select:focus, .ask-card textarea:focus { border-color: var(--gold); }
.ask-prev { width: 100%; height: 150px; border: 1px solid var(--border); border-radius: 10px; background-size: cover; background-position: center; }
.ask-act { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* Страница отдельного кадра продолжает тот же рисунок. */
.shot-page { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 72px; color: #fff; }
.shot-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; color: var(--muted); font-size: .82rem; }
.shot-crumbs a { color: var(--muted); text-decoration: none; }
.shot-crumbs a:hover { color: var(--gold); }
.shot-layout { display: grid; grid-template-columns: minmax(0,1fr) 285px; gap: 20px; align-items: start; }
.shot-main { min-width: 0; }
.shot-title { margin: 0 0 18px; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: clamp(2rem,4vw,3rem); line-height: 1.12; overflow-wrap: anywhere; }
.shot-frame { padding: 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: linear-gradient(180deg,rgba(255,255,255,.065),rgba(255,255,255,.025)); box-shadow: 0 24px 48px -30px rgba(0,0,0,.6); }
.shot-picture { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; border-radius: 11px; background: #0b1320; }
.shot-desc { margin: 24px 0 0; max-width: 780px; color: #b7c7d6; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.shot-side { border: 1px solid rgba(255,255,255,.09); border-radius: 16px; background: linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.025)); padding: 19px; backdrop-filter: blur(14px); }
.shot-side h2 { margin: 0 0 15px; color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 1.05rem; }
.shot-side-row { display: flex; align-items: start; gap: 10px; margin: 0; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.07); color: var(--muted); font-size: .86rem; line-height: 1.4; }
.shot-side-row i { color: var(--gold); margin-top: 2px; width: 16px; text-align: center; }
.shot-side-row a { color: #d4dfeb; text-decoration: none; }
.shot-side-row a:hover { color: var(--gold); }
.shot-actions { display: grid; gap: 9px; margin-top: 18px; }
.shot-actions button, .shot-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.045); color: #e0eaf3; font: inherit; font-size: .86rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.shot-actions button:hover, .shot-actions a:hover { border-color: var(--bh); color: #fff; }
.shot-actions i { color: var(--gold); }

@media (max-width: 760px) {
  .gl-head { align-items: start; flex-direction: column; gap: 18px; }
  .gl-upload { width: 100%; }
  .shot-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .gl-wrap { padding-top: 28px; }
  .gl-tools { top: 64px; padding: 10px; }
  .gl-sort { width: 100%; }
  .gl-sort a { flex: 1; }
  .gl-grid { grid-template-columns: 1fr; }
  .gl-img { aspect-ratio: 16 / 9; }
  .shot-page { padding-top: 24px; }
  .gl-lightbox { padding: 8px; }
  .gl-lightbox-panel { max-height: calc(100dvh - 16px); }
  .gl-lightbox-panel > img { max-height: calc(100dvh - 104px); }
  .gl-lightbox-caption { align-items: flex-start; flex-direction: column; gap: 8px; padding: 11px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gl-card, .gl-preview img, .gl-open { transition: none; }
}
