/* TDR-4688 header sizing and current-page underline. TDR-4689 footer. */

/* BEST Hub Newsroom desktop header: 132px tall (131px + 1px #CFCDC9 divider), logo 203x45, hero starts directly below. */
@media (min-width: 1200px) {
  .figma-site-header {
    min-height: 132px;
    margin-bottom: 0;
    padding: 0 50px;
    border-bottom: 1px solid #cfcdc9;
  }

  .figma-site-header > .container-fluid,
  .figma-site-header .figma-site-header__collapse {
    min-height: 131px;
  }

  .figma-site-header .figma-site-header__collapse {
    width: 100%;
  }

  .figma-site-header .figma-site-header__nav {
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
  }

  .figma-site-header .figma-site-header__nav > .site-logo {
    margin-right: auto;
  }

  .figma-site-header .figma-site-header__nav > .site-logo .logo-desktop {
    width: calc(203px * 1.1);
    height: calc(45px * 1.1);
    min-width: calc(203px * 1.1);
  }

  .figma-site-header .figma-site-header__nav > .nav-item > .nav-link {
    position: relative;
    top: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: 0.07em;
  }

  .figma-site-header .figma-site-header__nav > .nav-item {
    align-self: stretch;
    display: flex;
    align-items: center;
  }

  .figma-site-header .figma-site-header__nav .dropdown-menu {
    top: 100%;
    min-width: 220px;
    margin-top: 0;
    padding: 4px 0;
    border: 1px solid #c8c4bc;
    border-radius: 0;
    background: #fefcf7;
    box-shadow: none;
  }

  .figma-site-header .figma-site-header__nav .dropdown-item {
    padding: 10px 16px;
    color: #484848;
    font-family: DIN2014-Regular, "DIN 2014", Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.07em;
    line-height: 20px;
    text-decoration: none;
    text-transform: uppercase;
  }

  /* Match the Filter dropdown: gray stroke, gray fill on hover, no underline.
     The accessibility rule paints these items navy with an underline, so this needs to outrank it. */
  .tapestry-accessibility-updates .figma-site-header .navbar-nav.figma-site-header__nav ul.dropdown-menu .dropdown-item:hover,
  .tapestry-accessibility-updates .figma-site-header .navbar-nav.figma-site-header__nav ul.dropdown-menu .dropdown-item:focus,
  .tapestry-accessibility-updates .figma-site-header .navbar-nav.figma-site-header__nav ul.dropdown-menu .dropdown-item:focus-visible,
  .tapestry-accessibility-updates .figma-site-header .navbar-nav.figma-site-header__nav ul.dropdown-menu .dropdown-item:active,
  .figma-site-header .figma-site-header__nav .dropdown-item:hover,
  .figma-site-header .figma-site-header__nav .dropdown-item:focus-visible {
    background: #f3efe6;
    background-color: #f3efe6;
    color: #484848;
    opacity: 1;
    text-decoration: none;
    outline: 0;
  }

  .figma-site-header .figma-site-header__nav .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -16px;
    right: 0;
    left: 0;
    height: 16px;
  }
}

/* Supplier portal: six long labels. Spacing and type scale with the window so every item stays
   on screen from 1200px up, and reach the 16px / 40px design values on wide screens. */
@media (min-width: 1200px) {
  .figma-site-header--supplier {
    padding: 0 clamp(20px, 2.6vw, 50px);
  }

  .figma-site-header--supplier .figma-site-header__nav {
    gap: clamp(14px, 1.7vw, 40px);
  }

  .figma-site-header--supplier .figma-site-header__nav > .site-logo .logo-desktop {
    width: clamp(150px, 14vw, calc(203px * 1.1));
    height: auto;
    min-width: 0;
  }

  .figma-site-header--supplier .figma-site-header__nav > .nav-item > .nav-link {
    font-size: clamp(12px, 1.05vw, 16px);
    letter-spacing: 0.05em;
    white-space: nowrap;
  }
}

/* No spacing between the header and the page's first block (the featured-story hero). */
.page-template-page-sidebar-none #content,
.page-template-page-sidebar-none .site-main,
.page-template-page-sidebar-none .entry-header,
.page-template-page-sidebar-none .entry-content {
  margin-top: 0;
  padding-top: 0;
}

.page-template-page-sidebar-none .entry-header:not(:has(*)) {
  display: none;
}

