.home-event {
  padding-block: clamp(2.75rem, 5vw, 4.5rem);
  background: var(--paper);
  color: var(--ink);
}

.home-event-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid #21384a;
  border-radius: .45rem;
  background: #0b1d2c;
  color: #faf4ea;
}

.home-event-preview {
  display: grid;
  grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr);
  align-items: center;
  padding: clamp(1.5rem, 3.6vw, 3.25rem);
  gap: clamp(1rem, 3.5vw, 3.25rem);
}
.home-event-copy { min-width: 0; }
.home-event-copy .eyebrow { color: #f2bf83; }
.home-event-copy h2 {
  max-width: 12ch;
  margin: .85rem 0 1.15rem;
  font: 500 clamp(2.65rem, 4.9vw, 4.65rem)/.99 var(--display);
  letter-spacing: -.048em;
  text-wrap: balance;
}
.home-event-guide {
  max-width: 36ch;
  color: #c3d2dc;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.55;
}
.home-event-invitation { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.2rem; margin-top: 1.6rem; }
.home-event-invitation .button {
  border-color: #f7ecda;
  background: #f7ecda;
  color: #152633;
  cursor: pointer;
}
.home-event-invitation .button:hover { border-color: white; background: white; }
.home-event-invitation .text-link { color: #d1dce2; text-decoration-color: #71828d; }
.home-event-invitation .text-link:hover { color: white; text-decoration-color: currentColor; }
.home-event-invitation :focus-visible { outline-color: #aadeff; }
.home-event-figure { min-width: 0; }
.home-event-figure img { width: 100%; height: auto; }
.home-event-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .3rem 1rem;
  padding-top: .8rem;
  border-top: 1px solid #304252;
  color: #c3d2dc;
  font-size: .76rem;
  line-height: 1.4;
}
.home-event-legend > span { display: inline-flex; align-items: center; gap: .43rem; }
.event-key { display: inline-block; flex: none; width: .5rem; height: .5rem; }
.event-key--segment { width: .85rem; height: .15rem; background: #7bcfff; transform: rotate(-18deg); }
.event-key--reference { border: 1.5px solid #ffd166; transform: rotate(45deg); }
.event-key--candidate { background: #4ff0c0; border-radius: 50%; }
.event-key--below { width: .65rem; height: auto; color: #bec8d6; font: 700 .98rem/1 var(--body); }
.home-event-footnotes {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .2rem 1.5rem;
  margin-top: .55rem;
}
.home-event-footnotes p { color: var(--muted); font-size: .8rem; line-height: 1.55; }
.home-event-footnotes p a { display: inline-block; margin-left: .3rem; }
.home-event-frame { min-width: 0; min-height: 0; }
.home-event-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
/* Leave room for the sticky site header and keep the whole work area in view. */
.home-event-stage.is-active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(100% - clamp(1.5rem, 5vw, 6rem), 100rem);
  height: min(64rem, calc(100vh - 6rem));
  height: min(64rem, calc(100dvh - 6rem));
}
.home-event-feedback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.home-event-actions { display: none; }
.home-event-stage.is-active .home-event-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: .2rem .7rem;
  gap: .35rem .7rem;
  border-top: 1px solid #2b485f;
  background: #101f30;
  color: #e3edf7;
}
.home-event-actions button { min-height: 44px; font-family: inherit; cursor: pointer; }
.home-event-actions > .text-link { margin-left: auto; }
.home-event-stage.is-active .home-event-actions .button {
  padding: .3rem .65rem;
  border: 0;
  background: transparent;
  color: inherit;
}
.home-event-stage.is-active .home-event-actions .button:hover { background: #263b50; transform: none; }
.home-event-stage.is-active .home-event-actions .text-link:hover { color: white; }
.home-event-stage.is-active .home-event-actions :focus-visible { outline-color: #aadeff; outline-offset: -2px; }
.home-event-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.home-event-dialog[open] { display: flex; flex-direction: column; }
.home-event-dialog-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .15rem .8rem;
  background: #101f30;
  color: #e3edf7;
  border-bottom: 1px solid #2b485f;
}

.home-event-dialog-bar h2 { font: 600 .95rem/1.3 var(--body); }
.home-event-dialog-bar button {
  flex: none;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 0;
  border-radius: .25rem;
  background: transparent;
  color: inherit;
  font: 600 .875rem var(--body);
  cursor: pointer;
}

.home-event-dialog-bar button:hover { background: #263b50; }
.home-event-dialog-bar button:focus-visible { outline: 2px solid #aadeff; outline-offset: -2px; }
.home-event-dialog-content { flex: 1; min-height: 0; }
.home-event-dialog iframe { display: block; width: 100%; height: 100%; border: 0; }
.home-page:has(.home-event-dialog[open]) { overflow: hidden; }

@media (max-width: 740px) {
  .home-event-preview { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; padding: clamp(1.1rem, 4.5vw, 2rem); }
  .home-event-copy h2 { max-width: 20ch; margin-block: .6rem .75rem; }
  .home-event-guide { max-width: 48ch; }
  .home-event-invitation { margin-top: .9rem; }
  .home-event-figure { width: min(100%, 30rem); justify-self: center; }
  .home-event-footnotes { display: block; }
  .home-event-footnotes p { max-width: 60ch; }
}
@media (max-width: 460px) {
  .home-event-preview { gap: .85rem; }
  .home-event-copy h2 { font-size: clamp(2.35rem, 10vw, 2.8rem); }
  .home-event-legend { display: grid; grid-template-columns: auto auto; justify-content: start; column-gap: 1rem; font-size: .73rem; }
  .home-event-dialog-bar { padding-inline: .75rem; }
  .home-event-dialog-bar h2 { font-size: .85rem; }
}

@media (min-width: 560px) and (max-width: 950px) and (max-height: 500px) and (orientation: landscape) {
  .home-event { padding-block: 1.35rem; }
  .home-event-preview { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 1rem; padding: 1rem 1.25rem; }
  .home-event-copy h2 { max-width: 13ch; margin-block: .45rem .65rem; font-size: clamp(2rem, 4.5vw, 2.55rem); }
  .home-event-guide { font-size: .93rem; line-height: 1.45; }
  .home-event-invitation { gap: 0 .6rem; margin-top: .7rem; }
  .home-event-invitation .button { padding-inline: .7rem; }
  .home-event-invitation .text-link { gap: .35rem; font-size: .8rem; }
  .home-event-figure img { width: auto; max-height: 56svh; margin-inline: auto; }
  .home-event-legend { gap: .2rem .7rem; padding-top: .4rem; font-size: .7rem; }
}

html.event-viewer-open { overflow: hidden; overscroll-behavior: none; }
.home-event-dialog-bar { padding-top: max(.15rem, env(safe-area-inset-top)); padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
.home-event-dialog-content { padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
