
:root {
  /* --- neutrals --- */
  --paper: #FAF2F3;       /* main page background */
  --ink: #3A342F;         /* main text colour (warm near-black, not pure black) */
  --ink-soft: #746C63;    /* secondary text — captions, hints, labels */

  /* --- pastel section tints (alternate down the page for rhythm) --- */
  --tint-turquoise: #E3F5F1;
  --tint-pink: #FBEAEC;

  /* --- primary accent: turquoise (buttons, envelope, links) --- */
  --turquoise: #7EC8BC;
  --turquoise-dark: #5CA89C; /* hover states, small text needing more contrast */

  /* --- secondary accent: pastel pink (used on radio pills / soft highlights) --- */
  --pink: #F2C2C6;

  /* --- tertiary accent: dusty rose (used sparingly — the "special" colour) --- */
  --rose: #C98980;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, sans-serif;

  --measure: 640px;   /* max width for readable text columns (~80 characters) */
  --radius: 2px;      /* corner radius used everywhere — change once, applies everywhere */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper); /* solid fallback colour, shown briefly before the photo loads / if it fails */
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1; /* sits behind all normal page content */
  background-image: url('../img/colorful-petals-scattered-on-grass.jpg');
  background-position: center 50%;
  background-size: cover;
  background-repeat: no-repeat;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  text-align: center;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25em;
}

