/*==========================================================
  RTSC V14 ULTIMATE — GALLERY PRO
  assets/css/gallery.css
==========================================================*/

:root {
  --gallery-bg-950: #02080f;
  --gallery-bg-900: #061321;
  --gallery-bg-850: #091a2b;
  --gallery-bg-800: #0d2236;
  --gallery-bg-700: #14334e;

  --gallery-gold: #ffc107;
  --gallery-gold-light: #ffe071;
  --gallery-orange: #ff8c1a;
  --gallery-red: #ff453a;
  --gallery-green: #32d074;
  --gallery-blue: #3da5ff;

  --gallery-white: #ffffff;
  --gallery-text: #f7f9fc;
  --gallery-text-soft: rgba(247, 249, 252, 0.74);
  --gallery-text-muted: rgba(247, 249, 252, 0.52);

  --gallery-surface: rgba(255, 255, 255, 0.055);
  --gallery-surface-strong: rgba(255, 255, 255, 0.09);
  --gallery-border: rgba(255, 255, 255, 0.1);
  --gallery-border-gold: rgba(255, 193, 7, 0.36);

  --gallery-shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.22);
  --gallery-shadow-md: 0 22px 52px rgba(0, 0, 0, 0.34);
  --gallery-shadow-lg: 0 38px 100px rgba(0, 0, 0, 0.52);

  --gallery-radius-sm: 12px;
  --gallery-radius-md: 18px;
  --gallery-radius-lg: 26px;
  --gallery-radius-xl: 34px;
  --gallery-radius-pill: 999px;

  --gallery-container: 1440px;
  --gallery-transition-fast: 180ms ease;
  --gallery-transition: 300ms ease;
}

.gallery-page,
.gallery-page *,
.gallery-page *::before,
.gallery-page *::after,
.gallery-lightbox,
.gallery-lightbox *,
.gallery-lightbox *::before,
.gallery-lightbox *::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: hidden;
  color: var(--gallery-text);
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 193, 7, 0.15), transparent 29%),
    radial-gradient(circle at 94% 18%, rgba(61, 165, 255, 0.11), transparent 28%),
    linear-gradient(180deg, var(--gallery-bg-950), var(--gallery-bg-900) 44%, #071727);
}

.gallery-page::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

.gallery-page .container {
  width: min(calc(100% - 48px), var(--gallery-container));
  margin-inline: auto;
}

.gallery-page button,
.gallery-page input,
.gallery-page select,
.gallery-lightbox button {
  font: inherit;
}

.gallery-page button,
.gallery-page select,
.gallery-lightbox button {
  cursor: pointer;
}

.gallery-page :focus-visible,
.gallery-lightbox :focus-visible {
  outline: 3px solid rgba(255, 193, 7, 0.75);
  outline-offset: 3px;
}

.gallery-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.gallery-skip-link {
  position: fixed;
  z-index: 30000;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: var(--gallery-radius-sm);
  color: #111;
  background: var(--gallery-gold);
  font-weight: 900;
  transform: translateY(-160%);
  transition: transform var(--gallery-transition-fast);
}

.gallery-skip-link:focus {
  transform: translateY(0);
}

/* BUTTONS */

.gallery-primary-button,
.gallery-secondary-button,
.gallery-icon-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--gallery-radius-pill);
  font-weight: 900;
  text-decoration: none;
  transition:
    transform var(--gallery-transition-fast),
    border-color var(--gallery-transition),
    background var(--gallery-transition),
    color var(--gallery-transition-fast),
    box-shadow var(--gallery-transition);
}

.gallery-primary-button {
  padding: 12px 22px;
  border: 1px solid transparent;
  color: #111;
  background: linear-gradient(135deg, var(--gallery-gold-light), var(--gallery-gold), var(--gallery-orange));
  box-shadow: 0 14px 30px rgba(255, 193, 7, 0.2);
}

.gallery-primary-button:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
  box-shadow: 0 19px 38px rgba(255, 193, 7, 0.28);
}

