/*
 * Black Friday desktop skin: styles.
 *
 * Loaded by a stylesheet link in the page head (vueadmin App Config > Theme > Seasonal Skin > Black Friday >
 * Skin CSS Url), together with frontstore-bg.js. Nothing here applies until the script, inside the
 * sale dates, adds the side-bg-on class:
 *   - normal Blade pages: on #main, and the rails go inside #main;
 *   - the Vue search page: on the html element, and the backdrop and rails go inside its 1140px main element.
 * The script also sets --bf-half, --bf-gutter and --bf-band, and --bf-color when the script tag has
 * data-color.
 */
@import url("https://fonts.googleapis.com/css2?family=Anton&display=swap") screen and (min-width: 1360px);

@media (min-width: 1200px) {
  /* Normal pages: the gutters around the 1140px column turn black. */
  #main.side-bg-on {
    background-color: var(--bf-color, #000) !important;
  }

  /* Text that normally sits straight on the grey page background. */
  #main.side-bg-on #main-content > .breadcrumb,
  #main.side-bg-on #main-content > .breadcrumb > li > a > span,
  #main.side-bg-on #main-content > .breadcrumb > li + li:before {
    color: #ddd;
  }

  /* Homepage Trustpilot row: its children are floated and coloured inline, so give the row back the
     page grey and make it wrap its floats. */
  #main.side-bg-on .trusted-score {
    display: flow-root;
    background: #f5f5f5;
  }

  /* Carry the black on through the "Why Ink Station" band below the page, without the grey strip that
     normally sits above it. */
  #main.side-bg-on ~ #footerNew .footer-padding {
    display: none;
  }
  #main.side-bg-on ~ #footerNew #footer-why,
  #main.side-bg-on ~ #footerNew #footer-why .footer-why-header,
  #main.side-bg-on ~ #footerNew #footer-why .footer-why-content {
    background-color: var(--bf-color, #000);
  }
  #main.side-bg-on ~ #footerNew #footer-why p {
    color: #bbb;
  }
  #main.side-bg-on ~ #footerNew #footer-why .footer-why-header,
  #main.side-bg-on ~ #footerNew #footer-why h3 {
    color: #fff;
  }
  #main.side-bg-on ~ #footerNew #footer-why .footer-icon:before {
    color: #f2c14e;
  }

  /* Search page: a backdrop behind the main element as wide as the page, from the nav down to the footer.
     --bf-gutter is the width of one gutter. */
  html.side-bg-on #app main {
    position: relative;
  }
  html.side-bg-on #app main > .bf-backdrop {
    display: block;
    position: absolute;
    top: -10px;
    bottom: 0;
    left: calc(-1 * var(--bf-gutter, 0px));
    right: calc(-1 * var(--bf-gutter, 0px));
    z-index: -1;
    background: var(--bf-color, #000);
  }

  /* Search page footer: the same black band, whose icons are images; the filter turns their black SVG
     into the same gold. */
  html.side-bg-on #app footer > div:first-child {
    display: none;
  }
  html.side-bg-on #app footer > section:first-of-type,
  html.side-bg-on #app footer > section:first-of-type > * {
    background-color: var(--bf-color, #000);
  }
  html.side-bg-on #app footer > section:first-of-type p {
    color: #bbb;
  }
  html.side-bg-on #app footer > section:first-of-type > p,
  html.side-bg-on #app footer > section:first-of-type h3 {
    color: #fff;
  }
  html.side-bg-on #app footer > section:first-of-type img {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(90%) sepia(36%) saturate(1914%) hue-rotate(320deg) brightness(104%) contrast(90%);
  }
}

/* Side rails, one in each gutter, only where the gutter is wide enough to read. */
.bf-rail,
.bf-backdrop {
  display: none;
}
@media (min-width: 1360px) {
  #main.side-bg-on > .bf-rail,
  html.side-bg-on #app main > .bf-rail {
    display: block;
    position: absolute;
    z-index: 0;
    container-type: size;
    overflow: clip;
    pointer-events: none;
    font-family: "Anton", Impact, "Arial Narrow", sans-serif;
  }
  #main.side-bg-on > .bf-rail {
    top: 0;
    bottom: 0;
    width: calc((100% - 1140px) / 2);
  }
  /* Search page: the rails hang off the sides of the 1140px main element and run on down the black "Why Ink
     Station" band (--bf-band is its height), so a search with no results, which leaves the main element only
     about 150px tall, still has room for the words. */
  html.side-bg-on #app main > .bf-rail {
    top: -10px;
    bottom: calc(-1 * var(--bf-band, 0px));
    width: var(--bf-gutter, 0px);
  }
}
.bf-rail--left {
  left: 0;
}
.bf-rail--right {
  right: 0;
}
html.side-bg-on #app main > .bf-rail--left {
  left: auto;
  right: 100%;
}
html.side-bg-on #app main > .bf-rail--right {
  right: auto;
  left: 100%;
}