a {
  color: var(--turquoise-dark);
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-switcher {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 200;
  display: flex;
  gap: 0.35rem;
  background: rgba(253, 251, 250, 0.85);
  backdrop-filter: blur(4px);
  padding: 0.35rem 0.5rem;
  border-radius: 0.3rem;
  box-shadow: 0 2px 8px rgba(43, 38, 32, 0.12);
}

.lang-switcher__flag {
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.15s ease;
  display: inline-block;
}

.lang-switcher__flag:hover {
  opacity: 0.9;
  transform: scale(1.1);
}

.lang-switcher__flag.is-active {
  opacity: 1;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-stack {
  position: fixed;
  top: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(90vw, 420px);
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
}

.flash--success { background: var(--turquoise); }
.flash--error { background: var(--rose); }

/* ============================================================
   BUTTONS + FORM CONTROLS
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  background: var(--turquoise);
  color: var(--paper);
  border: 1px solid var(--turquoise);
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.button-holder{
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn:hover { background: var(--turquoise-dark); }

.btn:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}

.btn--outline {
  background: transparent;
  color: var(--turquoise-dark);
}

.btn--outline:hover {
  background: var(--turquoise);
  color: var(--paper);
}

input[type="text"], input[type="number"], input[type="file"], textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid #D8D2C4;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ============================================================
   GATE (code entry + closed envelope)
   ============================================================ */
.gate {
  min-height: 100vh;
  display: flex;
  justify-content: center;  
  align-items: flex-start;
  padding: 55% 1.25rem 2rem;
  overflow-x: hidden; /* safety net on very narrow screens, matching .page's rule for index.html */
}

.gate__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; 
  gap: 2rem;
  width: 100%;
  max-width: min(94vw, 520px);
  text-align: center;
}

.gate__form {
  width: 100%;
  max-width: 360px; /* keeps the code input a comfortable width even though .gate__stage is now wider, to fit the bigger envelope */
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gate__hint {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

:root {
  --postcard-pink-dark: #E7AEB4;  /* pocket sides/back — a touch darker than --pink */
  --postcard-heart: #ED9CA0;      /* floating hearts */

  --envelope-fold-duration: 0.4s; /* how long the flap takes to fold back */
  --envelope-fold-delay: 0.6s;    /* pause before the letter starts sliding up */
  --reveal-fade-duration: 0.6s;   /* how long the whole card takes to fade away once opened */

  --env-w: 480px;
  --env-h: 300px;
  --env-flap-extra: 15px; /* how much taller the flap's tip is than half the envelope's height, for a slight overlap look */
}

@media (max-width: 640px) {
  :root {
    --env-w: 340px;
    --env-h: 212px;
    --env-flap-extra: 11px;
  }
}

/* Small phones: shrink once more. */
@media (max-width: 400px) {
  :root {
    --env-w: 260px;
    --env-h: 165px;
    --env-flap-extra: 8px;
  }
}

.site-reveal {
  position: fixed;
  inset: 0;
  z-index: 300; /* above the language switcher (200) and flash messages */
  background: var(--paper);
  background-image: url('../img/colorful-petals-scattered-on-grass.jpg');
  background-position: center 50%;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 55% 1.25rem 2rem;
  gap: 2rem;
  overflow-x: hidden; /* safety net on very narrow screens */
  transition: opacity var(--reveal-fade-duration) ease, transform var(--reveal-fade-duration) ease;
}

.site-reveal.is-leaving {
  opacity: 0;
  pointer-events: none;
}

html.no-scroll,
html.no-scroll body {
  overflow: hidden;
  height: 100%;
}

.envlope-wrapper {
  display: flex;
  justify-content: center;
}

#envelope {
  position: relative;
  width: var(--env-w);
  height: var(--env-h);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  background-color: var(--rose);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.front {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 3;
}

.flap {
  border-left: calc(var(--env-w) / 2) solid transparent;
  border-right: calc(var(--env-w) / 2) solid transparent;
  border-bottom: calc(var(--env-h) / 2 - var(--env-flap-extra)) solid transparent;
  border-top: calc(var(--env-h) / 2 + var(--env-flap-extra)) solid var(--rose);
  transform-origin: top;
  pointer-events: none;
}

.pocket {
  border-left: calc(var(--env-w) / 2) solid var(--pink);
  border-right: calc(var(--env-w) / 2) solid var(--pink);
  border-bottom: calc(var(--env-h) / 2) solid var(--postcard-pink-dark);
  border-top: calc(var(--env-h) / 2) solid transparent;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.postcard-letter {
  position: relative;
  background-color: var(--paper);
  width: 90%;
  margin-left: auto;
  margin-right: auto;
  height: 90%;
  top: 5%;
  border-radius: 6px;
  box-shadow: 0 2px 26px rgba(0, 0, 0, 0.12);
}

.postcard-letter::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    180deg,
    rgba(242, 194, 198, 0) 25%,
    rgba(242, 194, 198, 0.7) 55%,
    rgba(242, 194, 198, 1) 100%
  );
}

.words {
  position: absolute;
  left: 10%;
  width: 80%;
  height: 14%;
  background-color: #EEEFF0; /* generic placeholder-text bars — purely decorative */
}
.words.line1 { top: 15%; width: 20%; height: 7%; }
.words.line2 { top: 30%; }
.words.line3 { top: 50%; }
.words.line4 { top: 70%; }

#envelope.open .flap {
  transform: rotateX(180deg);
  transition: transform var(--envelope-fold-duration) ease, z-index var(--envelope-fold-delay);
  z-index: 1;
}
#envelope.close .flap {
  transform: rotateX(0deg);
  transition: transform var(--envelope-fold-duration) var(--envelope-fold-delay) ease, z-index 1s;
  z-index: 5;
}
#envelope.close .postcard-letter {
  transform: translateY(0px);
  transition: transform var(--envelope-fold-duration) ease, z-index 1s;
  z-index: 1;
}
#envelope.open .postcard-letter {
  transform: translateY(calc(var(--env-h) / -3));
  transition: transform var(--envelope-fold-duration) var(--envelope-fold-delay) ease, z-index var(--envelope-fold-delay);
  z-index: 2;
}

.hearts {
  position: absolute;
  top: calc(var(--env-h) / 2);
  left: 0;
  right: 0;
  z-index: 2;
}

.postcard-seal {
  position: absolute;
  top: calc(var(--env-h) * 0.43);
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--env-h) * 0.22);
  height: calc(var(--env-h) * 0.22);
  border-radius: 50%;
  background: var(--rose);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: calc(var(--env-h) * 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  z-index: 6;
}
#envelope.open .postcard-seal {
  opacity: 0;
  transition: opacity 0.3s ease;
}
#envelope.close .postcard-seal {
  opacity: 1;
  transition: opacity 0.3s 0.5s ease; /* fades back in slightly after the flap closes, if ever re-closed */
}

