/*
 * /win - the Family Duo competition page (src/routes/win.tsx).
 *
 * From 768px up, the form is measured off the 1920px-wide "Duo Web Mock up"
 * and scales with the page exactly as the artwork images above it do: --u is
 * one mock-up pixel. Below 768px the form stacks so it stays easy to fill in.
 */

/* The artwork runs edge to edge; the form is sized as if the page were at
   most 1280px wide (two thirds of the mock-up), so it stays compact on big screens. */
.win { container-type: inline-size; background: #0a0907; overflow-x: clip; }
/* Below 1280px the site header floats over the page, as on the other pages; leave room for it. */
.win > .win-art:first-of-type { margin-top: clamp(48px, 9.1vw, 76px); }
@media (min-width: 1280px) { .win > .win-art:first-of-type { margin-top: 0; } }
.win-art { display: block; width: 100%; height: auto; }

/* ---------- T's & C's, in the empty foot of the Enter Now artwork ---------- */
.win-enter { position: relative; }
.win-tcs-wrap { display: flex; justify-content: center; padding: 4px 16px 28px; }
/* Mixed case with curly apostrophes, as drawn; buttons are otherwise capitals. */
.win-enter .win-tcs { text-transform: none; }

/* ---------- Entry form ---------- */
.win-form { background: #f5b335; padding: 40px 20px 48px; color: #fff; }
.win-form__heading { position: relative; margin: 0 auto 28px; width: fit-content; text-align: center; font-weight: 400; line-height: 1; }
.win-form__title { position: relative; z-index: 1; display: block; font-family: var(--font-script); font-size: 64px; color: #fff; }
.win-form__underline { position: absolute; left: -9%; right: -6%; bottom: -12px; width: 115%; height: auto; max-width: none; }

.win-form__form { display: grid; gap: 16px; max-width: 460px; margin: 0 auto; }
.win-row { display: grid; gap: 6px; }
.win-label { font-family: var(--font-display); font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; }
.win-input { width: 100%; height: 48px; padding: 0 14px; border: 0; border-radius: 0; background: #fff; color: #331e29; font: 500 16px/1 var(--font-display); }
.win-input:focus-visible { outline: 3px solid #331e29; outline-offset: 2px; }
.win-error { margin: 0; padding: 10px 14px; background: #fff; color: #9b1c2e; font: 600 14px/1.4 var(--font-display); }

/* "Where to look": the till slip shows on hover or keyboard focus, and on tap (public/win.js). */
.win-where { position: relative; }
.win-where__button { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: #331e29; color: #f5b335; font: italic 400 14px/1 var(--font-display); text-transform: uppercase; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.win-where__button:hover, .win-where__button:focus-visible, .win-where.is-open .win-where__button { background: #fff; color: #331e29; }
.win-where__button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Closed, the slip is out of the layout entirely, so it never lengthens the page on phones. */
.win-where__slip { display: none; position: absolute; z-index: 20; top: calc(100% + 10px); left: 0; width: min(340px, calc(100vw - 40px)); padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 18px 40px rgba(51, 30, 41, 0.35); pointer-events: none; animation: win-slip-in 0.15s ease-out; }
@keyframes win-slip-in { from { opacity: 0; transform: translateY(6px); } }
.win-where__slip img { display: block; width: 100%; height: auto; }
.win-where:hover .win-where__slip, .win-where:focus-within .win-where__slip, .win-where.is-open .win-where__slip { display: block; }

.win-human { justify-self: center; }

/* Dark aubergine pill as drawn in the mock-up; hover and press follow the button guide's gold and plum. */
.win-submit { justify-self: center; display: inline-flex; align-items: center; justify-content: center; min-width: 220px; height: 56px; margin-top: 10px; padding: 0 36px; border: 0; border-radius: 999px; background: #331e29; color: #fff; font: 400 26px/1 var(--font-nav); letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; transition: background-color 0.15s; }
.win-submit:hover, .win-submit:focus-visible { background: #b2700f; }
.win-submit:active { background: #35202a; }
.win-submit:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.win-submit:disabled { opacity: 0.7; cursor: progress; }

.win-done { max-width: 560px; margin: 0 auto; text-align: center; font-family: var(--font-display); }
.win-done__heading { margin: 8px 0 10px; font: 700 28px/1.2 var(--font-display); text-transform: uppercase; color: #331e29; }
.win-done__text { margin: 6px 0 0; font-size: 17px; line-height: 1.5; color: #331e29; }

/* ---------- From 768px: the mock-up, measured at 1920px ---------- */
@media (min-width: 768px) {
  .win { --u: calc(min(100cqw, 1280px) / 1920); }

  .win-tcs-wrap { position: absolute; left: 0; right: 0; top: calc(1053 / 1198 * 100%); padding: 0; }
  .win-enter .win-tcs { width: calc(329 * var(--u)); height: calc(86 * var(--u)); padding: 0; font-size: calc(54 * var(--u)); letter-spacing: 0.01em; }

  .win-form { position: relative; padding: calc(84 * var(--u)) 0 calc(54 * var(--u)); }
  .win-form__heading { margin: 0 auto; width: calc(1920 * var(--u)); height: calc(286 * var(--u)); }
  .win-form__title { position: absolute; left: calc(12 * var(--u)); right: 0; top: calc(-12 * var(--u)); font-size: calc(180 * var(--u)); }
  .win-form__underline { left: calc(562 * var(--u)); right: auto; top: calc(132 * var(--u)); bottom: auto; width: calc(794 * var(--u)); }

  .win-form__form { display: block; max-width: none; width: calc(1920 * var(--u)); margin: 0 auto; }
  .win-error { width: calc(584 * var(--u)); margin: 0 0 calc(24 * var(--u)) calc(871 * var(--u)); padding: calc(12 * var(--u)) calc(18 * var(--u)); font-size: calc(24 * var(--u)); }
  .win-row { grid-template-columns: calc(840 * var(--u)) calc(584 * var(--u)) auto; column-gap: calc(31 * var(--u)); align-items: center; height: calc(59 * var(--u)); margin-bottom: calc(59 * var(--u)); }
  .win-label { justify-self: end; font-size: calc(37 * var(--u)); letter-spacing: 0; white-space: nowrap; }
  .win-input { height: calc(59 * var(--u)); padding: 0 calc(18 * var(--u)); font-size: calc(26 * var(--u)); }

  /* Shrink-wrapped to the button, so the slip lines up with its right edge. */
  .win-where { align-self: start; justify-self: start; width: fit-content; margin-left: calc(-1 * var(--u)); }
  .win-where__button { width: calc(292 * var(--u)); height: calc(52 * var(--u)); padding: 0; font-size: calc(30 * var(--u)); }
  .win-where__slip { top: auto; bottom: calc(100% + 18 * var(--u)); left: auto; right: 0; width: calc(460 * var(--u)); min-width: 260px; padding: calc(14 * var(--u)); }

  .win-human { display: flex; justify-content: center; margin: calc(-20 * var(--u)) 0 calc(24 * var(--u)); }
  .win-submit { display: flex; margin: calc(65 * var(--u)) auto 0; min-width: 0; width: calc(357 * var(--u)); height: calc(89 * var(--u)); padding: 0; font-size: calc(45 * var(--u)); }
  .win-done { max-width: none; width: calc(1100 * var(--u)); padding-bottom: calc(40 * var(--u)); }
  .win-done__heading { font-size: calc(60 * var(--u)); }
  .win-done__text { font-size: calc(32 * var(--u)); }
}

/* Phones: the slip opens in line under the button, so the yellow section grows around it.
   Last in the file so it overrides the floating position above. */
@media (max-width: 767px) {
  .win-where__slip { position: static; width: 100%; max-width: 360px; margin-top: 10px; }
}
