/*
 * Gingerbread Lane artwork, shared by the popup and the homepage banner
 * (markup in inc/gingerbread-lane.php).
 *
 * Two compositions, each a box with its artboard's aspect ratio; every layer
 * is placed with percentages taken straight from the artboard coordinates,
 * and type is sized in cqw (1% of the box width) so it scales with the art.
 *   .shaverhall-gl-poster     portrait, artboard 04 cropped to the framed
 *                             poster: 967.43 x 1392 pt from origin 56.28,67.76
 *   .shaverhall-gl-landscape  artboard 03 / the 1880x940 JPG: 1880 x 940 pt
 *
 * Selectors are qualified by the composition root, which also beats
 * Elementor's kit rules for h2/p/img.
 */

/* Stand-in for Gibson (desktop-only license). SIL OFL, see fonts/figtree/OFL.txt. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/figtree/figtree-regular-latin.woff2") format("woff2");
}

/* ---------- Shared ---------- */

.shaverhall-gl-poster,
.shaverhall-gl-landscape {
  position: relative;
  width: 100%;
  container-type: inline-size;
}

/*
 * Artwork images are decorative: let the pointer pass through them, so they
 * can't be dragged or get in the way of selecting the copy.
 */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) img {
  position: absolute;
  display: block;
  max-width: none;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__frame {
  inset: 0;
  width: 100%;
  height: 100% !important;
}

/*
 * The copy box covers the whole composition, so it lets the pointer through
 * (to the CTA, which is above it anyway); the text itself stays selectable.
 */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__copy {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__copy :is(h2, p) {
  pointer-events: auto;
  user-select: text;
  cursor: text;
}

/* Date rules, positioned per composition. */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__copy::before,
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__copy::after {
  content: "";
  position: absolute;
  background: #f5efef;
}

/*
 * Copy: plain HTML text placed on the artboard baselines. top is the
 * baseline as % of the box height, minus the baseline's offset inside a
 * line-height:1 box (LaFarge Demi 0.8265em, Figtree 0.85em, from each font's
 * vertical metrics).
 */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__headline,
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__dates,
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__tagline {
  margin: 0;
  padding: 0;
  border: 0;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-shadow: none;
  white-space: nowrap;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__headline {
  color: #d6b651;
  font-family: "LaFarge Demi", Georgia, serif;
  letter-spacing: 0;
  text-transform: uppercase;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__headline-1,
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__headline-2 {
  position: absolute;
}

/* LANE: tracked slightly; the tracking hangs past its right edge. */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__headline-2 {
  letter-spacing: 0.0153em;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__dates,
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__tagline {
  position: absolute;
  font-family: "Figtree", "Helvetica Neue", Arial, sans-serif;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__dates {
  color: #f5efef;
  letter-spacing: 0.006em;
  text-transform: uppercase;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__tagline {
  color: #ffa897;
  letter-spacing: 0.082em;
}

/* "Learn More" and "Buy Tickets" plaques (shaverhall-elementor-widgets):
 * pink with a dark green inner border, like the Shaver Hall·idays banner
 * inverted. */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta {
  position: absolute;
  justify-content: center;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta .shaverhall-svg-cta__link {
  width: 100%;
  color: #35451f;
  transition: filter 0.3s;
}

/*
 * Glow from the site's .shape_button CTAs (header "Contact Us"), minus their
 * brightness(1.2): on the pink plaque that washed the button out, so the
 * glow read as sitting on top. drop-shadow alone renders behind the plaque.
 */
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta .shaverhall-svg-cta__link:hover,
:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta .shaverhall-svg-cta__link:focus {
  color: #35451f;
  filter: drop-shadow(0 0 8px #f3c49a);
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta .shaverhall-svg-cta__link:focus-visible {
  outline: 3px solid #f5efef;
  outline-offset: 4px;
}

:is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta .shaverhall-svg-cta__border {
  stroke: #35451f !important;
}

/* Only used if the plugin providing the plaque is deactivated. */
.shaverhall-gl__cta-fallback {
  display: block;
  padding: 0.8em 1em;
  border: 2px solid #35451f;
  outline: 2px solid #ffa897;
  background: #ffa897;
  font-family: "LaFarge Bold", Georgia, serif;
  font-size: 3cqw;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

/* ---------- Poster (portrait, artboard 04) ---------- */

.shaverhall-gl-poster {
  aspect-ratio: 967.43 / 1392;
}

/*
 * Stacking, back to front. Snow layers (popup only) sit between the art
 * layers, always under the logos and CTA.
 */
.shaverhall-gl-poster .shaverhall-gl__shadow { z-index: 0; }
.shaverhall-gl-poster .shaverhall-gl__frame { z-index: 0; }
.shaverhall-gl-poster .shaverhall-gl__sky { z-index: 1; }
.shaverhall-gl-poster .shaverhall-gl__snow--back { z-index: 2; }
.shaverhall-gl-poster .shaverhall-gl__house { z-index: 3; }
.shaverhall-gl-poster .shaverhall-gl__snow--mid { z-index: 4; }
.shaverhall-gl-poster .shaverhall-gl__copy { z-index: 5; }
.shaverhall-gl-poster .shaverhall-gl__snow--front { z-index: 6; }

.shaverhall-gl-poster .shaverhall-gl__logo-box,
.shaverhall-gl-poster .shaverhall-gl__banner,
.shaverhall-gl-poster .shaverhall-gl__cta {
  z-index: 7;
}

/*
 * Drop shadow, cast by a static silhouette (frame + logo box + banner)
 * behind everything rather than a filter on the whole poster: animated snow
 * would force that to be redrawn every frame. Before the frame in the
 * markup, so it paints underneath.
 */
.shaverhall-gl-poster .shaverhall-gl__shadow {
  inset: 0;
  width: 100%;
  height: 100% !important;
  filter: drop-shadow(0 18px 28px rgba(20, 27, 13, 0.45));
}

/*
 * Stars and house share one group at 84% of the artboard size: the stars'
 * box (AI x 98.97, y 172.55, w 861.75) keeps its centre line (x 529.85) and
 * drops so the roof peak clears the logo box. Group maps AI (x, y) to
 * (167.92 + (x - 98.97) * 0.84, 213.7 + (y - 172.55) * 0.84); house base
 * lands at y 951.6.
 */
.shaverhall-gl-poster .shaverhall-gl__sky {
  top: 10.484%;
  left: 11.54%;
  width: 74.824%;
}

/* House alone: AI x 230.72, w 652.25 -> x 278.59, w 547.89. */
.shaverhall-gl-poster .shaverhall-gl__house {
  top: 10.484%;
  left: 22.979%;
  width: 56.634%;
}

/* Logo box (designer export): AI x 294.25, y 67.76, w 491.75. */
.shaverhall-gl-poster .shaverhall-gl__logo-box {
  top: 0;
  left: 24.585%;
  width: 50.83%;
}

/* Shaver Hall·idays banner: AI x 269, y 1385.86, w 541.99. */
.shaverhall-gl-poster .shaverhall-gl__banner {
  top: 94.691%;
  left: 21.988%;
  width: 56.024%;
}

/*
 * Text block, laid out below at artboard size, then scaled to 88% about the
 * headline's cap top (x 540, y 1078.05) and moved up 102.65pt so it keeps
 * its original 27pt gap (scaled) under the smaller house.
 */
.shaverhall-gl-poster .shaverhall-gl__copy {
  transform: translateY(-7.374%) scale(0.88);
  transform-origin: 50% 72.578%;
}

/* Date rules (AI: x 113.08, w 519.55, y 1190.72 / 1253.05, 2pt). */
.shaverhall-gl-poster .shaverhall-gl__copy::before,
.shaverhall-gl-poster .shaverhall-gl__copy::after {
  left: 5.871%;
  width: 53.704%;
  height: 0.144%;
}

.shaverhall-gl-poster .shaverhall-gl__copy::before {
  top: 80.601%;
}

.shaverhall-gl-poster .shaverhall-gl__copy::after {
  top: 85.079%;
}

/* 117.4pt */
.shaverhall-gl-poster .shaverhall-gl__headline {
  font-size: 12.135cqw;
}

/* AI: x 94.51, baseline 1160.23 */
.shaverhall-gl-poster .shaverhall-gl__headline-1 {
  top: calc(78.482% - 0.8265em);
  left: 3.952%;
}

/* AI: right edge 982.2, baseline 1261.87 */
.shaverhall-gl-poster .shaverhall-gl__headline-2 {
  top: calc(85.784% - 0.8265em);
  right: calc(4.29% - 0.0153em);
}

/* 36.65pt */
.shaverhall-gl-poster .shaverhall-gl__dates,
.shaverhall-gl-poster .shaverhall-gl__tagline {
  font-size: 3.788cqw;
}

/* AI: x 121.55, baseline 1233.72 */
.shaverhall-gl-poster .shaverhall-gl__dates {
  top: calc(83.762% - 0.85em);
  left: 6.747%;
}

/* AI: centred, baseline 1328.94. Left padding balances trailing tracking. */
.shaverhall-gl-poster .shaverhall-gl__tagline {
  top: calc(90.602% - 0.85em);
  right: 0;
  left: 0;
  padding-left: 0.082em;
  text-align: center;
}

/*
 * CTAs side by side in the space freed under the tagline, centred between
 * it (bottom ~y 1202.7) and the banner (y 1386.5), and as a pair on the
 * poster's centre line (x 540). AI: each w 340 (h 112.6 at the plaque's
 * 151:50), y 1238.3; Learn More x 188, Buy Tickets x 552 (24pt gap).
 */
.shaverhall-gl-poster .shaverhall-gl__cta {
  top: 84.08%;
  width: 35.145%;
}

.shaverhall-gl-poster .shaverhall-gl__cta--learn {
  left: 13.616%;
}

.shaverhall-gl-poster .shaverhall-gl__cta--tickets {
  left: 51.241%;
}

/*
 * Snow (popup), adapted from "Snow (Pure CSS)" by alphardex
 * (https://codepen.io/alphardex/pen/dyPorwJ, MIT). The pen generates 200
 * keyframes in Sass; here the popup JS animates each flake with the Web
 * Animations API using concrete values, so the motion stays on the
 * compositor. Units are cqw of the poster: its height is 143.886cqw, and the
 * pen's 10px flake and 10px glow are 1.667cqw at the full 600px width.
 * The pen's glow is a drop-shadow over the whole scene; here it's drawn
 * into each flake's gradient, so nothing is re-filtered per frame.
 * Clipped to the inner edge of the green panel. Three layers (see the
 * stacking block above); the JS spreads flakes across them at random.
 */
.shaverhall-gl-poster .shaverhall-gl__snow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  clip-path: polygon(
    6.508% 2.927%,
    93.493% 2.927%,
    93.493% 7.096%,
    98.508% 7.096%,
    98.508% 92.651%,
    93.493% 92.651%,
    93.493% 96.819%,
    6.508% 96.819%,
    6.508% 92.651%,
    1.493% 92.651%,
    1.493% 7.096%,
    6.508% 7.096%
  );
}

/*
 * Flake + glow as one radial gradient (cheaper than a blurred box-shadow,
 * notably in Firefox). The box is 3x the pen's 1.667cqw flake: the solid
 * core is the inner third, the glow fades out over the 1.667cqw beyond it,
 * and the negative offset keeps the flake's centre where it was.
 */
.shaverhall-gl-poster .shaverhall-gl__snowflake {
  position: absolute;
  top: -1.667cqw;
  left: -1.667cqw;
  width: 5cqw;
  height: 5cqw;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    #fff 33%,
    rgba(255, 255, 255, 0.5) 36%,
    rgba(255, 255, 255, 0.15) 66%,
    rgba(255, 255, 255, 0) 100%
  );
  will-change: transform;
}

/* ---------- Landscape (artboard 03 / 1880x940 JPG) ---------- */

/*
 * The art box clips the house, which bleeds off the left, top and bottom
 * edges as in the design. 1cqw = 18.8 artboard pt.
 */
.shaverhall-gl-landscape {
  aspect-ratio: 1880 / 940;
  overflow: hidden;
}

/*
 * Same stacking as the poster, leaving 2, 4 and 6 free for the homepage
 * banner's snow layers (gingerbread-lane-banner.css): logos and CTA on top.
 */
.shaverhall-gl-landscape .shaverhall-gl__frame { z-index: 0; }
.shaverhall-gl-landscape .shaverhall-gl__sky { z-index: 1; }
.shaverhall-gl-landscape .shaverhall-gl__house { z-index: 3; }
.shaverhall-gl-landscape .shaverhall-gl__copy { z-index: 5; }

.shaverhall-gl-landscape .shaverhall-gl__logo,
.shaverhall-gl-landscape .shaverhall-gl__cta {
  z-index: 7;
}

/* Stars: artboard 03's top three; the lower three as moved in the JPG. */
.shaverhall-gl-landscape .shaverhall-gl__sky {
  inset: 0;
  width: 100%;
  height: 100% !important;
}

/* AI: x -16.03, y -68.64, w 772.16 */
.shaverhall-gl-landscape .shaverhall-gl__house {
  top: -7.302%;
  left: -0.853%;
  width: 41.072%;
}

/* AI: x 1000.73, y 123.6, w 420.3 */
.shaverhall-gl-landscape .shaverhall-gl__logo {
  top: 13.149%;
  left: 53.23%;
  width: 22.356%;
}

/* Copy: artboard 04's type at 1.1636x. */

/* Date rules (AI: x 715.9, w 605, y 450.22 / 522.8, 2.33pt). */
.shaverhall-gl-landscape .shaverhall-gl__copy::before,
.shaverhall-gl-landscape .shaverhall-gl__copy::after {
  left: 38.08%;
  width: 32.181%;
  height: 0.248%;
}

.shaverhall-gl-landscape .shaverhall-gl__copy::before {
  top: 47.772%;
}

.shaverhall-gl-landscape .shaverhall-gl__copy::after {
  top: 55.494%;
}

/* 136.68pt */
.shaverhall-gl-landscape .shaverhall-gl__headline {
  font-size: 7.27cqw;
}

/* AI: x 694.27, baseline 414.73 */
.shaverhall-gl-landscape .shaverhall-gl__headline-1 {
  top: calc(44.12% - 0.8265em);
  left: 36.929%;
}

/* AI: right edge 1727.8, baseline 533.05 */
.shaverhall-gl-landscape .shaverhall-gl__headline-2 {
  top: calc(56.707% - 0.8265em);
  right: calc(8.096% - 0.0153em);
}

/* 42.645pt */
.shaverhall-gl-landscape .shaverhall-gl__dates,
.shaverhall-gl-landscape .shaverhall-gl__tagline {
  font-size: 2.268cqw;
}

/* AI: x 726.29, baseline 500.29 */
.shaverhall-gl-landscape .shaverhall-gl__dates {
  top: calc(53.222% - 0.85em);
  left: 38.633%;
}

/* AI: x 760.14, baseline 623.27 */
.shaverhall-gl-landscape .shaverhall-gl__tagline {
  top: calc(66.305% - 0.85em);
  left: 40.433%;
}

/*
 * Bottom row: the design has the Shaver Hall·idays banner alone here; it's
 * replaced by the two CTAs side by side, centred on the banner's row
 * (y 750.2) and, as a pair, under the logo (centre x 1210.9), clear of the
 * pink burst (x 1600). AI: each w 280 (h 92.7), y 703.8; Learn More x 916,
 * Buy Tickets x 1226 (30pt gap).
 */
.shaverhall-gl-landscape .shaverhall-gl__cta {
  top: 74.877%;
  width: 14.894%;
}

.shaverhall-gl-landscape .shaverhall-gl__cta--learn {
  left: 48.723%;
}

.shaverhall-gl-landscape .shaverhall-gl__cta--tickets {
  left: 65.213%;
}

@media (prefers-reduced-motion: reduce) {
  :is(.shaverhall-gl-poster, .shaverhall-gl-landscape) .shaverhall-gl__cta .shaverhall-svg-cta__link {
    transition: none;
  }

  .shaverhall-gl-poster .shaverhall-gl__snow {
    display: none;
  }
}
