/* ClariFree — stories.css */
/* Styles exclusive to the Stories album page */

/* ===== PAGE HERO ===== */
.stories-page-hero {
  padding-top: calc(var(--nav-h) + clamp(4rem, 8vw, 6rem));
  padding-bottom: clamp(2rem, 4vw, 3rem);
  background: var(--white);
}

.stories-page-title {
  margin-bottom: 0.75rem;
}

.stories-page-sub {
  font-family: var(--font-garamond);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
  font-weight: 300;
  font-style: italic;
  color: var(--grey);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 0;
}

/* ===== WALL SECTION ===== */
.stories-wall-section {
  background: var(--off-white);
  padding: clamp(5rem, 10vw, 8rem) 0 clamp(8rem, 14vw, 12rem);
}

/* ===== THE GALLERY WALL ===== */
/* True pinned-photo-on-wall: fixed height container, cards absolutely placed */
.stories-wall {
  position: relative;
  width: 100%;
  height: 640px; /* tall enough for overlapping cards */
  margin: 0 auto;
  max-width: 900px;
}

/* ===== WALL CARD BASE ===== */
.wall-card {
  position: absolute;
  transform: rotate(var(--rot, 0deg));
  transition: box-shadow 0.35s ease, transform 0.35s ease, z-index 0s;
  border-radius: 20px;
  z-index: var(--z, 1);
  cursor: default;
}

.wall-card:hover {
  box-shadow: 0 32px 72px rgba(0,0,0,0.18), 0 8px 20px rgba(0,0,0,0.09);
  transform: rotate(calc(var(--rot, 0deg) * 0.3)) translateY(-8px) scale(1.02);
  z-index: 20;
}

/* ===== CARD INNER — the glass surface ===== */
.wall-card-inner {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 210, 205, 0.55);
  border-radius: 20px;
  padding: 2rem 2.25rem;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255,255,255,0.95);
}

/* ===== CARD SIZE VARIANTS & POSITIONS ===== */
/* Card 1 — square, top-left, slightly overlaps card 2 */
.wall-card--square:nth-child(1) {
  width: 300px;
  height: 300px;
  top: 40px;
  left: 0;
  --z: 2;
}

/* Card 2 — tall rectangle, center, overlaps both neighbours */
.wall-card--rect:nth-child(2) {
  width: 260px;
  height: 400px;
  top: 110px;
  left: 50%;
  transform: translateX(-50%) rotate(var(--rot, 0deg));
  --z: 3;
}
.wall-card--rect:nth-child(2):hover {
  transform: translateX(-50%) rotate(calc(var(--rot, 0deg) * 0.3)) translateY(-8px) scale(1.02);
}

/* Card 3 — square, top-right */
.wall-card--square:nth-child(3) {
  width: 280px;
  height: 280px;
  top: 80px;
  right: 0;
  --z: 1;
}

/* ===== QUOTE MARK ===== */
.wall-quote-mark {
  font-family: var(--font-garamond);
  font-size: 4.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--azure);
  opacity: 0.15;
  position: absolute;
  top: 0.5rem;
  left: 1.25rem;
  pointer-events: none;
  user-select: none;
}

/* ===== QUOTE TEXT ===== */
.wall-quote {
  font-family: var(--font-garamond);
  font-size: clamp(1.15rem, 1.6vw, 1.5rem);
  font-weight: 400;
  font-style: italic;
  color: var(--black);
  line-height: 1.75;
  letter-spacing: 0.01em;
  border: none;
  margin: 0;
  padding: 0;
  /* push text below the quote mark */
  padding-top: 0.5rem;
}

/* ===== REVEAL ANIMATION — wall cards ===== */
.reveal-wall {
  opacity: 0;
  transition:
    opacity 0.75s ease,
    transform 0.75s ease;
}

/* Restore each card's own transform + add Y offset when hidden */
.wall-card--square:nth-child(1).reveal-wall  { transform: rotate(1.8deg) translateY(28px); }
.wall-card--rect:nth-child(2).reveal-wall    { transform: translateX(-50%) rotate(-2.2deg) translateY(28px); }
.wall-card--square:nth-child(3).reveal-wall  { transform: rotate(1.1deg) translateY(28px); }

/* Visible state — snap to natural position */
.wall-card--square:nth-child(1).reveal-wall.visible  { opacity: 1; transform: rotate(1.8deg) translateY(0); }
.wall-card--rect:nth-child(2).reveal-wall.visible    { opacity: 1; transform: translateX(-50%) rotate(-2.2deg) translateY(0); }
.wall-card--square:nth-child(3).reveal-wall.visible  { opacity: 1; transform: rotate(1.1deg) translateY(0); }

/* Hover re-applies on top of visible state */
.wall-card--square:nth-child(1).reveal-wall.visible:hover { transform: rotate(calc(1.8deg * 0.3)) translateY(-8px) scale(1.02); }
.wall-card--rect:nth-child(2).reveal-wall.visible:hover   { transform: translateX(-50%) rotate(calc(-2.2deg * 0.3)) translateY(-8px) scale(1.02); }
.wall-card--square:nth-child(3).reveal-wall.visible:hover { transform: rotate(calc(1.1deg * 0.3)) translateY(-8px) scale(1.02); }

/* Stagger delays */
.reveal-wall:nth-child(1) { transition-delay: 0.05s; }
.reveal-wall:nth-child(2) { transition-delay: 0.22s; }
.reveal-wall:nth-child(3) { transition-delay: 0.39s; }

/* ===== BACK CTA SECTION ===== */
.stories-back-section {
  padding: clamp(3rem, 6vw, 5rem) 0;
  background: var(--white);
}

.btn-back {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--grey);
  border-bottom: 1px solid var(--grey-light);
  padding-bottom: 3px;
  transition: color 0.25s, border-color 0.25s;
}

.btn-back:hover {
  color: var(--azure);
  border-color: var(--azure);
}

/* ===== RESPONSIVE — mobile: clean grid ===== */
@media (max-width: 768px) {

  .stories-wall {
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    max-width: 100%;
  }

  /* Reset all organic positioning on mobile */
  .wall-card,
  .wall-card--square:nth-child(1),
  .wall-card--rect:nth-child(2),
  .wall-card--square:nth-child(3) {
    position: static;
    width: 100%;
    max-width: 480px;
    height: auto;
    min-height: auto;
    transform: none !important;
    top: auto; left: auto; right: auto;
  }

  .wall-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 40px rgba(0,0,0,0.10) !important;
  }

  .wall-card-inner {
    height: auto;
    padding: 2rem;
  }

  .wall-quote {
    font-size: 1.25rem;
    padding-top: 0.25rem;
  }

  /* Reset reveal animation for mobile (no rotation) */
  .reveal-wall,
  .wall-card--square:nth-child(1).reveal-wall,
  .wall-card--rect:nth-child(2).reveal-wall,
  .wall-card--square:nth-child(3).reveal-wall { transform: translateY(24px) !important; }

  .reveal-wall.visible,
  .wall-card--square:nth-child(1).reveal-wall.visible,
  .wall-card--rect:nth-child(2).reveal-wall.visible,
  .wall-card--square:nth-child(3).reveal-wall.visible { transform: translateY(0) !important; }
}

@media (max-width: 480px) {
  .wall-card-inner { padding: 1.5rem; }
  .wall-quote { font-size: 1.15rem; }
  .wall-quote-mark { font-size: 3.5rem; }
}