/*
 * Shared Photo & Video Gallery styles — reused byte-for-byte across sites.
 * The host page maps its own palette onto these --g-* variables, so the
 * gallery automatically matches each site's look. Do not hard-code colors here.
 */
:root {
  --g-bg: #141414;
  --g-panel: #1e1e1e;
  --g-panel-2: #272727;
  --g-text: #f3f3f3;
  --g-muted: #b9b9b9;
  --g-accent: #e0a52e;
  --g-accent-2: #d8641b;
  --g-line: rgba(255, 255, 255, 0.14);
  --g-radius: 18px;
  --g-font: Arial, Helvetica, sans-serif;
  --g-head-font: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

.gal-body {
  margin: 0;
  background: var(--g-bg);
  color: var(--g-text);
  font-family: var(--g-font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.gal-wrap {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px);
}

/* ---- Top bar ---- */
.gal-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: clamp(18px, 4vw, 34px);
}
.gal-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--g-muted);
  font-weight: 700;
  border: 1px solid var(--g-line);
  border-radius: 999px;
  padding: 9px 16px;
  transition: 0.18s ease;
  background: var(--g-panel);
}
.gal-home:hover { color: var(--g-text); border-color: var(--g-accent); transform: translateY(-1px); }
.gal-title {
  margin: 0;
  font-family: var(--g-head-font);
  font-size: clamp(1.5rem, 4vw, 2.3rem);
  line-height: 1.1;
}
.gal-title small {
  display: block;
  font-family: var(--g-font);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--g-accent);
  margin-bottom: 4px;
}

/* ---- Year cards ---- */
.gal-years {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(14px, 2.5vw, 22px);
}
.gal-year-card {
  position: relative;
  display: block;
  border: 1px solid var(--g-line);
  border-radius: var(--g-radius);
  overflow: hidden;
  background: var(--g-panel);
  color: inherit;
  text-align: left;
  cursor: pointer;
  min-height: 190px;
  padding: 0;
  font: inherit;
  transition: 0.2s ease;
}
.gal-year-card:hover { transform: translateY(-3px); border-color: var(--g-accent); }
.gal-year-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.62);
  transition: 0.3s ease;
}
.gal-year-card:hover .gal-year-thumb { filter: brightness(0.7); transform: scale(1.04); }
.gal-year-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.72) 100%);
}
.gal-year-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 20px;
}
.gal-year-num {
  font-family: var(--g-head-font);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0,0,0,0.55);
}
.gal-year-counts {
  margin-top: 6px;
  font-size: 0.86rem;
  color: #f0f0f0;
  font-weight: 700;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

/* ---- Filters ---- */
.gal-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0 22px;
}
.gal-filters { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.gal-filter {
  border: 1px solid var(--g-line);
  background: var(--g-panel);
  color: var(--g-muted);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 0.9rem;
  cursor: pointer;
  transition: 0.15s ease;
}
.gal-filter:hover { color: var(--g-text); }
.gal-filter[aria-pressed="true"] {
  background: var(--g-accent);
  border-color: var(--g-accent);
  color: #1a1206;
}
.gal-count-note { margin-left: auto; color: var(--g-muted); font-size: 0.85rem; }

/* ---- Media grid ---- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: clamp(10px, 1.8vw, 16px);
}
/* Section heading for the "All" view's Photos / Videos groups. */
.gal-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 12px;
  font-family: var(--g-head-font, inherit);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--g-text);
}
.gal-group:first-child { margin-top: 6px; }
.gal-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--g-line);
}
.gal-group-count {
  flex: none;
  font-family: var(--g-font, inherit);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--g-muted);
  background: var(--g-panel-2);
  border-radius: 999px;
  padding: 2px 10px;
}
.gal-tile {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--g-panel-2);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
}
.gal-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: 0.3s ease;
  background: var(--g-panel-2);
}
.gal-tile:hover img { transform: scale(1.06); }
/* Placeholder for a video that has no poster image. */
.gal-tile-ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  box-sizing: border-box;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,0.06), transparent 60%),
    var(--g-panel-2);
}
.gal-tile-ph-ico { font-size: 2rem; line-height: 1; opacity: 0.85; }
.gal-tile-ph-name {
  font-size: 0.72rem;
  color: var(--g-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
.gal-tile-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0,0,0,0.66);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.gal-tile-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.gal-tile-play span {
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
}
.gal-tile-play span::before {
  content: "";
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}

/* ---- States ---- */
.gal-status {
  padding: 60px 20px;
  text-align: center;
  color: var(--g-muted);
  font-size: 1.05rem;
}
.gal-spinner {
  width: 34px; height: 34px;
  margin: 0 auto 16px;
  border: 3px solid var(--g-line);
  border-top-color: var(--g-accent);
  border-radius: 50%;
  animation: gal-spin 0.8s linear infinite;
}
@keyframes gal-spin { to { transform: rotate(360deg); } }

/* ---- Lightbox ---- */
.gal-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8,8,8,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2vmin;
}
.gal-lightbox.open { display: flex; }
.gal-lb-stage {
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gal-lb-stage img,
.gal-lb-stage video {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0,0,0,0.6);
}
.gal-lb-btn {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 50px; height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.gal-lb-btn:hover { background: rgba(255,255,255,0.22); }
.gal-lb-close { top: 16px; right: 16px; }
.gal-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.gal-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.gal-lb-caption {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--g-muted);
  font-size: 0.85rem;
  background: rgba(0,0,0,0.5);
  padding: 5px 12px;
  border-radius: 999px;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .gal-grid { grid-template-columns: repeat(auto-fill, minmax(44vw, 1fr)); }
  .gal-lb-prev { left: 6px; }
  .gal-lb-next { right: 6px; }
  .gal-lb-btn { width: 44px; height: 44px; }
}
