/* ==========================================================================
   Whytelight — layout
   Wrappers, header, footer, section scaffolding, responsive behaviour.

   NOTE ON RESPONSIVE
   The v2 design is desktop-only: every grid is a fixed fr ratio and there is
   not one media query in it. Mobile behaviour below is therefore ours, not the
   design's. The rule applied throughout: two-column grids collapse to one at
   900px, side gutters halve at 640px, and anything relying on hover gets a
   tap-equivalent.
   ========================================================================== */

/* --- Wrappers ---------------------------------------------------------- */

.wl-wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wl-wrap--mid    { max-width: var(--wrap-mid); }
.wl-wrap--narrow { max-width: var(--wrap-narrow); }
.wl-wrap--prose  { max-width: var(--wrap-prose); }

.wl-section {
  padding-block: var(--sp-section);
}

.wl-section--lg {
  padding-block: var(--sp-section-lg) 8.75rem;
}

/* A page whose first element is not a full-bleed hero needs to clear the fixed
   header. The hero pages do not, because the header sits over the photograph. */
.wl-main--offset {
  padding-top: 9.375rem;
}

/* --- Dark bands -------------------------------------------------------- */

.wl-band {
  position: relative;
  background: var(--c-black);
  color: var(--c-white);
  overflow: hidden;
}

.wl-band--coll {
  background: var(--coll-bg);
  transition: background var(--dur-slow) var(--ease-out);
}

/* The photograph inside a band, oversized so it can parallax without gapping. */
.wl-band__img {
  position: absolute;
  inset: -10% 0;
  width: 100%;
  height: 120%;
  object-fit: cover;
  will-change: transform;
}

.wl-band__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(18, 17, 16, 0.62) 0%,
    rgba(18, 17, 16, 0.15) 38%,
    rgba(18, 17, 16, 0.75) 100%
  );
}

.wl-band__inner {
  position: relative;
  height: 100%;
}

/* --- Header ------------------------------------------------------------
   Fixed, transparent, and inverts against whatever sits behind it. The colour
   is driven by a data attribute that site.js updates from an IntersectionObserver
   rather than from scroll position, so it stays correct when content reflows.
   -------------------------------------------------------------------------- */

.wl-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.625rem;
  padding: 1.625rem var(--gutter);

  /* The bar itself must not eat clicks over the photograph; its children opt
     back in. */
  pointer-events: none;
}

.wl-header > * {
  pointer-events: auto;
}

/* Logged in, WordPress's admin bar sits across the top of the screen; keep
   the header below it rather than underneath it. Below 600px the admin bar
   scrolls away with the page, so the header goes back to the very top. */
.admin-bar .wl-header {
  top: 32px;
}

@media (max-width: 782px) {
  .admin-bar .wl-header {
    top: 46px;
  }
}

@media (max-width: 600px) {
  .admin-bar .wl-header {
    top: 0;
  }
}

/* Light text over a dark photograph, with a shadow so it survives a bright
   patch of sky; dark text over paper, with none. */
.wl-header[data-ink="light"] {
  color: var(--c-white);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.wl-header[data-ink="dark"] {
  color: var(--c-ink);
  text-shadow: none;
}

.wl-header__brand,
.wl-header__nav {
  transition: color var(--dur-fast) var(--ease-out), text-shadow var(--dur-fast) var(--ease-out);
}

/* The wordmark. Each letter is placed absolutely so the word can fold from a
   row into a column down the left edge (.is-vertical, set by site.js once the
   hero has gone) and spread a little on hover. */
.wl-header__brand {
  --lw: 21px;
  --lh: 24px;
  position: relative;
  display: block;
  width: calc(var(--n, 10) * var(--lw));
  height: var(--lh);
  font-family: var(--f-display);
  font-weight: var(--fw-display);
  font-size: 1.5rem;
  line-height: 1;
  color: inherit;
}

.wl-header__brand:hover {
  color: inherit;
  text-decoration: none;
}

.wl-logo__l {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--lw);
  text-align: center;
  transform: translate(calc(var(--i) * var(--lw)), 0);
  transition:
    transform 0.9s cubic-bezier(0.76, 0, 0.24, 1) calc((var(--n, 10) - 1 - var(--i)) * 0.035s),
    color 0.3s ease,
    text-shadow 0.3s ease;
}

/* A letter sitting over a different band from the rest of the header gets its
   own ink: in the column, the top letters can be over a photograph while the
   bottom ones are over paper. */
