/**
 * Gallery page — layout, tips, loading, and plugin UI polish.
 * Works with gridGallery.css / autoAlbums plugin.
 */

.gallery-section {
  background: var(--krome-page-bg, #f4f4f5);
  padding-top: 4rem;
  padding-bottom: 5rem;
}

.gallery-intro {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.gallery-intro__eyebrow {
  display: inline-block;
  margin: 0 0 0.6rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72em;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--krome-gold, #c9a227);
}

.gallery-intro__title {
  margin: 0 0 0.75rem;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.5em, 3vw, 1.85em);
  font-weight: 600;
  color: var(--krome-ink, #0a0a0a);
  letter-spacing: -0.02em;
}

.gallery-intro__lead {
  margin: 0 0 1.5rem;
  font-family: 'Karla', sans-serif;
  font-size: 1.05em;
  line-height: 1.65;
  color: #555;
}

.gallery-tips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery-tips li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  font-family: 'Karla', sans-serif;
  font-size: 0.88em;
  color: #444;
  line-height: 1.3;
}

.gallery-tips li i {
  color: var(--krome-gold, #c9a227);
  font-size: 0.95em;
  width: 1.1em;
  text-align: center;
}

.gallery-shell {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  background: var(--krome-panel-bg, #fff);
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  padding: 1.25rem 1rem 1.5rem;
}

@media (min-width: 768px) {
  .gallery-shell {
    padding: 1.5rem 1.35rem 1.75rem;
  }
}

/* Loading */
.gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 220px;
  padding: 2.5rem 1rem;
  color: #666;
  font-family: 'Karla', sans-serif;
  font-size: 0.95em;
}

.gallery-loading[hidden] {
  display: none !important;
}

.gallery-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(201, 162, 39, 0.2);
  border-top-color: var(--krome-gold, #c9a227);
  border-radius: 50%;
  animation: gallery-spin 0.75s linear infinite;
}

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

/* Empty state */
.gallery-empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.gallery-empty-state[hidden] {
  display: none !important;
}

.gallery-empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(201, 162, 39, 0.12);
  color: var(--krome-gold, #c9a227);
  font-size: 1.5rem;
}

.gallery-empty-state h2 {
  margin: 0 0 0.5rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25em;
  font-weight: 600;
  color: var(--krome-ink, #0a0a0a);
}

.gallery-empty-state p {
  margin: 0 0 1.25rem;
  font-family: 'Karla', sans-serif;
  color: #666;
  line-height: 1.6;
}

.gallery-empty-state__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.35rem;
  border-radius: 6px;
  background: var(--krome-ink, #0a0a0a);
  color: #fff !important;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-empty-state__cta:hover,
.gallery-empty-state__cta:focus-visible {
  background: var(--krome-gold, #c9a227);
  color: #0a0a0a !important;
  transform: translateY(-1px);
}

/* Grid wrapper */
.gallery-grid-wrapper {
  min-height: 120px;
  padding: 0;
}

/* Breadcrumb */
.gallery-shell .grid-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  float: none;
  margin: 0 0 1.25rem;
  padding: 0.65rem 0.85rem;
  background: var(--krome-page-bg, #f4f4f5);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.gallery-shell .grid-breadcrumb li {
  float: none;
  display: inline-flex;
  align-items: center;
  font-family: 'Karla', sans-serif;
  font-size: 0.92em !important;
  font-weight: 600;
  text-shadow: none;
}

.gallery-shell .grid-breadcrumb li a {
  color: var(--krome-ink, #0a0a0a) !important;
  text-decoration: none !important;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.gallery-shell .grid-breadcrumb li a:hover,
.gallery-shell .grid-breadcrumb li a:focus-visible {
  background: rgba(201, 162, 39, 0.15);
  color: #7a5f10 !important;
  text-decoration: none !important;
}

.gallery-shell .grid-breadcrumb li.active {
  color: #888 !important;
  padding: 0.25rem 0.45rem;
}

.gallery-shell .grid-breadcrumb .divider {
  margin: 0 0.15rem;
  color: #ccc;
  font-weight: 400;
}

/* Folder tiles */
.gallery-shell .gbox.gridFolder {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-shell .gbox.gridFolder:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.gallery-shell .gbox.gridFolder img {
  transition: transform 0.4s ease;
}

.gallery-shell .gbox.gridFolder:hover img {
  transform: scale(1.04);
}

.gallery-shell .gradient-container {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
  opacity: 1;
  height: 55%;
}

.gallery-shell .folder-info {
  border-top: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.15rem;
}

.gallery-shell .folder-name,
.gallery-shell .folder-count {
  float: none;
  padding: 0.75rem 0.85rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.88em;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.gallery-shell .folder-count {
  flex-shrink: 0;
  font-size: 0.78em;
  font-weight: 500;
  opacity: 0.9;
}

/* Photo thumbnails */
.gallery-shell .gbox:not(.gridFolder) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-shell .gbox:not(.gridFolder):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  z-index: 2;
}

.gallery-shell .gbox:not(.gridFolder) img {
  transition: transform 0.35s ease;
}

.gallery-shell .gbox:not(.gridFolder):hover img {
  transform: scale(1.03);
}

.gallery-shell .gbox {
  margin: 6px !important;
}

/* Load more */
.gallery-shell .grid-loadMore {
  margin: 1.75rem auto 0.5rem;
  width: auto;
  min-width: 160px;
  min-height: 44px;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  background: var(--krome-ink, #0a0a0a);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-shell .grid-loadMore:hover {
  background: var(--krome-gold, #c9a227);
  color: #0a0a0a !important;
  transform: translateY(-1px);
}

.gallery-shell .grid-loader {
  margin: 2rem auto;
}

/* Lightbox polish */
.autoGrid-lightbox {
  background: rgba(8, 8, 8, 0.94);
  backdrop-filter: blur(6px);
}

.autoGrid-nav {
  background: rgba(18, 18, 18, 0.98);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.autoGrid-play:hover,
.autoGrid-close:hover,
.autoGrid-next:hover,
.autoGrid-prev:hover,
.autoGrid-font:hover,
.autoGrid-play.selected,
.autoGrid-close.selected,
.autoGrid-next.selected,
.autoGrid-prev.selected {
  background: rgba(201, 162, 39, 0.2);
}

.autoGrid-lbcaption {
  font-family: 'Karla', sans-serif;
}

.lightbox-timer {
  background: var(--krome-gold, #c9a227);
}

/* Caption overlay on hover */
.gallery-shell .image-caption {
  background: rgba(10, 10, 10, 0.55);
  box-shadow: none;
}

.gallery-shell .image-caption h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
}

@media (max-width: 767px) {
  .gallery-section {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }

  .gallery-shell {
    border-radius: 10px;
    padding: 1rem 0.65rem 1.25rem;
  }

  .gallery-tips {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-tips li {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .gallery-tips li:nth-child(3) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-loading__spinner {
    animation: none;
    border-top-color: var(--krome-gold, #c9a227);
  }

  .gallery-shell .gbox.gridFolder,
  .gallery-shell .gbox.gridFolder img,
  .gallery-shell .gbox:not(.gridFolder),
  .gallery-shell .gbox:not(.gridFolder) img,
  .gallery-shell .grid-loadMore,
  .gallery-empty-state__cta {
    transition: none !important;
  }

  .gallery-shell .gbox.gridFolder:hover,
  .gallery-shell .gbox:not(.gridFolder):hover {
    transform: none;
  }
}