.heart {
  position: absolute;
  bottom: 0;
  right: 10%;
  pointer-events: none;
}
.heart::before,
.heart::after {
  position: absolute;
  content: "";
  left: calc(var(--env-w) * 0.18);
  top: 0;
  width: calc(var(--env-w) * 0.18);
  height: calc(var(--env-w) * 0.29); /* roughly width * 1.6 */
  background: var(--postcard-heart);
  border-radius: calc(var(--env-w) * 0.18) calc(var(--env-w) * 0.18) 0 0;
  transform: rotate(-45deg);
  transform-origin: 0 100%;
  pointer-events: none;
}
.heart::after {
  left: 0;
  transform: rotate(45deg);
  transform-origin: 100% 100%;
}
#envelope.close .heart {
  opacity: 0 !important;
  animation: none !important;
}

@keyframes postcardSlideUp {
  0%   { top: 0;      opacity: 0; } /* starts invisible */
  12%  {               opacity: 1; } /* fades in quickly at the start of the rise */
  80%  {               opacity: 1; } /* stays fully visible through most of the float */
  100% { top: -600px; opacity: 0; } /* fades out as it finishes rising, instead of popping off */
}
@keyframes postcardSideSway {
  0%   { margin-left: 0px; }
  100% { margin-left: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .heart { animation: none !important; }
}

.section--letter {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2.5rem;
  padding: 3rem 1.25rem 2rem;
  text-align: center;
}

.open-postcard {
  position: relative;
  width: var(--env-w);
  height: var(--env-h);
  filter: drop-shadow(0 14px 22px rgba(43, 38, 32, 0.18));
}

.open-postcard__flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: calc(var(--env-w) / 2) solid transparent;
  border-right: calc(var(--env-w) / 2) solid transparent;
  border-bottom: calc(var(--env-h) / 2 - var(--env-flap-extra)) solid transparent;
  border-top: calc(var(--env-h) / 2 + var(--env-flap-extra)) solid var(--rose);
  transform: rotateX(180deg);
  transform-origin: top;
  z-index: 0;
}

.open-postcard__pocket {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  background-color: #C98980;
  border-left: calc(var(--env-w) / 2) solid var(--pink);
  border-right: calc(var(--env-w) / 2) solid var(--pink);
  border-bottom: calc(var(--env-h) / 2) solid var(--postcard-pink-dark);
  border-top: calc(var(--env-h) / 2) solid transparent;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  z-index: 1;
}

.letter {
  position: absolute;
  margin-top: 0px;
  left: 8%;
  right: 8%;
  bottom: 10%;
  background: #FFFFFF; /* plain white, as opposed to --paper's warm off-white used elsewhere */
  border: 1px solid #E4DECF;
  border-radius: var(--radius);
  padding: 0rem 1.5rem 1rem 1.5rem;
  box-shadow: 0 8px 16px rgba(43, 38, 32, 0.12);
  opacity: 0;
  transform: translateY(16px);
  z-index: 2; /* above both the flap and the pocket */
}

.letter__names {
  vertical-align: top;
  font-family: "Pinyon Script", cursive;
  font-style: bold;
  font-size: 2.5rem;
  margin-bottom: 0.2rem;
}

.letter__body {
  font-size: 1.2rem;
  font-family: "Lobster Two", sans-serif;
  color: var(--ink-soft);
  margin: 0;
}

.letter__date {
  font-family: "Lobster Two", sans-serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--ink);
}

.countdown {
  padding:1rem;
  background-color: rgb(250, 242, 243,0.8);
  border-radius: 0.1rem;
  display: flex;
  gap: 1.5rem;
  opacity: 0;
  transform: translateY(16px);
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--turquoise-dark);
}

