/*
  Home on a landscape window from a small tablet up (Home.js adds .home--spread for the same media query).

  One composition in the header band's column, filling the height under it: the left column is the TODAY
  card (Daily Challenge, then every chosen current event beside the story art) over the Today row; the right
  column is the robot standing on PLAY. Both columns start under the header and end on one line, with PLAY
  level with the Today row, so the window never shows an empty stretch of clearing between the pieces.

  Everything is sized from --hk, one design pixel: 1px on a 1440 x 900 window, following the page box's
  width and height (whichever is tighter) so a laptop, a landscape tablet and a large monitor all show the
  same proportions. This file is loaded after home.css, quick-play.css and daily.css and owns every wide
  Home property it sets.
*/
@property --hk {
  syntax: '<length>';
  inherits: true;
  initial-value: 1px;
}
@property --home-foot {
  syntax: '<length>';
  inherits: true;
  initial-value: 104px;
}

:root.layout-wide .home.home--spread {
  display: grid;
  /* the TODAY card needs room for the story art beside readable rows; the robot column is as wide as PLAY */
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  /* a very tall window centres a composition no taller than 0.7 of its width instead of stretching the rows */
  grid-template-rows: minmax(0, min(100%, calc(0.7 * (min(var(--column-max), 100vw - 148px) - 48px))));
  align-content: center;
  align-items: stretch;
  gap: 0 clamp(20px, 2.4vw, 40px);
  padding: 20px 24px 24px;
  overflow: hidden;
}
/* the page box of a 1440 x 900 window is 1112 x 748; cq units here read .home's own box */
:root.layout-wide .home.home--spread > * {
  --hk: clamp(0.72px, min(calc(100cqw / 1112), calc(100cqh / 748)), 1.32px);
  --home-foot: calc(104 * var(--hk));
  /* the canvas unit the shared Home pieces (FitLabel, PLAY's stroke) are drawn in */
  --u: calc(0.7 * var(--hk));
}

