/* =============================================
   GALLERY PAGE STYLES
   ============================================= */

/* Gallery page body — lighter/fresher background */
body.gallery-page {
  background: #272422;
}

/* Page header */
.page-header {
  padding: 10rem 2rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, #1a1410 0%, #1a1816 100%);
  border-bottom: 1px solid rgba(201,168,76,0.1);
}

.page-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--white);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.page-sub {
  font-size: 0.9rem;
  color: var(--gray-lt);
  letter-spacing: 0.12em;
}

/* Gallery sections */
.gallery-section {
  padding: 5rem 0 3rem;
  background: #272422;
}

.gallery-section + .gallery-section {
  border-top: 1px solid rgba(201,168,76,0.07);
}

.gallery-section-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.gallery-section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
}

.section-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(201,168,76,0.25), transparent);
}

/* Photos section has no bottom padding — masonry goes to edge */
.gallery-photos-section {
  padding-bottom: 0;
}

/* =============================================
   AFTERMOVIES — horizontal scroll strip
   ============================================= */
.aftermovies-grid {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.8rem;
  cursor: grab;
  margin: 0 -1rem; /* bleed past container padding */
  padding-left: 1rem;
  padding-right: 1rem;
}
.aftermovies-grid:active { cursor: grabbing; }
.aftermovies-grid::-webkit-scrollbar { height: 3px; }
.aftermovies-grid::-webkit-scrollbar-track { background: transparent; }
.aftermovies-grid::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

.aftermovie-card {
  cursor: pointer;
  flex-shrink: 0;
  width: 280px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--dark2);
  border: 1px solid rgba(255,255,255,0.06);
  scroll-snap-align: start;
  transition: transform 0.25s, box-shadow 0.25s;
}

.aftermovie-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

.aftermovie-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #111;
}

.thumb-video,
.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  transition: background 0.2s;
}

.aftermovie-card:hover .play-overlay {
  background: rgba(0,0,0,0.15);
}

.play-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(201,168,76,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--black);
  transition: transform 0.2s, background 0.2s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.aftermovie-card:hover .play-btn {
  transform: scale(1.1);
  background: var(--gold);
}

.aftermovie-info {
  padding: 0.75rem 1rem;
}

.aftermovie-info h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.15rem;
  letter-spacing: 0.04em;
}

.aftermovie-info p {
  font-size: 0.72rem;
  color: var(--gray-lt);
  letter-spacing: 0.08em;
}

/* =============================================
   FILTER TABS
   ============================================= */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.filter-tab {
  padding: 0.55rem 1.3rem;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--gray-lt);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  border-color: rgba(201,168,76,0.4);
  color: var(--white);
}

.filter-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
  font-weight: 600;
}

/* =============================================
   EVENT MASONRY
   ============================================= */
.masonry-wrap {
  background: #272422;
  padding-bottom: 2rem;
}

.event-masonry {
  margin-bottom: 0;
}

.event-masonry.hidden {
  display: none;
}

.event-label {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 2rem 2rem 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

.event-label-date {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  white-space: nowrap;
}

.event-label-name {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event-label-rule {
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

/* =============================================
   MASONRY GRID — justified rows (maja-event style)
   ============================================= */
.masonry-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 3px;
}

.masonry-grid img {
  display: block;
  height: 280px;
  width: auto;
  min-width: 120px;
  flex-grow: 1;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.22s, filter 0.22s;
  vertical-align: top;
  border-radius: 0;
  margin-bottom: 0;
}

.masonry-grid img:hover {
  opacity: 0.80;
  filter: brightness(1.06);
}

/* =============================================
   VIDEO MODAL
   ============================================= */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.96);
  display: none;
  align-items: center;
  justify-content: center;
}

.video-modal.active {
  display: flex;
}

/* Active nav link */
.nav-links a.active {
  color: var(--gold);
}

/* Prevent last image in a row from stretching to fill remaining space */
.masonry-grid::after {
  content: '';
  flex-grow: 99999;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .masonry-grid img { height: 220px; }
}

@media (max-width: 700px) {
  .masonry-grid img { height: 160px; min-width: 80px; }
  .masonry-grid { gap: 2px; margin-bottom: 2px; }
  .aftermovies-grid { grid-template-columns: 1fr; }
  .filter-tabs { gap: 0.4rem; }
  .filter-tab { font-size: 0.72rem; padding: 0.45rem 1rem; }
  .event-label { padding: 1.4rem 1rem 0.8rem; }
}

@media (max-width: 420px) {
  .masonry-grid img { height: 130px; min-width: 60px; }
}