.gallery-secondary-button,
.gallery-icon-button {
  padding: 12px 22px;
  border: 1px solid var(--gallery-border);
  color: var(--gallery-white);
  background: rgba(255, 255, 255, 0.055);
}

.gallery-secondary-button:hover,
.gallery-icon-button:hover {
  transform: translateY(-3px);
  border-color: var(--gallery-border-gold);
  color: var(--gallery-gold-light);
  background: rgba(255, 193, 7, 0.07);
}

/* HERO */

.gallery-hero {
  position: relative;
  min-height: 760px;
  display: flex;
  align-items: center;
  padding: 126px 0 100px;
  overflow: hidden;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-hero::before {
  content: "";
  position: absolute;
  top: -300px;
  right: -230px;
  width: 820px;
  height: 820px;
  border: 1px solid rgba(255, 193, 7, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 110px rgba(255, 193, 7, 0.024),
    0 0 0 220px rgba(255, 193, 7, 0.014);
}

.gallery-hero-orb {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(85px);
}

.gallery-orb-one {
  top: 15%;
  left: -130px;
  width: 420px;
  height: 420px;
  background: rgba(255, 193, 7, 0.12);
}

.gallery-orb-two {
  right: -140px;
  bottom: -120px;
  width: 520px;
  height: 520px;
  background: rgba(61, 165, 255, 0.1);
}

.gallery-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(500px, 1.12fr);
  gap: clamp(48px, 7vw, 100px);
  align-items: center;
}

.gallery-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 9px 15px;
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: var(--gallery-radius-pill);
  color: var(--gallery-gold-light);
  background: rgba(255, 193, 7, 0.08);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-hero h1 {
  margin: 22px 0 0;
  color: var(--gallery-white);
  font-size: clamp(4rem, 8vw, 7.6rem);
  font-weight: 950;
  line-height: 0.92;
  letter-spacing: -0.065em;
}

.gallery-hero-copy > p {
  max-width: 720px;
  margin: 28px 0 0;
  color: var(--gallery-text-soft);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.75;
}

.gallery-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.gallery-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 680px;
  margin-top: 34px;
}

.gallery-stat-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-md);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow: var(--gallery-shadow-sm);
  backdrop-filter: blur(16px);
}

.gallery-stat-card strong {
  display: block;
  color: var(--gallery-gold);
  font-size: 1.8rem;
  font-weight: 950;
  line-height: 1;
}

.gallery-stat-card span {
  display: block;
  margin-top: 7px;
  color: var(--gallery-text-muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* HERO SHOWCASE */

.gallery-showcase-card {
  overflow: hidden;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow: var(--gallery-shadow-lg);
}

.gallery-showcase-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--gallery-bg-800);
}

.gallery-showcase-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease, filter 500ms ease;
}

.gallery-showcase-card:hover .gallery-showcase-media img {
  transform: scale(1.04);
  filter: saturate(1.06);
}

.gallery-showcase-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(2, 8, 15, 0.82));
}

.gallery-featured-badge {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 16px;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(255, 193, 7, 0.28);
  border-radius: var(--gallery-radius-pill);
  color: var(--gallery-gold-light);
  background: rgba(2, 8, 15, 0.74);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  backdrop-filter: blur(14px);
}

