@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700&display=swap');

/* ==========================================================================
   Albums & Gallery Design System
   Matches the minimal, high-end photography editorial theme of index.html
   ========================================================================== */

:root {
  --bg: #f2f0eb;
  --dark-bg: #11110f;
  --dark-surface: #1a1a17;
  --text: #171717;
  --text-light: #f2f0eb;
  --muted: #686862;
  --muted-light: rgba(242, 240, 235, 0.65);
  --line: rgba(23, 23, 23, 0.16);
  --line-light: rgba(242, 240, 235, 0.18);
  --max-width: 1500px;
  --gutter: clamp(1.25rem, 3vw, 3.5rem);
  --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "DM Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.albums-page,
body.album-subpage {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* ---------- Site Header & Nav ---------- */
.albums-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem var(--gutter);
  mix-blend-mode: multiply;
}

body.dark-header .albums-header {
  mix-blend-mode: normal;
  color: var(--text-light);
}

.albums-header .logo {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.albums-header .nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
}

.albums-header .nav a {
  transition: opacity 180ms ease;
}

.albums-header .nav a:hover,
.albums-header .nav a.active {
  opacity: 0.5;
}

.albums-header .menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  color: inherit;
}

.albums-header .menu-toggle__icon {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background 180ms ease;
}

.albums-header .menu-toggle__icon::before,
.albums-header .menu-toggle__icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform 180ms ease;
}

.albums-header .menu-toggle__icon::before {
  top: -7px;
}

.albums-header .menu-toggle__icon::after {
  bottom: -7px;
}

.albums-header .menu-toggle[aria-expanded="true"] .menu-toggle__icon {
  background: transparent;
}

.albums-header .menu-toggle[aria-expanded="true"] .menu-toggle__icon::before {
  transform: translateY(7px) rotate(45deg);
}

.albums-header .menu-toggle[aria-expanded="true"] .menu-toggle__icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Drawer */
.albums-mobile-menu,
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--dark-bg);
  color: var(--text-light);
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem var(--gutter);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}

.albums-mobile-menu.is-active,
.mobile-menu.active {
  opacity: 1;
  pointer-events: auto;
}

.albums-mobile-nav,
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.5rem;
  font-family: var(--font-display);
}

.albums-mobile-nav a.active,
.mobile-nav a.active {
  opacity: 0.5;
}

.albums-mobile-close {
  position: absolute;
  top: 1.25rem;
  right: var(--gutter);
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Typography & Utility ---------- */
.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow--light {
  color: var(--muted-light);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: opacity 180ms ease;
}

.text-link:hover {
  opacity: 0.6;
}

.text-link span {
  transition: transform 180ms ease;
}

.text-link:hover span {
  transform: translate(3px, -3px);
}

/* ---------- Main Container ---------- */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Albums Directory Intro ---------- */
.albums-intro-section {
  padding-top: clamp(7rem, 14vw, 11rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.albums-intro-heading {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(300px, 1.2fr);
  gap: 2rem;
  align-items: start;
}

.albums-intro-title {
  margin: 0;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: -0.06em;
}

.albums-intro-copy {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.28;
  letter-spacing: -0.03em;
  color: var(--muted);
}

/* ---------- Album Hero Cards List ---------- */
.albums-list {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3.5rem);
  padding-bottom: clamp(6rem, 12vw, 12rem);
}

.album-hero-card {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(360px, 68vh, 720px);
  overflow: hidden;
  background: var(--dark-surface);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-light);
}

.album-hero-card__image-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.album-hero-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1), filter 700ms ease;
  filter: brightness(0.82) contrast(1.05);
}

.album-hero-card:hover .album-hero-card__image {
  transform: scale(1.035);
  filter: brightness(0.72) contrast(1.08);
}

.album-hero-card__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(17, 17, 15, 0.25) 0%, rgba(17, 17, 15, 0.65) 100%),
              linear-gradient(180deg, rgba(17, 17, 15, 0.2) 0%, rgba(17, 17, 15, 0.6) 100%);
  pointer-events: none;
  transition: opacity 400ms ease;
}

.album-hero-card:hover .album-hero-card__overlay {
  background: radial-gradient(circle at center, rgba(17, 17, 15, 0.35) 0%, rgba(17, 17, 15, 0.75) 100%),
              linear-gradient(180deg, rgba(17, 17, 15, 0.25) 0%, rgba(17, 17, 15, 0.7) 100%);
}

.album-hero-card__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem var(--gutter);
}

.album-hero-card__meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 0.85rem;
  transition: transform 400ms ease, opacity 400ms ease;
}

