/* LVRY Giveaway page
 * Built from the Tour page's blocks, so tour.css is loaded first and does most of the work. This file is only
 * what the Giveaway design does differently. Desktop design is 1920 wide; breakpoints match tour.css (991, 600).
 */

/* ---------- Hero ---------- */

/* The photo is darker here than on the Tour page so the white title holds against the clouds */
.giveaway-hero .tour-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .48);
}
.giveaway-hero .tour-hero__img {
  background-position: center 50%;
}

/* On the Tour page the intro box is short and hangs off the bottom of the photo, over the map. Here it holds
   four paragraphs and nothing sits under it, so the photo gets a fixed height (--zone) and the box follows in
   the normal flow, overlapping the photo's bottom edge. tour.css already lays the hero out that way on small
   screens; this does the same for the desktop. */
@media (min-width: 992px) {
  .giveaway-hero {
    --zone: min(51vw, 1000px);                 /* 980px at 1920 */
    --overlap: clamp(48px, 6.35vw, 122px);     /* how far the box rides up over the photo */
    display: block;
    height: auto;
    max-height: none;
    padding: calc(var(--zone) - var(--overlap)) 24px 0;
  }
  .giveaway-hero .tour-hero__bg {
    bottom: auto;
    height: var(--zone);
  }
  .giveaway-hero .tour-hero__title {
    /* Design: 1380px wide at 1920, its top 445px down the photo */
    position: absolute;
    top: calc(var(--zone) * .454);
    left: 24px;
    right: 24px;
    width: auto;
    max-width: 1380px;
    margin: 0 auto;
  }
  .giveaway-hero .tour-intro {
    position: relative;
    left: auto;
    bottom: auto;
    width: auto;
    margin: 0 auto;
    transform: none;
  }
  .giveaway-hero .tour-intro__box {
    align-items: flex-start;
    justify-content: space-between;
    padding: clamp(40px, 2.97vw, 57px) clamp(32px, 7.35vw, 141px) clamp(40px, 2.97vw, 57px) clamp(32px, 7.15vw, 137px);
  }
  .giveaway-hero .tour-intro__heading {
    margin-top: 11px; /* its cap line sits a little under the first line of copy */
  }
}

.giveaway-hero .tour-intro__box {
  background: #303030;
}
.giveaway-intro__text {
  flex: 0 1 541px;
  min-width: 0;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: #fff;
}
.giveaway-intro__text p {
  margin: 0 0 17px;
}
.giveaway-intro__text p:last-child {
  margin-bottom: 0;
}
.giveaway-intro__text strong,
.giveaway-intro__text b {
  font-weight: 700;
}
.giveaway-intro__text a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.giveaway-intro__text a:hover {
  color: #ef3a32;
}

/* ---------- Gallery + entry form ---------- */
.giveaway-enter {
  padding-top: clamp(64px, 8.2vw, 158px);
}
@media (min-width: 992px) {
  .giveaway-form {
    padding-top: clamp(0px, 2.45vw, 47px); /* the heading starts a little below the top of the photo */
  }
  .giveaway-form .tour-form__title {
    font-size: clamp(22px, 1.98vw, 38px); /* 38px at 1920; scales so each half stays on one line */
  }
}

/* No photos picked in the admin: the entry form takes the row on its own */
.giveaway-enter--no-gallery .tour-missing__grid {
  display: block;
  padding: 0 7.7%;
}
@media (max-width: 991px) {
  .giveaway-enter--no-gallery .tour-missing__grid {
    padding: 0;
  }
}

.giveaway-widget {
  margin-top: 56px;
  max-width: 801px;
}
/* Gleam centres its widget (540px at most) in whatever holds it; line it up with the heading instead */
.giveaway-widget .e-widget-wrapper {
  margin-left: 0;
  margin-right: 0;
}
.giveaway-widget iframe {
  display: block;
  max-width: 100%;
}
/* The plain link Gleam replaces. It only stays on screen if the widget can't load, so it is styled as the
   page's button rather than left as a bare text link. */
.giveaway-widget a.e-widget {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 60px;
  padding: 10px 30px;
  background: #ef3a32;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background .2s ease;
}
.giveaway-widget a.e-widget:hover {
  background: #d92d26;
  color: #fff;
}
.giveaway-widget a.e-widget:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Reveal with the rest of the section (see "Reveal" under the gallery in tour.css) */
.tour-anim .giveaway-widget {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1);
  transition-delay: calc(.3s + var(--n, 0) * .07s);
}
.tour-anim .tour-missing.is-in .giveaway-widget {
  opacity: 1;
  transform: none;
}

/* ---------- Tablet and phone ---------- */
@media (max-width: 991px) {
  .giveaway-intro__text {
    flex: none;
  }
  .giveaway-widget {
    margin-top: 40px;
  }
}
@media (max-width: 600px) {
  .giveaway-intro__text {
    font-size: 15px;
  }
  .giveaway-widget a.e-widget {
    width: 100%;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    text-align: center;
  }
}
