/* Ceremony and Reception page. The green page: olive plaque, olive swans, olive seal and an olive Back button.
   Numbers are design pixels (see --u in site.css): first the phone design, then the desktop design.
   Tablets (760 to 1099px wide) get the phone design at its largest, because the desktop paper alone is 1000px wide
   (as on the main page and the Dress Code page). */

.venues {
  --pt: 30; --pb: 132;
  --tw: 346; --h1: 46;
  --nw: 366; --note-mt: -26; --n-pt: 34; --n-px: 14; --n-pb: 78; --key: 7;
  --tallw: 338; --widew: 338;
  --h2: 40; --h2-mt: 2; --h2-mb: 12; --h3: 13.5; --addr: 16; --addr-mt: 8; --when: 13; --when-mt: 13; --when-gap: 11; --when-rule: 15;
  --orn-mt: 26; --orn-mb: 0; --orn-gap: 12; --orn-w: 44; --swan: 78;
  --seal: 74;
  --olive-script: #3d4a1f;
  padding: calc(var(--pt) * var(--u)) 0 calc(var(--pb) * var(--u));
  padding-bottom: calc(var(--pb) * var(--u) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 760px) and (max-width: 1099.98px) {
  .venues { --u: calc(520px / 390); --wall: 440; }
}
@media (min-width: 1100px) {
  .venues {
    --pt: 56; --pb: 170;
    --tw: 540; --h1: 72;
    --nw: 1000; --note-mt: -150; --n-pt: 176; --n-px: 60; --n-pb: 100; --key: 9;
    --tallw: 420; --widew: 480;
    --h2: 56; --h2-mt: 0; --h2-mb: 18; --h3: 18; --addr: 21; --addr-mt: 10; --when: 16; --when-mt: 20; --when-gap: 16; --when-rule: 19;
    --orn-mt: 10; --orn-mb: 14; --orn-gap: 18; --orn-w: 64; --swan: 112;
    --seal: 104;
  }
}

/* ---------- title: the olive plaque turned on its side, the page's name centred on it ---------- */
.head { position: relative; z-index: 3; }
.title { position: relative; width: calc(var(--tw) * var(--u)); margin: 0 auto; }
.title-bg { width: 100%; height: auto; filter: drop-shadow(1px 1.5px 1px rgba(40, 34, 14, .34)) drop-shadow(4px 9px 10px rgba(40, 34, 14, .22)); }
.tcopy {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-bottom: calc(5 * var(--u)); color: var(--pearl);
}
/* the padding gives the script's swashes room inside the box (needed for the written-on reveal); the margins cancel it out.
   The small shift left centres the two lines by eye: the script's last stroke carries empty space on its right. */
.tcopy h1 {
  font-family: var(--script); font-size: calc(var(--h1) * var(--u)); line-height: .92; text-align: center; white-space: nowrap;
  padding: .3em .25em .5em; margin: -.3em -.25em -.5em; transform: translateX(-.09em);
}
.tcopy h1 span { display: block; }

.bq { position: absolute; z-index: 6; }
.bq img { width: 100%; height: auto; filter: drop-shadow(1px 2px 1.5px rgba(40, 24, 14, .26)) drop-shadow(5px 10px 9px rgba(40, 24, 14, .20)); }
.bq1 { left: calc(50% - 201 * var(--u)); top: calc(-22 * var(--u)); width: calc(96 * var(--u)); }
.bq2 { left: calc(50% + 111 * var(--u)); top: calc(-40 * var(--u)); width: calc(92 * var(--u)); }
@media (min-width: 1100px) {
  .bq1 { left: calc(50% - 346px); top: -36px; width: 168px; }
  .bq2 { left: calc(50% + 412px); top: -62px; width: 150px; }
}

/* ---------- the paper: ivory with a silver keyline ---------- */
.note {
  position: relative; z-index: 2; width: calc(var(--nw) * var(--u)); margin: calc(var(--note-mt) * var(--u)) auto 0;
  padding: calc(var(--n-pt) * var(--u)) calc(var(--n-px) * var(--u)) calc(var(--n-pb) * var(--u));
  background: linear-gradient(165deg, #f8f4ee 0%, #f1e9dd 100%);
  box-shadow: 1px 1.5px 1.5px rgba(52, 30, 18, .24), 5px 11px 14px rgba(52, 30, 18, .17);
}
.note::after {
  content: ""; position: absolute; top: calc(var(--key) * var(--u)); right: calc(var(--key) * var(--u)); bottom: calc(var(--key) * var(--u)); left: calc(var(--key) * var(--u));
  pointer-events: none; border: 1px solid transparent;
  border-image: linear-gradient(115deg, #7d8288, #d5d8db 30%, #858a90 52%, #c3c7cb 74%, #7d8288) 1;
  outline: 1px solid rgba(125, 130, 136, .32); outline-offset: 3px;
}

/* ---------- a venue: its painting, then its words ----------
   Each painting file already thins away to nothing on every side and is tinted for this paper, so it needs no frame and no blending.
   Its box is larger than the paint that shows; the negative margins tuck the words up into that clear part. */
.venue { text-align: center; }
.paint { display: block; margin: 0 auto; }
.paint img { width: 100%; height: auto; }
.paint.tall { width: calc(var(--tallw) * var(--u)); margin-bottom: calc(-22 * var(--u)); }
.paint.wide { width: calc(var(--widew) * var(--u)); margin-top: calc(6 * var(--u)); margin-bottom: calc(-16 * var(--u)); }
.words { display: flow-root; }

.venue h2 {
  font-family: var(--script); font-size: calc(var(--h2) * var(--u)); line-height: 1; white-space: nowrap; color: var(--olive-script);
  padding: .25em .3em .45em; margin: calc(var(--h2-mt) * var(--u) - .25em) -.3em calc(var(--h2-mb) * var(--u) - .45em);
}
.venue h3 {
  font-family: var(--display); font-size: calc(var(--h3) * var(--u)); line-height: 1.35; text-transform: uppercase; letter-spacing: .2em; padding-left: .2em;
  color: var(--olive-deep);
}
.addr { font-size: calc(var(--addr) * var(--u)); font-weight: 500; line-height: 1.28; margin-top: calc(var(--addr-mt) * var(--u)); }
.when {
  display: flex; align-items: center; justify-content: center; gap: calc(var(--when-gap) * var(--u)); margin-top: calc(var(--when-mt) * var(--u));
  font-family: var(--display); font-size: calc(var(--when) * var(--u)); line-height: 1; text-transform: uppercase; letter-spacing: .18em; white-space: nowrap; color: var(--olive-deep);
}
.when time { display: contents; }
.when span { padding-left: .18em; }
.when i { display: block; width: 1px; height: calc(var(--when-rule) * var(--u)); background: linear-gradient(180deg, rgba(125, 130, 136, .2), #8d9298 30%, #8d9298 70%, rgba(125, 130, 136, .2)); }

/* on a computer the painting and its words sit side by side: church on the left, hotel on the right */
@media (min-width: 1100px) {
  .venue { display: grid; align-items: center; column-gap: 8px; }
  .venue.ceremony { grid-template-columns: 420px minmax(0, 1fr); }
  .venue.reception { grid-template-columns: minmax(0, 1fr) 460px; }
  .venue .paint { grid-row: 1; margin-right: 0; margin-left: -14px; }
  .venue .paint.tall { grid-column: 1; }
  .venue .paint.wide { grid-column: 2; }
  .venue .words { grid-row: 1; }
  .venue.reception .words { grid-column: 1; }
}

/* ---------- between the two venues: the olive swans on a silver line ---------- */
.orn { display: flex; align-items: center; justify-content: center; gap: calc(var(--orn-gap) * var(--u)); margin: calc(var(--orn-mt) * var(--u)) 0 calc(var(--orn-mb) * var(--u)); }
.orn i { display: block; height: 1px; width: calc(var(--orn-w) * var(--u)); background: linear-gradient(90deg, rgba(125, 130, 136, 0), #8d9298 60%, #b9bdc2); }
.orn i:last-child { background: linear-gradient(270deg, rgba(125, 130, 136, 0), #8d9298 60%, #b9bdc2); }
.swans { display: block; width: calc(var(--swan) * var(--u)); filter: drop-shadow(.5px 1px .8px rgba(22, 26, 8, .45)) drop-shadow(1.5px 3px 3px rgba(22, 26, 8, .22)); }
.swans img { width: 100%; height: auto; }

/* ---------- end of the page: the olive seal on the paper's edge (decoration only) and the last bouquet ---------- */
.foot { position: relative; }
.seal {
  display: block; position: relative; z-index: 5; width: calc(var(--seal) * var(--u)); margin: calc(var(--seal) * var(--u) * -.5) auto 0;
  filter: drop-shadow(1px 2px 1.5px rgba(22, 26, 8, .5)) drop-shadow(3px 6px 6px rgba(22, 26, 8, .3));
}
.seal img { width: 100%; height: auto; }

/* ---------- the Back button is olive on this page only; its place, shape, size and words are the same as on every page ---------- */
.stick.olive .pill {
  background: linear-gradient(180deg, #4d5628 0%, #2f3515 100%);
  box-shadow: 0 0 0 1.5px rgba(206, 210, 214, .95), 0 2px 3px rgba(22, 26, 8, .45), 0 9px 20px rgba(22, 26, 8, .34);
}

/* ====================================================================================================
   Motion. Applies only when <html> has the class "anim", which the page adds itself when motion is allowed.
   Without it (motion switched off on the phone, or scripts blocked) everything above is simply shown.
   Each piece plays once. Only opacity, transform and a mask position ever change.
   ==================================================================================================== */

/* waiting states */
.anim:not(.ready) .head, .anim:not(.ready) .note { visibility: hidden; }
.anim [data-reveal]:not(.in) { visibility: hidden; }

/* arrival: the plaque settles, the title is written, the bouquet slides in, the paper rises */
.anim.ready .title { animation: a-card .6s var(--ease) both; }
.anim.ready .tcopy h1 { animation: a-write .95s cubic-bezier(.45, .1, .3, 1) .3s both; }
.anim.ready .bq1 { transform-origin: 70% 80%; animation: a-bq1 .75s var(--ease) .3s both; }
.anim.ready .note { animation: a-up .6s var(--ease) .2s both; }

/* the script lines that are "written": a soft edge sweeps across from left to right */
.anim .tcopy h1, .anim .venue h2 {
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-size: 222% 100%; mask-size: 222% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* each venue, once, when it scrolls into view: the painting soaks into the paper, its heading is written, the lines rise in turn */
.anim .venue.in .paint { animation: a-soak 1.1s cubic-bezier(.3, .6, .3, 1) both; }
.anim .venue.in h2 { animation: a-write .9s cubic-bezier(.45, .1, .3, 1) .3s both; }
.anim .venue.in h3 { animation: a-rise .45s var(--ease) .62s both; }
.anim .venue.in .addr { animation: a-rise .45s var(--ease) .74s both; }
.anim .venue.in .when { animation: a-rise .45s var(--ease) .86s both; }

/* between them: the two lines draw outward from the swans */
.anim .orn.in i { transform-origin: right center; animation: a-line .55s var(--ease) .15s both; }
.anim .orn.in i:last-child { transform-origin: left center; }
.anim .orn.in .swans { animation: a-swans .55s var(--ease) both; }

/* end of the page: the seal is pressed on, the last bouquet slides in */
.anim .foot.in .seal { animation: a-stamp .5s cubic-bezier(.5, 0, .3, 1) both; }
.anim .foot.in .bq2 { transform-origin: 30% 20%; animation: a-bq2 .75s var(--ease) .22s both; }

@keyframes a-card { from { opacity: 0; transform: translateY(-14px) scale(1.035); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes a-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes a-write { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0% 0; mask-position: 0% 0; } }
@keyframes a-bq1 { from { opacity: 0; transform: translate(-16px, -12px) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes a-bq2 { from { opacity: 0; transform: translate(14px, 8px) rotate(7deg); } to { opacity: 1; transform: none; } }
@keyframes a-soak { from { opacity: 0; transform: scale(.955); } to { opacity: 1; transform: none; } }
@keyframes a-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes a-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes a-swans { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes a-stamp { 0% { opacity: 0; transform: scale(1.42); } 55% { opacity: 1; transform: scale(.965); } 100% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .anim *, .anim *::before { animation: none !important; visibility: visible !important; -webkit-mask-image: none !important; mask-image: none !important; }
}
