/* ==========================================================================
   LUXURY EDITORIAL WEDDING INVITATION — STYLESHEET
   ========================================================================== */

:root {
  --bg-ivory: #FBF9F5;
  --bg-cream: #F4EFE6;
  --paper-white: #FCFBF9;
  
  --color-wine: #5C242B;
  --color-wine-dark: #3F151B;
  --color-dusty-rose: #C8A29B;
  --color-muted-green: #535F55;
  --color-gold-accent: #C5A880;
  --color-gold-border: rgba(197, 168, 128, 0.55);
  --color-charcoal: #2A2624;
  --color-text-muted: #7A736E;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-display: 'Cinzel', serif;
  --font-sans: 'Montserrat', -apple-system, sans-serif;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-ivory);
  font-family: var(--font-serif);
  color: var(--color-charcoal);
  user-select: none;
}

/* Scene Viewport */
.scene-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Ambient Tabletop Background Texture */
.tabletop-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 45%, #FFFFFF 0%, #F5EFE4 55%, #EBE1CF 100%);
  z-index: 1;
  pointer-events: none;
}

.tabletop-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image: radial-gradient(#2a2624 0.6px, transparent 0.6px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Layer Stacking */
.layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer-bg { z-index: 10; }
.butterfly-canvas {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 15;
  pointer-events: none;
}
.layer-fg { z-index: 20; }
.layer-mid { z-index: 50; }
.layer-mid.elevated { z-index: 500 !important; }

/* Botanical Elements (All 100% Transparent User PNGs) */
.botanical {
  position: absolute;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 14px 28px rgba(35, 25, 20, 0.14));
  will-change: transform;
}

/* Background Purple Flowers */
.bg-purple-flowers {
  top: 2%;
  right: 4%;
  width: 380px;
  transform: rotate(5deg);
  opacity: 0.95;
}

.bg-purple-flowers-bottom {
  bottom: -60px;
  right: 2%;
  width: 290px;
  transform: rotate(185deg);
  opacity: 0.85;
}

/* Scattered Rose Petals (gülYaprak1adet.png with dynamic wind float) */
.mid-petal-red {
  bottom: 22%;
  left: 17%;
  width: 135px;
  transform: rotate(25deg);
  filter: drop-shadow(0 10px 22px rgba(25, 15, 10, 0.22));
}

.petal-top-left {
  top: 6%;
  left: 7%;
  width: 115px;
  transform: rotate(55deg);
  filter: drop-shadow(0 10px 20px rgba(25, 15, 10, 0.20));
}

.petal-bottom-right {
  bottom: 7%;
  right: 15%;
  width: 125px;
  transform: rotate(-35deg);
  filter: drop-shadow(0 10px 22px rgba(25, 15, 10, 0.22));
}

.petal-mid-right {
  top: 46%;
  right: 4%;
  width: 95px;
  transform: rotate(-15deg);
  filter: drop-shadow(0 8px 18px rgba(25, 15, 10, 0.18));
}

.petal-center-low {
  bottom: 12%;
  left: 36%;
  width: 85px;
  transform: rotate(115deg);
  filter: drop-shadow(0 8px 18px rgba(25, 15, 10, 0.18));
}

/* Foreground Burgundy Rose */
.fg-rose-burgundy {
  bottom: -90px;
  left: -80px;
  width: 420px;
  filter: drop-shadow(0 20px 40px rgba(20, 10, 10, 0.28));
}

/* Foreground Pink Rose */
.fg-rose-blush {
  top: -80px;
  right: -70px;
  width: 390px;
  filter: drop-shadow(0 20px 40px rgba(20, 10, 10, 0.22));
}

/* ==========================================================================
   LUXURY STATIONERY ENVELOPE
   ========================================================================== */

.envelope-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 530px;
  height: 355px;
  perspective: 1200px;
  pointer-events: auto;
}

.envelope {
  position: relative;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #FAF7F0 0%, #F2EBE0 60%, #EBE2D2 100%);
  border-radius: 6px;
  box-shadow: 
    0 15px 35px rgba(35, 25, 20, 0.14),
    0 30px 65px rgba(25, 15, 10, 0.12);
  cursor: pointer;
  transition: box-shadow 0.4s ease;
}

.envelope:hover {
  box-shadow: 
    0 18px 40px rgba(35, 25, 20, 0.16),
    0 35px 75px rgba(25, 15, 10, 0.14);
}

/* Envelope Back Pocket */
.envelope-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #EBE3D4 0%, #E2D7C5 100%);
  border-radius: 6px;
  box-shadow: inset 0 0 25px rgba(0,0,0,0.06);
  pointer-events: none;
}

/* Physical Pocket Mask: Clips card below the bottom of the envelope */
.envelope-pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  clip-path: polygon(-100px -1500px, calc(100% + 100px) -1500px, calc(100% + 100px) 100%, -100px 100%);
  pointer-events: none;
}