.gallery-showcase-open {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #111;
  background: linear-gradient(135deg, #fff6c9, var(--gallery-gold), var(--gallery-orange));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  font-size: 1.35rem;
  transition: transform var(--gallery-transition), box-shadow var(--gallery-transition);
}

.gallery-showcase-open:hover {
  transform: rotate(90deg) scale(1.07);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.gallery-showcase-content {
  padding: 26px;
}

.gallery-showcase-content > p:first-child {
  margin: 0;
  color: var(--gallery-gold);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gallery-showcase-content h2 {
  margin: 12px 0 0;
  color: var(--gallery-white);
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.gallery-showcase-content > p:not(:first-child) {
  margin: 14px 0 0;
  color: var(--gallery-text-soft);
  line-height: 1.65;
}

/* CONTROLS */

.gallery-controls-section {
  position: sticky;
  z-index: 40;
  top: 0;
  padding: 18px 0;
  border-bottom: 1px solid var(--gallery-border);
  background: rgba(2, 8, 15, 0.88);
  backdrop-filter: blur(20px);
}

.gallery-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.gallery-search {
  position: relative;
}

.gallery-search-icon {
  position: absolute;
  top: 50%;
  left: 17px;
  color: var(--gallery-text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.gallery-search input {
  width: 100%;
  height: 50px;
  padding: 0 48px 0 44px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-pill);
  outline: 0;
  color: var(--gallery-white);
  background: rgba(255, 255, 255, 0.055);
  transition: border-color var(--gallery-transition), background var(--gallery-transition), box-shadow var(--gallery-transition);
}

.gallery-search input:focus {
  border-color: var(--gallery-border-gold);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.07);
}

.gallery-search input::placeholder {
  color: var(--gallery-text-muted);
}

.gallery-search-clear {
  position: absolute;
  top: 50%;
  right: 9px;
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--gallery-text-muted);
  background: transparent;
  transform: translateY(-50%);
}

.gallery-search.has-value .gallery-search-clear {
  display: grid;
}

.gallery-search-clear:hover {
  color: var(--gallery-white);
  background: rgba(255, 255, 255, 0.08);
}

.gallery-type-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-type-filters::-webkit-scrollbar {
  display: none;
}

.gallery-filter {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-pill);
  color: var(--gallery-text-soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
  transition: transform var(--gallery-transition-fast), color var(--gallery-transition-fast), border-color var(--gallery-transition), background var(--gallery-transition);
}

.gallery-filter:hover {
  transform: translateY(-2px);
  color: var(--gallery-white);
  border-color: var(--gallery-border-gold);
}

.gallery-filter.active {
  color: #111;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gallery-gold-light), var(--gallery-gold), var(--gallery-orange));
}

.gallery-sort-wrap select {
  height: 46px;
  min-width: 150px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-pill);
  outline: 0;
  color: var(--gallery-white);
  background-color: rgba(255, 255, 255, 0.055);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gallery-gold) 50%),
    linear-gradient(135deg, var(--gallery-gold) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 11px) 19px;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.gallery-sort-wrap option {
  color: #fff;
  background: var(--gallery-bg-800);
}

/* SECTIONS */

.gallery-featured-section,
.gallery-albums-section,
.gallery-library-section,
.gallery-club-strip {
  padding: 82px 0;
}

.gallery-section-header {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.gallery-section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--gallery-gold);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.gallery-section-header h2,
.gallery-club-strip h2 {
  margin: 0;
  color: var(--gallery-white);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.05em;
}

.gallery-section-meta,
.gallery-results-count {
  margin: 0;
  color: var(--gallery-text-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

/* FEATURED ALBUM */

.gallery-featured-album {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  overflow: hidden;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  box-shadow: var(--gallery-shadow-lg);
}

.gallery-featured-cover {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: var(--gallery-bg-800);
}

.gallery-featured-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 65%, rgba(2, 8, 15, 0.18));
}

.gallery-featured-cover img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  transition: transform 700ms ease;
}

.gallery-featured-album:hover .gallery-featured-cover img {
  transform: scale(1.035);
}

.gallery-featured-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5vw, 68px);
}

.gallery-album-label {
  color: var(--gallery-gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-featured-content h3 {
  margin: 17px 0 0;
  color: var(--gallery-white);
  font-size: clamp(2rem, 4vw, 3.8rem);
  font-weight: 950;
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.gallery-featured-content > p {
  margin: 22px 0 0;
  color: var(--gallery-text-soft);
  font-size: 0.96rem;
  line-height: 1.75;
}

.gallery-album-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 26px;
}

.gallery-album-summary > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--gallery-radius-sm);
  background: rgba(255, 255, 255, 0.035);
}

