/* ==========================================================================
   InterCUP 2026 Gallery — Interact Pontus Euxinus
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@1,500&family=Space+Mono:wght@700&display=swap');

:root {
  --blue-700: #1565C0;
  --blue-600: #1976D2;
  --blue-500: #2196F3;
  --blue-400: #42A5F5;
  --navy: #0D1B2A;
  --white: #fff;
  --gray-50: #F8F9FA;
  --gray-100: #F1F3F5;
  --gray-200: #E5E7EB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-700: #374151;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--navy);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; }
button { font-family: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; }

/* ==========================================================================
   Hero Header — blue band with logo
   ========================================================================== */

.hero {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  color: var(--white);
  padding: 2.5rem 1.5rem 2.25rem;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.hero-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.3);
}

@media (max-width: 480px) {
  .hero-logo { width: 50px; height: 50px; border-radius: 12px; }
}

.hero-text { min-width: 0; }

.hero-title {
  font-size: clamp(1.5rem, 4.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

/* Author handles — plain inline text on the blue background */
.hero-credits {
  margin-top: 0.3rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
}

.handle-tech {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  text-decoration: none;
  position: relative;
  display: inline;
}

.handle-tech::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 1.5px;
  background: rgba(255,255,255,0.6);
  animation: techPulse 2.8s ease-in-out infinite;
}

@keyframes techPulse {
  0%, 100% { opacity: 0.15; transform: scaleX(0.5); }
  50% { opacity: 0.8; transform: scaleX(1); }
}

.handle-tech:hover { color: #fff; }
.handle-tech:hover::after { opacity: 1; animation: none; }

.handle-elegant {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.9rem;
  color: #fff;
  text-decoration: none;
  display: inline;
}

.handle-elegant:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.sparkle {
  display: inline-block;
  font-style: normal;
  font-size: 0.7em;
  animation: twinkle 2.2s ease-in-out infinite;
}
.sparkle.s2 { animation-delay: 1.1s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.amp {
  color: rgba(255,255,255,0.45);
  margin: 0 3px;
}

/* ==========================================================================
   Toolbar
   ========================================================================== */

.toolbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-500);
}

.toolbar-right { display: flex; align-items: center; gap: 8px; }

.btn-zip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: var(--white);
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-zip:hover { background: var(--blue-700); }
.btn-zip svg { width: 14px; height: 14px; fill: currentColor; }

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
}

.btn-view {
  background: none;
  border: none;
  padding: 7px 12px;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.btn-view.active { background: var(--navy); color: var(--white); }

/* ==========================================================================
   Photo Grid
   ========================================================================== */

.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 580px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

.grid.compact {
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
@media (min-width: 580px) {
  .grid.compact { grid-template-columns: repeat(4, 1fr); gap: 5px; }
}
@media (min-width: 900px) {
  .grid.compact { grid-template-columns: repeat(6, 1fr); gap: 6px; }
}

.card {
  position: relative;
  aspect-ratio: 9 / 14;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--gray-200);
}

.grid.compact .card { border-radius: 4px; }

.card.landscape { aspect-ratio: 16 / 10; }

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover img { transform: scale(1.04); }

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .card-overlay { opacity: 1; }
@media (hover: none) { .card-overlay { opacity: 1; } }

.card-name {
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
}

.btn-dl {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--navy);
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.btn-dl:hover { transform: scale(1.1); }

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.lightbox.open { opacity: 1; visibility: visible; pointer-events: auto; }

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  flex-shrink: 0;
}

.lb-counter {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  font-weight: 500;
}

.lb-actions { display: flex; gap: 8px; }

.lb-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s ease;
}
.lb-btn:hover { background: rgba(255,255,255,0.2); }
.lb-btn.close:hover { background: #dc2626; }

.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 56px;
  overflow: hidden;
}
@media (max-width: 640px) { .lb-stage { padding: 0 8px; } }

.lb-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: auto;
  -webkit-user-select: auto;
  transform: scale(0.96);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}
.lightbox.open .lb-img { transform: scale(1); opacity: 1; }
.lb-img.zoomed { cursor: grab; transform: scale(2); }

.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lb-arrow:hover { background: rgba(255,255,255,0.18); }
.lb-arrow.prev { left: 10px; }
.lb-arrow.next { right: 10px; }
@media (max-width: 640px) { .lb-arrow { display: none; } }

.lb-bottom {
  padding: 14px 16px 18px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.lb-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 6px;
  transition: background 0.12s ease;
}
.lb-download:hover { background: var(--gray-100); }

/* Hint — mobile only */
.lb-hint { display: none; }

@media (max-width: 768px) {
  .lb-hint {
    display: flex;
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255,255,255,0.85);
    padding: 8px 12px 8px 14px;
    border-radius: 20px;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    max-width: 88vw;
    z-index: 10;
    white-space: nowrap;
    animation: hintIn 0.35s ease;
  }
  .lb-hint.dismissed { display: none; }
  .hint-dismiss {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    flex-shrink: 0;
  }
}

@keyframes hintIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==========================================================================
   ZIP Modal
   ========================================================================== */

.zip-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.15s ease;
}
.zip-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; }

.zip-card {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.zip-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }

.zip-track {
  width: 100%;
  height: 4px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.zip-bar {
  width: 0%;
  height: 100%;
  background: var(--blue-600);
  border-radius: 2px;
  transition: width 0.15s ease;
}
.zip-card p { font-size: 0.8rem; color: var(--gray-500); }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  padding: 2rem 1.5rem;
  text-align: center;
}
.site-footer a { font-size: 0.8rem; font-weight: 600; color: var(--blue-700); text-decoration: none; }
.site-footer p { font-size: 0.75rem; color: var(--gray-400); margin-top: 4px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