.envelope-pocket.unclipped {
  clip-path: none !important;
  z-index: 50 !important;
}

/* Keepsake Photo Prints (STABLE, NO JITTER ON HOVER) */
.photo-keepsake {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 175px;
  background: #FFFFFF !important;
  padding: 8px 8px 16px 8px;
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(35, 25, 20, 0.22);
  border: 1px solid rgba(210, 190, 160, 0.5);
  cursor: pointer;
  display: none;
  opacity: 0;
  pointer-events: auto;
  z-index: 1020;
  transition: box-shadow 0.25s ease;
}

.photo-keepsake:hover {
  box-shadow: 0 22px 48px rgba(30, 20, 15, 0.38) !important;
}

.keepsake-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #FFFFFF !important;
}

.keepsake-inner img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  border-radius: 3px;
}

.keepsake-caption {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 500;
  color: var(--color-wine);
  margin-top: 7px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Envelope Flaps */
.envelope-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 285px;
  height: 100%;
  background: linear-gradient(135deg, #EFE8DA 0%, #E5DCB9 100%);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  z-index: 5;
  filter: drop-shadow(3px 0 5px rgba(0,0,0,0.04));
  pointer-events: none;
}

.envelope-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 285px;
  height: 100%;
  background: linear-gradient(225deg, #EAE1D1 0%, #E0D4C0 100%);
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  z-index: 5;
  filter: drop-shadow(-3px 0 5px rgba(0,0,0,0.04));
  pointer-events: none;
}

.envelope-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 235px;
  background: linear-gradient(0deg, #F4EEE2 0%, #E9DFC2 100%);
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
  z-index: 6;
  filter: drop-shadow(0 -4px 7px rgba(0,0,0,0.05));
  pointer-events: none;
}

/* Top Flap with 3D Flip Hinge */
.envelope-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 225px;
  transform-origin: top center;
  transform-style: preserve-3d;
  z-index: 7;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.10));
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  pointer-events: none;
}

.envelope-top.open {
  transform: rotateX(-180deg);
  z-index: 2;
}

.flap-front {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #FAF4E9 0%, #ECE3D2 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  backface-visibility: hidden;
}

.flap-inner {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #4F161E 0%, #3A0D13 70%, #26070B 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: rotateX(180deg);
  backface-visibility: hidden;
}

/* Realistic Wax Seal (K&Ö Monogram) */
.wax-seal {
  position: absolute;
  top: 190px;
  left: 50%;
  margin-top: -38px;
  margin-left: -38px;
  width: 76px;
  height: 76px;
  background: radial-gradient(circle at 35% 32%, #822C37 0%, #5E1F27 55%, #380E13 100%);
  border-radius: 50%;
  box-shadow: 
    0 10px 22px rgba(35, 12, 16, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.3),
    inset 0 -3px 6px rgba(0, 0, 0, 0.45);
  cursor: pointer !important;
  pointer-events: auto !important;
  z-index: 100 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wax-seal::after {
  content: '';
  position: absolute;
  inset: -25px;
  border-radius: 50%;
}

.wax-seal:hover {
  transform: scale(1.08);
  box-shadow: 
    0 14px 28px rgba(35, 12, 16, 0.55),
    inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.wax-seal-emboss {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1.5px solid rgba(220, 185, 140, 0.35);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
  pointer-events: none;
}

.wax-monogram {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #ECD7BE;
  text-shadow: 0 1px 2px rgba(0,0,0,0.65);
  letter-spacing: 1.5px;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.seal-hint {
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-wine);
  opacity: 0.9;
  pointer-events: none;
  animation: hintPulse 2s infinite ease-in-out;
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(3px); }
}

/* ==========================================================================
   ELEGANT INVITATION CARD (PERFECTLY BALANCED EDITORIAL PROPORTIONS)
   ========================================================================= */

.invitation-card {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 475px;
  height: 565px;
  background: #FCFAF5 !important;
  background-color: #FCFAF5 !important;
  border-radius: 6px;
  box-shadow: 0 15px 40px rgba(35, 25, 20, 0.16);
  z-index: 3;
  padding: 24px 22px;
  border: 1px solid rgba(197, 168, 128, 0.35);
  display: none;
  opacity: 1 !important;
  pointer-events: none;
}

.invitation-card.card-elevated {
  display: block !important;
  opacity: 1 !important;
  box-shadow: 
    0 25px 60px rgba(30, 20, 15, 0.22),
    0 45px 95px rgba(20, 10, 5, 0.16);
  z-index: 1000 !important;
  pointer-events: auto !important;
}

.card-inner {
  height: 100%;
  border: 1.5px solid var(--color-gold-border);
  padding: 22px 20px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  position: relative;
  background: #FAF7F0 !important;
  background-color: #FAF7F0 !important;
  border-radius: 4px;
}

.editorial-subtitle {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  letter-spacing: 5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

.couple-names {
  font-family: var(--font-serif);
  font-size: 2.85rem;
  font-weight: 400;
  color: var(--color-wine);
  line-height: 1.12;
  letter-spacing: 1px;
}

.couple-names .ampersand {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 2.35rem;
  color: var(--color-dusty-rose);
  margin: 0 6px;
}

.header-divider {
  width: 50px;
  height: 1.5px;
  background: var(--color-gold-accent);
  margin: 12px auto 0;
  opacity: 0.8;
}

.invitation-lead {
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
  color: var(--color-charcoal);
  margin: 18px 0 20px;
  font-weight: 400;
  padding: 0 8px;
}

/* Date & Time Row (2 Columns) */
.date-time-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 0;
  border-top: 1px solid rgba(200, 162, 155, 0.35);
  border-bottom: 1px solid rgba(200, 162, 155, 0.35);
  margin-bottom: 16px;
}

.detail-block {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 2px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.detail-val {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-wine-dark);
  letter-spacing: 1px;
}

.detail-sub {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--color-muted-green);
  margin-top: 3px;
  letter-spacing: 1px;
}

.detail-divider {
  width: 1px;
  height: 32px;
  background: rgba(200, 162, 155, 0.35);
}

/* Venue Section (Spacious, Clear & Prominent) */
.venue-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0 16px;
}

