/* =========================================================================
   NN Brand Strip - the shop-by-brand row (effort 14).

   Only what is new to the house is written here: the strip's own edge and
   air, its heading and its quiet door, the sliding row's width, the brand
   card, the logo slot, the quiet difference an empty brand carries, and the
   two light arrows.

   Numbers are the approved prototype's (`.prototype/shop-by-brand/`): the
   card is 288 wide on a computer and 200 on a phone, the pictures are square
   and bare, the logo box sits above the name with both centred, the name is
   the 16 rung and the quiet line is the overline rung.

   House tokens only: ivory ground, charcoal words, stone for a quiet mark.
   One deliberate bend from the house rules, by the owner's explicit choice:
   the arrows are the shop's only rounded, filled surface.

   The 96 / 56 air under the banner is deliberate - a full 192 / 112 pair
   there pushes the first block below the fold. It flips in one place.
   ========================================================================= */

/* --- 1. The strip's edge and its air ------------------------------------
   The whole strip keeps the goods column's own edge - 24 on a computer, 16 on
   a phone, one edge top to bottom - and carries 96 of air above and below on
   a computer, 56 on a phone. */

.nn-bs {
  position: relative;
  box-sizing: border-box;
  display: block;
  width: 100%;
  margin: 0;
  padding-block: 96px;
  background: var(--color-ivory, #F4F1EA);
  color: var(--color-charcoal, #20201F);
  font-family: var(--font-body, Manrope, sans-serif);
  -webkit-font-smoothing: antialiased;
}

/* The builder wraps page content in its own narrow column. The wrapper that
   holds the strip is widened to the window, exactly as the shop's grid and
   the brand sections do, so the cards can bleed past the column's edge. A
   strip dropped on a plain page (a scratch page, a campaign page) widens the
   page's own column the same way. */

.e-con:has(> .nn-bs),
.elementor-element:has(> .nn-bs),
.page-content:has(> .nn-bs),
.site-main:has(> .page-content > .nn-bs) {
  box-sizing: border-box;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* The builder prints a lone closing tag after a shortcode, and the browser
   reads it as one more empty paragraph worth about 58px of phantom air. The
   measured pairs above only hold when it draws nothing. A paragraph with
   words in it is untouched, and the strip itself is never hidden. */

.e-con:has(> .nn-bs) > p:empty,
.elementor-element:has(> .nn-bs) > p:empty,
.page-content:has(> .nn-bs) > p:empty,
.nn-bs + p:empty {
  display: none;
}

@media (max-width: 767px) {
  .nn-bs {
    padding-block: 56px;
  }
}

/* --- 2. The heading and the quiet door ----------------------------------
   The shop's own section-heading rung: 40 on a computer, 28 on a phone. The
   heading is plain text and never a link; the door beside it carries the way
   out, in the same words the page's other doors into The Shop already use. */

.nn-bs__head {
  box-sizing: border-box;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-inline: 24px;
}

.nn-bs__title {
  margin: 0;
  font-family: var(--font-body, Manrope, sans-serif);
  font-size: 40px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--color-charcoal, #20201F);
}

/* Two classes on the selector, because the page's own link rule
   (".page-content a") underlines every link inside page content. */

.nn-bs .nn-bs__door {
  flex: none;
  display: inline-block;
  padding: 0 0 3px;
  font-family: var(--font-body, Manrope, sans-serif);
  font-size: var(--type-label-md-size, 12px);
  font-weight: var(--type-label-md-weight, 600);
  line-height: var(--type-label-md-leading, 1.2);
  letter-spacing: 0.096em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-charcoal, #20201F);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--color-charcoal, #20201F);
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
}

.nn-bs .nn-bs__door:hover,
.nn-bs .nn-bs__door:focus-visible {
  color: var(--color-stone, #A79D91);
  border-bottom-color: var(--color-stone, #A79D91);
  text-decoration: none;
}

.nn-bs .nn-bs__door:focus-visible {
  outline: 2px solid var(--color-charcoal, #20201F);
  outline-offset: 3px;
}

/* --- 3. The row --------------------------------------------------------
   One viewport that clips at the goods edge, one rail of cards inside it, and
   the two arrows on the picture's middle line at the row's sides.

   With the script blocked nothing is transformed, nothing is clipped away and
   the two arrows are not drawn: the rail simply wraps, and the six cards,
   their links and the words are one plain row. */

.nn-bs__row {
  position: relative;
  box-sizing: border-box;
  margin-top: 56px;
  padding-inline: 24px;
}

.nn-bs__viewport {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  /* A sideways drag belongs to the row; an up-and-down one still scrolls the
     page. Without this the browser keeps the horizontal drag for itself. */
  touch-action: pan-y;
}

/* A card is a link and a picture, and a browser's own image drag would take a
   drag out of the row's hands the moment the pointer moved: it cancels the
   stream and the row never follows. The pictures are not draggable things. */

.nn-bs__rail img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.nn-bs__rail {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}

/* The script's own mark on the section. Only then does the rail become one
   travelling row, and only then are the arrows drawn. */

.nn-bs--live .nn-bs__rail {
  flex-wrap: nowrap;
  transform: translate3d(0, 0, 0);
  transition: transform var(--nn-bs-travel, 0.5s) var(--nn-bs-easing, ease-in-out);
}

.nn-bs--still .nn-bs__rail {
  transition: none;
}

/* --- 4. The card -------------------------------------------------------
   Top to bottom: the square picture, the logo box, the name, and - on an
   empty brand only - one quiet line. The whole card is one link. */

.nn-bs__card {
  box-sizing: border-box;
  flex: 0 0 var(--nn-bs-card-w, 288px);
  width: var(--nn-bs-card-w, 288px);
  max-width: var(--nn-bs-card-w, 288px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nn-bs .nn-bs__link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
  text-align: center;
}

.nn-bs .nn-bs__link:hover,
.nn-bs .nn-bs__link:focus-visible {
  text-decoration: none;
}

.nn-bs .nn-bs__link:focus-visible {
  outline: 2px solid var(--color-charcoal, #20201F);
  outline-offset: 4px;
}

/* The picture: square 1:1, bare - no border, no rounding, no shadow, no box -
   and cover-cropped at the centre so the square is always filled. The box
   carries three classes' worth of weight because the parent theme's own image
   reset (img { height: auto; max-width: 100% }) and the builder's image rule
   both outrank a single class, and either one cuts the foot of the picture. */

.nn-bs .nn-bs__hero {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: var(--color-ivory, #F4F1EA);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.nn-bs .nn-bs__hero > .nn-bs__hero-img {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  object-fit: cover;
  object-position: 50% 50%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}

/* A world with no picture of its own draws the quiet sand ground, bare, with
   nothing written on it. The square is the same square a photograph fills. */

.nn-bs .nn-bs__hero > .nn-bs__hero-ground {
  position: absolute;
  inset: 0;
  display: block;
  background-color: var(--color-sand, #E8E1D6);
}

/* The logo slot sits above the name and is always filled: the brand's own
   mark where it has one, the builder's stand-in picture where it does not. */

.nn-bs .nn-bs__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 72px;
  height: 44px;
  margin: 16px auto 0;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}

.nn-bs .nn-bs__logo > .nn-bs__logo-img {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  object-fit: contain;
  object-position: 50% 50%;
}

/* A stand-in picture fills its box like a picture, not like a mark. */
.nn-bs .nn-bs__logo > .nn-bs__logo-img--standin {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nn-bs .nn-bs__name {
  display: block;
  margin: 12px 0 0;
  font-family: var(--font-body, Manrope, sans-serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--color-charcoal, #20201F);
}

/* The quiet line under an empty brand's name: the overline rung in stone,
   printed exactly as stored - title case, never uppercase, no badge, no
   world colour, no mark. */

.nn-bs .nn-bs__soon {
  display: block;
  margin: 8px 0 0;
  font-family: var(--font-body, Manrope, sans-serif);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 1.4px;
  text-transform: none;
  color: var(--color-stone, #A79D91);
}

/* --- 5. The quiet difference of an empty brand -------------------------
   The picture is muted over the ivory ground and the name softens to a
   tint of the same charcoal - not a fifth colour. The card keeps its place,
   and the difference leaves by itself the moment the world holds a piece. */

.nn-bs .nn-bs__card--empty .nn-bs__hero > .nn-bs__hero-img {
  opacity: 0.55;
}

/* A ground with no photograph behind it is already quiet; muting it again
   would read as a fault, so it keeps its own strength. */
.nn-bs .nn-bs__card--empty .nn-bs__hero > .nn-bs__hero-ground {
  opacity: 1;
}

.nn-bs .nn-bs__card--empty .nn-bs__name {
  color: #4a4741;
}

/* --- 6. The two arrows -------------------------------------------------
   The banner's own arrow, in light. Same size, same soft square, same mark,
   same offsets - only the fill is inverted, so a light button carries the
   house charcoal instead of a dark button carrying white. The owner asked for
   one arrow design across the shop, so this is the banner's drawing moved
   here rather than a second arrow invented for the strip.

   They sit on the picture's middle line, 16px inside the row's own edge on a
   computer and 8px on a phone - exactly where the banner's stand inside its
   picture. One card per press; they never disable and never hide, because the
   row has no ends.

   Every state is written out, background, border, colour and appearance
   included, because the parent theme paints hovered and focused buttons pink
   (#cc3366) and these are buttons. */

.nn-bs__arrow {
  position: absolute;
  top: calc(var(--nn-bs-card-w, 288px) / 2);
  z-index: 5;
  box-sizing: border-box;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(255, 255, 255, 0.92);
  background-image: none;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(24, 22, 20, 0.18);
  color: #20201F;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
  text-decoration: none;
  text-shadow: none;
  transition: background-color 0.2s ease;
}

.nn-bs--live .nn-bs__arrow {
  display: flex;
}

/* 24px of goods edge + the banner's own 16px inset. */
.nn-bs__arrow--prev {
  left: 40px;
}

.nn-bs__arrow--next {
  right: 40px;
}

.nn-bs__arrow:hover,
.nn-bs__arrow:focus,
.nn-bs__arrow:active,
.nn-bs__arrow:focus-visible {
  appearance: none;
  -webkit-appearance: none;
  background-color: #ffffff;
  background-image: none;
  border: 0;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(24, 22, 20, 0.18);
  color: #20201F;
  text-decoration: none;
  text-shadow: none;
}

.nn-bs__arrow:focus-visible {
  outline: 2px solid #20201F;
  outline-offset: 2px;
}

/* The mark inside the arrow: two sides of a square, turned - the banner's own
   mark, drawn in the house charcoal instead of white. */

.nn-bs__chev {
  display: block;
  width: 10px;
  height: 10px;
  border: 0;
  border-top: 2px solid #20201F;
  border-right: 2px solid #20201F;
  border-radius: 0;
  background: none;
}

.nn-bs__arrow--prev .nn-bs__chev {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.nn-bs__arrow--next .nn-bs__chev {
  transform: rotate(45deg) translate(-1px, 1px);
}

/* --- 7. The phone -----------------------------------------------------
   200-wide cards, 16 gaps, 60x38 logo box, 28 heading, 36 arrows 8 in from
   the edge. About one and three-quarter cards stand in the window and the
   next one always peeks. */

@media (max-width: 767px) {
  .nn-bs {
    --nn-bs-card-w: 200px;
  }

  .nn-bs__head {
    gap: 14px;
    padding-inline: 16px;
  }

  .nn-bs__title {
    font-size: 28px;
  }

  .nn-bs__row {
    padding-inline: 16px;
  }

  .nn-bs .nn-bs__logo {
    width: 60px;
    height: 38px;
  }

  .nn-bs__arrow {
    width: 36px;
    height: 36px;
    border-radius: 2px;
  }

  .nn-bs__arrow:hover,
  .nn-bs__arrow:focus,
  .nn-bs__arrow:active,
  .nn-bs__arrow:focus-visible {
    border-radius: 2px;
  }

  /* 16px of goods edge + the banner's own 8px inset. */
  .nn-bs__arrow--prev {
    left: 24px;
  }

  .nn-bs__arrow--next {
    right: 24px;
  }

  .nn-bs__chev {
    width: 8px;
    height: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nn-bs__arrow {
    transition: none;
  }
}

/* --- 8. Less motion ---------------------------------------------------
   A visitor who asks their machine for less motion gets a still row: no
   travel at all, and the arrows step one card instantly. */

@media (prefers-reduced-motion: reduce) {
  .nn-bs--live .nn-bs__rail {
    transition: none !important;
  }
}
