.gallery-page {
  width: 100%;
  padding: 1.5rem 1rem 4rem;
  background: #0c0c0d;
  color: #f5f1ea;
  box-sizing: border-box;
}
.gallery-page * {
  box-sizing: border-box;
}
.gallery-page .gallery-hero,
.gallery-page .gallery-soiree,
.gallery-page .gallery-empty {
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
}
.gallery-page section {
  min-height: auto;
  flex: none;
  display: block;
  align-items: normal;
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}
.gallery-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 1rem;
}
.gallery-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 0.6rem;
  color: #fff;
}
.gallery-hero p {
  color: rgba(245, 241, 234, 0.75);
  max-width: 640px;
  margin: 0 auto 1.6rem;
  line-height: 1.6;
}
.gallery-btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 100px;
  font-weight: 700;
  border: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.gallery-btn--primary {
  background: var(--rouge-gc);
  color: #fff;
  box-shadow: 0 8px 24px rgba(var(--rouge-gc-rgb), 0.4);
}
.gallery-btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(var(--rouge-gc-rgb), 0.55);
}
.gallery-soiree {
  margin-bottom: 3.5rem;
}
.gallery-soiree h2 {
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 0.6rem;
  margin: 0 0 1.2rem;
  text-transform: capitalize;
  color: #fff;
}
.gallery-count {
  color: rgba(245, 241, 234, 0.5);
  font-weight: 400;
  font-size: 0.85rem;
}
.gallery-masonry {
  columns: 4 220px;
  column-gap: 14px;
}
@media (max-width: 640px) {
  .gallery-masonry {
    columns: 2 160px;
  }
}
.gallery-masonry__item {
  display: block;
  position: relative;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  break-inside: avoid;
  background: #1a1717;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: zoom-in;
}
.gallery-masonry__item:hover,
.gallery-masonry__item:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
}
.gallery-masonry__item img,
.gallery-masonry__item video {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s ease;
}
.gallery-masonry__item:hover img {
  transform: scale(1.05);
}
.gallery-masonry__item--video {
  cursor: default;
}
.gallery-masonry__item--video:hover,
.gallery-masonry__item--video:focus-visible {
  transform: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
.gallery-masonry__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 0.75rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
  padding: 1.4rem 0.6rem 0.4rem;
  pointer-events: none;
}
.gallery-empty {
  text-align: center;
  color: rgba(245, 241, 234, 0.6);
  padding: 3rem 1rem;
}
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0.94);
  animation: gallery-fade-in 0.25s ease both;
}
.gallery-lightbox[hidden] {
  display: none;
}
@keyframes gallery-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.gallery-lightbox__img {
  max-width: min(92vw, 1100px);
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover {
  background: var(--rouge-gc);
  transform: scale(1.08);
}
.gallery-lightbox__close {
  top: 20px;
  right: 20px;
}
.gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}
.gallery-lightbox__nav:hover {
  transform: translateY(-50%) scale(1.08);
}
.gallery-lightbox__nav--prev {
  left: 20px;
}
.gallery-lightbox__nav--next {
  right: 20px;
}
@media (max-width: 640px) {
  .gallery-lightbox__close,
  .gallery-lightbox__nav {
    width: 40px;
    height: 40px;
  }
  .gallery-lightbox__nav--prev {
    left: 8px;
  }
  .gallery-lightbox__nav--next {
    right: 8px;
  }
}
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.gallery-overlay--active {
  opacity: 1;
  visibility: visible;
}
.gallery-upload-popup {
  position: fixed;
  z-index: 999;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%);
  width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  color: #1a1717;
  border-radius: 18px;
  padding: 1.6rem 1.6rem 1.4rem;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}
.gallery-upload-popup--active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}
.gallery-upload-popup h2 {
  margin: 0 0 1.2rem;
  font-size: 1.2rem;
  color: #1a1717;
}
.gallery-upload-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f2f2f2;
  border: none;
  color: #444;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
.gallery-upload-popup__close:hover {
  background: #e4e4e4;
}
.gallery-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}
.gallery-field > label {
  font-weight: 600;
  font-size: 0.95rem;
}
.gallery-field .opt {
  font-weight: 400;
  color: #999;
}
.gallery-field input[type="text"],
.gallery-field input[type="date"],
.gallery-field select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  font-size: 1rem;
  min-height: 44px;
  box-sizing: border-box;
  background: #fff;
  color: #1a1717;
}
.gallery-field select:disabled {
  background: #f2f2f2;
  color: #999;
}
.gallery-field input:focus-visible,
.gallery-field select:focus-visible {
  outline: 3px solid rgba(200, 40, 40, 0.3);
  outline-offset: 1px;
  border-color: #c82828;
}
.gallery-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.4rem;
  border: 2px dashed #c9c9c9;
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.gallery-drop:hover {
  border-color: #c82828;
  background: #fff5f5;
}
.gallery-drop__main {
  font-weight: 600;
}
.gallery-drop__hint {
  color: #999;
  font-size: 0.78rem;
}
.gallery-drop input[type="file"] {
  width: 100%;
  font-size: 0.85rem;
}
.gallery-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  margin: 0 0 1.1rem;
}
.gallery-previews:empty {
  display: none;
}
.gallery-preview {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #eee;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-preview__vid {
  font-size: 1.8rem;
}
.gallery-preview span {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 0.6rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  text-align: center;
  padding: 1px 2px;
}
.gallery-preview.is-toobig {
  outline: 2px solid #d33;
  outline-offset: -2px;
}
.gallery-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: #444;
  line-height: 1.45;
  margin-bottom: 1.2rem;
  cursor: pointer;
}
.gallery-consent input {
  margin-top: 0.15rem;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.gallery-submit {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 12px;
  background: #c82828;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.gallery-submit:hover {
  background: #a81f1f;
}
.gallery-submit:active {
  transform: scale(0.98);
}
.gallery-submit:disabled {
  opacity: 0.6;
  cursor: default;
}
.gallery-bar-wrap {
  height: 22px;
  background: #eee;
  border-radius: 11px;
  overflow: hidden;
  margin-top: 0.9rem;
}
.gallery-bar {
  height: 100%;
  width: 0;
  background: #2a9d3a;
  color: #fff;
  font-size: 0.7rem;
  line-height: 22px;
  text-align: center;
  transition: width 0.2s ease;
}
.gallery-status {
  margin: 0.8rem 0 0;
  font-size: 0.92rem;
  min-height: 1.2em;
}
.gallery-status.is-error {
  color: #c0392b;
}
.gallery-status.is-success {
  color: #1e7d2f;
  font-weight: 600;
}
.gallery-status.is-loading {
  color: #555;
}
@media (max-width: 600px) {
  .gallery-upload-popup {
    padding: 1.3rem 1.1rem 1.1rem;
  }
}
