/* ── Gallery pill pane ──────────────────────────────────────────────────── */

#pane-gallery {
  padding: 14px 16px 20px;
}

/* ── Thumbnail strip ────────────────────────────────────────────────────── */
.gallery-strip-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.gallery-strip-overflow {
  flex: 1;
  overflow: hidden;
}

.gallery-strip {
  display: flex;
  gap: 6px;
  transition: transform 0.25s ease;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb:hover {
  opacity: 0.85;
  border-color: var(--accent);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
}

.gallery-thumb-empty {
  flex-shrink: 0;
  width: 82px;
  height: 82px;
  border-radius: 8px;
  background: var(--bg-card-inner);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.58rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px;
  line-height: 1.3;
}

.gallery-strip-prev,
.gallery-strip-next {
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  width: 26px;
  height: 82px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.gallery-strip-prev:hover,
.gallery-strip-next:hover {
  background: var(--bg-pill-hover);
}

.gallery-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}

/* ── Lightbox ───────────────────────────────────────────────────────────── */
#gallery-lightbox,
#gallery-lightbox-weekend {                 /* ← ADDED: new weekend-only lightbox id needs the same base styling */
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}




.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.9);
}

.lightbox-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90vw;
  max-width: 860px;
  max-height: 90vh;
  gap: 8px;
  padding: 0 44px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: 0;
  background: #333;
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s;
}

.lightbox-close:hover { background: #555; }

.lightbox-description {
  color: #eee;
  font-size: 0.82rem;
  text-align: center;
  max-width: 600px;
  line-height: 1.4;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lightbox-media {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 55vh;
  border-radius: 10px;
  object-fit: contain;
  display: block;
}

.lightbox-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 55vh;
  border-radius: 10px;
  border: none;
}


.lightbox-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lightbox-footer-row {
  display: flex;
  align-items: center;
  gap: 16px;
}





.lightbox-source {
  color: #aaa;
  font-size: 0.72rem;
  text-decoration: none;
  border-bottom: 1px solid #555;
  transition: color 0.15s;
}

.lightbox-source:hover { color: #fff; }

.lightbox-counter {
  color: #777;
  font-size: 0.72rem;
}

/* ── Lightbox strip ─────────────────────────────────────────────────────── */
.lightbox-strip-wrapper {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.lightbox-strip-wrapper::-webkit-scrollbar { display: none; }

.lightbox-strip {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: 2px 0;
}

.lb-strip-thumb {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.15s, border-color 0.15s;
  background: #222;
}

.lb-strip-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-strip-thumb.active {
  border-color: #fff;
  opacity: 1;
}

.lb-strip-thumb:hover:not(.active) { opacity: 0.8; }

.lb-strip-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  background: rgba(0,0,0,0.45);
}

/* ── Lightbox nav buttons ───────────────────────────────────────────────── */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: calc(50% - 30px);
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  z-index: 2;
}

.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.25); }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .lightbox-box {
    width: 100vw;
    padding: 0 40px;
  }
}



























/* ── Gallery sub-pills ───────────────────────────────────────────────────── */
#gallery-sub-pills {
  display: flex;
  gap: 6px;
  padding: 0 0 12px 0;
  flex-shrink: 0;
}

#gallery-sub-pills .gallery-sub-pill {
  flex-shrink: 0;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  /* Reset browser button defaults */
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
}

#gallery-sub-pills .gallery-sub-pill:hover:not(.active) {
  background: var(--bg-pill-hover);
  color: var(--text-primary);
}

#gallery-sub-pills .gallery-sub-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

















/* ── Race weekend gallery empty state ────────────────────────────────────── */
.gallery-weekend-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}

/* ── Video thumbnail in gallery strip ────────────────────────────────────── */
.gallery-thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Attribution on thumbnail ────────────────────────────────────────────── */
.gallery-thumb-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
  padding: 4px 6px 3px;
  font-size: 0.48rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 0 0 8px 8px;
}

/* ── Lightbox credit link ────────────────────────────────────────────────── */
.lightbox-credit-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(197,83,43,0.3);
  transition: color 0.15s;
}

.lightbox-credit-link:hover { color: #e8693a; }

/* ── Lightbox video ──────────────────────────────────────────────────────── */
.lightbox-video {
  width: 100%;
  max-height: 55vh;
  border-radius: 10px;
  display: block;
  outline: none;
}

/* ── Race weekend horizontal strip ──────────────────────────────────────── */

#race-weekend-strip-wrap {
  position: fixed;
  bottom: 60px;
  left: 80px;   /* clear the progress bar (14px + 20px bar + 14px gap) */
  right: 14px;
  z-index: 600;
  padding: 0 0 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

/* When panel is open on desktop, shrink right edge to avoid panel */
body.panel-open #race-weekend-strip-wrap {
  right: 354px;
}



#race-weekend-strip-wrap.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#race-weekend-strip-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

#race-weekend-strip-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

#race-weekend-strip-gp {
  font-size: 0.58rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

body.light-theme #race-weekend-strip-gp {
  color: rgba(0,0,0,0.5);
  text-shadow: 0 1px 3px rgba(255,255,255,0.9);
}



#race-weekend-strip-overflow {
  overflow: hidden;
  width: 100%;
}

/* ── Empty state: no items yet within an active weekend window — hide
   the (empty) image row entirely and remove the gap above the
   contribute line, so header and prompt sit flush together. ────────────── */
#race-weekend-strip-wrap.empty #race-weekend-strip-overflow {
  display: none;
}

#race-weekend-strip-wrap.empty .gallery-contribute-line {
  margin-top: 0;
}

#race-weekend-strip-wrap.has-items #race-weekend-strip-overflow {
  display: block;
}



#race-weekend-strip {
  display: flex;
  gap: 8px;
  overflow-x: visible;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-bottom: 4px;
  width: max-content;
}

#race-weekend-strip::-webkit-scrollbar { display: none; }

/* Auto-scroll animation — only when enough items */
#race-weekend-strip.auto-scroll {
  animation: stripScroll 20s linear infinite;
}

#race-weekend-strip.auto-scroll:hover,
#race-weekend-strip.auto-scroll:active {
  animation-play-state: paused;
}

@keyframes stripScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}








.strip-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1.5px solid rgba(255,255,255,0.15);
  background: rgba(30,30,46,0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.15s, border-color 0.15s;
}

.strip-thumb:hover {
  transform: scale(1.06);
  border-color: var(--accent);
}

.strip-thumb img,
.strip-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.strip-thumb-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  background: rgba(0,0,0,0.35);
}

.strip-thumb-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
  padding: 3px 5px 2px;
  font-size: 0.44rem;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .strip-thumb {
  border-color: rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.85);
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  #race-weekend-strip-wrap {
    bottom: 90px;   /* same row as the zoom controls now sit */
    left: 72px;
    right: 60px;    /* leaves room for zoom controls, now moved to this row */
    padding: 0 0 6px;
  }  


  .strip-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
  }

  #race-weekend-strip-label {
    font-size: 0.5rem;
  }

  #race-weekend-strip-gp {
    font-size: 0.5rem;
  }

  #race-weekend-strip-header {
    margin-bottom: 4px;
  }
}





/* ── Lightbox source button ──────────────────────────────────────────────── */

.lightbox-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding: 2px 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.4;
}

.lightbox-source-btn:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
}







/* Hide description in lightbox — source button replaces it */
.lightbox-description {
  display: none !important;
}



@keyframes galleryAutoScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Pause on hover */
.gallery-strip[style*="galleryAutoScroll"]:hover {
  animation-play-state: paused;
}