.gallery-album-summary strong {
  display: block;
  color: var(--gallery-gold);
  font-size: 1.4rem;
  font-weight: 950;
  line-height: 1;
}

.gallery-album-summary span {
  display: block;
  margin-top: 7px;
  color: var(--gallery-text-muted);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-featured-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 28px;
}

/* ALBUMS */

.gallery-albums-section {
  padding-top: 36px;
}

.gallery-album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.gallery-album-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-lg);
  background: var(--gallery-bg-800);
  box-shadow: var(--gallery-shadow-md);
  cursor: pointer;
  transition: transform var(--gallery-transition), border-color var(--gallery-transition), box-shadow var(--gallery-transition);
}

.gallery-album-card:hover {
  transform: translateY(-8px);
  border-color: var(--gallery-border-gold);
  box-shadow: var(--gallery-shadow-lg);
}

.gallery-album-card img {
  width: 100%;
  height: 310px;
  object-fit: cover;
  transition: transform 600ms ease, filter var(--gallery-transition);
}

.gallery-album-card:hover img {
  transform: scale(1.05);
  filter: saturate(1.07);
}

.gallery-album-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 8, 15, 0.02), rgba(2, 8, 15, 0.9));
}

.gallery-album-card-content {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 18px;
  left: 18px;
}

.gallery-album-card-content span {
  color: var(--gallery-gold);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-album-card-content h3 {
  margin: 8px 0 0;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.25;
}

.gallery-album-card-content p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
  font-weight: 750;
}

/* GALLERY GRID */

.gallery-library-section {
  padding-top: 36px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 230px;
  gap: 16px;
}

.gallery-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-lg);
  background: var(--gallery-bg-800);
  box-shadow: var(--gallery-shadow-md);
  cursor: pointer;
  transition: transform var(--gallery-transition), border-color var(--gallery-transition), box-shadow var(--gallery-transition);
}

.gallery-card:nth-child(7n + 1),
.gallery-card.is-featured {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-card:hover {
  transform: translateY(-7px);
  border-color: var(--gallery-border-gold);
  box-shadow: var(--gallery-shadow-lg);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms ease, filter var(--gallery-transition);
}

.gallery-card:hover img {
  transform: scale(1.055);
  filter: saturate(1.08);
}

.gallery-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(2, 8, 15, 0.86));
}

.gallery-card-type,
.gallery-card-album {
  position: absolute;
  z-index: 3;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: var(--gallery-radius-pill);
  font-size: 0.63rem;
  font-weight: 900;
  backdrop-filter: blur(12px);
}

.gallery-card-type {
  top: 12px;
  left: 12px;
  border: 1px solid rgba(255, 193, 7, 0.26);
  color: var(--gallery-gold-light);
  background: rgba(2, 8, 15, 0.76);
  text-transform: uppercase;
}

.gallery-card-album {
  top: 12px;
  right: 12px;
  max-width: 50%;
  overflow: hidden;
  color: #fff;
  background: rgba(2, 8, 15, 0.7);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card-play {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #111;
  background: linear-gradient(135deg, #fff6c9, var(--gallery-gold), var(--gallery-orange));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  transition: transform var(--gallery-transition);
}

.gallery-card:hover .gallery-card-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.gallery-card-content {
  position: absolute;
  z-index: 3;
  right: 16px;
  bottom: 15px;
  left: 16px;
}

.gallery-card-content h3 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.25;
}

.gallery-card-content p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
}

/* SKELETONS */

.gallery-skeleton-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-lg);
  background: rgba(255, 255, 255, 0.06);
}

.gallery-skeleton-card:nth-child(7n + 1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.08) 48%, rgba(255, 255, 255, 0.13) 52%, transparent 80%);
  animation: galleryShimmer 1.5s infinite;
}

/* STATES */

.gallery-offline-banner {
  display: none;
  margin-bottom: 22px;
  padding: 13px 17px;
  border: 1px solid rgba(255, 140, 26, 0.3);
  border-radius: var(--gallery-radius-md);
  color: #ffe6c2;
  background: rgba(104, 54, 9, 0.7);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
}