.countdown__unit small {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* ============================================================
   GENERAL SECTIONS
   ============================================================ */
.page {
  max-width: 100%;
}

.page--narrow .section { max-width: var(--measure); margin: 0 auto; }

.section {
  padding: 4rem 1.5rem;
  max-width: var(--measure);
  margin: 0 auto;
  border-radius: 0.1rem;
  background-color: rgb(250, 242, 243,0.8)
}

.section-top {
  padding: 55% 1.25rem 2rem;
  max-width: var(--measure);
  margin: 0 auto;
}

.section--tint {
  max-width: none;
  background: var(--tint-turquoise);
}

.section--tint-a {
  max-width: none;
  background: var(--tint-turquoise);
}

.section--tint-b {
  max-width: none;
  background: var(--tint-pink);
}

.section--tint > *,
.section--tint-a > *,
.section--tint-b > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.section__intro {
  text-align: center;
  color: var(--ink-soft);
  margin: 0 auto 1.5rem;
}

.divider {
  text-align: center;
  color: var(--rose);
  font-size: 1.1rem;
  padding: 0.5rem 0;
}

/* ============================================================
   STORY CAROUSEL
   ============================================================ */
.story-carousel {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story-grid {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.25rem 0.25rem 1rem;
  scrollbar-width: none;
}
.story-grid::-webkit-scrollbar { display: none; }

.story-grid__item {
  flex: 0 0 auto;
  width: min(78vw, 280px);
  scroll-snap-align: center;
  margin: 0;
}

.story-grid__item img,
.story-grid__item video {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  background: #ddd6c4;
}

.story-grid__item figcaption {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-top: 0.5rem;
  text-align: center;
}

.story-grid__text {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0.2rem 0 0;
  text-align: center;
  line-height: 1.5;
}

.story-carousel__arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #D8D2C4;
  background: var(--paper);
  color: var(--turquoise-dark);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-carousel__arrow:hover {
  background: var(--turquoise);
  color: var(--paper);
}

@media (max-width: 560px) {
  .story-carousel__arrow { display: none; }
}

/* ============================================================
   MAP
   ============================================================ */
.map-embed {
  max-width: 550px;
  margin: 0 auto 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #E4DECF;
}

.map-embed iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}

.section#location { text-align: center; }

/* ============================================================
   SCHEDULE
   ============================================================ */
.schedule-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 420px;
}

.schedule-list li {
  display: flex;
  gap: 1.25rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #DED8C9;
}

.schedule-list__time {
  font-family: var(--font-display);
  color: var(--turquoise-dark);
  min-width: 4ch;
}

/* ============================================================
   ACCOMMODATION
   ============================================================ */
.stay-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.25rem;
  text-align: center;
}

.stay-list__item {
  border-top: 1px solid #DED8C9;
  padding-top: 1rem;
}

.stay-list__item p {
  color: var(--ink-soft);
  margin: 0.25rem 0 0.4rem;
}

/* ============================================================
   PHOTOS: UPLOAD / VIEW / QR
   ============================================================ */
.photo-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.qr-block {
  text-align: center;
}

.qr-block img {
  border: 8px solid #fff;
  box-shadow: 0 4px 10px rgba(43,38,32,0.12);
}

.qr-block p {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-top: 0.5rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
  margin: 0 auto 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.gallery-grid img,
.gallery-grid video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ============================================================
   RSVP FORM
   ============================================================ */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 480px;
  margin: 0 auto;
}

.radio-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid #D8D2C4;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.radio-pill:has(input:checked) {
  background: var(--pink);
  border-color: var(--rose);
}

.radio-pill input { width: auto; }

/* ============================================================
   FADE-IN (single, quiet reveal — applied per-section via JS)
   ============================================================ */
.js-fade-target {
  opacity: 0;
  transform: translateY(16px);
}


/* Styling voor grotere schermen (Desktop / tablets vanaf 768px breed) */
@media (min-width: 48rem) {
  .gate {
    padding: 15% 1.25rem 4rem; 
  }
  .section-top {
    padding: 15% 1.25rem 4rem; 
  }
  .site-reveal {
    padding: 15% 1.25rem 4rem; 
  }
}
