/* Basic public gallery styles */
.awsgallery-public { --gap: 12px; }
.awsgallery-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
}
.awsgallery-card { display:block; border:none; border-radius:0; overflow:hidden; color:inherit; text-decoration:none; background:transparent; padding:0; }
/* Subtle hover that works on light and dark (optional shadow only) */
.awsgallery-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.18); }
.awsgallery-card-cover-wrapper, .awsgallery-thumb-wrapper { position:relative; aspect-ratio: 4 / 3; overflow:hidden; border-radius:0; background:#111; }
.awsgallery-card-cover-wrapper.preserve::before, .awsgallery-thumb-wrapper.preserve::before { content:""; position:absolute; inset:0; background:var(--awsgallery-bg) center/cover no-repeat; filter:blur(18px) brightness(.85); transform:scale(1.1); }
.awsgallery-card-cover { width:100%; height:100%; object-fit:contain; display:block; position:relative; z-index:1; border-radius:0; }
.awsgallery-card-meta { padding:8px 0 16px; text-align:center; }
.awsgallery-card-title { margin:0 0 6px; font-size:16px; color:inherit; text-transform:uppercase; }
/* Use reduced opacity instead of hardcoded color for better contrast on dark backgrounds */
.awsgallery-card-id { font-size:11px; opacity:0.65; margin-bottom:2px; }
.awsgallery-card-date { font-size:12px; opacity:0.7; display:block; }
.awsgallery-gallery-actions { margin: 8px 0 4px; display:flex; justify-content:center; gap:10px; }
.awsgallery-back { display:inline-block; margin-bottom:8px; }
.awsgallery-event { opacity:0.85; }
.awsgallery-view-all { text-align:center; margin-top:20px; }
.awsgallery-view-all-link { display:inline-block; padding:12px 24px; background:#007cba; color:#fff; text-decoration:none; border-radius:6px; font-weight:500; transition:background 0.2s ease; }
.awsgallery-view-all-link:hover { background:#005a87; color:#fff; }
/* Masonry-style layout using CSS multi-columns */
.awsgallery-tiles {
  padding: var(--gap); /* outer padding matches inner column gap */
  column-count: 5;
  column-gap: var(--gap);
}

.awsgallery-tile {
  display:block;
  margin:0 0 var(--gap);
  break-inside: avoid;
}

/* Ensure all gallery images (including portrait) fill the full column width */
.awsgallery-tiles .awsgallery-tile img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .awsgallery-tiles { column-count: 4; }
}
@media (max-width: 900px) {
  .awsgallery-tiles { column-count: 3; }
}
@media (max-width: 600px) {
  .awsgallery-tiles { column-count: 2; }
}

/* Public viewer overlay */
.awsgallery-viewer { position:fixed; inset:0; background:rgba(0,0,0,0.9); z-index:9999; display:none; }
.awsgallery-viewer-stage { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); max-width:90vw; max-height:90vh; }
.awsgallery-viewer-img { max-width:90vw; max-height:90vh; display:block; margin:0 auto; transition:opacity .2s ease; }
.awsgallery-viewer-count { position:absolute; bottom:-28px; left:0; right:0; text-align:center; color:#fff; opacity:.8; font-size:13px; }

.awsgallery-viewer-close,
.awsgallery-viewer-prev,
.awsgallery-viewer-next { position:absolute; top:50%; transform:translateY(-50%); background:transparent; color:#fff; border:none; font-size:28px; line-height:1; padding:10px 14px; cursor:pointer; opacity:.85; }
.awsgallery-viewer-close { top:16px; right:16px; transform:none; font-size:32px; }
.awsgallery-viewer-prev { left:12px; }
.awsgallery-viewer-next { right:12px; }
.awsgallery-viewer-close:hover,
.awsgallery-viewer-prev:hover,
.awsgallery-viewer-next:hover { opacity:1; }

/* Spinner */
.awsgallery-spinner { width:32px; height:32px; border:3px solid rgba(255,255,255,0.3); border-top-color:#fff; border-radius:50%; animation:awsgallery-spin 1s linear infinite; position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); }
@keyframes awsgallery-spin { to { transform:translate(-50%,-50%) rotate(360deg); } }

/* Viewer toolbar */
.awsgallery-viewer-toolbar { position:absolute; top:16px; left:16px; display:flex; gap:8px; z-index:1; }
.awsgallery-icon { width:34px; height:34px; display:inline-flex; align-items:center; justify-content:center; border-radius:50%; background:rgba(255,255,255,0.12); color:#fff; border:1px solid rgba(255,255,255,0.25); cursor:pointer; }
.awsgallery-icon:hover { background:rgba(255,255,255,0.2); }
.awsgallery-share-label { align-self:center; color:#fff; opacity:0.85; font-size:13px; margin:0 4px 0 4px; }

/* Front-page / hero slideshow */
.awsgallery-slideshow {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.awsgallery-slides {
  position: relative;
}

.awsgallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.awsgallery-slide.is-active {
  position: relative;
  opacity: 1;
}

.awsgallery-slideshow { width:100%; position:relative; overflow:hidden; }
.awsgallery-slide img {
  display:block;
  width:100%;
  height:var(--awsgallery-height, 700px); /* configurable via shortcode */
  object-fit:cover; /* Fill container, crop as needed */
}
@media (max-width: 900px) {
  .awsgallery-slide img { height:55vh; }
}
@media (max-width: 600px) {
  .awsgallery-slide img { height:42vh; }
}

.awsgallery-slide-prev,
.awsgallery-slide-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.awsgallery-slide-prev { left: 12px; }
.awsgallery-slide-next { right: 12px; }

.awsgallery-slide-prev:hover,
.awsgallery-slide-next:hover {
  background: rgba(0,0,0,0.55);
}

.awsgallery-slide-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
}

.awsgallery-slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.7);
  background: rgba(0,0,0,0.3);
  padding: 0;
  cursor: pointer;
}

.awsgallery-slide-dot.is-active {
  background: #fff;
}
