/* Modern Art Portfolio - Instagram-inspired Dark Design */

/* Cross-Document View Transition API */
@view-transition {
  navigation: auto;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

:root {
  color-scheme: dark;

  /* Sophisticated dark color palette */
  --color-primary: #ffffff;
  --color-secondary: #e5e5e5;
  --color-accent: #d4af37;
  --color-accent-light: #f4e4a6;
  --color-accent-dark: #b8941f;
  --color-background: #000000;
  --color-surface: #111111;
  --color-surface-elevated: #1a1a1a;
  --color-surface-hover: #222222;
  --color-border: #2a2a2a;
  --color-border-light: #333333;
  --color-text: #ffffff;
  --color-text-secondary: #cccccc;
  --color-text-muted: #888888;
  --color-text-light: #666666;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Spacing system */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --spacing-4xl: 96px;

  /* Design tokens */
  --border-radius: 2px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px rgba(212, 175, 55, 0.15);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  font-size: 16px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  user-select: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}
h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}
h4 {
  font-size: 1.25rem;
}

p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* Header */
.site-header {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-medium);
}

/* Remove sticky positioning and border on gallery carousel pages */
body:has(.gallery-content) .site-header {
  position: relative;
  border-bottom: none;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
  position: relative;
}

.logo h1 {
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.03em;
  transition: color var(--transition-fast);
}

.logo a {
  text-decoration: none;
}

.logo:hover h1 {
  color: var(--color-accent);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--spacing-2xl);
  align-items: center;
}

.nav-menu a {
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all var(--transition-fast);
  position: relative;
  padding: var(--spacing-sm) 0;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width var(--transition-medium);
}

.nav-menu a:hover {
  color: var(--color-text);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a.active {
  color: var(--color-text);
}

/* Gallery title in header */
.gallery-title-header {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Gallery title link - invisible styling to maintain design */
.gallery-title-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-title-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.02em;
  text-transform: lowercase;
}

/* Main content */
.main-content {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

/* Hero section */
.hero {
  width: 100%;
  padding: var(--spacing-4xl) 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: clamp(var(--spacing-xl), 5vw, var(--spacing-4xl));
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--spacing-xl);
  padding-right: var(--spacing-xl);
  min-height: 0; /* Prevent grid blowout */
}

.hero-content {
  min-width: 0; /* Allow shrinking */
  max-width: none;
}

.hero-image {
  width: clamp(280px, 35vw, 500px);
  height: auto;
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-slow);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.1;
  margin-bottom: var(--spacing-xl);
  color: var(--color-text);
  letter-spacing: -0.04em;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-2xl);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--color-background);
  padding: 18px 36px;
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: all var(--transition-medium);
  border: 1px solid var(--color-accent);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--color-accent-dark);
  transition: left var(--transition-slow);
  z-index: -1;
}

.cta-button:hover::before {
  left: 0;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium), var(--shadow-glow);
}

.hero-image:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-4px);
  border-color: var(--color-accent);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.hero-image:hover img {
  transform: scale(1.02);
}

.hero-image a {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
}

.hero-image a img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: var(--color-surface-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 300;
  text-align: center;
  padding: var(--spacing-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
}

/* Gallery content - Full height layout */
.gallery-content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  max-height: calc(100vh - 80px);
  overflow: hidden;
  position: relative;
  align-items: center;
  justify-content: center;
  padding: 0; /* Remove padding - buttons will be positioned differently */
}

/* Carousel wrapper - contains scroll container and buttons */
.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* Reserve space for indicators */
  height: calc(100% - 60px);
  /* Reserve space for buttons positioned at viewport edges */
  max-width: calc(100vw - 120px);
}

/* Gallery Grid - Instagram Style */
.galleries-listing {
  padding: var(--spacing-4xl) 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-3xl);
}

.gallery-card {
  background: var(--color-surface);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: all var(--transition-medium);
  box-shadow: var(--shadow-subtle);
  position: relative;
}

.gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
  border-color: var(--color-accent);
}

.gallery-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.gallery-thumbnail {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-card:hover .gallery-thumbnail img {
  transform: scale(1.05);
}

/* Always visible gallery names */
.gallery-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: var(--spacing-2xl) var(--spacing-xl) var(--spacing-xl);
  color: white;
}

.gallery-info h4 {
  color: white;
  margin: 0;
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Native Scroll Carousel */
.gallery-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--color-background);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-carousel.initialized {
  opacity: 1;
}

.carousel-container {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: transparent;
}

/* Native scroll container */
.carousel-scroll-container {
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  background: transparent;
  overscroll-behavior: contain;
}

.carousel-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

.carousel-track {
  display: flex;
  height: 100%;
  width: max-content;
  background: transparent;
}

.carousel-slide {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: transparent;
  /* No padding here - padding will be calculated dynamically */
}

.carousel-slide img {
  max-width: 100%;
  max-height: calc(100vh - 80px - 60px); /* Full available height */
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: transparent;
  /* No border-radius or box-shadow to avoid visual artifacts */
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  border: none;
  color: white;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    all var(--transition-fast),
    opacity var(--transition-medium);
  z-index: 1002;
  opacity: 0.8;
  pointer-events: auto;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  user-select: none;
}

.carousel-nav:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-50%) scale(1.1);
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
}

