/* =============================================================================
   GALLERY — gallery.css  v2.0 (Production)
   ============================================================================= */

.gallery-page { padding-bottom: var(--space-24); }

/* ══════════════════════════════════════════════════
   SKELETON LOADING
   Shimmer cards shown while artworks.json is fetched
══════════════════════════════════════════════════ */

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0;  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-shimmer-1) 0%,
    var(--color-shimmer-2) 50%,
    var(--color-shimmer-1) 100%
  );
  background-size: 600px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--color-shimmer-1);
  }
}

.skeleton-card {
  break-inside: avoid;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
}

/* Skeleton images alternate between portrait/landscape to simulate real layout */
.skeleton-img {
  width: 100%;
  border-radius: 0;
}
.skeleton-card:nth-child(odd)  .skeleton-img { aspect-ratio: 3 / 4; }
.skeleton-card:nth-child(even) .skeleton-img { aspect-ratio: 4 / 3; }

.skeleton-info {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-title {
  height: 18px;
  width: 70%;
}

.skeleton-meta {
  height: 13px;
  width: 45%;
}

/* ══════════════════════════════════════════════════
   GALLERY PAGE TOP PADDING
══════════════════════════════════════════════════ */
.gallery-page {
  padding-top: var(--space-10);
}

/* ══════════════════════════════════════════════════
   MASONRY GRID (CSS columns — Pinterest style)
   Images render at their NATURAL aspect ratio.
   Portrait, landscape, and square all look great.
══════════════════════════════════════════════════ */
.gallery-grid {
  columns: 1;
  column-gap: var(--space-5);
}

/* 2 columns on narrow phones */
@media (min-width: 420px)  { .gallery-grid { columns: 2; } }
/* 2 columns on tablets */
@media (min-width: 640px)  { .gallery-grid { columns: 2; column-gap: var(--space-6); } }
/* 3 columns on small desktops */
@media (min-width: 1024px) { .gallery-grid { columns: 3; column-gap: var(--space-6); } }
/* 4 columns on wide screens */
@media (min-width: 1400px) { .gallery-grid { columns: 4; } }

/* Card entrance animation — fires automatically, no JS class needed */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ══════════════════════════════════════════════════
   GALLERY CARD
══════════════════════════════════════════════════ */
.gallery-card {
  break-inside: avoid;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  cursor: pointer;
  /* Staggered entrance via CSS animation */
  animation: cardReveal 0.5s ease both;
  animation-delay: calc(var(--card-index, 0) * 55ms);
  /* Hover transitions only */
  transition:
    box-shadow   var(--transition-base),
    border-color var(--transition-base),
    transform    var(--transition-base);
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card { animation: none; }
}

/* .visible kept for backward compat but no longer needed for opacity */
.gallery-card.visible { opacity: 1; }

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

.gallery-card:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-color: var(--color-accent);
}

/* ── Card Image ────────────────────────────────────────────────────────────── */
/* No forced aspect-ratio — every image renders at its own natural dimensions.
   Portrait, landscape, square: all look correct. No cropping, no stretching. */
.card-image-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--color-bg-elevated); /* subtle bg while image loads */
}

.card-image {
  width: 100%;
  height: auto;          /* natural aspect ratio always preserved */
  display: block;
  transition: transform var(--transition-slow);
}

.gallery-card:hover .card-image {
  transform: scale(1.045);
}

/* ── Card Hover Overlay ────────────────────────────────────────────────────── */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    hsla(220, 16%, 5%, 0.97) 0%,
    hsla(220, 16%, 5%, 0.6)  40%,
    transparent               70%
  );
  display: flex;
  align-items: flex-end;
  padding: var(--space-5);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-card:hover .card-overlay,
.gallery-card:focus-visible .card-overlay {
  opacity: 1;
}

.card-overlay-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: hsl(0, 0%, 100%);
  line-height: 1.2;
  margin-bottom: var(--space-1);
  text-wrap: balance;
}

.card-overlay-medium {
  font-size: var(--text-xs);
  color: hsla(0, 0%, 100%, 0.65);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.card-overlay-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ── Card Info (below image) ───────────────────────────────────────────────── */
.card-info {
  padding: var(--space-4) var(--space-4) var(--space-4);
  border-top: 1px solid var(--color-border);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  letter-spacing: 0.04em;
}

/* ── Placeholder (when image 404s) ────────────────────────────────────────── */
.card-placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--color-bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-3);
  font-size: var(--text-sm);
}

.card-placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  display: block;
}

/* ══════════════════════════════════════════════════
   NO RESULTS STATE
══════════════════════════════════════════════════ */
.no-results {
  display: none;
  text-align: center;
  padding: var(--space-20) var(--space-4);
  color: var(--color-text-3);
}

.no-results.visible { display: block; }

.no-results-emoji {
  font-size: 3.5rem;
  margin-bottom: var(--space-4);
  display: block;
  opacity: 0.4;
}

.no-results-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--color-text-2);
  margin-bottom: var(--space-2);
}

.no-results-text {
  font-size: var(--text-sm);
  color: var(--color-text-3);
  margin-bottom: var(--space-6);
}

/* ══════════════════════════════════════════════════
   LOADING / ERROR STATES
══════════════════════════════════════════════════ */
.gallery-error {
  text-align: center;
  padding: var(--space-16) var(--space-4);
  color: var(--color-text-3);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.gallery-error code {
  font-family: var(--font-mono);
  background: var(--color-bg-elevated);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--color-accent);
}

