
/* Giurgea Archive — Gallery CSS v3.7 */
:root {
  --ga-accent: #8b5e3c;
  --ga-border: #ebebeb;
  --ga-bg-row: #fff;
  --ga-bg-open: #faf9f7;
  --ga-bg-head: #f4f4f4;
  --ga-text: #111;
  --ga-muted: #999;
  --ga-thumb: 52px;
}

#ga-root { font-family: inherit; }

/* ── Font scale classes ── */
/* xs */
#ga-root.ga-scale-xs .ga-row-name,
#ga-root.ga-scale-xs .ga-file-name,
#ga-root.ga-scale-xs .ga-sf-name  { font-size: 9px !important; }
#ga-root.ga-scale-xs .ga-row-cnt,
#ga-root.ga-scale-xs .ga-file-size,
#ga-root.ga-scale-xs .ga-sf-cnt   { font-size: 8px !important; }
/* sm */
#ga-root.ga-scale-sm .ga-row-name,
#ga-root.ga-scale-sm .ga-file-name,
#ga-root.ga-scale-sm .ga-sf-name  { font-size: 10px !important; }
/* lg */
#ga-root.ga-scale-lg .ga-row-name,
#ga-root.ga-scale-lg .ga-file-name,
#ga-root.ga-scale-lg .ga-sf-name  { font-size: 13px !important; }
#ga-root.ga-scale-lg .ga-row-cnt,
#ga-root.ga-scale-lg .ga-file-size,
#ga-root.ga-scale-lg .ga-sf-cnt   { font-size: 11px !important; }
#ga-root.ga-scale-lg .ga-file-thumb { width: 64px; height: 64px; }
/* xl */
#ga-root.ga-scale-xl .ga-row-name,
#ga-root.ga-scale-xl .ga-file-name,
#ga-root.ga-scale-xl .ga-sf-name  { font-size: 15px !important; }
#ga-root.ga-scale-xl .ga-row-cnt,
#ga-root.ga-scale-xl .ga-file-size,
#ga-root.ga-scale-xl .ga-sf-cnt   { font-size: 12px !important; }
#ga-root.ga-scale-xl .ga-file-thumb { width: 72px; height: 72px; }

/* ── Folder tabs ── */
.ga-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 0 32px;
}
.ga-tab {
  background: #fff;
  border: 1px solid #0f0f0f;
  color: #0f0f0f;
  font-family: inherit;
  font-size: 10px !important;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 16px;
  cursor: pointer;
  border-radius: 0;
  transition: background .15s, color .15s;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ga-tab:hover {
  background: #0f0f0f;
  color: #fff;
}
.ga-tab.active {
  background: #0f0f0f;
  color: #fff;
}

/* ── Toolbar ── */
.ga-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--ga-border);
  margin-bottom: 0;
}
.ga-search-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 7px 0;
  font-size: 14px !important;
  font-family: inherit;
  outline: none;
  background: transparent;
  color: var(--ga-text);
}
.ga-search-input::placeholder { color: #bbb; }
.ga-font-controls { display: flex; gap: 4px; flex-shrink: 0; }
.ga-font-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 11px !important;
  font-family: inherit;
  color: #666;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  letter-spacing: 0;
}
.ga-font-btn:hover { border-color: #999; color: #111; }
.ga-select {
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 12px !important;
  font-family: inherit;
  color: var(--ga-text);
  background: #fff;
  cursor: pointer;
  outline: none;
}

/* ── List ── */
.ga-list { width: 100%; }
.ga-list-head {
  display: flex;
  align-items: center;
  padding: 7px 16px 7px 36px;
  background: var(--ga-bg-head);
  border-bottom: 1px solid var(--ga-border);
  font-size: 10px !important;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ga-muted);
}
.glh-name  { flex: 1; }
.glh-count { width: 80px; text-align: right; padding-right: 4px; }

/* ── Row ── */
.ga-row { border-bottom: 1px solid var(--ga-border); }

