/* =============================================
   Work Gallery Page Styles
   ============================================= */

/* Gallery Hero Section */
.gallery-hero {
  position: relative;
  padding: 4rem 2rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(30, 30, 45, 0.5) 100%);
}

.gallery-hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.gallery-hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.5rem;
}

/* Gallery content wrapper for sticky controls */
.gallery-content-wrapper {
  position: relative;
}

/* =============================================
   Sort/Filter Controls
   ============================================= */
.gallery-controls {
  padding: 1rem 2rem;
  background: rgba(10, 12, 27, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 80px;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  /* Ensure rounded corners are preserved during sticky scroll */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);
}

/* Responsive sticky top position */
@media (max-width: 768px) {
  .gallery-controls {
    top: 56px;
    padding: 0.75rem 1rem;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 1002;
  }
}

@media (max-width: 480px) {
  .gallery-controls {
    top: 48px;
    padding: 0.5rem 0.75rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 1002;
  }
}

.sort-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.sort-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: var(--overflow-clip);
  transition: 
    color 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

.sort-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 30%,
    rgba(106, 176, 243, 0.15) 45%,
    rgba(106, 176, 243, 0.25) 50%,
    rgba(106, 176, 243, 0.15) 55%,
    transparent 70%,
    transparent 100%
  );
  transition: left 0.5s ease;
  pointer-events: none;
}

.sort-btn:hover::before {
  left: 100%;
}

/* =============================================
   TIMELINE VIEW - Chronological Path (Grid Layout)
   ============================================= */
.gallery-grid.view-timeline {
  display: block;
  position: relative;
  padding: 2rem 0;
  padding-left: 40px;
  overflow: visible;
}

/* Continuous vertical path line for entire timeline */
.gallery-grid.view-timeline::before {
  content: '';
  position: absolute;
  top: -80px; /* Extend up behind the controls */
  left: 18px;
  width: 4px;
  height: calc(100% + 80px);
  background: linear-gradient(180deg, 
    transparent 0%,
    rgba(106, 176, 243, 0.15) 5%,
    rgba(106, 176, 243, 0.4) 10%,
    rgba(106, 176, 243, 0.4) 95%,
    transparent 100%
  );
  border-radius: 2px;
  z-index: -1;
}

/* Continuous flowing light effect */
.gallery-grid.view-timeline::after {
  content: '';
  position: absolute;
  top: -80px;
  left: 18px;
  width: 4px;
  height: 20%;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(106, 176, 243, 0.4) 20%,
    rgba(106, 176, 243, 1) 50%,
    rgba(106, 176, 243, 0.4) 80%,
    transparent 100%
  );
  animation: timelineFlow 10s linear infinite;
  border-radius: 2px;
  pointer-events: none;
  z-index: -1;
}

@keyframes timelineFlow {
  0% { top: -80px; opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Year Section Container */
.timeline-year-section {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-year-section:last-child {
  margin-bottom: 0;
}

/* Timeline year markers */
.timeline-year-marker {
  position: relative;
  margin-bottom: 2rem;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
}

/* Dot on the path line at year marker */
.timeline-year-marker::before {
  content: '';
  position: absolute;
  left: -48px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: var(--radius-full);
  border: 3px solid var(--bg);
  box-shadow: 0 0 15px rgba(106, 176, 243, 0.6);
  z-index: 10;
}

/* Connector line from dot to year badge */
.timeline-year-marker::after {
  content: '';
  position: absolute;
  left: -32px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 3px;
  background: var(--accent);
  z-index: 5;
}

.year-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  position: relative;
  z-index: 6;
  box-shadow: 0 0 20px rgba(106, 176, 243, 0.2);
}

/* Decorative line extending from year badge */
.year-badge::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% + 100vw);
  height: 1px;
  background: linear-gradient(90deg, 
    var(--accent) 0%,
    rgba(106, 176, 243, 0.2) 10%,
    rgba(106, 176, 243, 0.1) 30%,
    rgba(106, 176, 243, 0.05) 60%,
    transparent 100%
  );
}

