/* === GALERIJAS (galerijas.html, galerija.html) — foto albumi un video ===
   Virsraksti, pogas, vietturi — style.css */

.gl-wrap { max-width: 1365px; margin: 24px auto 56px; padding: 0 24px; }

/* ── CEĻŠ + ATPAKAĻ ── */
.gl-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; font-size: 12.5px; color: var(--muted); }
.gl-crumbs nav a { color: var(--muted); transition: color .15s; }
.gl-crumbs nav a:hover { color: var(--blue); }
.gl-crumbs nav span { margin: 0 6px; opacity: .6; }
.gl-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--navy); }
.gl-back:hover { color: var(--blue); }

/* ── CILNES Foto / Video ── */
.gl-tabs { display: inline-flex; gap: 4px; background: var(--light-bg); border-radius: 12px; padding: 5px; margin: 6px 0 14px; }
.gl-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: none; border-radius: 9px;
  background: transparent; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .15s;
}
.gl-tab:hover { color: var(--navy); }
.gl-tab.on { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(10, 33, 85, .12); }
.gl-tab .n { font-size: 11.5px; font-weight: 700; background: #e3ecf8; color: var(--blue); border-radius: 6px; padding: 2px 7px; }

/* ── FILTRI ── */
.gl-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--light-bg); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.gl-select, .gl-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 0 12px; height: 40px; }
.gl-select select { border: none; outline: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; height: 100%; }
.gl-select svg, .gl-search svg { color: var(--muted); flex-shrink: 0; }
.gl-search { flex: 1; min-width: 220px; }
.gl-search input { border: none; outline: none; font-family: inherit; font-size: 13px; width: 100%; background: transparent; }
.gl-reset { font-family: inherit; font-size: 13px; font-weight: 600; color: var(--blue); background: none; border: none; cursor: pointer; padding: 0 8px; }
.gl-reset:hover { text-decoration: underline; }
.gl-count { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.gl-count b { color: var(--text); font-weight: 600; }

/* ── ALBUMU KARTĪTES ── */
.gl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 22px; }
.gl-card { display: flex; flex-direction: column; gap: 7px; color: inherit; }
.gl-cover { position: relative; aspect-ratio: 4/3; border-radius: 10px; overflow: visible; margin: 6px 0 6px; }
/* "kaudzes" efekts — albums, nevis viena bilde */
.gl-cover::before, .gl-cover::after { content: ''; position: absolute; left: 8%; right: 8%; height: 100%; border-radius: 10px; background: #d5dbe6; z-index: 0; transition: transform .25s; }
.gl-cover::before { top: -5px; left: 5%; right: 5%; background: #e1e6ee; }
.gl-cover::after  { top: -9px; left: 10%; right: 10%; background: #edf0f5; z-index: -1; }
.gl-cover-img { position: absolute; inset: 0; z-index: 1; border-radius: 10px; overflow: hidden; background: #c8cdd8; }
.gl-cover-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gl-card:hover .gl-cover-img img { transform: scale(1.05); }
.gl-badge {
  position: absolute; z-index: 2; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(10, 33, 85, .82); color: #fff; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 7px;
}
.gl-date { font-size: 10.5px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.gl-card h3 { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); transition: color .15s; }
.gl-card:hover h3 { color: var(--blue); }

/* ── VIDEO KARTĪTES ── */
.gl-vgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.gl-vcard { display: flex; flex-direction: column; gap: 7px; text-align: left; background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; color: inherit; }
.gl-thumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: #0a2155; margin-bottom: 4px; }
.gl-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: transform .3s, opacity .2s; }
.gl-vcard:hover .gl-thumb img { transform: scale(1.04); opacity: .75; }
.gl-play {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; background: rgba(200, 16, 46, .92);
  display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); transition: transform .2s;
}
.gl-vcard:hover .gl-play { transform: scale(1.1); }
.gl-vcard h3 { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); transition: color .15s; }
.gl-vcard:hover h3 { color: var(--blue); }

.gl-empty { grid-column: 1/-1; text-align: center; font-size: 14px; color: var(--muted); font-style: italic; padding: 50px 0; }
.gl-more { display: flex; justify-content: center; margin-top: 34px; }

/* ── VIENS ALBUMS ── */
.gl-album-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; margin-bottom: 28px; }
.gl-album-head .page-heading { max-width: 900px; }
.gl-album-meta { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 6px; }
.gl-album-meta span { display: inline-flex; align-items: center; gap: 6px; }
.gl-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gl-photo { position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: #c8cdd8; border: none; padding: 0; cursor: zoom-in; }
.gl-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gl-photo:hover img { transform: scale(1.06); }
.gl-photo:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.gl-related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.gl-related h2 { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 20px; }

/* ── SKATĪTĀJS (lightbox) ── */
.gl-lb { position: fixed; inset: 0; z-index: 10000; background: rgba(6, 14, 36, .97); display: flex; flex-direction: column; }
.gl-lb[hidden] { display: none; }
.gl-lb-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; color: #fff; font-size: 13.5px; }
.gl-lb-top b { font-weight: 600; }
.gl-lb-title { opacity: .7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-lb-acts { display: flex; gap: 6px; flex-shrink: 0; }
.gl-lb-btn { width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s; }
.gl-lb-btn:hover { background: rgba(255, 255, 255, .22); }
.gl-lb-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 70px; min-height: 0; touch-action: pan-y; }
.gl-lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; user-select: none; -webkit-user-drag: none; }
.gl-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; }
.gl-lb-prev { left: 12px; } .gl-lb-next { right: 12px; }
.gl-lb-strip { display: flex; gap: 6px; justify-content: safe center; padding: 14px 20px 18px; overflow-x: auto; }
.gl-lb-strip button { flex: 0 0 auto; width: 64px; height: 48px; border-radius: 5px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #333; cursor: pointer; opacity: .5; transition: opacity .15s; }
.gl-lb-strip button.on { border-color: #fff; opacity: 1; }
.gl-lb-strip button:hover { opacity: .9; }
.gl-lb-strip img { width: 100%; height: 100%; object-fit: cover; }

/* ── VIDEO LOGS ── */
.gl-vbox { width: min(1100px, 100%); padding: 0 20px; margin: auto; }
.gl-vframe { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 8px; overflow: hidden; }
.gl-vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gl-vframe .demo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; opacity: .6; font-size: 14px; }

@media (max-width: 1100px) { .gl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .gl-vgrid, .gl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  {
  .gl-wrap { padding: 0 16px; }
  .gl-grid, .gl-vgrid { grid-template-columns: minmax(0, 1fr); }
  .gl-search { min-width: 100%; }
  .gl-tabs { display: flex; } .gl-tab { flex: 1; justify-content: center; }
  .gl-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .gl-lb-stage { padding: 0 8px; }
  .gl-lb-nav { display: none; }
  .gl-lb-strip { display: none; }
}
/* ── PHP versija: video ilgums, saite video logā ── */
.gl-dur { position: absolute; right: 8px; bottom: 8px; z-index: 1; background: rgba(0, 0, 0, .78); color: #fff; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 5px; }
.gl-lb-link { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 21px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s; }
.gl-lb-link:hover { background: rgba(255, 255, 255, .22); }
.gl-lb-link[hidden] { display: none; }