.album-hero-card__title {
  margin: 0;
  font-size: clamp(2.2rem, 5.5vw, 5rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #ffffff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  max-width: 24ch;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.album-hero-card:hover .album-hero-card__title {
  transform: translateY(-4px);
}

.album-hero-card__desc {
  margin: 1rem 0 0;
  max-width: 52ch;
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.album-hero-card:hover .album-hero-card__desc {
  transform: translateY(-4px);
}

.album-hero-card__cta {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  opacity: 0.85;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 0.2rem;
  transition: opacity 300ms ease, border-color 300ms ease;
}

.album-hero-card:hover .album-hero-card__cta {
  opacity: 1;
  border-color: #ffffff;
}

/* Empty State */
.albums-empty {
  padding: 5rem var(--gutter);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 4px;
}

.albums-empty h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.albums-empty p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* ==========================================================================
   Album Subpage Specifics
   ========================================================================== */
.album-header-section {
  padding-top: clamp(6.5rem, 13vw, 9.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

.album-nav-back {
  margin-bottom: 2rem;
}

.album-header-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.5fr) minmax(220px, 1fr);
  gap: 2.5rem;
  align-items: end;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.album-page-title {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.album-page-description {
  margin: 1.5rem 0 0;
  max-width: 60ch;
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.6;
  color: var(--muted);
}

.album-meta-info {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

@media (min-width: 768px) {
  .album-meta-info {
    align-items: flex-end;
    text-align: right;
  }
}

/* Photo Gallery Grid */
.album-gallery-section {
  padding-bottom: clamp(6rem, 12vw, 12rem);
}

.album-gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(1rem, 2vw, 2rem);
  align-items: start;
}

.album-photo-item {
  margin: 0;
  grid-column: span 4;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  border-radius: 2px;
}

/* Asymmetric editorial rhythm matching homepage */
.album-photo-item:nth-child(6n + 1) {
  grid-column: span 5;
}
.album-photo-item:nth-child(6n + 2) {
  grid-column: span 7;
}
.album-photo-item:nth-child(6n + 3) {
  grid-column: span 4;
}
.album-photo-item:nth-child(6n + 4) {
  grid-column: span 8;
}
.album-photo-item:nth-child(6n + 5) {
  grid-column: span 6;
}
.album-photo-item:nth-child(6n + 6) {
  grid-column: span 6;
}

.album-photo-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 500ms cubic-bezier(0.2, 0.65, 0.2, 1);
}

.album-photo-item:hover img {
  transform: scale(1.02);
}

.album-photo-item figcaption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ==========================================================================
   Lightbox System (Enhanced with Next/Prev & keyboard controls)
   ========================================================================== */
.album-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 10, 9, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.album-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.modal-open {
  overflow: hidden;
}

.album-lightbox__backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.album-lightbox__topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1010;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--gutter);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.album-lightbox__counter {
  letter-spacing: 0.1em;
  color: var(--muted-light);
}

.album-lightbox__close {
  background: transparent;
  border: 0;
  color: var(--text-light);
  font-size: 1.8rem;
  line-height: 1;
  padding: 0.5rem;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 180ms ease, transform 180ms ease;
}

.album-lightbox__close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.album-lightbox__stage {
  position: relative;
  z-index: 1005;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-lightbox__stage img {
  max-width: 90vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  cursor: zoom-out;
}

/* Nav arrows */
.album-lightbox__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1010;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.album-lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.08);
}

.album-lightbox__btn--prev {
  left: 1.5rem;
}

.album-lightbox__btn--next {
  right: 1.5rem;
}

.album-lightbox__spinner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: lightboxSpin 0.75s linear infinite;
  pointer-events: none;
}

.album-lightbox__spinner.is-hidden {
  display: none;
}

@keyframes lightboxSpin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.albums-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem var(--gutter);
  background: var(--dark-bg);
  color: var(--muted-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.albums-footer a {
  transition: color 180ms ease;
}

.albums-footer a:hover {
  color: #ffffff;
}

.albums-footer__links {
  display: flex;
  gap: 1.5rem;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 900px) {
  .albums-intro-heading {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .album-hero-card {
    height: 55vh;
  }

  .album-photo-item,
  .album-photo-item:nth-child(6n + 1),
  .album-photo-item:nth-child(6n + 2),
  .album-photo-item:nth-child(6n + 3),
  .album-photo-item:nth-child(6n + 4),
  .album-photo-item:nth-child(6n + 5),
  .album-photo-item:nth-child(6n + 6) {
    grid-column: span 6;
  }

  .album-lightbox__btn {
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 768px) {
  .albums-header .nav {
    display: none;
  }

  .albums-header .menu-toggle {
    display: flex;
  }
}

@media (max-width: 600px) {
  .album-hero-card {
    height: 48vh;
  }

  .album-photo-item,
  .album-photo-item:nth-child(n) {
    grid-column: 1 / -1;
  }

  .album-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .album-lightbox__btn--prev {
    left: 0.5rem;
  }

  .album-lightbox__btn--next {
    right: 0.5rem;
  }
}
