/* ─── FONTS ──────────────────────────────────────────── */
@font-face { font-family:'Raleway'; src:url('../fonts/raleway-200.woff2') format('woff2'); font-weight:200; font-style:normal; font-display:swap; }
@font-face { font-family:'Raleway'; src:url('../fonts/raleway-300.woff2') format('woff2'); font-weight:300; font-style:normal; font-display:swap; }

/* ─── RESET & VARIABLES ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #1a1a1a;
  --bg-dark:    #0e0e0e;
  --bg-panel:   #242424;
  --text:       #dedede;
  --text-dim:   #c0c0c0;
  --text-faint: #777;
  --gap:        12px;
  --font:       'Raleway', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img  { display: block; }
a    { color: inherit; text-decoration: none; }

/* ─── SITE HEADER ───────────────────────────────────── */
.site-header {
  padding: 24px 32px 20px;
  text-align: center;
}
.site-name {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-block;
  transition: color 0.2s;
  text-indent: 0.42em;
}
.site-name:hover { color: #fff; }

/* ─── BACK LINK ─────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
}
.back-link:hover { color: #fff; }

/* ─── ALBUM INDEX GRID ───────────────────────────────── */
.album-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  padding: var(--gap);
}
.album-card {
  display: block;
  background: var(--bg-panel);
  cursor: pointer;
}
.album-card-cover {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: opacity 0.2s;
}
.album-card-no-cover {
  background: var(--bg-panel);
}
.album-card:hover .album-card-cover { opacity: 0.8; }
.album-card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 8px 14px;
}
.album-card-icon { opacity: 0.5; flex-shrink: 0; }
.album-card-title {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── ALBUM HERO ────────────────────────────────────── */
.album-hero {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: #111;
}
.album-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.58) 100%);
  pointer-events: none;
}
.album-hero-title {
  position: absolute;
  bottom: 28px;
  left: 28px;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 200;
  letter-spacing: 0.03em;
  color: #fff;
  z-index: 2;
  pointer-events: none;
  line-height: 1.15;
}

/* ─── ALBUM ACTION BAR ──────────────────────────────── */
.album-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 14px;
}
.action-btn {
  width: 40px;
  height: 40px;
  background: var(--bg-panel);
  border: none;
  border-radius: 3px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.action-btn:hover { background: #2e2e2e; color: #fff; }

/* ─── ALBUM DESCRIPTION ─────────────────────────────── */
.album-description {
  flex: 1;
  margin: 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ─── JUSTIFIED GRID ────────────────────────────────── */
.just-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}
.grid-item {
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: var(--bg-panel);
}
.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s;
  pointer-events: none;
}
.grid-item:hover img { opacity: 0.78; }
.grid-item.is-video::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
  pointer-events: none;
}
.play-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  border: 1.5px solid rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.play-badge svg { margin-left: 3px; }
.duration-badge {
  position: absolute;
  bottom: 7px; right: 8px;
  font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.04em;
  background: rgba(0,0,0,0.6);
  color: rgba(255,255,255,0.88);
  padding: 2px 6px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 2;
}
.video-not-ready { opacity: 0.5; cursor: default; }

/* ─── LIGHTBOX ──────────────────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 500;
  flex-direction: row;
}
.lightbox.active { display: flex; }

.lb-sidebar {
  width: 46px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 4px;
  background: rgba(0,0,0,0.3);
  z-index: 2;
}
.lb-icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.38);
  border-radius: 3px;
  border: none; background: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.lb-icon-btn:hover {
  color: rgba(255,255,255,0.92);
  background: rgba(255,255,255,0.07);
}

.lb-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 44px 60px;
}
.lb-img-area {
  position: relative;
  width: 100%;
  height: 100%;
}
.lb-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center center;
  transition: opacity 0.45s ease;
  opacity: 1;
}
.lb-img.out { opacity: 0; }

.lb-caption {
  position: absolute;
  bottom: 16px; left: 68px;
  font-size: 13px; font-weight: 300;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.82);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  pointer-events: none;
  z-index: 3;
  max-width: 60%;
}

.lb-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 110px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 34px; font-weight: 200;
  z-index: 4;
  transition: color 0.15s;
  user-select: none;
  cursor: pointer;
}
.lb-arrow:hover { color: rgba(255,255,255,0.88); }
.lb-arrow.lb-prev { left: 46px; }
.lb-arrow.lb-next { right: 0; }

.lb-close {
  position: absolute;
  top: 10px; right: 14px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.35);
  font-size: 18px;
  z-index: 5;
  border: none; background: none;
  cursor: pointer;
  transition: color 0.15s;
}
.lb-close:hover { color: rgba(255,255,255,0.9); }

/* ─── VIDEO PAGE ────────────────────────────────────── */
.video-wrap {
  width: 100%;
  background: #000;
  position: relative;
  line-height: 0;
}
.main-video {
  width: 100%;
  max-height: 85vh;
  background: #000;
  display: block;
}
.video-processing {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 85vh;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-faint);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.error-note { color: #b44; font-size: 12px; }
.video-info {
  max-width: 880px;
  padding: 28px 28px 52px;
}
.video-title {
  font-size: 1.55rem;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  line-height: 1.3;
}
.video-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-dim);
  line-height: 1.75;
}

