/*
 * Lock In Infusions: the 21+ age gate. Loaded on every page, after site.css
 * (which explains the --f / --m / --u sizing units used below).
 *
 * The names here say "entry", not "age gate", on purpose: some content
 * blockers hide or block anything named after an age gate.
 */

/* Each page is hidden in its own HTML (the "hidden" attribute on #site), so it
   stays closed even if this file never loads. This file never opens the page
   by itself: js/site.js adds "entered" to <html> only after a birth date that
   makes the visitor 21 or older has been typed in, and remembers that for the
   browser tab. Without JavaScript nothing here can open it. */

.entered .site {
  display: block;
}

.entered .site-entry {
  display: none;
}

.site-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(28 * var(--f));
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(40 * var(--f)) calc(24 * var(--m));
  background: var(--paper);
  text-align: center;
}

.site-entry__logo {
  width: min(100%, calc(342 * var(--f)));
  height: auto;
  aspect-ratio: 1336 / 486;
  object-fit: cover;
}

.site-entry__text {
  max-width: 20em;
  font-size: calc(18 * var(--f));
  line-height: 1.25;
}

/* ---------- Date of birth form ---------- */

.site-entry__form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(16 * var(--f));
}

/* The form ships hidden; site.js shows it. Without this rule the line above
   would override the hidden attribute. */
.site-entry__form[hidden] {
  display: none;
}

.site-entry__dob {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.site-entry__legend,
.site-entry__label {
  font-size: max(14px, calc(14 * var(--f)));
  line-height: 1.25;
  text-transform: uppercase;
}

.site-entry__legend {
  width: 100%;
  margin-bottom: calc(14 * var(--f));
  padding: 0;
  text-align: center;
}

.site-entry__fields {
  display: flex;
  justify-content: center;
  gap: calc(12 * var(--f));
}

.site-entry__field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(6 * var(--f));
}

/* 16px is the smallest type an iPhone will not zoom into; 44px the smallest
   comfortable tap height. */
.site-entry__input {
  width: calc(72 * var(--f));
  height: max(44px, calc(48 * var(--f)));
  padding: 0 calc(8 * var(--f));
  border: 1.5px solid var(--ink);
  border-radius: var(--pill);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: max(16px, calc(18 * var(--f)));
  letter-spacing: 0;
  text-align: center;
}

.site-entry__input--year {
  width: calc(96 * var(--f));
}

/* A field with a problem gets a heavier outline, so the cue does not rely on colour */
.site-entry__input[aria-invalid="true"] {
  border-width: 3px;
}

/* Room is kept for one line so the Enter button does not jump when a message appears */
.site-entry__message {
  max-width: 20em;
  min-height: 1.25em;
  font-size: max(16px, calc(16 * var(--f)));
  line-height: 1.25;
}

/* The Enter button is the one action on this screen: a size up from the same
   circle-plus link elsewhere on the site, without the browser's button look. */
.site-entry .icon-link {
  height: calc(56 * var(--f));
  padding: 0;
  border: 0;
  background: none;
  font-size: calc(19 * var(--f));
  cursor: pointer;
}

.site-entry .icon-link__icon {
  width: calc(34 * var(--f));
  height: calc(34 * var(--f));
}

/* ================= Desktop: 1024px and wider ================= */

@media (min-width: 1024px) {
  .site-entry {
    gap: calc(32 * var(--u));
  }

  .site-entry__logo {
    width: calc(560 * var(--u));
  }

  .site-entry__text {
    font-size: calc(24 * var(--u));
  }

  .site-entry__form {
    gap: calc(18 * var(--u));
  }

  .site-entry__legend,
  .site-entry__label {
    font-size: max(14px, calc(15.75 * var(--u)));
  }

  .site-entry__legend {
    margin-bottom: calc(14 * var(--u));
  }

  .site-entry__fields {
    gap: calc(14 * var(--u));
  }

  .site-entry__field {
    gap: calc(6 * var(--u));
  }

  .site-entry__input {
    width: calc(88 * var(--u));
    height: max(44px, calc(52 * var(--u)));
    padding: 0 calc(10 * var(--u));
    font-size: max(16px, calc(20 * var(--u)));
  }

  .site-entry__input--year {
    width: calc(120 * var(--u));
  }

  .site-entry__message {
    font-size: max(16px, calc(18 * var(--u)));
  }

  .site-entry .icon-link {
    height: calc(56 * var(--u));
    font-size: calc(22 * var(--u));
  }

  .site-entry .icon-link__icon {
    width: calc(40 * var(--u));
    height: calc(40 * var(--u));
  }
}