/* Timeline cards grid within each year */
.timeline-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  position: relative;
  padding-left: 0;
}

/* Timeline card wrapper with date label */
.timeline-card-wrapper {
  position: relative;
}

/* Date label for timeline cards */
.timeline-date {
  display: inline-block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: rgba(106, 176, 243, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(106, 176, 243, 0.2);
}

/* =============================================
   CATEGORY VIEW - Grouped Sections
   ============================================= */
.gallery-grid.view-category {
  display: block;
}

.category-section {
  margin-bottom: 4rem;
}

.category-section:last-child {
  margin-bottom: 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(106, 176, 243, 0.2) 0%, rgba(74, 141, 195, 0.3) 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(106, 176, 243, 0.3);
  overflow: var(--overflow-clip);
}

.category-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
  fill: none;
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.category-count {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: auto;
}

.category-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* =============================================
   ALPHABETICAL VIEW - Letter Sections
   ============================================= */
.gallery-grid.view-alpha {
  display: block;
}

/* Jump Navigation */
.alpha-jump-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding: 1rem;
  background: rgba(30, 30, 45, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: var(--overflow-clip);
}

.alpha-jump-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.alpha-jump-link:hover {
  color: var(--accent);
  background: rgba(106, 176, 243, 0.1);
}

.alpha-jump-link.disabled {
  color: rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.alpha-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: 180px;
}

.alpha-section:last-child {
  margin-bottom: 0;
}

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

.alpha-letter {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  min-width: 80px;
  text-align: center;
  opacity: 0.8;
}

.alpha-divider {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(106, 176, 243, 0.3), transparent);
}

.alpha-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.sort-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  transition: stroke 0.3s ease;
}

.sort-btn:hover {
  color: var(--text);
  border-color: rgba(106, 176, 243, 0.5);
  box-shadow: 0 0 15px rgba(106, 176, 243, 0.1);
}

/* Active Sort Button State */
.sort-btn.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(106, 176, 243, 0.2) 0%, rgba(74, 141, 195, 0.25) 100%);
  border-color: var(--accent);
  box-shadow: 
    0 0 20px rgba(106, 176, 243, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sort-btn.active .sort-icon {
  stroke: var(--accent);
}

.sort-btn:active {
  transform: scale(0.98);
}

/* =============================================
   Gallery Section Base
   ============================================= */
.gallery-section {
  padding: 3rem 2rem 4rem;
  min-height: 60vh;
  transition: padding 0.4s ease;
  overflow: var(--overflow-clip); /* Clip the timeline path extending above */
  position: relative;
  /* Ensure inner content respects rounded corners during scroll */
  isolation: isolate;
}

.gallery-grid {
  max-width: 1400px;
  margin: 0 auto;
  transition: all 0.4s ease;
}

/* Default Grid Layout */
.gallery-grid.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* =============================================
   Flip Card Styles
   ============================================= */
.gallery-card {
  perspective: 1000px;
  height: 400px;
  cursor: pointer;
}

/* Card link wrapper - makes entire card clickable */
.gallery-card-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.gallery-card-link:focus-visible .gallery-card-inner {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.gallery-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.gallery-card:hover .gallery-card-inner {
  transform: rotateY(180deg);
}

/* Card Faces */
.gallery-card-front,
.gallery-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: var(--overflow-clip);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    0 2px 10px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

.gallery-card:hover .gallery-card-front,
.gallery-card:hover .gallery-card-back {
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 5px 20px rgba(0, 0, 0, 0.4);
}

/* Front Face */
.gallery-card-front {
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
}

.card-thumbnail {
  width: 100%;
  height: 60%;
  background-size: cover;
  background-position: center;
  background-color: #2a2a3d;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Thumbnail placeholder - shown when no image is set */
.card-thumbnail-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #2a2a3d 0%, #1e1e2d 100%);
  z-index: 0;
}

.card-thumbnail-placeholder svg {
  width: 64px;
  height: 64px;
  stroke: rgba(106, 176, 243, 0.3);
  opacity: 0.6;
}

/* Hide placeholder when thumbnail image is loaded */
.card-thumbnail[style*="background-image"] .card-thumbnail-placeholder {
  opacity: 0;
}

.card-thumbnail::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, var(--card-bg), transparent);
  z-index: 1;
}