.gallery-offline-banner.active {
  display: block;
}

.gallery-empty-state,
.gallery-error-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  padding: 40px 24px;
  border: 1px dashed var(--gallery-border);
  border-radius: var(--gallery-radius-lg);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
}

.gallery-empty-state[hidden],
.gallery-error-state[hidden] {
  display: none;
}

.gallery-empty-state > div,
.gallery-error-state > div {
  max-width: 520px;
}

.gallery-empty-state span,
.gallery-error-state span {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(255, 193, 7, 0.24);
  border-radius: 50%;
  color: var(--gallery-gold);
  background: rgba(255, 193, 7, 0.07);
  font-size: 1.8rem;
  font-weight: 950;
}

.gallery-empty-state h3,
.gallery-error-state h3 {
  margin: 0;
  color: var(--gallery-white);
  font-size: 1.4rem;
  font-weight: 950;
}

.gallery-empty-state p,
.gallery-error-state p {
  margin: 10px 0 20px;
  color: var(--gallery-text-muted);
  line-height: 1.65;
}

.gallery-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* CLUB STRIP */

.gallery-club-strip {
  padding-top: 30px;
}

.gallery-club-strip-inner {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-xl);
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 193, 7, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 193, 7, 0.09), rgba(255, 255, 255, 0.03));
  box-shadow: var(--gallery-shadow-md);
}

.gallery-club-strip p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--gallery-text-soft);
  line-height: 1.7;
}

/* LIGHTBOX */

.gallery-lightbox {
  position: fixed;
  z-index: 15000;
  inset: 0;
  display: grid;
  visibility: hidden;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--gallery-transition), visibility var(--gallery-transition);
}

.gallery-lightbox.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 7, 13, 0.92);
  backdrop-filter: blur(20px);
}

.gallery-lightbox-window {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-xl);
  background:
    radial-gradient(circle at 94% 4%, rgba(255, 193, 7, 0.13), transparent 30%),
    linear-gradient(145deg, var(--gallery-bg-850), var(--gallery-bg-950));
  box-shadow: var(--gallery-shadow-lg);
  transform: translateY(24px) scale(0.98);
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-lightbox.is-open .gallery-lightbox-window {
  transform: translateY(0) scale(1);
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  border: 1px solid var(--gallery-border);
  border-radius: 50%;
  color: #fff;
  background: rgba(2, 8, 15, 0.78);
  backdrop-filter: blur(14px);
  transition: transform var(--gallery-transition-fast), color var(--gallery-transition-fast), background var(--gallery-transition);
}

.gallery-lightbox-close {
  top: 16px;
  right: 16px;
  width: 46px;
  height: 46px;
  font-weight: 900;
}

.gallery-lightbox-close:hover {
  color: #111;
  background: var(--gallery-gold);
  transform: rotate(90deg);
}

.gallery-lightbox-nav {
  top: 42%;
  width: 52px;
  height: 52px;
  font-size: 2rem;
}

.gallery-lightbox-prev {
  left: 16px;
}

.gallery-lightbox-next {
  right: 16px;
}

.gallery-lightbox-nav:hover {
  color: #111;
  background: var(--gallery-gold);
  transform: scale(1.06);
}

.gallery-lightbox-media {
  display: grid;
  min-height: 540px;
  place-items: center;
  overflow: hidden;
  background: #000;
}

.gallery-lightbox-media img,
.gallery-lightbox-media video,
.gallery-lightbox-media iframe {
  display: block;
  width: 100%;
  max-height: 72vh;
  border: 0;
  object-fit: contain;
}

.gallery-lightbox-media iframe {
  aspect-ratio: 16 / 9;
}

.gallery-lightbox-content {
  padding: clamp(26px, 4vw, 44px);
}

