
/* Photobook Show (Album Mode) */
.photobook-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--ui-bg, #0F1115);
  font-family: var(--font-serif, 'EB Garamond', serif);
  overflow: hidden;
  position: relative; 
}

/* The Book Page */
.photobook-page-view {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 90vh;
  background-color: var(--paper-aged, #F6F1E8);
  box-shadow: 0 0 50px rgba(0,0,0,0.5), inset 0 0 100px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl, 40px);
  
  /* Paper Grain Texture Overlay */
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
  perspective: 1500px;
}

/* Inner Shadow / Vignette */
.photobook-page-view::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(42, 37, 32, 0.15); /* --ink-dark with alpha */
  pointer-events: none;
  z-index: 10;
}

/* Header / Title Area */
.photobook-header {
  position: absolute;
  top: var(--space-xl, 40px);
  left: 0;
  right: 0;
  text-align: center;
  color: var(--ink-soft, #6B6258);
  z-index: 20;
  opacity: 0.8;
}

.photobook-title {
  font-size: var(--text-sm, 14px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: var(--space-xs, 4px);
}

.photobook-subtitle {
  font-size: var(--text-xs, 12px);
  font-style: italic;
}

/* Photo Frame */
.photo-frame-wrapper {
  position: relative;
  z-index: 20;
  transform: rotate(var(--photo-rotation, 0deg));
  transition: transform 0.5s ease;
  padding: 20px 20px 60px 20px; /* Polaroid style bottom heavy */
  background-color: #fff; /* Matte border */
  box-shadow: 2px 4px 15px rgba(0,0,0,0.15);
  max-width: 80%;
  max-height: 70vh;
}

.photo-frame-wrapper:hover {
   transform: scale(1.01) rotate(0deg);
}

.photo-image {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  /* Dust grain overlay on image */
  filter: sepia(0.1) contrast(1.05); 
}

.encrypted-viewer-container {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0,0,0,0.03);
}

.viewer-placeholder {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--ink-soft);
  text-align: center;
  padding: 40px;
}

/* Overlay Scratches/Dust */
.photo-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Caption Area */
.caption-area {
  margin-top: var(--space-lg, 24px);
  text-align: center;
  color: var(--ink-dark, #2A2520);
  z-index: 20;
  width: 100%;
  max-width: 600px;
}

.photo-date-location {
  font-family: var(--font-serif);
  font-size: var(--text-sm, 14px);
  color: var(--ink-soft, #6B6258);
  margin-bottom: var(--space-sm, 8px);
  display: block;
}

.photo-caption {
  font-family: var(--font-serif);
  font-size: var(--text-lg, 20px);
  line-height: 1.4;
  font-style: italic;
}

/* Navigation Controls */
.nav-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: var(--cursor-pointer);
  color: var(--ink-soft, #6B6258);
  opacity: 0.5;
  transition: opacity 0.2s;
  font-family: var(--font-serif);
  font-size: var(--text-xl, 28px);
  z-index: 30;
  padding: 20px;
  text-decoration: none;
}

.nav-control:hover {
  opacity: 1;
  color: var(--leather-brown, #5A3E2B);
}

.nav-prev { left: 20px; }
.nav-next { right: 20px; }

/* Interactive overlay simulation */
.ui-overlay {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 40;
}

.photobook-page-view:hover .ui-overlay {
  opacity: 1;
}

.ui-btn {
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: var(--cursor-pointer);
  color: var(--ui-muted);
  text-decoration: none;
}

.ui-btn:hover {
  color: var(--ui-accent);
}

.stack-view-trigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100;
}

.page-number {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--ink-soft);
    opacity: 0.6;
}

/* Cover specific */
.cover-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

@media (max-width: 768px) {
  .photobook-container {
    flex-direction: column;
    min-height: 100dvh;
    padding: var(--space-md) 0;
  }

  .photobook-page-view {
    height: auto;
    min-height: calc(100dvh - 32px);
    padding: var(--space-md);
  }

  .photo-frame-wrapper { max-width: 100%; padding: 12px 12px 40px; }
  .photo-image { max-height: 55dvh; }
  .photobook-container .book-cover-wrapper { max-width: calc(100% - 32px); }
  .photobook-container .nav-control {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--sepia-line);
    border-radius: 50%;
    background: var(--paper-base);
    opacity: 1;
  }
  .photobook-container .nav-prev { left: var(--space-sm); }
  .photobook-container .nav-next { right: var(--space-sm); }
  .photobook-container .stack-view-trigger {
    position: relative;
    bottom: auto;
    left: auto;
    flex-wrap: wrap;
    margin: var(--space-md) 0 0;
  }
  .page-number { position: static; margin-top: var(--space-sm); }
}