.card-front-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-front-content h3 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.card-category-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(106, 176, 243, 0.15);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: auto;
  width: fit-content;
}

/* Back Face */
.gallery-card-back {
  background: linear-gradient(145deg, var(--card-bg), #252538);
  transform: rotateY(180deg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
}

.gallery-card-back h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.card-back-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(120,140,180,0.18) rgba(40,40,60,0.08);
}

/* Custom Scrollbar for Overview Text (Card Back) */
.card-back-description::-webkit-scrollbar {
  width: 7px;
  background: transparent;
}
.card-back-description::-webkit-scrollbar-thumb {
  background: rgba(120,140,180,0.18);
  border-radius: 8px;
  min-height: 24px;
  border: 2px solid rgba(40,40,60,0.08);
}
.card-back-description::-webkit-scrollbar-thumb:hover {
  background: rgba(120,140,180,0.28);
}
.card-back-description::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 8px;
}


.card-back-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.meta-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--accent);
  fill: none;
}

.meta-item span {
  color: var(--text);
}

/* Tech Tags */
.card-back-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tech-tag {
  background: rgba(106, 176, 243, 0.12);
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  border: 1px solid rgba(106, 176, 243, 0.25);
}

.tech-tag--more {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Role Tags */
.card-back-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.role-tag {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 500;
}

/* Card Links */
.card-back-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);
  overflow: var(--overflow-clip);
  transition: all 0.3s ease;
}

.card-link--view {
  background: linear-gradient(135deg, rgba(106, 176, 243, 0.2) 0%, rgba(74, 141, 195, 0.25) 100%);
  border-color: var(--accent);
}

.card-link svg {
  width: 16px;
  height: 16px;
}