.page-template-page-sidebar-none .entry-content > .newsroom-featured-story:first-child {
  margin-top: 0;
}

/* Every top-level item (Company, Brands, Responsibility, Investors, Careers, Newsroom)
   uses the same underline on hover as the active item. Parent :hover keeps it while a dropdown is open. */
.figma-site-header .figma-site-header__nav > .nav-item:hover > .nav-link,
.figma-site-header .figma-site-header__nav > .nav-item:focus-within > .nav-link,
.figma-site-header .figma-site-header__nav > .nav-item.show > .nav-link,
.figma-site-header .figma-site-header__nav > .nav-item > .nav-link:hover,
.figma-site-header .figma-site-header__nav > .nav-item > .nav-link:focus-visible,
.figma-site-header .figma-site-header__nav > .nav-item.is-active > .nav-link {
  text-decoration-line: underline !important;
  text-decoration-thickness: 1px !important;
  text-underline-offset: 6px;
}

@media (min-width: 1200px) {
  .figma-site-header .figma-site-header__nav > .nav-item:hover > .nav-link,
  .figma-site-header .figma-site-header__nav > .nav-item:focus-within > .nav-link,
  .figma-site-header .figma-site-header__nav > .nav-item.show > .nav-link,
  .figma-site-header .figma-site-header__nav > .nav-item > .nav-link:hover,
  .figma-site-header .figma-site-header__nav > .nav-item > .nav-link:focus-visible {
    border-bottom: 0;
  }
}

/* Desktop footer sizing. Below 1200px the global footer styles from _bscore_custom.scss apply (Figma mobile). */
@media (min-width: 1200px) {
  .global-site-footer {
    padding: 64px 50px 28px;
  }

  .global-site-footer__heading,
  .global-site-footer__submenu a {
    font-size: 14px;
    letter-spacing: 0.06em;
    line-height: 1.3;
  }

  .global-site-footer__heading {
    margin-bottom: 18px;
  }

  .global-site-footer__submenu {
    gap: 14px;
  }

  .global-site-footer__legal {
    margin-top: 40px;
    font-size: 12px;
    line-height: 18px;
  }

  /* Footer logo shares the nav's 50px left edge. A centered max-width column sits further right. */
  .global-site-footer__container {
    max-width: none;
    margin: 0;
  }

  .global-site-footer__top {
    justify-content: flex-start;
  }

  .global-site-footer__logo-link {
    margin-left: 0;
  }
}

/* Mobile header: the newsroom hamburger is three 2px strokes, 19x14, on every page. */
@media (max-width: 1199.98px) {
  .figma-site-header .navbar-toggler.collapsed .big-cross-sign {
    width: 19px;
    height: 14px;
    min-width: 19px;
    min-height: 14px;
    background-image: url("../img/newsroom/newsroom-hamburger.svg");
    background-size: 19px 14px;
  }

  /* Footer logo shares the menu labels' left edge. A centered logo link sits in the middle of the column. */
  .global-site-footer__container {
    max-width: none;
    margin: 0;
  }

  .global-site-footer__top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .global-site-footer__logo-link {
    display: block;
    flex: 0 0 auto;
    align-self: flex-start;
    width: 114px;
    margin: 0 0 30px;
    text-align: left;
  }

  .global-site-footer__logo {
    display: block;
    width: 114px;
    height: 25px;
    margin: 0;
    object-fit: contain;
    object-position: left center;
  }
}

/* Block backgrounds: any block section saved with a white background uses the site colour (#fefcf7).
   Limited to block wrappers; buttons, inputs, dialogs and image badges keep their own colours. */
:is(main, .entry-content) :is(section, div, figure, aside, article)[class*="wp-block-"]:is(
  [style*="background-color:#fff;"],
  [style*="background-color: #fff;"],
  [style*="background-color:#ffffff"],
  [style*="background-color: #ffffff"],
  [style*="background-color:white"],
  [style*="background-color: white"],
  [style*="background:#fff"],
  [style*="background: #fff"],
  [style*="background:#ffffff"],
  [style*="background: #ffffff"],
  [style*="background:white"],
  [style*="background: white"]
),
:is(main, .entry-content) .has-white-background-color,
:is(main, .entry-content) .has-background.has-white-background-color {
  background-color: #fefcf7 !important;
}
