/* ---------------------------------------------------------------------------
   Anna & Jindřich — wedding site
   Fonts: Fraunces (display) + Cabinet Grotesk (text)
   --------------------------------------------------------------------------- */

:root {
  --green: #394213;
  --blue:  #CBD5DF;
  --light: #FFFCFB;
  --white: #FFFFFF;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Cabinet Grotesk", system-ui, -apple-system, sans-serif;

  --stripe: 40px;            /* width of each band in the striped sections */
  --page-max: 1200px;
}

/* --- reset ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-text);
  color: var(--green);
  background: var(--light);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  margin: 0;
}

p { margin: 0 0 1em; }

a { color: inherit; }

/* Placeholder styling for assets supplied later ----------------------------- */
.placeholder {
  background-color: var(--blue);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}
.placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(57, 66, 19, 0.55);
}
/* Hide the label once a real background image is set */
.placeholder.has-image::after { content: none; }

.section {
  padding: 88px 24px;
}
.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

/* Shared striped background (vertical green / light bands) ------------------- */
.striped {
  --stripe-alt: var(--light);
  background-image: repeating-linear-gradient(
    90deg,
    var(--green) 0,
    var(--green) var(--stripe),
    var(--stripe-alt) var(--stripe),
    var(--stripe-alt) calc(var(--stripe) * 2)
  );
}
/* Announcement band under the header uses blue stripes instead of light. */
.announce.striped { --stripe-alt: var(--blue); }

/* Buttons ------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 10px 22px;
  background: transparent;
  color: var(--green);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--green); color: var(--light); }

.btn--solid { background: var(--green); color: var(--light); }
.btn--solid:hover { background: #2b3210; }

/* ===========================================================================
   1. HERO
   =========================================================================== */
/* Clips the mobile envelope's horizontal bleed (it spills out of the hero and
   over the announcement) so it never triggers a horizontal scrollbar. clip on
   x only — vertical stays visible so the downward spill still shows. */
.hero-wrap {
  overflow-x: clip;
}

.hero {
  position: relative;
  /* At least full viewport height, but never flatter than a 16:9 ratio. */
  min-height: max(100vh, 56.25vw);
  overflow: hidden;
}
.hero__photo {
  position: absolute;
  /* Extra height (top/bottom) gives the parallax room to travel without
     exposing an edge; the hero's overflow:hidden clips the excess. */
  inset: -12% 0;
  background-image: url('../img/my.jpg');
  background-position: top center;
  will-change: transform;
}
/* Portrait crop for mobile. */
@media (max-width: 720px) {
  .hero__photo { background-image: url('../img/my-mobil.jpg'); }
}
.hero__logo {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  max-width: 60%;
  z-index: 2;
}
/* the top-logo is dark green; keep it readable on a photo */
.hero__logo img { width: 100%; height: auto; }

/* Envelope — three stacked layers: back → card → front.
   The card is its own layer so it can slide out of the envelope later. */
.envelope {
  position: relative;
  aspect-ratio: 1163 / 1179;
}
.envelope img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.envelope__back  { z-index: 1; }
.envelope__card  {
  z-index: 2;
  transform: translateY(0);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: transform;
  /* On page load the invitation slides up out of the envelope pocket.
     `backwards` fill holds the tucked start position during the delay. */
  animation: card-reveal 1.3s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s backwards;
}
.envelope__front { z-index: 3; }

@keyframes card-reveal {
  from { transform: translateY(22%); }
  to   { transform: translateY(0); }
}

/* Future reveal: add `is-open` to slide the invitation up and out. */
.envelope.is-open .envelope__card { transform: translateY(-40%); }

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

/* Placement of the envelope in the hero (declared after .envelope so the
   absolute positioning wins the cascade over .envelope's position: relative). */
.hero__envelope {
  position: absolute;
  right: 6%;
  top: 53%;
  transform: translateY(-50%) rotate(5.7deg);
  width: 52%;
  max-width: 598px;
  z-index: 2;
}

/* ===========================================================================
   2. ANNOUNCEMENT (striped band + oval)
   =========================================================================== */