/* Scattered gold dust with a few red flecks. Each layer repeats on a different odd-sized tile so the
   specks never line up into a grid. Fades out towards the page. */
.bf-rail::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background:
    radial-gradient(circle, rgba(255, 236, 170, .95) 0 1px, transparent 2px) 13px 21px / 97px 89px,
    radial-gradient(circle, rgba(242, 193, 78, .8) 0 1.5px, transparent 3px) 61px 7px / 131px 113px,
    radial-gradient(circle, rgba(255, 244, 207, .45) 0 2px, transparent 6px) 37px 64px / 173px 157px,
    radial-gradient(circle, rgba(215, 20, 26, .7) 0 1.5px, transparent 3px) 90px 40px / 149px 191px;
  -webkit-mask-image: linear-gradient(to right, #000, transparent 90%);
  mask-image: linear-gradient(to right, #000, transparent 90%);
}
.bf-rail--right::before {
  -webkit-mask-image: linear-gradient(to left, #000, transparent 90%);
  mask-image: linear-gradient(to left, #000, transparent 90%);
}

/* Held at the middle of the screen while the page scrolls. --bf-half is half the box's height, so
   sticky itself centres the box and keeps all of it inside the rail: at the end of the page the box
   rests on the bottom of the rail and scrolls away with it. */
.bf-rail__inner {
  position: sticky;
  top: 0;
  top: max(0px, calc(50vh - var(--bf-half, 0px)));
  box-sizing: border-box;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: radial-gradient(closest-side, rgba(242, 193, 78, .16), transparent);
}
/* A rail shorter than the screen (empty cart and other short pages) can't hold the box at the middle
   of the screen, so centre it in the rail instead. */
@container (max-height: 100vh) {
  .bf-rail__inner {
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    padding: 0;
  }
}
/* Too short for the words at all: keep just the black and the dust. */
@container (max-height: 260px) {
  .bf-rail__inner {
    display: none;
  }
}

/* Words stacked horizontally and sized to the gutter width. FRIDAY, the widest line, runs about 2.8em
   in Anton, so 28cqw leaves a margin either side. From a 1712px screen up the gutter is wide enough,
   so the text and tags stop growing and every larger screen gets the same size. */
.bf-rail__spine {
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1;
  font-size: min(calc((100vw - 1140px) * .14), 80px);
  font-size: min(28cqw, 80px, 22cqh);
  /* Slightly mis-registered cyan and magenta plates, like a print run caught mid-press. */
  filter: drop-shadow(-.035em 0 0 rgba(0, 174, 239, .75)) drop-shadow(.035em .02em 0 rgba(236, 0, 140, .6));
}
/* Each right-hand line is sized to run as wide as FRIDAY on the left. Anton widths: FRIDAY 2.50em,
   BIGGEST 2.94em, DEALS 2.25em, OF THE YEAR 4.48em. */
.bf-rail--right .bf-rail__spine > :nth-child(1) {
  font-size: .85em;
}
.bf-rail--right .bf-rail__spine > :nth-child(2) {
  font-size: 1.11em;
}
.bf-rail--right .bf-rail__spine > :nth-child(3) {
  font-size: .56em;
}
/* Metallic gold banded down each line, plus a highlight that sweeps across it. */
.bf-rail__spine > * {
  color: #f2c14e;
  background:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .9) 50%, transparent 58%) 140% 0 / 300% 100% no-repeat,
    linear-gradient(to bottom, #fff4cf 0%, #f8e6a0 22%, #d4a23c 48%, #6e440b 54%, #b9852d 66%, #f8e6a0 86%, #fff4cf 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: bf-sheen 6s ease-in-out infinite;
}
@keyframes bf-sheen {
  0%, 55% {
    background-position: 140% 0, 0 0;
  }
  100% {
    background-position: -40% 0, 0 0;
  }
}

.bf-rail__tag {
  font-size: clamp(16px, calc((100vw - 1140px) * .08), 46px);
  font-size: clamp(16px, 16cqw, 46px);
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: #d7141a;
  padding: .18em .5em .12em;
  border-radius: 3px;
  transform: rotate(-8deg);
  box-shadow: 0 0 0 2px #000, 0 0 0 4px #f2c14e, 0 8px 24px rgba(215, 20, 26, .45);
}
.bf-rail--right .bf-rail__tag {
  font-size: clamp(13px, 11cqw, 31px);
  transform: rotate(4deg);
}
.bf-rail__note {
  margin: 0 0 -12px;
  font: 13px/1.3 "Roboto", sans-serif;
  color: #d6d6d6;
  text-align: center;
  max-width: 80%;
}

@media (prefers-reduced-motion: reduce) {
  .bf-rail__spine > * {
    animation: none;
  }
}
@media print {
  .bf-rail,
  .bf-backdrop {
    display: none !important;
  }
}
