/* ============================================
   Alba Tull Photography — Global Styles
   ============================================ */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */
html, body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: #f5f3f0;
  color: #333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.overlay-open {
  overflow: hidden;
}

/* Typography */
.font-display {
  font-family: 'Playfair Display', serif;
}

/* ============================================
   Navigation
   ============================================ */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(245, 243, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e0dcd7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8b7355;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.nav-links a:hover {
  opacity: 0.7;
}

main {
  padding-top: 64px;
}

/* ============================================
   Homepage: Rolodex + Featured Panel
   ============================================ */
.home-layout {
  display: flex;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Left: Rolodex column */
.rolodex-column {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.rolodex-scroll {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

.rolodex-scroll::-webkit-scrollbar {
  width: 6px;
}
.rolodex-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.rolodex-scroll::-webkit-scrollbar-thumb {
  background: rgba(139, 115, 85, 0.25);
  border-radius: 3px;
}

.rolodex-spacer {
  position: relative;
  width: 100%;
}

.rolodex-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rolodex-perspective {
  width: 100%;
  height: 100%;
  perspective: 1200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ============================================
   Rolodex Cards
   ============================================ */
.rolo-card {
  position: absolute;
  width: 420px;
  height: 560px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  will-change: transform;
  backface-visibility: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s ease;
}

.rolo-card:hover {
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.28);
}

/* Media container inside each card (handles live preview swap) */
.rolo-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
}

.rolo-img, .rolo-video, .rolo-freeze {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 180ms ease;
}

/* Still image visible by default */
.rolo-img {
  position: relative;
  opacity: 1;
  z-index: 1;
}

/* Video hidden by default, shown when tile is live */
.rolo-video {
  opacity: 0;
  z-index: 2;
}

/* When IntersectionObserver marks tile as live */
.rolo-tile.is-live .rolo-video {
  opacity: 1;
}
.rolo-tile.is-live .rolo-img {
  opacity: 0;
}

/* Canvas freeze frame during transition */
.rolo-freeze {
  z-index: 3;
}

/* Category label on card */
.rolo-label {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 10;
  backdrop-filter: blur(4px);
}

/* ============================================
   Right: Featured / Info Panel
   ============================================ */
.info-panel {
  width: 380px;
  background: white;
  border-left: 1px solid #e0dcd7;
  padding: 40px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.info-panel::-webkit-scrollbar {
  width: 4px;
}
.info-panel::-webkit-scrollbar-thumb {
  background: rgba(139, 115, 85, 0.2);
  border-radius: 2px;
}

.info-artist {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: #333;
}

.info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #aaa;
  font-weight: 600;
  margin-bottom: 6px;
}

.info-category {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #8b7355;
  font-weight: 700;
}

.info-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: #333;
  font-weight: 700;
  line-height: 1.3;
}

.info-description {
  font-size: 13px;
  line-height: 1.7;
  color: #777;
}

.info-counter {
  font-size: 12px;
  color: #bbb;
}

/* Category tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #f0ebe4;
  color: #8b7355;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  text-decoration: none;
}

.tag:hover {
  background: #8b7355;
  color: white;
}

/* ============================================
   Category Grid Page
   ============================================ */
.grid-page {
  padding: 40px;
  min-height: calc(100vh - 64px);
}

.grid-header {
  margin-bottom: 40px;
}

.grid-title {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  color: #333;
}

.grid-back {
  font-size: 13px;
  color: #8b7355;
  text-decoration: none;
  display: inline-block;
  margin-top: 12px;
  transition: opacity 0.3s;
}
.grid-back:hover {
  opacity: 0.7;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.grid-tile {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.grid-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.grid-tile:hover img {
  transform: scale(1.04);
}

.grid-tile-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  padding: 24px 16px 16px;
  font-size: 14px;
  font-weight: 600;
}

/* ============================================
   Photo/Video Detail Page
   ============================================ */
.detail-layout {
  display: flex;
  gap: 48px;
  padding: 48px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.detail-hero {
  flex: 1;
  max-width: 700px;
}

.detail-hero img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.detail-sidebar {
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 8px;
}

.detail-back {
  font-size: 13px;
  color: #8b7355;
  text-decoration: none;
  transition: opacity 0.3s;
}
.detail-back:hover { opacity: 0.7; }

.detail-category {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: #8b7355;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.detail-description {
  font-size: 15px;
  line-height: 1.8;
  color: #666;
}

/* Audio narration */
.audio-section {
  padding-top: 20px;
  border-top: 1px solid #e0dcd7;
}

.audio-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #aaa;
  font-weight: 600;
  margin-bottom: 10px;
}

.audio-player {
  background: #f5f3f0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #e0dcd7;
}

.audio-player audio {
  width: 100%;
  height: 32px;
}

/* Related photos */
.related-section {
  margin-top: 48px;
  padding: 0 40px 60px;
}

.related-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.related-item {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

.related-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.related-item:hover img {
  transform: scale(1.05);
}

/* ============================================
   Stage Overlay (lightbox with route support)
   ============================================ */
.stage-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.stage-overlay.is-open {
  display: block;
}

.stage-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(2px);
}

.stage-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1200px, calc(100vw - 80px));
  height: min(800px, calc(100vh - 80px));
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.stage-close {
  position: absolute;
  right: 20px;
  top: 18px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 24px;
  color: #999;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.stage-close:hover {
  background: rgba(0,0,0,0.05);
  color: #333;
}

.stage-body {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 40px;
}

/* ============================================
   Repeating-Frame Transition Layer
   ============================================ */
.rt-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

.rt-frame {
  position: fixed;
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  will-change: left, top, width, height, clip-path;
}

/* ============================================
   About Page
   ============================================ */
.about-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 40px;
  min-height: calc(100vh - 64px);
}

.about-back {
  font-size: 13px;
  color: #8b7355;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 24px;
  transition: opacity 0.3s;
}
.about-back:hover { opacity: 0.7; }

.about-title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 700;
  color: #333;
  margin-bottom: 32px;
}

.about-content {
  line-height: 1.9;
  color: #666;
  font-size: 16px;
}

.about-content p {
  margin-bottom: 24px;
}

/* Grid subtitle */
.grid-subtitle {
  font-size: 14px;
  color: #999;
  margin-top: 8px;
}

/* Mobile nav toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #8b7355;
  transition: all 0.3s;
}
.nav-mobile-toggle.is-open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.nav-mobile-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.is-open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .rolo-video { display: none; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .home-layout {
    flex-direction: column;
  }
  .info-panel {
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 1px solid #e0dcd7;
    padding: 24px;
  }
  .rolo-card {
    width: 320px;
    height: 440px;
  }
  .detail-layout {
    flex-direction: column;
    padding: 24px;
  }
  .detail-hero {
    max-width: 100%;
  }
  .detail-sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(245, 243, 240, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 20px 40px;
    gap: 16px;
    border-bottom: 1px solid #e0dcd7;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-mobile-toggle {
    display: flex;
  }
}

@media (max-width: 640px) {
  .nav-bar {
    padding: 0 20px;
  }
  .rolo-card {
    width: 280px;
    height: 380px;
  }
  .grid-page {
    padding: 20px;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .about-title {
    font-size: 32px;
  }
  .about-page {
    padding: 24px 20px;
  }
}