.announce {
  padding: 72px 24px;
}
.announce__oval {
  position: relative;
  background: var(--light);
  border-radius: 50%;
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 12%;
  text-align: center;
  aspect-ratio: 5 / 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Slight centered shadow beneath the oval (negative spread keeps it
     concentrated in the middle rather than tracing the whole edge). */
  box-shadow: 0 30px 45px -30px rgba(57, 66, 19, 0.45);
  /* Tilt the whole oval slightly to the left. */
  transform: rotate(-3.81deg);
}
/* Two dots on the oval's centerline — one near the top, one near the bottom. */
.announce__oval::before,
.announce__oval::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}
.announce__oval::before { top: 34px; }
.announce__oval::after  { bottom: 34px; }
.announce__oval p {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
}
.announce__oval p:last-child { margin-bottom: 0; }

/* ===========================================================================
   3. PRAKTICKÉ INFORMACE (blob cards)
   =========================================================================== */
.practical { text-align: center; }
.practical > h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 56px;
}
.blobs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 20px;
  max-width: 1202px;
  margin: 0 auto;
}
.blob {
  position: relative;
  background: var(--blue);
  text-align: center;
  padding: 42px 40px;
  flex: 0 0 auto;
  width: var(--w);
  height: var(--h, auto);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0px 11px 24px 0px #00000014;
}
/* Shape variants (see splash.png):
   circle → Dress Code, Fotky · rounded rect → Ubytování, Dary · clover → Parkování */
.blob--circle {
  --w: 377px;           /* Dress Code & Fotky: 377 × 377 */
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 30px;
}
.blob--rect {
  /* --w / --h set per blob below (Ubytování 377×227, Dary 332×215) */
  border-radius: 20px;
  padding: 40px;
}
.blob--clover {
  --w: 380px;           /* Parkování: 380 × 380 */
  aspect-ratio: 1 / 1;
  padding: 0;
  background: transparent;
  /* Shadow lives on this (unclipped) outer element so it isn't trimmed away;
     the clover clip is on .blob__shape inside. drop-shadow follows the shape. */
  box-shadow: none;
  filter: drop-shadow(0px 11px 24px #00000014);
}
.blob--clover .blob__shape {
  width: 100%;
  height: 100%;
  padding: 40px 58px;
  background: var(--blue);
  clip-path: url(#cloverClip);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.blob h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  margin-bottom: 12px;
}
.blob p {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
  margin: 0;
}
.blob a  { text-decoration: underline; }

/* Sizes + tilt + relative spacing per Figma (row 2 overlaps up into row 1).
   Row 1: Dress Code · Ubytování · Parkování   Row 2: Dary · Fotky */
.blob:nth-child(1) { z-index: 5; --tilt: -4.01deg; transform: translateY(0) rotate(var(--tilt)); }                       /* Dress Code */
.blob:nth-child(2) { z-index: 4; --tilt: 2.83deg; --w: 377px; --h: 227px; transform: translateY(-11px) rotate(var(--tilt)); } /* Ubytování */
.blob:nth-child(3) { z-index: 3; --tilt: -3.82deg; transform: translateY(11px) rotate(var(--tilt)); }                    /* Parkování */
.blob:nth-child(4) { z-index: 2; --tilt: -4.17deg; --w: 332.3px; --h: 215px; margin-top: -150px; transform: translateY(24px) rotate(var(--tilt)); } /* Dary */
.blob:nth-child(5) { z-index: 1; --tilt: 6.18deg; margin-top: -150px; transform: translateY(0) rotate(var(--tilt)); }    /* Fotky */

/* ===========================================================================
   4. UBYTOVÁNÍ (dark section)
   =========================================================================== */
.lodging {
  background: var(--green);
  color: var(--light);
  text-align: center;
}
.lodging h2 {
  color: var(--light);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 40px;
}
.lodging__oval {
  background: var(--blue);
  color: var(--green);
  border: 10px solid var(--light);
  border-radius: 50%;
  width: 100%;
  max-width: 944px;               /* design ellipse width 943.55px */
  margin: 0 auto 72px;
  padding: 80px 10%;
  aspect-ratio: 943.55 / 464;     /* design ellipse 943.55 × 464 (~2.034) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: rotate(1.63deg);
}
.lodging__oval p {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: center;
}
.lodging__oval strong { font-weight: 500; }
/* Button paragraph pulls up slightly. */
.lodging__oval p:last-child { margin-bottom: -10px; }

.lodging h3 {
  color: var(--light);
  font-size: 1.6rem;
  margin-bottom: 32px;
}

.lodging__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 1212px;   /* 3 × 393.33 + 2 × 16 gap */
  margin: 0 auto;
}
.lodge-card {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  background: var(--light);
  color: var(--green);
  border-radius: 20px;
  padding: 32px;
  text-align: left;
}
.lodge-card__dist {
  align-self: flex-start;
  background: var(--blue);
  border-radius: 6px;
  padding: 3px 8px;
  margin-bottom: 8px;
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0;
}
.lodge-card__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 0;
}
.lodge-card__addr {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 2px 0 0;
}
.lodge-card__actions {
  display: flex;
  gap: 10px;
  margin-top: auto;   /* anchor buttons to the bottom of the card */
}
.lodge-card__actions .btn { flex: 1; padding: 8px 12px; }

/* Buttons in the Ubytování section use Fraunces. */
.lodging .btn {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.1;
  letter-spacing: 0;
}

/* ===========================================================================
   5. POTVRĎTE ÚČAST (RSVP form)
   =========================================================================== */
.rsvp { text-align: center; }
.rsvp h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 8px;
}
.rsvp__note { opacity: 0.75; margin-bottom: 40px; }