/* ---- left column: TODAY card over the Today row ---------------------------------------------------------- */
:root.layout-wide .home.home--spread .home__news {
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: calc(16 * var(--hk));
  width: auto;
  height: 100%;
  min-height: 0;
  padding: 0;
}
:root.layout-wide .home.home--spread .home__stories {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow: visible;
  mask-image: none;
}
:root.layout-wide .home.home--spread .home-events.home-events--combined {
  container: today / inline-size;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  align-self: stretch;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0 calc(6 * var(--hk)) calc(6 * var(--hk));
  border-radius: calc(26 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-events__heading {
  flex: none;
  min-height: calc(62 * var(--hk));
  padding: 0 calc(10 * var(--hk)) 0 calc(18 * var(--hk));
  gap: calc(16 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-events__title {
  font-size: calc(27 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-events__all {
  height: calc(44 * var(--hk));
  min-height: calc(44 * var(--hk));
  padding: 0 calc(18 * var(--hk));
  gap: calc(6 * var(--hk));
  font-size: calc(17 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-events__combined-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  border-radius: calc(20 * var(--hk));
}

/* Daily Challenge: the card's first and largest action */
:root.layout-wide .home.home--spread .home-events--combined .home-daily {
  flex: none;
  min-height: calc(108 * var(--hk));
  padding: calc(14 * var(--hk)) calc(20 * var(--hk));
  gap: calc(16 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily__info {
  gap: calc(16 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily__info > img {
  width: calc(56 * var(--hk));
  height: calc(62 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily__info > span {
  gap: calc(4 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily strong {
  font-size: calc(26 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily small {
  font-size: max(14px, calc(18 * var(--hk)));
  line-height: 1.3;
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily__play {
  --btn-h: calc(56 * var(--hk));
  --btn-font: calc(22 * var(--hk));
  min-height: calc(56 * var(--hk));
  max-width: none;
  padding-inline: calc(22 * var(--hk));
  gap: calc(8 * var(--hk));
}
:root.layout-wide .home.home--spread .home-events--combined .home-daily__play .btn__icon {
  width: calc(26 * var(--hk));
  height: calc(26 * var(--hk));
}

/* the story shelf: the story art beside the chosen stories, taking the rest of the card */
:root.layout-wide .home.home--spread .home-events__spread {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  gap: calc(12 * var(--hk));
  margin: 0 calc(20 * var(--hk));
  padding: calc(16 * var(--hk)) 0 calc(18 * var(--hk));
  border-top: 1px solid #0012421c;
}
:root.layout-wide .home.home--spread .home-events__section {
  flex: none;
  color: #637094;
  font-size: max(11px, calc(14 * var(--hk)));
  line-height: 1.2;
  font-weight: var(--w-bold);
  letter-spacing: 0.06em;
}
:root.layout-wide .home.home--spread .home-events__shelf {
  container: shelf / size;
  display: flex;
  align-items: flex-start;
  flex: 1 1 0;
  min-height: 0;
  gap: calc(20 * var(--hk));
}
/* The story art keeps its own 768 x 1344 shape: as tall as the shelf, but never wider than 34 % of it,
   centred beside the stories when the shelf is taller than that. */
:root.layout-wide .home.home--spread .home-events--combined .home-events__shelf > .home-events__story {
  display: block;
  position: relative;
  flex: none;
  align-self: center;
  width: auto;
  height: min(100cqh, calc(34cqw * 1344 / 768));
  aspect-ratio: 768 / 1344;
  margin: 0;
  border-radius: calc(18 * var(--hk));
  box-shadow: 0 calc(4 * var(--hk)) calc(10 * var(--hk)) rgba(27, 37, 89, 0.18);
}
:root.layout-wide .home.home--spread .home-events--combined .home-events__shelf > .home-events__story .home-events__fallback {
  padding: 0 14%;
}
:root.layout-wide .home.home--spread .home-events--combined .home-events__shelf > .home-events__story .home-events__fallback-art {
  width: 100%;
  height: auto;
}
:root.layout-wide .home.home--spread .home-events__list {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  align-self: stretch;
  min-width: 0;
}
:root.layout-wide .home.home--spread .home-events__list .home-event {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(176 * var(--hk));
  width: 100%;
  gap: calc(16 * var(--hk));
  padding: calc(10 * var(--hk)) 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #1b2559;
}
:root.layout-wide .home.home--spread .home-events__list .home-event + .home-event {
  border-top: 1px solid #0012421c;
}
:root.layout-wide .home.home--spread .home-events__list .home-event__disc {
  position: static;
  flex: none;
  width: calc(64 * var(--hk));
  height: calc(64 * var(--hk));
  transform: none;
}
:root.layout-wide .home.home--spread .home-events__list .home-event__text {
  position: static;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 0;
  align-self: stretch;
  min-width: 0;
  gap: calc(5 * var(--hk));
  overflow: hidden;
}
:root.layout-wide .home.home--spread .home-events__list .home-event__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: auto;
  max-height: none;
  font-size: max(16px, calc(23 * var(--hk)));
  line-height: 1.2;
}
/* as many summary lines as the row has room for under its title (Home.js useSummaryCut) */
:root.layout-wide .home.home--spread .home-events__list .home-event__kicker {
  -webkit-line-clamp: var(--summary-lines, 2);
  font-size: max(13px, calc(17 * var(--hk)));
  line-height: 1.35;
}
:root.layout-wide .home.home--spread .home-events__list .home-event.is-tight .home-event__kicker {
  display: none;
}
:root.layout-wide .home.home--spread .home-events__list .home-event__chevron {
  position: static;
  flex: none;
  width: calc(22 * var(--hk));
  height: auto;
  transform: none;
  font-size: calc(46 * var(--hk));
  line-height: 1;
}
/* loading or an empty feed: the status line at a story title's size, centred beside the globe */
:root.layout-wide .home.home--spread .home-events__list .home-events__empty {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 0;
}
:root.layout-wide .home.home--spread .home-events__list .home-events__empty > span {
  color: #53627b;
  font-size: max(16px, calc(23 * var(--hk)));
  font-weight: var(--w-semibold);
  line-height: 1.3;
}
/* A short shelf drops stories rather than squeezing them (All current events lists them all). */
@container shelf (max-height: 250px) {
  :root.layout-wide .home.home--spread .home-events__list .home-event:nth-child(n + 3) {
    display: none;
  }
}
@container shelf (max-height: 150px) {
  :root.layout-wide .home.home--spread .home-events__list .home-event:nth-child(n + 2) {
    display: none;
  }
}
/* A narrow card gives its rows the whole width rather than squeezing them beside the art. */
@container today (max-width: 560px) {
  :root.layout-wide .home.home--spread .home-events--combined .home-events__shelf > .home-events__story {
    display: none;
  }
}

/* the Today row: as tall as PLAY, so the two columns end on one line */
:root.layout-wide .home.home--spread .home-today {
  flex: none;
  height: var(--home-foot);
  margin: 0;
  padding: calc(10 * var(--hk)) calc(16 * var(--hk));
  border-radius: calc(26 * var(--hk));
}
:root.layout-wide .home.home--spread .home-today__cell {
  gap: calc(14 * var(--hk));
  padding: 0 calc(8 * var(--hk));
  border-radius: calc(18 * var(--hk));
}
:root.layout-wide .home.home--spread .home-today__icon {
  width: calc(60 * var(--hk));
  height: calc(60 * var(--hk));
}
:root.layout-wide .home.home--spread .home-today__divider {
  height: calc(60 * var(--hk));
}

/* ---- right column: the robot standing on PLAY ---------------------------------------------------------- */
:root.layout-wide .home.home--spread .home-stage--quick {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  align-content: normal;
  justify-content: flex-end;
  gap: calc(18 * var(--hk));
  width: auto;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  container: home-hero / size;
}
/* The robot box keeps the clip's 461 x 555 shape: as tall as the room above PLAY, at most 92 % of the column's width. */
:root.layout-wide .home.home--spread .home-stage__robot {
  position: relative;
  inset: auto;
  flex: none;
  width: auto;
  height: min(calc(100cqh - var(--home-foot) - 18 * var(--hk)), calc(92cqw * 555 / 461), calc(660 * var(--hk)));
  min-height: 0;
  max-width: none;
  max-height: none;
  aspect-ratio: 461 / 555;
  margin: 0;
  transform: none;
}
:root.layout-wide .home.home--spread .home-quick-actions {
  position: relative;
  inset: auto;
  flex: none;
  width: 100%;
  max-width: none;
  margin: 0;
  gap: 0;
  transform: none;
}
:root.layout-wide .home.home--spread .home-play {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  height: var(--home-foot);
  min-height: 0;
  padding: 0 calc(32 * var(--hk)) calc(8 * var(--hk));
  gap: calc(20 * var(--hk));
  transform: none;
}
:root.layout-wide .home.home--spread .home-play::before {
  border-radius: calc(34 * var(--hk));
}
:root.layout-wide .home.home--spread .home-play__title {
  width: auto;
  height: auto;
  font-size: calc(var(--fit-size, 96) * 0.62 * var(--hk));
  line-height: 1.15;
}
:root.layout-wide .home.home--spread .home-play__icon {
  width: calc(50 * var(--hk));
  height: calc(50 * var(--hk));
}