.venue-label {
  font-family: var(--font-sans);
  font-size: 0.58rem;
  letter-spacing: 2.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.venue-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--color-wine);
  letter-spacing: 2px;
  line-height: 1.25;
}

.venue-address {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-muted-green);
  margin-top: 4px;
  letter-spacing: 1px;
  font-weight: 400;
}

/* Families Section (Gelin ve Damat Ailesi En Altta) */
.card-families-section {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 16px 0 8px;
  border-top: 1px dashed rgba(200, 162, 155, 0.45);
  margin-top: 8px;
}

.family-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.family-label {
  font-family: var(--font-sans);
  font-size: 0.56rem;
  letter-spacing: 2.5px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.family-names-text {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--color-wine-dark);
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.family-divider-line {
  width: 1px;
  height: 34px;
  background: rgba(200, 162, 155, 0.4);
}

.card-footer {
  margin-top: 6px;
}

.monogram-watermark {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 5px;
  color: var(--color-dusty-rose);
  opacity: 0.75;
}

/* ==========================================================================
   PHOTO LIGHTBOX MODAL (CLEAN FULL-SCREEN PHOTO VIEW)
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 12, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto !important;
}

.lightbox-card {
  max-width: 500px;
  width: 90%;
  background: #FFFDF9;
  padding: 16px 16px 22px 16px;
  border-radius: 6px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.35);
  border: 1px solid rgba(210, 190, 160, 0.5);
  position: relative;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.35s ease;
}

.modal-overlay.active .lightbox-card {
  transform: translateY(0);
}

.lightbox-image-wrap {
  width: 100%;
  max-height: 65vh;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.lightbox-image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 65vh;
  object-fit: cover;
  display: block;
}

.lightbox-caption {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--color-wine);
  margin-top: 14px;
  letter-spacing: 1px;
}

.modal-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-wine);
  border: 2px solid #FFF;
  font-size: 1.3rem;
  color: #FFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.modal-close:hover {
  background: var(--color-wine-dark);
  transform: scale(1.1);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (MOBILE PERFECTION)
   ========================================================================== */

@media (max-width: 600px) {
  .envelope-wrapper {
    transform: translate(-50%, -50%) scale(0.60) !important;
  }
  
  .couple-names { font-size: 2.3rem; }
  .invitation-lead { font-size: 1.05rem; }
  .venue-name { font-size: 1.3rem; }
  
  /* Botanicals on Mobile */
  .bg-purple-flowers {
    width: 210px;
    right: -45px;
    top: -20px;
  }

  .bg-purple-flowers-bottom {
    width: 190px;
    right: -35px;
    bottom: -35px;
  }
  
  .fg-rose-blush {
    width: 200px;
    right: -45px;
    top: -40px;
  }
  
  .fg-rose-burgundy {
    width: 210px;
    left: -45px;
    bottom: -45px;
  }
  
  .mid-petal-red {
    width: 95px;
    left: 4%;
    bottom: 14%;
  }

  .petal-top-left {
    width: 80px;
    left: 4%;
    top: 4%;
  }

  .petal-bottom-right {
    width: 90px;
    right: 6%;
    bottom: 4%;
  }

  .photo-keepsake {
    width: 150px !important;
    padding: 6px 6px 14px 6px !important;
  }
  
  .photo-keepsake img {
    height: 145px !important;
  }
  
  .keepsake-caption {
    font-size: 0.68rem !important;
  }
}
