/**
 * Gallery Styles
 * Styles for gallery layouts, artist statements, and filmstrip components.
 */

/* ============================================
   Artist Statement (Collapsible)
   ============================================ */

.artist-statement {
  max-width: var(--max-width-text);
  position: relative;
  overflow: hidden;
  max-height: 6em; /* ~4 lines at body size */
  transition: max-height var(--duration-expand) var(--ease-out);
}

.artist-statement::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(transparent, var(--color-bg));
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.artist-statement.expanded {
  max-height: none;
}

.artist-statement.expanded::after {
  opacity: 0;
}

.artist-statement-content {
  color: var(--color-text-secondary);
  line-height: var(--line-height-body);
}

.artist-statement-content p {
  margin: 0 0 var(--space-md) 0;
}

.artist-statement-content p:last-child {
  margin-bottom: 0;
}

.continue-reading {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: var(--font-size-small);
  color: var(--color-text-tertiary);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  text-decoration: underline;
  transition: color var(--duration-fast) var(--ease-default);
}

.continue-reading:hover {
  color: var(--color-text-secondary);
}

.continue-reading.hidden {
  display: none;
}

/* ============================================
   Photo Gallery (Single Column)
   ============================================ */

.photo-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-4xl); /* 96px desktop */
  max-width: var(--max-width-gallery);
  margin: 0 auto;
}

.photo-gallery-item {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
}

.photo-gallery-image {
  width: 100%;
  height: auto;
  display: block;
  background-color: var(--color-skeleton);
}

/* Tablet (md: 640-1024px) */
@media (max-width: 1024px) {
  .photo-gallery {
    gap: var(--space-3xl); /* 64px tablet */
  }
}

/* Mobile (sm: < 640px) */
@media (max-width: 640px) {
  .photo-gallery {
    gap: var(--space-2xl); /* 48px mobile */
  }
}

/* ============================================
   Hero + Filmstrip (Synthesis Layout)
   ============================================ */

/* Filmstrip below hero (landscape images) */
.synthesis-layout[data-filmstrip="below"] {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Filmstrip beside hero (portrait images on desktop) */
.synthesis-layout[data-filmstrip="side"] {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-xl);
  align-items: start;
}

/* Mobile: always below regardless of data attribute */
@media (max-width: 1024px) {
  .synthesis-layout[data-filmstrip="side"] {
    display: flex;
    flex-direction: column;
  }
}

/* ============================================
   Hero Image
   ============================================ */

.synthesis-hero {
  position: relative;
  max-width: var(--max-width-gallery);
  cursor: zoom-in;
}

.synthesis-hero-image {
  width: 100%;
  height: auto;
  display: block;
  background-color: var(--color-skeleton);
  transition: opacity var(--duration-slow) var(--ease-out);
}

.synthesis-hero-image.crossfade {
  opacity: 0;
}

/* ============================================
   Filmstrip
   ============================================ */

.filmstrip {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
  -webkit-overflow-scrolling: touch;
}

/* Vertical filmstrip (beside hero) */
.filmstrip.vertical {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 500px;
}

.filmstrip-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--duration-fast) var(--ease-default);
  border: 2px solid transparent;
  background-color: var(--color-skeleton);
}

.filmstrip-thumbnail:hover {
  opacity: 0.9;
}

.filmstrip-thumbnail.selected {
  opacity: 1;
  border-color: var(--color-text-primary);
}

/* Mobile: smaller thumbnails */
@media (max-width: 640px) {
  .filmstrip-thumbnail {
    width: 60px;
    height: 60px;
  }
}

/* ============================================
   Process Notes (Expandable)
   ============================================ */

.process-notes {
  margin-top: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-xl);
}

.process-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: var(--space-sm) 0;
}

.process-notes-title {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.process-notes-toggle {
  font-size: var(--font-size-small);
  color: var(--color-text-tertiary);
  transition: transform var(--duration-normal) var(--ease-out);
}

.process-notes.expanded .process-notes-toggle {
  transform: rotate(180deg);
}

.process-notes-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-expand) var(--ease-out);
}

.process-notes.expanded .process-notes-content {
  max-height: 500px;
}

.process-notes-body {
  padding-top: var(--space-md);
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
}

.process-notes-body dt {
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.process-notes-body dd {
  margin: 0 0 var(--space-md) 0;
}

/* ============================================
   Scroll Sentinel (Infinite Scroll)
   ============================================ */

.scroll-sentinel {
  height: 1px;
  width: 100%;
  visibility: hidden;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  color: var(--color-text-tertiary);
}

.empty-state-message {
  font-size: var(--font-size-h3);
  margin-bottom: var(--space-md);
}

.empty-state-description {
  font-size: var(--font-size-body);
  color: var(--color-text-secondary);
}

/* ============================================
   Image Loading States
   ============================================ */

.photo-loading {
  background-color: var(--color-skeleton);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.photo-error {
  background-color: var(--color-skeleton);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-tertiary);
  font-size: var(--font-size-small);
}

/* ============================================
   Back Navigation Link
   ============================================ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--font-size-small);
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: var(--space-xl);
  transition: color var(--duration-fast) var(--ease-default);
}

.back-link:hover {
  color: var(--color-text-primary);
  text-decoration: none;
}

.back-link::before {
  content: '\2190'; /* Left arrow */
}

/* ============================================
   Project Page Layout
   ============================================ */

.project-page {
  max-width: var(--max-width-gallery);
  margin: 0 auto;
}

.project-header {
  margin-bottom: var(--space-3xl);
}

.project-title {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  margin-bottom: var(--space-sm);
}

.project-subtitle {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-h3);
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-light);
}

.project-statement {
  margin-top: var(--space-xl);
}

/* ============================================
   Synthesis Page Layout
   ============================================ */

.synthesis-page {
  max-width: var(--max-width-container);
  margin: 0 auto;
}

.synthesis-header {
  margin-bottom: var(--space-2xl);
}

.synthesis-title {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
  margin-bottom: var(--space-sm);
}

.synthesis-metadata {
  font-size: var(--font-size-small);
  color: var(--color-text-tertiary);
}

/* ============================================
   Feed Page Layout
   ============================================ */

.feed-page {
  max-width: var(--max-width-gallery);
  margin: 0 auto;
}

.feed-header {
  margin-bottom: var(--space-2xl);
}