.carousel-prev {
  left: 20px; /* 20px from left edge of viewport */
}

.carousel-next {
  right: 20px; /* 20px from right edge of viewport */
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 0;
  background: transparent;
  z-index: 10;
  flex-shrink: 0;
  width: 100%;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  border: none;
  outline: none;
}

@media (min-width: 769px) {
  .carousel-dot:hover {
    background: var(--color-text-muted);
    transform: scale(1.2);
  }
}

.carousel-dot.active {
  background: var(--color-accent);
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* About page */
.about-content {
  padding: var(--spacing-4xl) 0;
}

.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--spacing-4xl);
  max-width: 1200px;
  margin: 0 auto;
}

.about-text h3 {
  color: var(--color-text);
  margin-bottom: var(--spacing-xl);
  margin-top: var(--spacing-3xl);
  font-weight: 300;
  font-size: 2rem;
  letter-spacing: -0.02em;
}

.about-text h3:first-child {
  margin-top: 0;
}

.about-text p {
  margin-bottom: var(--spacing-xl);
  line-height: 1.8;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 300;
}

/* No content states */
.no-galleries,
.no-images {
  text-align: center;
  padding: var(--spacing-4xl);
  color: var(--color-text-muted);
}

.no-galleries h3 {
  color: var(--color-text);
  margin-bottom: var(--spacing-xl);
  font-weight: 300;
  font-size: 1.5rem;
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  color: var(--color-text-muted);
  padding: var(--spacing-xl) 0;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
  text-align: center;
}

.footer-content p {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--color-text-light);
  margin-bottom: 0;
  opacity: 0.6;
  letter-spacing: 0.02em;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Loading states */
img {
  transition: opacity var(--transition-medium);
  user-select: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

img[loading='lazy'] {
  opacity: 0;
}

img[loading='lazy'].loaded {
  opacity: 1;
}

/* Responsive design */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }

  .carousel-wrapper {
    max-width: calc(100vw - 100px); /* Reduce button space on tablets */
  }

  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: var(--spacing-2xl);
    padding: var(--spacing-3xl) 0;
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
  }

  .hero-image {
    width: min(400px, 80vw);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-3xl);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
  }
}

@media (max-width: 768px) {
  /* Hide Home nav item on mobile */
  .nav-menu li:first-child {
    display: none;
  }

  .carousel-wrapper {
    max-width: 100vw;
    width: 100vw;
    margin: 0;
    padding: 0;
  }

  .carousel-container {
    width: 100vw;
    margin: 0;
    padding: 0;
  }

  .carousel-scroll-container {
    width: 100vw;
    margin: 0;
    padding: 0;
  }

  .nav-container {
    height: 70px;
    padding: 0 var(--spacing-md);
  }

  body:has(.gallery-content) .nav-menu {
    display: none;
  }

  /* Show gallery title in header on mobile, right-aligned */
  body:has(.gallery-content) .gallery-title-header {
    position: static;
    transform: none;
    left: auto;
    text-align: right;
    pointer-events: auto;
  }

  body:has(.gallery-content) .gallery-title-header h2 {
    font-size: 1.3rem;
  }

  /* Gallery title link - invisible styling to maintain design */
  .gallery-title-link:hover,
  .gallery-title-link:focus,
  .gallery-title-link:active {
    text-decoration: none;
    color: inherit;
    outline: none;
    background: none;
    transform: none;
    box-shadow: none;
  }

  .gallery-title-link h2 {
    margin: 0;
    transition: none;
  }

  .gallery-title-link:hover h2,
  .gallery-title-link:focus h2,
  .gallery-title-link:active h2 {
    color: inherit;
    transform: none;
  }

  /* Keep nav menu visible on non-gallery pages */
  body:not(:has(.gallery-content)) .nav-menu {
    gap: var(--spacing-xl);
  }

  body:not(:has(.gallery-content)) .nav-menu a {
    font-size: 0.9rem;
  }

  .hero {
    padding: var(--spacing-2xl) 0;
    gap: var(--spacing-xl);
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .hero-image {
    width: min(320px, 90vw);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
  }

  .carousel-nav {
    display: none;
  }

  /* Adjust gallery content height for mobile */
  .gallery-content {
    height: calc(100vh - 70px);
    max-height: calc(100vh - 70px);
  }

  .carousel-indicators {
    padding: 20px 0;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .footer-content {
    padding: 0 var(--spacing-md);
  }

  /* Adjust gallery content height for mobile */
  /* Hide footer on gallery pages */
  body:has(.gallery-content) .site-footer {
    display: none;
  }

  /* Hide focus rings on mobile/touch devices */
  *:focus {
    outline: none;
  }
}

@media (max-width: 480px) {
  .nav-container {
    height: 60px;
    padding: 0 var(--spacing-md);
  }

  .container {
    font-size: 1.5rem;
  }

  .nav-menu {
    gap: var(--spacing-lg);
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: var(--spacing-xl) 0;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }

  .hero-image {
    width: min(280px, 95vw);
  }

  .about-content,
  .gallery-content {
    padding: var(--spacing-2xl) 0;
  }

  .carousel-nav {
    display: none;
  }

  .gallery-title-header h2 {
    font-size: 1.2rem;
  }
}