.wl-logo__l[data-ink="light"] {
  color: var(--c-white);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

.wl-logo__l[data-ink="dark"] {
  color: var(--c-ink);
  text-shadow: none;
}

.wl-header:not(.is-vertical) .wl-header__brand:hover .wl-logo__l,
.wl-header:not(.is-vertical) .wl-header__brand:focus-visible .wl-logo__l {
  transform: translate(calc(var(--i) * var(--lw) * 1.0714), 0);
  transition-delay: 0s;
  color: var(--a-link-hover);
}

.wl-header:not(.is-vertical) .wl-header__brand:hover .wl-logo__l[data-ink="light"],
.wl-header:not(.is-vertical) .wl-header__brand:focus-visible .wl-logo__l[data-ink="light"],
.wl-header[data-ink="light"]:not(.is-vertical) .wl-header__brand:hover .wl-logo__l:not([data-ink]) {
  color: var(--a-warm);
}

.wl-header.is-vertical .wl-logo__l {
  transform: translate(0, calc(var(--i) * var(--lh)));
  transition-delay: calc(var(--i) * 0.035s), 0s, 0s;
}

/* The nav sits in a frosted pill once the page has moved, tinted to match the
   ink so it never fights the photograph behind. */
.wl-header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  color: inherit;
  padding: 10px 18px;
  margin: -10px -18px;
  border-radius: 999px;
  background: transparent;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition:
    color var(--dur-fast) var(--ease-out),
    text-shadow var(--dur-fast) var(--ease-out),
    background 0.4s ease;
}

.wl-header.is-scrolled[data-ink="light"] .wl-header__nav {
  background: rgba(18, 17, 16, 0.45);
}

.wl-header.is-scrolled[data-ink="dark"] .wl-header__nav {
  background: rgba(255, 255, 255, 0.6);
}

.wl-header__link {
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: inherit;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.wl-header__link:hover,
.wl-header__link:focus-visible {
  text-decoration: none;
  color: var(--a-link-hover);
  border-bottom-color: currentColor;
}

.wl-header[data-ink="light"] .wl-header__link:hover,
.wl-header[data-ink="light"] .wl-header__link:focus-visible {
  color: var(--a-warm);
}

/* The menu toggle gets the colour but not the underline: its bars are enough. */
.wl-header__link.wl-menu-toggle:hover,
.wl-header__link.wl-menu-toggle:focus-visible {
  border-bottom-color: transparent;
}

.wl-header__count {
  font-family: var(--f-mono);
  font-size: var(--fs-label);
  opacity: 0.7;
}

/* Basket link, with its count */
.wl-basket-link {
  display: flex;
  align-items: center;
  gap: 0.5625rem;
}

/*
 * The full-width bar. Where the wordmark stays a row (phones, tablets, any
 * touch screen), a pill behind the nav alone left the logo to run over the
 * page underneath, so once the page moves the whole header gets a tinted,
 * frosted bar instead. At the very top there is none: the header sits on the
 * hero as designed. site.js sets .is-bar.
 */
.wl-header {
  transition: background-color 0.35s ease;
}

.wl-header.is-bar {
  pointer-events: auto;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.wl-header.is-bar[data-ink="light"] {
  background: rgba(18, 17, 16, 0.55);
}

.wl-header.is-bar[data-ink="dark"] {
  background: rgba(251, 247, 241, 0.82);
}

.wl-header.is-bar.is-scrolled[data-ink] .wl-header__nav {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* On the bar every letter takes the bar's ink, so none is lost against it. */
.wl-header.is-bar .wl-logo__l[data-ink] {
  color: inherit;
  text-shadow: inherit;
}

/* --- Menu toggle -------------------------------------------------------- */

.wl-menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: inherit;
}

.wl-menu-toggle__bars {
  position: relative;
  width: 26px;
  height: 12px;
  display: inline-block;
}

.wl-menu-toggle__bars span {
  position: absolute;
  left: 0;
  width: 26px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.5s var(--ease-bar);
}

.wl-menu-toggle__bars span:first-child { top: 0; }
.wl-menu-toggle__bars span:last-child  { top: 10px; }

/* Cross when open. */
[aria-expanded="true"] .wl-menu-toggle__bars span:first-child {
  transform: translateY(5px) rotate(45deg);
}

[aria-expanded="true"] .wl-menu-toggle__bars span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* --- Footer ------------------------------------------------------------ */

.wl-footer {
  background: var(--c-black);
  color: var(--t-footer);
}

.wl-footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3.75rem;
  padding-block: 5.625rem 3.75rem;
}

.wl-footer__mark {
  font-family: var(--f-display);
  font-weight: var(--fw-display);
  font-size: 2.125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: 1.125rem;
}

.wl-footer__blurb {
  font-size: 0.9375rem;
  max-width: 34ch;
}

/* Lines the second link column up under the Collections heading. */
.wl-footer__spacer {
  height: 2rem;
}

.wl-footer__heading {
  font-family: var(--f-body);
  font-weight: var(--fw-label);
  font-size: 0.6875rem;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--t-footer-head);
  margin-bottom: 1.125rem;
}