.gallery-lightbox-meta-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.gallery-lightbox-date {
  color: var(--gallery-text-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.gallery-lightbox-content h2 {
  margin: 18px 0 0;
  color: var(--gallery-white);
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.gallery-lightbox-content > p {
  margin: 16px 0 0;
  color: var(--gallery-text-soft);
  line-height: 1.75;
}

.gallery-lightbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 26px;
}

/* TOASTS */

.gallery-toast-container {
  position: fixed;
  z-index: 20000;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(calc(100% - 40px), 390px);
  gap: 10px;
  pointer-events: none;
}

.gallery-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--gallery-border);
  border-radius: var(--gallery-radius-md);
  color: #fff;
  background: rgba(9, 26, 43, 0.97);
  box-shadow: var(--gallery-shadow-lg);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: galleryToastIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.gallery-toast-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #111;
  background: var(--gallery-gold);
  font-weight: 950;
}

.gallery-toast strong {
  display: block;
  font-size: 0.8rem;
}

.gallery-toast span {
  display: block;
  margin-top: 3px;
  color: var(--gallery-text-muted);
  font-size: 0.68rem;
}

/* ANIMATIONS */

@keyframes galleryShimmer {
  100% { transform: translateX(100%); }
}

@keyframes galleryToastIn {
  from { opacity: 0; transform: translateX(24px) scale(0.97); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* LIGHT THEME */

html[data-theme="light"] .gallery-page,
body.light-theme .gallery-page {
  --gallery-bg-950: #edf2f7;
  --gallery-bg-900: #f5f8fb;
  --gallery-bg-850: #ffffff;
  --gallery-bg-800: #e7edf3;
  --gallery-bg-700: #dbe4ec;
  --gallery-text: #122235;
  --gallery-text-soft: rgba(18, 34, 53, 0.74);
  --gallery-text-muted: rgba(18, 34, 53, 0.54);
  --gallery-surface: rgba(255, 255, 255, 0.78);
  --gallery-surface-strong: #fff;
  --gallery-border: rgba(18, 34, 53, 0.12);
  --gallery-shadow-sm: 0 10px 24px rgba(21, 42, 65, 0.09);
  --gallery-shadow-md: 0 22px 52px rgba(21, 42, 65, 0.13);
  --gallery-shadow-lg: 0 38px 100px rgba(21, 42, 65, 0.17);
  color-scheme: light;
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 193, 7, 0.17), transparent 29%),
    radial-gradient(circle at 94% 18%, rgba(61, 165, 255, 0.11), transparent 28%),
    linear-gradient(180deg, #f8fafc, #edf3f7 45%, #f7f9fb);
}

html[data-theme="light"] .gallery-hero h1,
html[data-theme="light"] .gallery-section-header h2,
html[data-theme="light"] .gallery-club-strip h2,
html[data-theme="light"] .gallery-showcase-content h2,
html[data-theme="light"] .gallery-featured-content h3,
html[data-theme="light"] .gallery-lightbox-content h2,
body.light-theme .gallery-hero h1,
body.light-theme .gallery-section-header h2,
body.light-theme .gallery-club-strip h2,
body.light-theme .gallery-showcase-content h2,
body.light-theme .gallery-featured-content h3,
body.light-theme .gallery-lightbox-content h2 {
  color: #102136;
}

html[data-theme="light"] .gallery-controls-section,
body.light-theme .gallery-controls-section {
  background: rgba(248, 250, 252, 0.92);
}

html[data-theme="light"] .gallery-search input,
html[data-theme="light"] .gallery-sort-wrap select,
body.light-theme .gallery-search input,
body.light-theme .gallery-sort-wrap select {
  color: #122235;
  background-color: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .gallery-showcase-card,
html[data-theme="light"] .gallery-featured-album,
html[data-theme="light"] .gallery-club-strip-inner,
body.light-theme .gallery-showcase-card,
body.light-theme .gallery-featured-album,
body.light-theme .gallery-club-strip-inner {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 247, 250, 0.92));
}

/* RESPONSIVE */