/* ══════════════════════════════════════════════════
/* ══════════════════════════════════════════════════
   LIGHTBOX — Fullscreen artwork viewer (Behance / ArtStation style)
══════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  background: rgba(4, 6, 11, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* ── Fullscreen Container ───────────────────────────────────────────────────── */
.lightbox-inner {
  position: absolute;
  inset: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  margin: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  overflow: hidden;

  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.lightbox.open .lightbox-inner {
  opacity: 1;
  transform: scale(1);
}

/* Mobile layout: image on top, info stacked below */
@media (max-width: 767px) {
  .lightbox-inner {
    flex-direction: column;
  }
}

/* ── Image Side (Occupies 75-80% of desktop width) ────────────────────────── */
.lightbox-image-side {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  box-sizing: border-box;
  overflow: hidden;
}

@media (max-width: 767px) {
  .lightbox-image-side {
    flex: 1;
    min-height: 0;
    padding: var(--space-4);
  }
}

/* Artwork image — preserves aspect ratio, maximum size, never cropped */
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  transition: opacity var(--transition-base);
}

.lightbox-img.fading {
  opacity: 0.15;
}

/* ── Prev / Next Navigation Buttons ────────────────────────────────────────── */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.lightbox-nav:hover:not(:disabled) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: hsl(220, 16%, 7%);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.lightbox-nav:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.lightbox-prev { left: var(--space-6); }
.lightbox-next { right: var(--space-6); }

@media (max-width: 767px) {
  .lightbox-prev { left: var(--space-3); width: 40px; height: 40px; }
  .lightbox-next { right: var(--space-3); width: 40px; height: 40px; }
}

/* ── Counter Badge ─────────────────────────────────────────────────────────── */
.lightbox-counter {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  letter-spacing: 0.06em;
  z-index: 10;
}

/* ── Metadata Info Panel (Sidebar on desktop, bottom sheet on mobile) ─────── */
.lightbox-info {
  display: flex;
  flex-direction: column;
  width: 380px;
  min-width: 320px;
  max-width: 28vw;
  flex-shrink: 0;
  height: 100%;
  background: var(--color-bg-surface);
  border-left: 1px solid var(--color-border);
  padding: 3rem 2rem 2rem 2rem;
  overflow-y: auto;
  position: relative;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .lightbox-info {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 42vh;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: 1.5rem;
    overflow-y: auto;
    flex-shrink: 0;
  }
}


/* Close button */
.lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
  z-index: 1;
}

.lightbox-close:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: hsl(220, 16%, 7%);
  transform: rotate(90deg);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Category tag */
.lightbox-tag {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: var(--radius-full);
  background: var(--color-accent-muted);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: calc(36px + var(--space-5));
  margin-bottom: var(--space-4);
  align-self: flex-start;
}

/* Title */
.lightbox-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-3xl));
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: var(--space-5);
  text-wrap: balance;
}

/* Metadata rows */
.lightbox-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-border);
}

.lightbox-meta-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.meta-key {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-3);
  min-width: 72px;
  flex-shrink: 0;
}

.meta-val {
  color: var(--color-text-1);
  font-weight: 500;
}

/* Description */
.lightbox-desc {
  font-size: var(--text-sm);
  color: var(--color-text-2);
  line-height: 1.85;
  flex: 1;
}

/* Keyboard hint */
.lightbox-hint {
  margin-top: auto;
  padding-top: var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text-3);
  text-align: center;
  letter-spacing: 0.05em;
  opacity: 0.65;
}

@media (max-width: 767px) {
  .lightbox-hint { display: none; }
}

/* ══════════════════════════════════════════════════
   FEATURED WORKS — homepage cards
══════════════════════════════════════════════════ */
.featured-section {
  padding: var(--space-24) 0;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px)  { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .featured-grid { grid-template-columns: repeat(3, 1fr); } }

.featured-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  transition:
    transform     var(--transition-base),
    box-shadow    var(--transition-base),
    border-color  var(--transition-base);
}

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

.featured-card-link { display: block; }

.featured-card-image-wrapper {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  position: relative;
}

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

.featured-card:hover .featured-card-image {
  transform: scale(1.06);
}

.featured-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsla(220, 16%, 5%, 0.9) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-5);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.featured-card:hover .featured-card-overlay { opacity: 1; }

.view-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: hsl(0, 0%, 100%);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  letter-spacing: 0.04em;
}

.featured-card-info {
  padding: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.featured-card-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-1);
  line-height: 1.2;
}

.featured-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════
   ABOUT TEASER — homepage section
══════════════════════════════════════════════════ */
.about-teaser {
  padding: var(--space-24) 0;
  background: var(--color-bg-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.about-teaser-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (min-width: 768px) {
  .about-teaser-inner { grid-template-columns: 5fr 7fr; gap: var(--space-16); }
}

.about-teaser-img-wrap {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

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

.about-teaser-img-wrap:hover img {
  transform: scale(1.04);
}

.about-teaser-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.about-teaser-quote {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.1vw, 1.55rem);
  font-style: italic;
  color: var(--color-text-1);
  line-height: 1.4;
  padding-left: var(--space-5);
  border-left: 3px solid var(--color-accent);
}

@media (min-width: 992px) {
  .about-teaser-quote {
    white-space: nowrap;
  }
}

.about-teaser-text {
  color: var(--color-text-2);
  line-height: 1.85;
  margin-bottom: var(--space-4);
}

.about-teaser-text:last-child {
  margin-bottom: 0;
}

/* Stats */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.stat-item {
  text-align: center;
  padding: var(--space-5) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  transition: border-color var(--transition-fast), transform var(--transition-base);
}

.stat-item:hover {
  border-color: var(--color-accent);
  transform: translateY(-3px);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 700;
  color: var(--color-accent);
  display: block;
  line-height: 1.1;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-3);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}
