/*
 * gallery.css
 * Delt styling til Keramik- og Have-galleriet.
 */

/* ── Slideshow-container ──────────────────────────────────────────────────── */
.gallery-slideshow {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto 2rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--ink, #3a3220);
  box-shadow: 0 4px 24px rgba(58, 50, 32, 0.18);
  aspect-ratio: 4 / 3;         
  user-select: none;
}

/* Fuldskærmstilpasning så den fylder hele skærmen uden border-radius */
.gallery-slideshow:fullscreen {
  max-width: 100%;
  border-radius: 0;
  aspect-ratio: auto;
}
.gallery-slideshow:-webkit-full-screen {
  max-width: 100%;
  border-radius: 0;
  aspect-ratio: auto;
}

/* Hvert slide */
.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}

.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Billedet fylder størstedelen af kortet */
.gallery-slide__img {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #2a2417; /* Dyb mørk farve som baggrund til billeder i andet format */
}

.gallery-slide__img img {
  width: 100%;
  height: 100%;
  /* RETTELSE: "contain" sikrer at INTET bliver beskåret! */
  object-fit: contain; 
  display: block;
}

/* Tekst-overlay i bunden */
.gallery-slide__caption {
  padding: 1rem 1.25rem 1.1rem;
  background: linear-gradient(to top, rgba(30, 24, 12, 0.88) 0%, rgba(30, 24, 12, 0.0) 100%);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: #f5f2eb;
  font-family: 'Lora', Georgia, serif;
}

.gallery-slide__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  letter-spacing: 0.01em;
}

.gallery-slide__desc {
  font-size: 0.82rem;
  opacity: 0.85;
  line-height: 1.45;
  font-style: italic;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(234, 230, 220, 0.15);
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #eae6dc;
  backdrop-filter: blur(4px);
  transition: background 0.2s, transform 0.15s;
  z-index: 10;
}

.gallery-nav:hover {
  background: rgba(234, 230, 220, 0.3);
  transform: translateY(-50%) scale(1.08);
}

.gallery-nav--prev { left: .75rem; }
.gallery-nav--next { right: .75rem; }
.gallery-nav svg { width: 1.1rem; height: 1.1rem; }

/* ── Prikker / indikatorer ────────────────────────────────────────────────── */
.gallery-dots {
  position: absolute;
  bottom: 3.8rem;         
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .45rem;
  z-index: 10;
}

.gallery-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  border: none;
  background: rgba(234, 230, 220, 0.45);
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.2s;
}

.gallery-dot.active {
  background: #eae6dc;
  transform: scale(1.25);
}

/* ── Knapper i top (Play/Pause og Fuldskærm) ─────────────────────────────── */
.gallery-playpause, .gallery-fullscreen {
  position: absolute;
  top: .65rem;
  background: rgba(234, 230, 220, 0.15);
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #eae6dc;
  backdrop-filter: blur(4px);
  z-index: 10;
  transition: background 0.2s;
}

.gallery-playpause:hover, .gallery-fullscreen:hover { 
  background: rgba(234, 230, 220, 0.3); 
}
.gallery-playpause svg, .gallery-fullscreen svg { 
  width: .9rem; height: .9rem; 
}

/* Placer play i højre side, og fullscreen i venstre */
.gallery-playpause { right: .65rem; }
.gallery-fullscreen { left: .65rem; }

/* ── Loading-tilstand ─────────────────────────────────────────────────────── */
.gallery-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 240px;
  color: var(--sand, #c8c09a);
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: .9rem;
  gap: .6rem;
}

.gallery-loading::before {
  content: '';
  display: block;
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--sand, #c8c09a);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Fejl-tilstand ────────────────────────────────────────────────────────── */
.gallery-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #c8a090;
  font-style: italic;
  font-size: .9rem;
  padding: 2rem;
  text-align: center;
}

/* ── Responsivt ───────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gallery-slideshow {
    aspect-ratio: 3 / 2;
    border-radius: 4px;
  }
  .gallery-nav { width: 2rem; height: 2rem; }
  .gallery-slide__title { font-size: .9rem; }
  .gallery-slide__desc  { font-size: .75rem; }
}

.gallery-section-header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.gallery-section-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--olive, #6b6b4a);
  letter-spacing: 0.03em;
}
.gallery-section-divider {
  width: 3rem;
  height: 2px;
  background: var(--sand, #c8c09a);
  margin: .6rem auto 0;
  border-radius: 2px;
}