@media (max-width: 1180px) {
  .gallery-hero-grid {
    grid-template-columns: minmax(0, 0.8fr) minmax(430px, 1.2fr);
    gap: 48px;
  }

  .gallery-controls {
    grid-template-columns: 1fr auto;
  }

  .gallery-type-filters {
    grid-column: 1 / -1;
    order: 3;
  }

  .gallery-featured-album {
    grid-template-columns: 1fr;
  }

  .gallery-featured-cover,
  .gallery-featured-cover img {
    min-height: 450px;
  }

  .gallery-album-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .gallery-page .container {
    width: min(calc(100% - 34px), var(--gallery-container));
  }

  .gallery-hero {
    min-height: auto;
    padding: 96px 0 76px;
  }

  .gallery-hero-grid {
    grid-template-columns: 1fr;
  }

  .gallery-controls-section {
    position: relative;
  }

  .gallery-featured-section,
  .gallery-albums-section,
  .gallery-library-section,
  .gallery-club-strip {
    padding: 66px 0;
  }

  .gallery-album-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-club-strip-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .gallery-page .container {
    width: min(calc(100% - 24px), var(--gallery-container));
  }

  .gallery-hero {
    padding: 76px 0 60px;
  }

  .gallery-hero h1 {
    font-size: clamp(3.5rem, 18vw, 5.2rem);
  }

  .gallery-hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .gallery-hero-actions .gallery-primary-button,
  .gallery-hero-actions .gallery-secondary-button {
    width: 100%;
  }

  .gallery-hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-hero-stats .gallery-stat-card:last-child {
    grid-column: 1 / -1;
  }

  .gallery-showcase-card {
    border-radius: var(--gallery-radius-lg);
  }

  .gallery-controls {
    grid-template-columns: 1fr;
  }

  .gallery-sort-wrap select {
    width: 100%;
  }

  .gallery-section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-featured-cover,
  .gallery-featured-cover img {
    min-height: 340px;
  }

  .gallery-featured-content {
    padding: 28px 20px 32px;
  }

  .gallery-album-summary {
    grid-template-columns: 1fr 1fr;
  }

  .gallery-album-summary > div:last-child {
    grid-column: 1 / -1;
  }

  .gallery-featured-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .gallery-featured-actions .gallery-primary-button,
  .gallery-featured-actions .gallery-secondary-button {
    width: 100%;
  }

  .gallery-album-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-auto-rows: 300px;
  }

  .gallery-card:nth-child(7n + 1),
  .gallery-card.is-featured,
  .gallery-skeleton-card:nth-child(7n + 1) {
    grid-column: auto;
    grid-row: auto;
  }

  .gallery-club-strip-inner .gallery-primary-button {
    width: 100%;
  }

  .gallery-lightbox {
    padding: 0;
  }

  .gallery-lightbox-window {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .gallery-lightbox-media {
    min-height: 360px;
  }

  .gallery-lightbox-nav {
    top: 32%;
  }

  .gallery-lightbox-content {
    padding: 26px 18px 40px;
  }

  .gallery-lightbox-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .gallery-lightbox-actions .gallery-primary-button,
  .gallery-lightbox-actions .gallery-secondary-button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .gallery-page .container {
    width: calc(100% - 16px);
  }

  .gallery-hero-stats,
  .gallery-album-summary {
    grid-template-columns: 1fr;
  }

  .gallery-hero-stats .gallery-stat-card:last-child,
  .gallery-album-summary > div:last-child {
    grid-column: auto;
  }

  .gallery-grid {
    grid-auto-rows: 260px;
  }

  .gallery-lightbox-nav {
    width: 46px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-page *,
  .gallery-page *::before,
  .gallery-page *::after,
  .gallery-lightbox *,
  .gallery-lightbox *::before,
  .gallery-lightbox *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports (padding: env(safe-area-inset-top)) {
  .gallery-hero {
    padding-top: calc(126px + env(safe-area-inset-top));
  }

  .gallery-toast-container {
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
  }

  @media (max-width: 900px) {
    .gallery-hero {
      padding-top: calc(96px + env(safe-area-inset-top));
    }
  }
}