.rsvp form {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}
.field { margin-bottom: 22px; }
.field > label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.field input[type="text"],
.field textarea {
  width: 100%;
  font-family: var(--font-text);
  font-size: 0.95rem;
  color: var(--green);
  background: var(--white);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 12px 14px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; }

/* Ano / Ne toggle pair */
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: block;
  text-align: center;
  padding: 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.choice input:checked + label { background: var(--green); color: var(--light); }

.rsvp button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  font-size: 1rem;
}
.rsvp button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

/* Honeypot field — hidden from real users, off-screen (not display:none so
   bots that skip hidden fields still see it). */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Submission result / thank-you message */
.rsvp__status {
  max-width: 560px;
  margin: 24px auto 0;
  text-align: center;
}
.rsvp__status.is-success {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  color: var(--green);
}
.rsvp__status.is-error {
  font-family: var(--font-text);
  font-size: 1rem;
  color: #a3341f;
}

/* ===========================================================================
   6. CONTACT band
   =========================================================================== */
.contact {
  background: var(--green);
  color: var(--light);
}
.contact .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.contact__photo {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background-position: top center;
}
.contact__text {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.25;
}

/* ===========================================================================
   7. FOOTER
   =========================================================================== */
.footer {
  padding: 80px 24px;
  text-align: center;
  background: var(--light);
}
.footer__logo {
  width: 130px;
  margin: 0 auto;
}
.footer-stripes {
  height: 40px;
  --stripe-alt: var(--blue);
}

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */
@media (max-width: 900px) {
  .lodging__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .section { padding: 64px 20px; }

  /* Narrower stripes on mobile. */
  .striped { --stripe: 24px; }

  /* Hero: full-bleed portrait photo (≥ 9:16) with the envelope overlaid on it */
  .hero {
    min-height: calc(177.78vw + 100px);   /* 9:16 portrait — height = width × 16/9 */
    overflow: visible;      /* let the envelope spill past the hero bottom */
  }
  .hero__photo {
    position: absolute;
    inset: 0;
  }
  .hero__logo { top: 24px; width: 170px; max-width: 62%; }
  .hero__envelope {
    top: auto;
    right: auto;
    left: 50%;
    bottom: -20%;           /* spill over into the section below */
    transform: translateX(-50%) rotate(5.7deg);
    width: 110%;
    max-width: 600px;
    z-index: 5;             /* above the following section */
  }

  .practical > h2,
  .rsvp h2 { font-size: 2rem; }

  .announce {
	padding: calc(72px + 30vw) 24px 72px 24px;
  }

  /* Portrait "egg" — the opposite of the desktop 5:3 landscape oval. */
  .announce__oval {
    aspect-ratio: 3 / 5;
    border-radius: 50%;
    padding: 88px 44px;
  }

  /* Portrait "egg" to match the announcement oval. */
  .lodging__oval {
    aspect-ratio: 3 / 5;
    border-radius: 50%;
    padding: 72px 40px;
  }
  .lodging__grid { grid-template-columns: 1fr; max-width: 420px; }

  .contact .container { grid-template-columns: 1fr; gap: 28px; }
  .contact__photo { aspect-ratio: 3 / 4; }
  .contact__text { text-align: center; }
}