/* ─── SLIDESHOW ─────────────────────────────────────── */
.slideshow {
  display: none;
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 600;
  overflow: hidden;
}
.slideshow.active { display: block; }
.ss-slot {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.ss-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transition: opacity 0.8s ease;
}
.ss-img.out { opacity: 0; }
.ss-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  background: rgba(255,255,255,0.48);
  z-index: 3;
}
.ss-counter {
  position: absolute;
  bottom: 16px; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: 0.12em;
  color: rgba(255,255,255,0.28);
  pointer-events: none; z-index: 3;
}
.ss-close {
  position: absolute;
  top: 16px; right: 20px;
  color: rgba(255,255,255,0.38);
  font-size: 20px; z-index: 4;
  border: none; background: none;
  cursor: pointer; font-family: var(--font);
  transition: color 0.15s;
}
.ss-close:hover { color: rgba(255,255,255,0.9); }

/* ─── SITE FOOTER ──────────────────────────────────── */
.site-footer {
  padding: 16px 32px 22px;
  text-align: right;
}
.copyright {
  font-size: 11px;
  font-weight: 300;
  color: #555;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

/* ─── MISC ──────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-faint);
}
.not-found h1 { font-size: 6rem; font-weight: 200; opacity: 0.3; }
.not-found p  { margin: 16px 0; font-size: 14px; }
.not-found a  { color: var(--text-dim); border-bottom: 1px solid currentColor; }

.empty-state {
  padding: 60px 20px;
  color: var(--text-faint);
  font-size: 13px;
  letter-spacing: 0.06em;
}

/* ─── MOBILE LIGHTBOX SLIDESHOW BUTTON ─────────────── */
/* hidden on desktop; shown on mobile in place of the sidebar */
.lb-mobile-ss { display: none; }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 680px) {
  .album-grid        { grid-template-columns: 1fr; }
  .album-hero        { height: 240px; }
  .album-hero-title  { font-size: 1.5rem; bottom: 16px; left: 16px; }

  /* Lightbox: full-width image, swipe to navigate */
  .lb-sidebar        { display: none; }
  .lb-arrow          { display: none; }
  .lb-stage          { padding: 0; }
  .lb-caption        { left: 16px; bottom: 12px; }

  /* Slideshow button floats top-left where sidebar used to be */
  .lb-mobile-ss {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px;
    left: 14px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    z-index: 5;
    transition: color 0.15s;
  }
  .lb-mobile-ss:hover { color: rgba(255,255,255,0.9); }
}

/* Landscape phones (width > 680px but height < 500px, e.g. iPhone rotated).
   Sidebar reappears at this width but fullscreen API doesn't work on iOS —
   collapse back to the same mobile layout used in portrait. */
@media (max-height: 500px) {
  .lb-sidebar  { display: none; }
  .lb-arrow    { display: none; }
  .lb-stage    { padding: 0; }
  .lb-caption  { left: 16px; bottom: 12px; }
  .lb-mobile-ss {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 10px; left: 14px;
    width: 36px; height: 36px;
    background: none; border: none;
    color: rgba(255,255,255,0.35);
    cursor: pointer; z-index: 5;
    transition: color 0.15s;
  }
}