.card-link:hover,
.gallery-card:hover .card-link--view {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.card-link:hover svg,
.gallery-card:hover .card-link--view svg {
  stroke: var(--bg);
}

/* =============================================
   View Transition Animations
   ============================================= */
.gallery-grid {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.gallery-grid.transitioning {
  opacity: 0;
}

.gallery-grid.sorting .gallery-card {
  animation: cardFadeOut 0.3s ease forwards;
}

.gallery-grid.sorted .gallery-card {
  animation: cardFadeIn 0.4s ease forwards;
  animation-delay: calc(var(--card-index) * 0.05s);
}

@keyframes cardFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Initial load animation */
.gallery-card {
  opacity: 0;
  animation: cardFadeIn 0.5s ease forwards;
  animation-delay: calc(var(--card-index, 0) * 0.08s);
}

/* Timeline-specific animations */
.timeline-year-section {
  opacity: 0;
  animation: sectionFadeIn 0.5s ease forwards;
  animation-delay: calc(var(--section-index, 0) * 0.15s);
}

.timeline-card-wrapper {
  opacity: 0;
  animation: cardFadeIn 0.5s ease forwards;
  animation-delay: calc(var(--card-index, 0) * 0.08s);
}

.timeline-year-marker {
  opacity: 0;
  animation: yearMarkerFadeIn 0.5s ease forwards;
}

@keyframes yearMarkerFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Category section animations */
.category-section {
  opacity: 0;
  animation: sectionFadeIn 0.5s ease forwards;
  animation-delay: calc(var(--section-index, 0) * 0.1s);
}

@keyframes sectionFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Alpha section animations */
.alpha-section {
  opacity: 0;
  animation: sectionFadeIn 0.5s ease forwards;
  animation-delay: calc(var(--section-index, 0) * 0.08s);
}

/* =============================================
   Active Navigation Link
   ============================================= */
.nav-links a.active {
  color: var(--accent);
  position: relative;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* =============================================
   Footer Styling (Gallery Page)
   ============================================= */
.gallery-section + .site-footer {
  background: var(--bg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* =============================================
   Responsive Design
   ============================================= */
@media (max-width: 1024px) {
  .gallery-grid.view-grid,
  .category-cards,
  .alpha-cards,
  .timeline-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }
  
  .gallery-hero h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-hero {
    padding: 3rem 1.5rem 1.5rem;
  }
  
  .gallery-hero h1 {
    font-size: 2rem;
  }
  
  .gallery-subtitle {
    font-size: 1rem;
  }
  
  .sort-buttons {
    gap: 0.5rem;
  }
  
  .sort-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
  }
  
  .sort-btn span {
    display: none;
  }
  
  .sort-icon {
    width: 20px;
    height: 20px;
  }
  
  .gallery-section {
    padding: 2rem 1rem 3rem;
  }

  .alpha-section {
    scroll-margin-top: 160px;
  }
  
  .gallery-grid.view-grid,
  .category-cards,
  .alpha-cards,
  .timeline-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
  }
  
  .gallery-card {
    height: 380px;
  }
  
  /* Category view mobile */
  .category-header {
    flex-wrap: wrap;
  }
  
  .category-title {
    font-size: 1.25rem;
  }
  
  .category-count {
    width: 100%;
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  /* Alpha view mobile */
  .alpha-jump-nav {
    gap: 0.25rem;
    padding: 0.75rem;
  }
  
  .alpha-jump-link {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
  }
  
  .alpha-letter {
    font-size: 2rem;
    min-width: 60px;
  }
  
  /* Timeline mobile adjustments */
  .gallery-grid.view-timeline {
    padding-left: 30px;
  }
  
  .gallery-grid.view-timeline::before,
  .gallery-grid.view-timeline::after {
    left: 10px;
  }
  
  .timeline-year-marker::before {
    left: -28px;
    width: 12px;
    height: 12px;
  }
  
  .timeline-year-marker::after {
    left: -16px;
    width: 16px;
  }

  .timeline-card-wrapper::before {
    left: -28px;
    width: 6px;
    height: 6px;
  }
  
  .timeline-card-wrapper::after {
    left: -20px;
    width: 20px;
  }

  .year-badge::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .gallery-hero h1 {
    font-size: 1.75rem;
  }
  
  .gallery-card {
    height: 360px;
  }
  
  .card-thumbnail {
    height: 55%;
  }
  
  .card-front-content {
    padding: 1.25rem;
  }
  
  .card-front-content h3 {
    font-size: 1.15rem;
  }
  
  .gallery-card-back {
    padding: 1.25rem;
  }

  .alpha-section {
    scroll-margin-top: 140px;
  }
  
  /* Timeline mobile adjustments */
  .gallery-grid.view-timeline {
    padding-left: 0.5rem;
  }
  
  .gallery-grid.view-timeline::before,
  .gallery-grid.view-timeline::after {
    display: none;
  }
  
  .timeline-year-marker::before,
  .timeline-year-marker::after {
    display: none;
  }

  .timeline-card-wrapper::before,
  .timeline-card-wrapper::after {
    display: none;
  }

  .year-badge {
    font-size: 0.95rem;
    padding: 0.4rem 1.2rem;
  }
}

/* =============================================
   Reduced Motion Support
   ============================================= */
@media (prefers-reduced-motion: reduce) {
  .gallery-card-inner {
    transition: none;
  }
  
  .gallery-card,
  .timeline-year-section,
  .timeline-card-wrapper,
  .timeline-year-marker,
  .category-section,
  .alpha-section {
    animation: none;
    opacity: 1;
  }
  
  .gallery-grid.sorting .gallery-card,
  .gallery-grid.sorted .gallery-card {
    animation: none;
    opacity: 1;
  }
  
  .sort-btn::before {
    transition: none;
  }
  
  .sort-btn:hover::before {
    left: -100%;
  }
  
  .gallery-grid.view-timeline::after {
    animation: none;
  }
}

/* =============================================
   Empty State
   ============================================= */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.5);
}

.gallery-empty svg {
  width: 64px;
  height: 64px;
  stroke: rgba(255, 255, 255, 0.3);
  margin-bottom: 1rem;
}

.gallery-empty h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
}