/* Blobs stack into a single column earlier than the rest of the layout: below
   ~840px their fixed widths can't fit two per row, and the desktop row-2
   overlap margins (margin-top:-150px) would then collide. Stacking here keeps
   each blob's tilt but drops the scatter offsets. */
@media (max-width: 840px) {
  .blobs { max-width: 360px; }
  .blob {
    transform: rotate(var(--tilt)) !important;
    margin: -14px 0 !important;
  }
  .blob--circle,
  .blob--clover { --w: 84%; }
  .blob:nth-child(2),
  .blob:nth-child(4) { --w: 88%; --h: auto; }
  .blob:nth-child(even) { align-self: flex-end; }
  .blob:nth-child(odd)  { align-self: flex-start; }
}

@media (max-width: 420px) {
  .blob--circle,
  .blob--clover { --w: 94%; }
  .blob:nth-child(2),
  .blob:nth-child(4) { --w: 96%; }
}

/* ===========================================================================
   MOTION — scroll-reveal + idle blob float
   Progressive enhancement: hidden states apply only with JS on (.js) and when
   the visitor hasn't asked for reduced motion. `translate` is used for reveals
   so it composes with (doesn't overwrite) any element's `transform` tilt.
   =========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* Fade + rise, triggered when `.is-visible` is added by the observer. */
  .js .reveal {
    opacity: 0;
    translate: 0 24px;
    transition: opacity 0.6s ease-out, translate 0.6s ease-out;
  }
  .js .reveal.is-visible {
    opacity: 1;
    translate: 0 0;
  }

  /* Blobs fade in with a small stagger (their `translate` is used by the
     float animation below, so the reveal is opacity-only). */
  .js .blobs .blob {
    opacity: 0;
    transition: opacity 0.6s ease-out;
  }
  .js .blobs.is-visible .blob { opacity: 1; }
  .js .blobs .blob:nth-child(1) { transition-delay: 0s; }
  .js .blobs .blob:nth-child(2) { transition-delay: 0.08s; }
  .js .blobs .blob:nth-child(3) { transition-delay: 0.16s; }
  .js .blobs .blob:nth-child(4) { transition-delay: 0.24s; }
  .js .blobs .blob:nth-child(5) { transition-delay: 0.32s; }

  /* Lodging cards fade + rise with a stagger. */
  .js .lodging__grid .lodge-card {
    opacity: 0;
    translate: 0 24px;
    transition: opacity 0.6s ease-out, translate 0.6s ease-out;
  }
  .js .lodging__grid.is-visible .lodge-card { opacity: 1; translate: 0 0; }
  .js .lodging__grid .lodge-card:nth-child(2) { transition-delay: 0.06s; }
  .js .lodging__grid .lodge-card:nth-child(3) { transition-delay: 0.12s; }
  .js .lodging__grid .lodge-card:nth-child(4) { transition-delay: 0.18s; }
  .js .lodging__grid .lodge-card:nth-child(5) { transition-delay: 0.24s; }
  .js .lodging__grid .lodge-card:nth-child(6) { transition-delay: 0.30s; }

  /* Idle float — gentle, out-of-phase per blob. Uses the independent
     `translate` property so it layers on top of each blob's tilt/stagger. */
  @keyframes blob-float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -6px; }
  }
  .blob { animation: blob-float 7s ease-in-out infinite; }
  .blob:nth-child(2) { animation-duration: 8s;   animation-delay: -1.5s; }
  .blob:nth-child(3) { animation-duration: 9s;   animation-delay: -3s; }
  .blob:nth-child(4) { animation-duration: 7.5s; animation-delay: -2s; }
  .blob:nth-child(5) { animation-duration: 8.5s; animation-delay: -4s; }
}
