/* Kopīgs galerijas izskats viesu lapai un biedru zonai: albumu kartītes, bilžu režģis un foto skatītājs. */

/* --- Albumu kartītes: bilde pa visu kartīti, nosaukums uz tās --- */
.g-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.g-album { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 1.25rem; overflow: hidden; background: #12372e; color: #fff; font: inherit; text-align: left; text-decoration: none; cursor: pointer; isolation: isolate; box-shadow: 0 1px 2px rgba(12, 36, 30, 0.08); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.g-album > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.g-album::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(7, 19, 15, 0.88) 0%, rgba(7, 19, 15, 0.35) 42%, rgba(7, 19, 15, 0) 68%); }
.g-album-in { position: absolute; inset: auto 0 0 0; display: grid; gap: 0.3rem; padding: 1.25rem; }
.g-album-in b { font-size: 1.25rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.g-album-in small { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.82); }
.g-tag { position: absolute; top: 0.85rem; left: 0.85rem; padding: 0.3rem 0.65rem; border-radius: 99px; background: rgba(7, 19, 15, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 0.75rem; font-weight: 700; font-style: normal; color: #fff; }
.g-tag.pub { background: rgba(255, 255, 255, 0.92); color: #12372e; }
@media (hover: hover) { .g-album:hover { transform: translateY(-4px); box-shadow: 0 18px 36px rgba(12, 36, 30, 0.2); } .g-album:hover > img { transform: scale(1.06); } }
.g-album:focus-visible, .g-grid button:focus-visible, .gx-btn:focus-visible, .gx-strip button:focus-visible { outline: 3px solid #e8b651; outline-offset: 2px; }

/* --- Bilžu režģis --- */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); grid-auto-flow: dense; gap: 0.5rem; margin-top: 1.25rem; }
.g-grid button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 0.875rem; overflow: hidden; background: rgba(18, 55, 46, 0.08); cursor: zoom-in; }
.g-grid button:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
.g-grid img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.45s ease, filter 0.3s ease; }
@media (hover: hover) { .g-grid button:hover img { transform: scale(1.05); filter: brightness(1.06); } }
@media (max-width: 40rem) { .g-grid { grid-template-columns: repeat(3, 1fr); gap: 0.3rem; } .g-grid button { border-radius: 0.5rem; } .g-albums { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; } .g-album { border-radius: 1rem; } .g-album-in { padding: 0.85rem; } .g-album-in b { font-size: 1rem; } }

/* --- Foto skatītājs pa visu ekrānu --- */
.gx { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: rgba(7, 19, 15, var(--gx-dim, 1)); color: #fff; grid-template-rows: auto minmax(0, 1fr) auto; }
.gx[open] { display: grid; animation: gx-in 0.2s ease; }
.gx::backdrop { background: transparent; }
@keyframes gx-in { from { opacity: 0; } }
.gx-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.5rem 1.25rem; }
.gx-meta { display: grid; gap: 0.1rem; min-width: 0; }
.gx-title { font-size: 1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-count { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.gx-btn { display: grid; place-items: center; flex: none; width: 2.75rem; height: 2.75rem; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.gx-btn:hover { background: rgba(255, 255, 255, 0.24); }
.gx-btn:active { transform: scale(0.94); }
.gx-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0.5rem 4.75rem; touch-action: pan-y pinch-zoom; }
.gx-img { max-width: 100%; max-height: 100%; min-height: 0; object-fit: contain; border-radius: 0.5rem; opacity: 0; transform: translateX(var(--gx-from, 0)); user-select: none; -webkit-user-select: none; }
.gx-img.in { opacity: 1; transform: none; transition: opacity 0.25s ease, transform 0.3s ease; }
.gx-img.drag { transition: none; }
.gx-prev, .gx-next { position: absolute; top: 50%; margin-top: -1.375rem; }
.gx-prev { left: 1rem; }
.gx-next { right: 1rem; }
.gx.one .gx-prev, .gx.one .gx-next { display: none; }
.gx-strip { display: flex; gap: 0.4rem; padding: 0.6rem 1rem max(0.9rem, env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; justify-content: safe center; }
.gx-strip::-webkit-scrollbar { display: none; }
.gx-strip button { flex: none; width: 3.5rem; height: 3.5rem; padding: 0; border: 0; border-radius: 0.6rem; overflow: hidden; background: rgba(255, 255, 255, 0.08); opacity: 0.45; cursor: pointer; transition: opacity 0.2s ease, transform 0.2s ease; }
.gx-strip button.on { opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 2px #fff; }
.gx-strip button:hover { opacity: 1; }
.gx-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Telefonā bultiņu nav — bildes pāršķir ar pirkstu; sīktēli ir mazāki. */
@media (max-width: 40rem) { .gx-stage { padding: 0.25rem 0; } .gx-img { border-radius: 0; } .gx-prev, .gx-next { display: none; } .gx-strip button { width: 2.9rem; height: 2.9rem; } }
@media (prefers-reduced-motion: reduce) { .gx[open], .gx-img.in, .g-album, .g-album > img, .g-grid img { animation: none; transition: none; } }
.gx:focus { outline: 0; }
.g-video { margin-top: 1.25rem; max-width: 44rem; }
.g-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 0.875rem; background: #07130f; }
.g-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.25rem; font-variant-numeric: tabular-nums; }
.g-pager button:disabled { opacity: 0.4; cursor: default; }
/* Viesu lapā: četri albumi rindā, zem tiem poga un papildu režģis */
#gallery .g-albums { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-more { display: flex; justify-content: flex-end; margin: 0.9rem 0 0; }
/* Neuzkrītoša poga labajā malā: mazs teksts, skaitlis aplītī un bultiņa, kas apgriežas, kad saraksts atvērts */
.g-morebtn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem 0.45rem 0.95rem; border: 1px solid rgba(18, 55, 46, 0.16); border-radius: 99px; background: transparent; color: #12372e; font-family: inherit; font-size: 0.8125rem; font-weight: 600; line-height: 1; letter-spacing: 0.01em; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.g-morebtn span { padding: 0.2rem 0.45rem; border-radius: 99px; background: rgba(18, 55, 46, 0.08); font-size: 0.6875rem; font-variant-numeric: tabular-nums; }
.g-morebtn svg { transition: transform 0.25s ease; }
.g-morebtn[aria-expanded="true"] svg { transform: rotate(180deg); }
.g-morebtn:hover { background: #12372e; border-color: #12372e; color: #fff; }
.g-morebtn:hover span { background: rgba(255, 255, 255, 0.18); }
.g-morebtn:focus-visible { outline: 3px solid #e8b651; outline-offset: 2px; }
.g-rest { margin-top: 1.5rem; animation: g-drop 0.3s ease; }
@keyframes g-drop { from { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 62rem) { #gallery .g-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
