/* ==========================================================================
   LE SSERAFIM — album.css
   Individual album page: fixed cover banner that zooms on scroll, a sheet
   that slides over it with a sticky title bar, sticky specs beside the
   tracklist, a video rail, a tabbed photo gallery and a lightbox.
   Design frame: 1440 wide; px / 14.4 = vw.
   ========================================================================== */

.album-page {
  --ag: clamp(20px, 5.56vw, 80px);              /* page gutter (80 at 1440) */
  --hero-h: clamp(220px, 21.2vw, 380px);        /* cover banner (305 at 1440) */
  --bar-h: 140px;                               /* measured by album.js */
  --panel: #1a1a1a;
}

/* Header sits over the banner without the inner-page gradient */
.album-page .site-header { background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0)); transition: background 0.4s ease; }
.album-page .brand { transition: opacity 0.35s ease; }
/* Once the title bar is stuck at the top it takes over the left side */
.bar-stuck .album-page .site-header { background: none; }
.bar-stuck .album-page .brand { opacity: 0; pointer-events: none; }

/* ---------- Cover banner ---------- */
.album-hero {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  height: var(--hero-h);
  overflow: hidden;
  background: #000;
}
.album-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(calc(var(--zoom, 1) * 1.04)); /* 1.12 hides the soft blurred edges */
  transform-origin: 50% 50%;
  filter: blur(8px);
  will-change: transform;
}
/* Overlay from the design (Overlay.svg): 25px blur (on the image itself, see
   .album-hero__img), 50% black and a fine white grain on top */
.album-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: rgba(0, 0, 0, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='luminanceToAlpha'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='discrete' tableValues='1 0'/%3E%3C/feComponentTransfer%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  pointer-events: none;
}
.album-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: #000;
  opacity: var(--shade, 0);
}
.page-enter .album-hero__img { animation: hero-in 1.6s var(--ease-out) backwards; }
@keyframes hero-in {
  from { opacity: 0; filter: blur(45px); transform: scale(1.25); }
}

/* ---------- Sheet (slides up over the banner) ---------- */
.album-sheet {
  position: relative;
  z-index: 1;
  margin-top: var(--hero-h);
  /* Circles stay put while the page scrolls past them */
  background: #000 url("../img/circles-album.svg") center / cover no-repeat fixed;
}

