/* Gallery-only styles - Categorized gallery with tabs */
/* Header uses default styling from style.css - DO NOT override */

/* --- Page background --- */
.gallery-page{
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(37,99,235,.22), transparent 60%),
    radial-gradient(900px 600px at 85% 35%, rgba(236,72,153,.14), transparent 55%),
    linear-gradient(180deg, #0a152b 0%, #081223 50%, #07101f 100%);
  color:#eaf2ff;
  padding-bottom: 64px;
  min-height: 100vh;
}

/* --- Hero section --- */
.gallery-hero{
  padding: 44px 0 32px;
  text-align: center;
}

.gallery-hero .kicker{
  opacity:.8;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-size:12px;
  color: rgba(37,99,235,1);
  margin-bottom: 8px;
}

.gallery-hero h1{
  margin: 10px 0 12px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 800;
}

.gallery-hero .lede{
  max-width: 70ch;
  opacity:.88;
  margin: 0 auto;
  font-size: 18px;
}

/* --- Category Tabs --- */
.gallery-tabs-section{
  padding: 0 0 32px;
}

.gallery-tabs{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.08);
}

.gallery-tab{
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(234,242,255,.85);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-icon {
  font-size: 16px;
  opacity: 0.8;
  transition: all 0.2s ease;
}

.gallery-tab:hover .tab-icon {
  opacity: 1;
  transform: scale(1.1);
}

.gallery-tab:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.18);
  transform: translateY(-1px);
}

.gallery-tab.active{
  background: rgba(37,99,235,.25);
  border-color: rgba(37,99,235,.45);
  color: #fff;
  box-shadow: 0 0 20px rgba(37,99,235,.35);
}

/* --- Gallery section --- */
.gallery-section{
  padding: 0;
}

/* --- Category Cards Grid --- */
.gallery-categories-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

@media (max-width: 768px){
  .gallery-categories-grid{
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 480px){
  .gallery-categories-grid{
    grid-template-columns: 1fr;
  }
}

/* --- Category Card --- */
.category-card{
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 10px 40px rgba(0,0,0,.30);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.category-card:hover{
  transform: translateY(-4px);
  border-color: rgba(37,99,235,.45);
  box-shadow: 
    0 20px 60px rgba(0,0,0,.40),
    0 0 30px rgba(37,99,235,.25);
  background: rgba(255,255,255,.08);
}

/* Hidden by default - shown by JS based on active tab */
.category-card[data-category]:not([data-category="all"]){
  display: none;
}

/* Show all cards when "All" tab is active */
.category-card{
  display: flex;
}

/* --- Card Image --- */
.category-card-image{
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37,99,235,.15), rgba(236,72,153,.10));
  position: relative;
}

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

.category-card:hover .category-card-image img{
  transform: scale(1.05);
}

/* --- Card Label --- */
.category-card-label{
  padding: 20px;
  background: rgba(10,20,35,.60);
  backdrop-filter: blur(10px);
}

.category-card-label h3{
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.category-card-label p{
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
  color: rgba(234,242,255,.85);
}

/* --- ENHANCED HISTORY SECTION --- */

/* History Header with background and stats */
.history-header {
  position: relative;
  padding: 60px 24px;
  margin-bottom: 40px;
  border-radius: 24px;
  overflow: hidden;
  background: 
    linear-gradient(135deg, rgba(10,20,35,.95) 0%, rgba(16,37,90,.92) 100%),
    linear-gradient(45deg, transparent 30%, rgba(37,99,235,.08) 50%, transparent 70%);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 
    0 20px 60px rgba(0,0,0,.40),
    inset 0 1px 0 rgba(255,255,255,.1);
}

.history-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    /* Film grain texture */
    url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.08"/></svg>'),
    /* Vintage vignette */
    radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,.3) 100%);
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.history-header::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    /* Subtle RAF roundel pattern */
    radial-gradient(circle at 20% 30%, rgba(37,99,235,.15) 0%, transparent 25%),
    radial-gradient(circle at 80% 70%, rgba(220,38,38,.08) 0%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(251,191,36,.05) 0%, transparent 30%);
  opacity: 0.6;
  pointer-events: none;
  animation: floatBackground 20s ease-in-out infinite;
}

@keyframes floatBackground {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(2%, -2%) rotate(1deg); }
  66% { transform: translate(-2%, 2%) rotate(-1deg); }
}

.history-header-bg {
  position: absolute;
  inset: 0;
  background: 
    /* Grid pattern */
    url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.02)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>'),
    /* Diagonal stripes for vintage feel */
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,.01) 40px,
      rgba(255,255,255,.01) 80px
    );
  opacity: 0.5;
  pointer-events: none;
}

.history-header-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.history-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(251,191,36,.15);
  border: 1px solid rgba(251,191,36,.35);
  border-radius: 50px;
  color: #fbbf24;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.history-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  margin: 0 0 12px 0;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.history-subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin: 0 0 36px 0;
  color: rgba(234,242,255,.95);
}

.history-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.history-stat {
  text-align: center;
}

