/* KICKSTW reskin: the home page's first screen, the two floors side by side (one over the other on
   a phone), per site_prototype/assets/css/home-floors.css there. Each half is one link.
   --floors-top is the header's height and the admin bar's, set by home-floors.js. Everything is under .kt-chrome.
   A half's photo is a finished picture that carries its own words (since 22 Nov): nothing is laid over
   it, and it is cut around its centre, so its words stay in the middle 1700 x 1300 of a 2000 x 2000
   square (what computers and upright phones keep, with the pointer's 4%). A half without a photo is a
   plain panel with its title: the light one in the brand's grey, the dark one in ink. */

/* The halves fill what the header and WordPress's admin bar (shown to anyone signed in) leave of the
   screen: home-floors.js sets --floors-top to the two heights together. Until it runs, the fallback
   is the header's height in the drawing, 139px on a computer, 97px on a tablet and 100px on a phone
   (the header is in its narrow form at 1024px and below), plus the admin bar's 32px (46px on a
   phone). Those are the drawing's numbers, checked on staging. WordPress's bar is 46px already at
   782px; the checked breakpoints are 720px and 1024px, so between 721px and 782px the fallback is
   14px short until the script measures. */
.kt-chrome .floors { position: relative; display: flex; gap: 4px; height: calc(100svh - var(--floors-top, 140px)); min-height: 440px; overflow: hidden; }
body.admin-bar .kt-chrome .floors { height: calc(100svh - var(--floors-top, calc(140px + 32px))); }
@media (max-width: 1024px) {
  .kt-chrome .floors { height: calc(100svh - var(--floors-top, 100px)); }
  body.admin-bar .kt-chrome .floors { height: calc(100svh - var(--floors-top, calc(100px + 32px))); }
}
@media (max-width: 720px) {
  body.admin-bar .kt-chrome .floors { height: calc(100svh - var(--floors-top, calc(100px + 46px))); }
}

.kt-chrome .floorway { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; display: flex; align-items: flex-end; overflow: hidden; text-decoration: none; }
.kt-chrome .floorway:focus-visible { outline-offset: -4px; }
/* The ring is ink everywhere else; on the dark floor it would not show. */
.kt-chrome .floorway--dark:focus-visible { outline-color: var(--white); }
.kt-chrome .floorway__photo { position: absolute; inset: 0; background: var(--brand-bg); }
.kt-chrome .floorway--dark .floorway__photo { background: var(--ink); }
.kt-chrome .floorway__photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
/* A half's video lies over its picture, cut the same way, and shows only once it plays
   (home-floors.js adds is-playing): until then, and for anyone it is not started for, the picture. */
.kt-chrome .floorway__video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; opacity: 0; }
.kt-chrome .floorway__video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .kt-chrome .floorway__video { transition: opacity 0.4s ease; }
}
/* One button for the videos, in the first screen's lower right corner, as the cards' white labels;
   shown by home-floors.js once a video plays (a moving picture must be able to stop). */
.kt-chrome .floors__pause { position: absolute; right: 16px; bottom: 16px; z-index: 2; margin: 0; padding: 8px 12px; border: 0; border-radius: 0; background: var(--white); color: var(--ink); font: var(--type-label); cursor: pointer; }
.kt-chrome .floors__pause[hidden] { display: none; }
.kt-chrome .floors__pause:hover { background: var(--white); color: var(--ink); text-decoration: underline; }
.kt-chrome .floors__pause:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Over a picture the title is the link's name only: out of sight, still read by screen readers. */
.kt-chrome .floorway.has-photo .floorway__text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.kt-chrome .floorway__text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 0 var(--gutter) 40px; }
/* The title is staff's own words: a line longer than the half wraps, and a word longer than the
   half breaks, so nothing runs out of it. Three classes, to win over the page's h2 reset. */
.kt-chrome .floors .floorway__title { margin: 0; color: inherit; font: var(--type-display); letter-spacing: -0.02em; text-transform: uppercase; text-wrap: initial; overflow-wrap: anywhere; }
.kt-chrome .floorway--light, .kt-chrome .floorway--light:hover { color: var(--ink); }
.kt-chrome .floorway--dark, .kt-chrome .floorway--dark:hover { color: var(--white); }

/* The seam between the halves stays where it is, so neither title moves. Only the photo under the
   pointer comes 4% closer, from its centre, on the featured brands' clock; a click opens the page at
   once (home-floors.js does not hold it). */
@media (prefers-reduced-motion: no-preference) {
  .kt-chrome .floors[data-motion="on"] .floorway__photo :is(img, video) { transform-origin: 50% 50%; transition: scale 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s ease; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .kt-chrome .floors[data-motion="on"] .floorway:hover .floorway__photo :is(img, video) { scale: 1.04; }
}

@media (max-width: 720px) {
  .kt-chrome .floors { flex-direction: column; min-height: 480px; }
  .kt-chrome .floorway__text { gap: 8px; padding-bottom: 20px; }
}

/* One picture across the first screen, alone: nothing is printed under it. Its
   section is a column so the picture's link spans the width. */
.kt-chrome .floors.floors--hero { flex-direction: column; }

/* A picture that carries its own words: shown whole, in its own proportions, with nothing over it,
   and still under the pointer (a picture brought closer would lose the words at its edges).
   --pic is the photo's width / height, and --pic-narrow the phone's photo's when it has one; both
   are set on the photo's box by the template. The ring is ink with white inside it, to show on any
   picture, and is drawn over the photo: the link's own outline is covered by the photo. */
.kt-chrome .floors.floors--whole, body.admin-bar .kt-chrome .floors.floors--whole { height: auto; min-height: 0; }
.kt-chrome .floorway--whole { flex: 0 0 auto; display: block; }
.kt-chrome .floorway--whole .floorway__photo { position: relative; inset: auto; display: block; aspect-ratio: var(--pic); }
.kt-chrome .floorway--whole:focus-visible .floorway__photo::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--white); }
@media (max-width: 720px) {
  .kt-chrome .floorway--whole .floorway__photo { aspect-ratio: var(--pic-narrow, var(--pic)); }
}