/* ---------- Title bar (sticky) ---------- */
.album-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.8vw, 40px);
  min-height: clamp(96px, 9.7vw, 140px);
  padding: 16px var(--ag);
  background: var(--panel);
}
.album-bar__head { flex: 1; min-width: 0; }
.album-bar__head .label { font-size: clamp(13px, 1.04vw, 15px); font-weight: 500; }
.album-bar__title {
  margin-top: 4px;
  font-size: clamp(28px, 3.34vw, 48px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.album-bar__artist {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.album-bar__date {
  align-self: center;
  font-size: clamp(13px, 1.04vw, 15px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-muted);
}

/* ---------- Intro: sticky cover + copy, specs, tracklist ---------- */
.album-intro {
  display: grid;
  grid-template-columns: minmax(0, 350px) minmax(0, 1fr);
  gap: clamp(28px, 5.56vw, 80px);
  align-items: start;
  padding: clamp(28px, 2.9vw, 42px) var(--ag) 0;
}
/* The cover stays in view (just under the sticky title bar) while the right column scrolls */
.album-cover {
  position: sticky;
  top: calc(var(--bar-h) + 40px);
  aspect-ratio: 1;
  overflow: hidden;
  background: #1c1c1c;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-main { min-width: 0; }

.album-text {
  font-size: clamp(14px, 1.04vw, 15px);
  line-height: 1.3;
  letter-spacing: 0.03em;
  color: #ececec;
  text-align: justify;
  text-align-last: left;
}
.album-text p + p { margin-top: 1.15em; }

/* Genre | Format | Runtime in one row with dividers */
.album-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: clamp(28px, 2.8vw, 40px) 0 0;
}
.album-specs__row {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 0 clamp(14px, 2vw, 28px);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.album-specs__row:first-child { padding-left: 0; border-left: 0; }
.album-specs .label { font-size: clamp(13px, 1.04vw, 15px); font-weight: 500; }
.album-specs dd {
  margin: 0;
  font-size: clamp(14px, 1.04vw, 15px);
  letter-spacing: 0.03em;
  line-height: 1.35;
}

.tracklist { margin-top: clamp(44px, 4.4vw, 64px); }

.section-title {
  margin: 0;
  font-size: clamp(24px, 2.22vw, 32px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.tracklist__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: clamp(16px, 2vw, 28px);
}
.tracklist__count {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
  font-family: var(--font-italic);
  font-style: italic;
}
.tracklist__list { margin: 0; padding: 0; list-style: none; }

.track {
  display: grid;
  grid-template-columns: clamp(40px, 4.2vw, 60px) minmax(0, 1fr) auto;
  align-items: center;
  min-height: clamp(52px, 4.9vw, 70px);
  padding: 0 clamp(8px, 0.7vw, 10px);
  font-size: clamp(14px, 1.04vw, 15px);
  letter-spacing: 0.04em;
  transition: background 0.35s ease, padding 0.45s var(--ease-out);
}
.track:hover { background: var(--panel); padding-left: clamp(14px, 1.4vw, 20px); padding-right: clamp(14px, 1.4vw, 20px); }
.track__no,
.track__time { font-variant-numeric: tabular-nums; color: var(--c-muted); }
.track__name { color: var(--c-white); text-transform: uppercase; }
.track__tag {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 6px 3px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 10px;
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  color: #bdbdbd;
  vertical-align: 0.15em;
  white-space: nowrap;
}

/* ---------- Rails (shared horizontal scrollers) ---------- */
.rail {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  cursor: grab;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-gliding { scroll-snap-type: none; }
.rail.is-dragging a,
.rail.is-dragging button { pointer-events: none; }
.rail__track {
  display: flex;
  gap: clamp(14px, 1.39vw, 20px);
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rail__track > li { flex: none; scroll-snap-align: start; }

/* ---------- Video ---------- */
.album-videos { padding-top: clamp(56px, 4.9vw, 72px); }
.album-videos .section-title { padding: 0 var(--ag); margin-bottom: clamp(20px, 2.2vw, 32px); }
.video-list { padding: 0 var(--ag); gap: clamp(14px, 2.36vw, 34px); }
.video-list > li { scroll-margin-left: var(--ag); }

.video-card {
  position: relative;
  display: block;
  width: clamp(280px, 49.4vw, 711px);
  aspect-ratio: 711 / 400;
  overflow: hidden;
  background: #111;
}
.video-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.6s var(--ease-out), transform 0.9s var(--ease-out);
  -webkit-user-drag: none;
}
.video-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 20px;
  font-size: clamp(12px, 1.04vw, 15px);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  /* frosted strip: blurs the video thumbnail behind it, with a light dark tint */
  background: rgba(0, 0, 0, 0.25);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: opacity 0.4s ease, transform 0.5s var(--ease-out);
}
.video-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(60px, 6.25vw, 90px);
  height: clamp(60px, 6.25vw, 90px);
  margin: calc(clamp(60px, 6.25vw, 90px) / -2) 0 0 calc(clamp(60px, 6.25vw, 90px) / -2);
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}
.video-card:hover .video-card__img,
.video-card:focus-visible .video-card__img { filter: blur(16px) brightness(0.6); transform: scale(1.06); }
.video-card:hover .video-card__caption,
.video-card:focus-visible .video-card__caption { opacity: 0; transform: translateY(8px); }
.video-card:hover .video-card__play,
.video-card:focus-visible .video-card__play { opacity: 1; transform: scale(1); }

/* ---------- Gallery ---------- */
.album-gallery {
  display: grid;
  grid-template-columns: clamp(180px, 19.45vw, 280px) minmax(0, 1fr);
  padding: clamp(56px, 4.4vw, 64px) 0 clamp(64px, 8vw, 120px) var(--ag);
}
.gallery__side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-right: 20px;
}
.gallery__nav { display: grid; gap: 14px; padding-bottom: 6px; }
.gallery__count {
  font-size: 14px;
  font-family: var(--font-italic);
  font-style: italic;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.gallery__arrows { display: flex; gap: 22px; }
.gallery__arrow {
  width: 40px;
  height: 24px;
  color: var(--c-white);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}
.gallery__arrow svg { width: 40px; height: 14px; overflow: visible; }
.gallery__arrow:hover:not(:disabled) { transform: translateX(var(--nudge, 4px)); }
#gallery-prev { --nudge: -4px; }
.gallery__arrow:disabled { opacity: 0.3; cursor: default; }

.gallery__main { min-width: 0; }
.gallery__tabs {
  display: flex;
  gap: clamp(16px, 1.53vw, 22px);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.gallery__tabs::-webkit-scrollbar { display: none; }
.gallery__tab {
  position: relative;
  flex: none;
  padding: 0 0 8px;
  font-size: clamp(14px, 1.18vw, 17px);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #8f8f8f;
  transition: color 0.3s ease;
}
.gallery__tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--c-white);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.gallery__tab:hover { color: #d6d6d6; }
.gallery__tab[aria-selected="true"] { color: var(--c-white); }
.gallery__tab[aria-selected="true"]::after { transform: scaleX(1); }

.photo-list { padding-right: var(--ag); }
.photo-list > li { scroll-margin-left: 0; }
.photo-card {
  position: relative;
  display: block;
  height: clamp(240px, 27.8vw, 400px);
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
}
.photo-card img {
  height: 100%;
  width: auto;
  max-width: none;
  transition: filter 0.6s var(--ease-out), transform 0.9s var(--ease-out);
  -webkit-user-drag: none;
}
.photo-card__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.4s ease, transform 0.6s var(--ease-out);
}
.photo-card:hover img,
.photo-card:focus-visible img { filter: blur(14px) brightness(0.55); transform: scale(1.06); }
.photo-card:hover .photo-card__icon,
.photo-card:focus-visible .photo-card__icon { opacity: 1; transform: scale(1); }

/* Tab switch: photos blur back in */
.photo-list.is-swapping { opacity: 0; filter: blur(12px); transform: translateX(24px); }
.photo-list { transition: opacity 0.45s ease, filter 0.5s ease, transform 0.6s var(--ease-out); }

/* ---------- Lightbox ---------- */
/* The page behind is blurred and darkened; the photo floats in the middle with
   the close button on its top-right corner and the caption underneath */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--c-white);
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.lightbox[open] { display: block; animation: lb-in 0.45s ease both; }
.lightbox[open]::backdrop { animation: lb-in 0.45s ease both; }
@keyframes lb-in { from { opacity: 0; } }

.lightbox__frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px clamp(72px, 9vw, 160px);
}
.lightbox__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}
.lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(68vw, 1100px);
  max-height: calc(100dvh - 210px);
  object-fit: contain;
  transition: opacity 0.35s ease, filter 0.45s ease;
}
.lightbox__img.is-loading { opacity: 0; filter: blur(14px); }