.ga-row-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 8px;
  cursor: default;
  transition: background .1s;
}
.ga-row-hd:hover { background: #f8f8f8; }
.ga-row.open > .ga-row-hd { background: var(--ga-bg-open); }

.ga-tog {
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  color: #bbb;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 3px;
  transition: color .15s;
}
.ga-tog:hover { color: #666; }
.ga-arr {
  width: 8px; height: 12px;
  transition: transform .18s ease;
  display: block;
}
.ga-tog[aria-expanded="true"] .ga-arr { transform: rotate(90deg); }

.ga-row-name {
  flex: 1;
  font-size: 11px !important;
  color: var(--ga-text);
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3 !important;
}
.ga-row-cnt {
  width: 80px;
  text-align: right;
  font-size: 12px !important;
  color: var(--ga-muted);
  flex-shrink: 0;
  padding-right: 4px;
}

/* ── File list (expanded) ── */
.ga-row-files {
  border-top: 1px solid var(--ga-border);
  background: var(--ga-bg-open);
}
.ga-row-loading {
  padding: 16px 16px 16px 36px;
  display: flex;
  align-items: center;
}
.ga-file-list {
  padding: 4px 0;
}
.ga-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 16px 5px 36px;
  transition: background .1s;
}
.ga-file-item:hover { background: #f2f0ec; }

.ga-file-thumb {
  width: var(--ga-thumb);
  height: var(--ga-thumb);
  flex-shrink: 0;
  overflow: hidden;
  background: #e8e4de;
  border-radius: 2px;
}
.ga-file-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.ga-file-icon {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px !important;
  letter-spacing: 1px;
  color: #aaa;
  text-transform: uppercase;
}
.ga-file-name {
  flex: 1;
  font-size: 11px !important;
  color: #333;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3 !important;
}
.ga-file-size {
  font-size: 10px !important;
  color: var(--ga-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
  width: 64px;
  text-align: right;
  padding-right: 4px;
}

/* ── Subfolder rows (nested inside file list) ── */
.ga-sf-row {
  border-top: 1px solid var(--ga-border);
}
.ga-sf-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 52px;
  cursor: default;
  background: #f5f4f1;
  transition: background .1s;
}
.ga-sf-hd:hover { background: #eeece8; }
.ga-sf-tog {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  color: #bbb;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 3px;
}
.ga-sf-tog:hover { color: #666; }
.ga-sf-tog[aria-expanded="true"] .ga-arr { transform: rotate(90deg); }
.ga-sf-icon {
  font-size: 11px !important;
  color: #aaa;
  flex-shrink: 0;
}
.ga-sf-name {
  flex: 1;
  font-size: 10px !important;
  letter-spacing: 0.08em;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ga-sf-cnt {
  font-size: 10px !important;
  color: var(--ga-muted);
  flex-shrink: 0;
  width: 64px;
  text-align: right;
  padding-right: 4px;
}
.ga-sf-body {
  padding-left: 16px;
  background: #f9f8f5;
  border-top: 1px solid var(--ga-border);
}

/* ── Search results ── */
.ga-search-hdr {
  padding: 14px 16px 10px 36px;
  font-size: 10px !important;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ga-muted);
  border-bottom: 1px solid var(--ga-border);
}
.ga-file-namegroup {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
/* when namegroup is present, file-name should not have flex:1 itself */
.ga-file-namegroup .ga-file-name {
  flex: none;
}
.ga-file-folder-tag {
  font-size: 9px !important;
  color: var(--ga-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── PDF loading placeholder ── */
#ga-pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 12px !important;
  gap: 10px;
  pointer-events: none;
}

/* ── Misc ── */
.ga-msg {
  padding: 40px 16px;
  text-align: center;
  color: var(--ga-muted);
  font-size: 13px !important;
}
.ga-msg-sm { padding: 12px 36px; text-align: left; }
.ga-spin {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid #ddd;
  border-top-color: var(--ga-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── PDF Lightbox ── */
#ga-pdf-lb {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9998;
  flex-direction: column;
}
#ga-pdf-lb.active { display: flex; }

#ga-pdf-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(0,0,0,.7);
  flex-shrink: 0;
}
#ga-pdf-cap {
  color: #ddd;
  font-size: 12px !important;
  letter-spacing: .5px;
  max-width: 70%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#ga-pdf-bar .ga-lb-btns { display: flex; gap: 4px; align-items: center; }
#ga-pdf-ext {
  background: rgba(255,255,255,.1);
  border: none; color: #ddd;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 4px;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background .15s;
}
#ga-pdf-ext:hover { background: rgba(255,255,255,.25); color: #fff; }

#ga-pdf-wrap {
  flex: 1;
  display: flex;
  padding: 12px;
}
#ga-pdf-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
  border-radius: 2px;
}

/* ── Image Lightbox ── */
#ga-lb {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.93);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
#ga-lb.active { display: flex; }

#ga-lb-bar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: rgba(0,0,0,.6);
  z-index: 1;
}
#ga-lb-cap {
  color: #ddd;
  font-size: 12px !important;
  letter-spacing: .5px;
  max-width: 60%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ga-lb-btns { display: flex; gap: 4px; }
.ga-lb-btns button {
  background: rgba(255,255,255,.1);
  border: none; color: #ddd;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 4px;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.ga-lb-btns button:hover { background: rgba(255,255,255,.25); }

#ga-lb-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  overflow: hidden;
}
#ga-lb-wrap.dragging {
  cursor: grabbing;
}
#ga-lb-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  transform-origin: center;
  transition: transform .15s ease, opacity .2s ease;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* drag handled on wrap */
}

#ga-lb-prev, #ga-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.45);
  border: none; color: #fff;
  font-size: 28px; cursor: pointer;
  width: 44px; height: 64px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 10;
  pointer-events: all;
}
#ga-lb-prev:hover, #ga-lb-next:hover { background: rgba(0,0,0,.7); }
#ga-lb-prev { left: 16px; }
#ga-lb-next { right: 16px; }
#ga-lb-prev[hidden], #ga-lb-next[hidden] { display: none; }

#ga-lb-ctr {
  position: fixed; bottom: 16px;
  color: rgba(255,255,255,.5);
  font-size: 12px !important;
}

/* Lightbox loading spinner */
#ga-lb-spinner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}
#ga-lb-spinner.active { display: flex; }
.ga-spin-lg {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: rgba(255,255,255,.85);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