.history-stat-number {
  font-size: 36px;
  font-weight: 800;
  color: #fbbf24;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.history-stat-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  font-weight: 600;
}

/* Search Bar */
.history-search-container {
  margin-bottom: 24px;
}

.history-search-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.history-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(234,242,255,.5);
  pointer-events: none;
}

.history-search-input {
  width: 100%;
  padding: 14px 48px 14px 48px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50px;
  color: #eaf2ff;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  outline: none;
}

.history-search-input::placeholder {
  color: rgba(234,242,255,.45);
}

.history-search-input:focus {
  background: rgba(255,255,255,.08);
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.history-search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.12);
  color: rgba(234,242,255,.7);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-search-clear:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

/* Decade Filters */
.decade-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 32px;
}

.decade-btn {
  padding: 10px 22px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50px;
  color: rgba(234,242,255,.85);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  white-space: nowrap;
}

.decade-btn:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.20);
  transform: translateY(-1px);
}

.decade-btn.active {
  background: rgba(37,99,235,.25);
  border-color: rgba(37,99,235,.45);
  color: #fff;
  box-shadow: 0 0 20px rgba(37,99,235,.30);
}

/* Results Count */
.history-results-count {
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
  color: rgba(234,242,255,.7);
}

.history-results-count strong {
  color: #fbbf24;
  font-weight: 700;
}

/* History Photos Grid */
.history-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.history-photo {
  display: block;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 4px 16px rgba(0,0,0,.30);
  cursor: pointer;
  background: rgba(255,255,255,.04);
}

.history-photo:hover {
  transform: translateY(-4px);
  border-color: rgba(37,99,235,.40);
  box-shadow: 
    0 12px 36px rgba(0,0,0,.40),
    0 0 25px rgba(37,99,235,.20);
}

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

.history-photo:hover img {
  transform: scale(1.05);
}

.history-photo div {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent);
  color: white;
  font-weight: 700;
  font-size: 15px;
  backdrop-filter: blur(4px);
}

/* No Results Message */
.no-results-message {
  text-align: center;
  padding: 80px 20px;
  opacity: 0.7;
}

.no-results-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.no-results-message h3 {
  font-size: 24px;
  margin: 0 0 10px 0;
  color: #eaf2ff;
}

.no-results-message p {
  margin: 0;
  font-size: 16px;
  color: rgba(234,242,255,.7);
}

/* Lightbox Modal */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: white;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.lightbox-close:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.5);
  transform: rotate(90deg);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1);
  color: white;
  font-size: 32px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.5);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.lightbox-content img {
  max-width: 100%;
  max-height: calc(90vh - 100px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0,0,0,.6);
}

.lightbox-caption {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: rgba(255,255,255,.1);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.2);
}

.lightbox-year {
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
}

.lightbox-counter {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  font-variant-numeric: tabular-nums;
}

/* --- Responsive adjustments --- */
@media (max-width: 768px) {
  .history-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .history-header {
    padding: 40px 20px;
  }

  .history-stats {
    gap: 32px;
  }

  .history-stat-number {
    font-size: 28px;
  }

  .decade-filters {
    gap: 8px;
  }

  .decade-btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 20px;
    top: 12px;
    right: 12px;
  }

  .lightbox-prev {
    left: 12px;
  }

  .lightbox-next {
    right: 12px;
  }
}

@media (max-width: 640px){
  .gallery-tabs{
    gap: 6px;
    padding: 8px;
  }
  
  .gallery-tab{
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .gallery-hero{
    padding: 32px 0 24px;
  }
  
  .category-card-label{
    padding: 16px;
  }
  
  .category-card-label h3{
    font-size: 18px;
  }

  .history-photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .history-title {
    font-size: 28px;
  }

  .history-subtitle {
    font-size: 15px;
  }

  .history-stats {
    flex-direction: column;
    gap: 20px;
  }

  .history-search-input {
    padding: 12px 40px;
    font-size: 14px;
  }
}

/* Photo Grids for Categories */
.photos-grid-section {
  width: 100%;
  padding: 40px 20px;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.photos-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s;
}

.photos-grid img:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .photos-grid img {
    height: 150px;
  }
}

/* Category Headers (like History but simpler) */
.category-header {
  text-align: center;
  padding: 40px 20px 20px;
  margin-bottom: 20px;
}

.category-header h2 {
  font-size: 2.5rem;
  color: #ffffff;
  margin: 0 0 10px 0;
  font-weight: 700;
}

.category-header p {
  font-size: 1.1rem;
  color: #b8c9e0;
  margin: 0 0 20px 0;
}

.category-stats {
  font-size: 1rem;
  color: #daa520;
  font-weight: 600;
}

.category-search {
  max-width: 600px;
  margin: 0 auto 30px;
  padding: 0 20px;
}

.category-search input {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transition: all 0.3s ease;
}

.category-search input:focus {
  outline: none;
  border-color: #4a9eff;
  background: rgba(255, 255, 255, 0.08);
}

.category-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