.lightbox__meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 26px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}
.lightbox__count {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.lightbox__btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--c-white);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}
/* ✕ sits just outside the photo's top-right corner */
.lightbox__close {
  top: -8px;
  left: calc(100% + 10px);
  width: 40px;
  height: 40px;
  opacity: 0.60;
}
.lightbox__close svg { width: 24px; height: 24px; }
.lightbox__close:hover,
.lightbox__close:focus-visible {
  opacity: 1;
  transform: scale(1.15);
}
.lightbox__close:focus { outline: none; }

/* thin arrows at the far left and right of the screen */
.lightbox__prev,
.lightbox__next {
  top: 50%;
  width: 56px;
  height: 40px;
  margin-top: -20px;
  opacity: 0.8;
}
.lightbox__prev { left: clamp(10px, 2.5vw, 40px); }
.lightbox__next { right: clamp(10px, 2.5vw, 40px); }
.lightbox__prev svg,
.lightbox__next svg { width: 34px; height: 10px; overflow: visible; }
.lightbox__prev:hover,
.lightbox__next:hover { opacity: 1; }
.lightbox__prev:hover { transform: translateX(-4px); }
.lightbox__next:hover { transform: translateX(4px); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .album-intro { grid-template-columns: 1fr; }
  .album-cover { position: relative; top: auto; max-width: 420px; }
}

@media (max-width: 767px) {
  .album-page { --hero-h: calc(var(--vh) * 34); }
  .album-bar { flex-wrap: wrap; gap: 4px 14px; padding-top: 14px; padding-bottom: 14px; }
  .album-bar .arrow-back { width: 36px; }
  .album-bar .arrow-back svg { width: 36px; }
  .album-bar__date { flex-basis: 100%; padding-left: 50px; font-size: 12px; }
  .bar-stuck .album-page .brand { opacity: 1; pointer-events: auto; }
  .album-page .album-bar { top: var(--header-h); }
  .album-page .album-bar { transition: top 0.5s var(--ease-out); }
  .nav-hidden .album-page .album-bar { top: 0; }
  .bar-stuck .album-page .site-header { background: var(--panel); }
  .album-text { text-align: left; font-size: 15px; line-height: 1.55; }
  /* Phones: specs stack, divided by lines between them */
  .album-specs { grid-template-columns: 1fr; }
  .album-specs__row { padding: 14px 0; border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.2); }
  .album-specs__row:first-child { padding-top: 0; border-top: 0; }

  /* Phones: GALLERY title, then tabs + photos, then count (left) and arrows (right) below */
  .album-gallery { display: flex; flex-direction: column; padding-right: 0; }
  .gallery__side { display: contents; }
  .gallery__side .section-title { order: 1; margin-bottom: 18px; }
  .gallery__main { order: 2; }
  .gallery__nav {
    order: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 0 var(--ag) 0 0;
  }
  .gallery__tabs { padding-right: var(--ag); }

  /* Phones: photo full width, ✕ above its top-right corner, arrows beside the caption */
  /* Phones: photo full width, ✕ above its top-right corner,
     arrows on the photo's left and right edges at its vertical middle */
  .lightbox__frame { padding: 64px 14px; }
  .lightbox__img { max-width: 100%; max-height: calc(100dvh - 190px); }
  .lightbox__close { top: auto; bottom: calc(100% + 6px); left: auto; right: -6px; }
  .lightbox__prev,
  .lightbox__next {
    top: calc(50% - 21px);   /* middle of the photo (the caption below it is ~42px tall) */
    width: 40px;
    height: 40px;
    margin-top: -20px;
    opacity: 1;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);   /* keeps the arrow readable over light photos */
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .lightbox__prev svg,
  .lightbox__next svg { width: 20px; height: 8px; }
  .lightbox__prev { left: 22px; }
  .lightbox__next { right: 22px; }
}

@media (hover: none) {
  .video-card__caption { opacity: 1 !important; transform: none !important; }
  .rail { cursor: auto; }
}