.wl-footer__list {
  display: grid;
  gap: 0.625rem;
  list-style: none;
}

.wl-footer__list a {
  font-family: var(--f-display);
  font-weight: var(--fw-display);
  font-size: 1.375rem;
  letter-spacing: 0.03em;
  color: var(--t-footer-link);
}

.wl-footer__list a:hover {
  color: var(--c-white);
  text-decoration: none;
}

.wl-footer__bar {
  border-top: 1px solid var(--c-line-dark);
}

.wl-footer__bar-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-block: 1.375rem;
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: var(--ls-caption);
  text-transform: uppercase;
  color: var(--t-footer-head);
}

.wl-footer__bar-inner a {
  color: var(--t-footer-head);
}

/* Shenachie credit, in the house yellow. */
.wl-credit a {
  color: #fff391;
}

.wl-credit a:hover {
  color: #fff391;
}

/* --- Newsletter -------------------------------------------------------- */

.wl-signup {
  display: flex;
  gap: 0.625rem;
  align-items: stretch;
  max-width: 420px;
}

.wl-signup input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--t-body);
  border-radius: var(--radius-ui);
  padding: 0.875rem 1rem;
  font-size: 0.90625rem;
  background: transparent;
  color: var(--c-white);
}

.wl-signup input::placeholder {
  color: var(--t-footer-head);
}

.wl-signup button {
  flex: none;
  background: var(--c-white);
  color: var(--c-black);
  border-radius: var(--radius-ui);
  padding: 0.875rem 1.5rem;
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background var(--dur-fast) ease;
}

.wl-signup button:hover {
  background: var(--c-sand);
}

/* --- Page heads -------------------------------------------------------- */

.wl-pagehead {
  padding-block: 9.375rem 0;
}

.wl-pagehead__kicker {
  font-family: var(--f-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--a-link-hover);
  margin-bottom: 1rem;
}

.wl-pagehead__title {
  font-size: var(--fs-page);
  letter-spacing: 0.04em;
  line-height: 1;
}

/* --- Captions ---------------------------------------------------------- */

.wl-caption {
  font-family: var(--f-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-caption);
  color: var(--t-caption);
  text-transform: uppercase;
}

.wl-on-dark .wl-caption,
.wl-band .wl-caption {
  color: rgba(245, 234, 216, 0.8);
}

.wl-kicker {
  font-family: var(--f-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  color: var(--coll-accent);
}

/* --- Responsive -------------------------------------------------------
   Everything below this line is ours; the design had no mobile state.
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .wl-footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .wl-footer__brand-col {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  :root {
    --sp-section: 4.5rem;
    --sp-section-lg: 5.5rem;
  }

  .wl-main--offset,
  .wl-pagehead {
    padding-top: 7rem;
  }

  .wl-header {
    padding: 1.25rem var(--gutter);
  }

  /* The word "Menu" is the first thing to go; the bars carry the meaning. */
  .wl-menu-toggle span.wl-menu-toggle__label {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --gutter: var(--gutter-sm);
  }

  .wl-header {
    padding: 1rem var(--gutter);
    gap: 1rem;
  }

  .wl-header__nav {
    gap: 1.125rem;
  }

  .wl-header__brand {
    --lw: 17.5px;
    --lh: 20px;
    font-size: 1.25rem;
  }

  /* "Prints" duplicates the menu on a small screen. */
  .wl-header__link--prints {
    display: none;
  }

  .wl-footer__top {
    grid-template-columns: 1fr;
    gap: 2.75rem;
    padding-block: 3.5rem 2.5rem;
  }

  .wl-footer__bar-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  .wl-signup {
    max-width: none;
  }
}
