/* The open day page (/open-days): the invitation over the photograph, what there is to see, and the form.
   Loaded after the bundle and built from the same tokens. */

/* While there is an open day the parts marked data-od-none stay away, and the other way round. */
.od[data-state="on"] [data-od-none], .od[data-state="none"] [data-od-on] { display: none !important; }

/* The invitation: a card on the photograph of the barn */
.od-hero { position: relative; min-height: min(88vh, 860px); display: flex; align-items: center; justify-content: center; padding: 64px 24px; background: var(--night); overflow: hidden; }
.od-hero > img, .od-hero > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 46%; animation: drift 28s ease-in-out infinite alternate; }
.od-hero__shade { position: absolute; inset: 0; background: linear-gradient(rgba(24, 32, 30, 0.2), rgba(24, 32, 30, 0.46)); }
.od-card { position: relative; width: min(540px, 100%); padding: 12px; background: var(--cream); color: var(--slate); text-align: center; box-shadow: 0 26px 70px rgba(16, 22, 20, 0.42); }
.od-card__in { border: 1px solid var(--slate); padding: 40px 36px 42px; }
.od-card__mark { width: auto; height: 76px; margin: 0 auto 20px; }
.od-card .accent { margin-bottom: 10px; }
.od-card h1, .od-card__title { font-family: var(--serif); font-weight: 400; text-transform: uppercase; line-height: 1.1; color: var(--slate); margin: 0; }
.od-card h1 { font-size: clamp(42px, 6vw, 66px); letter-spacing: 0.1em; margin-right: -0.1em; }
.od-card__title { font-size: clamp(30px, 4vw, 42px); letter-spacing: 0.07em; }
.od-card .brush { width: 220px; margin: 18px auto 22px; }
.od-card__date { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.14em; font-size: clamp(17px, 2vw, 21px); line-height: 1.3; color: var(--slate); margin: 0; text-wrap: balance; }
/* The hours are set in the plain face: the display face draws a 1 that reads as a capital I. */
.od-card__time { font-family: var(--sans); font-weight: 600; text-transform: uppercase; letter-spacing: 0.22em; font-size: 14px; color: var(--green); margin: 10px 0 0; }
.od-card__where { font-size: 15px; line-height: 1.6; color: var(--text); margin: 16px auto 0; }
.od-card__where--line { max-width: 34ch; text-wrap: balance; }
.od-card .btns { margin-top: 26px; }

/* What you'll see */
.od-see { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.od-see figure { margin: 0; }
.od-see__ph { aspect-ratio: 4 / 5; overflow: hidden; background: #ddd6cc; }
.od-see img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease-out; }
.od-see figure:hover img { transform: scale(1.04); }
.od-see figcaption { text-align: center; margin-top: 16px; }
.od-see b { display: block; font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: 0.12em; font-size: 18px; line-height: 1.3; color: var(--slate); }
.od-see figcaption span { display: block; font-size: 14px; line-height: 1.5; margin-top: 2px; text-wrap: balance; }

.od-see__go { margin-top: 44px; }

/* Saving a place, straight after the invitation: the heading, the form, then the day, the place and the way there.
   On a wide screen the form stands beside the rest; on a narrow one it comes before the details. */
.od-rsvp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; grid-template-areas: "head form" "facts form"; column-gap: 64px; align-items: start; }
.od-rsvp__head { grid-area: head; }
.od-rsvp__head .brush { margin-left: 0; margin-bottom: 0; }
.od-rsvp__facts { grid-area: facts; }
.od-rsvp .od-form { grid-area: form; }
.od-facts { margin-top: 32px; }
.od-facts li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.od-facts b { font-family: var(--serif); font-weight: 400; font-style: italic; text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; color: var(--slate); }

.od-facts__go { white-space: nowrap; }
.od-photo { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; margin-top: 36px; }

/* The form */
.od-form .enq__fields { margin-top: 0; }
.od-form p.enq__error { color: #9b2c2c; }
.od-form .field label i { font-style: normal; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; opacity: 0.75; }
.od-left { font-family: var(--serif); font-style: italic; text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; color: var(--green) !important; margin: 14px 0 0; }
/* A message about one box sits straight under that box. */
.od-form p.enq__error.od-err--field { margin: -8px 0 16px; }
.od-party { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.od-party legend { font-family: var(--serif); text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: var(--slate); padding: 0; margin-bottom: 8px; }
.od-party__row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.od-party label { position: relative; display: block; }
.od-party input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.od-party label span { display: flex; align-items: center; justify-content: center; height: 48px; border: 1px solid var(--rule); border-radius: 3px; background: var(--white); font-family: var(--serif); font-size: 19px; color: var(--slate); transition: background-color 0.16s ease-out, color 0.16s ease-out, border-color 0.16s ease-out; }
.od-party label:hover span { border-color: var(--slate); }
.od-party input:checked + span { background: var(--green); border-color: var(--green); color: var(--white); }
.od-party input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }
.od-hp { position: absolute; left: -9999px; top: -9999px; }

/* After the form: on the list, a place from its link, or no places left */
.od-done:focus { outline: 0; }
.od-ticket { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 16px 0; margin: 4px 0 18px; }
.od-ticket b { display: block; font-family: var(--serif); font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; font-size: 20px; line-height: 1.3; color: var(--slate); }
.od-ticket > span { display: block; font-size: 15px; margin-top: 2px; text-wrap: balance; }
.od-done .btns { margin-top: 20px; }
.od-done a:not(.btn) { color: var(--green); text-underline-offset: 3px; }
/* Room to tap the link that cancels, clear of the bar at the foot of a phone screen. */
.od-done .enq__small a { display: inline-block; padding: 12px 0; }

@media (max-width: 1080px) {
  .od-rsvp { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "head" "form" "facts"; }
  .od-rsvp .od-form { margin-top: 28px; }
  .od-photo { display: none; }
}
@media (max-width: 900px) {
  .od-see { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
}
@media (max-width: 720px) {
  .od-hero { min-height: 0; padding: 40px 16px 48px; }
  /* The card covers most of the photograph on a phone, so it stays still. */
  .od-hero > img, .od-hero > picture > img { animation: none; }
  .od-card { padding: 9px; }
  .od-card__in { padding: 30px 20px 32px; }
  .od-card__mark { height: 60px; margin-bottom: 16px; }
  .od-card .brush { width: 180px; margin: 14px auto 18px; }
  .od-card__date { font-size: 15px; letter-spacing: 0.1em; }
  .od-form button[type="submit"] { width: 100%; min-height: 52px; }
  .od-see__go { margin-top: 32px; }
  .od-see__go .btn { width: 100%; }
  .od-facts li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .od-see b { font-size: 16px; }
  .od-party__row { gap: 6px; }
}
@media (max-width: 350px) {
  .od-card__in { padding: 26px 14px 28px; }
  .od-card h1 { font-size: 36px; letter-spacing: 0.08em; }
  .od-card__date { font-size: 13.5px; letter-spacing: 0.06em; }
  .od-card__where { font-size: 13.5px; }
  .od-party__row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .od-hero > img, .od-hero > picture > img { animation: none; }
  .od-see img { transition: none; }
  .od-see figure:hover img { transform: none; }
}
