/*
 * frvr.com's header and footer (inc/chrome.php). Ported from frvr-website-generator's
 * src/scss/base/_header.scss and _footer.scss (Bootstrap breakpoints: sm 576, md 768, lg 992);
 * keep the two in step.
 */

@font-face {
  font-family: 'Lilita One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/lilita-one/lilita-one-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

.frvr-chrome {
  --frvr-bar: #161a3d;
  --frvr-navy: #1e2250;
  --frvr-light: #fff;
  --frvr-light-grey: #d5daee;
  --frvr-yellow: #ffc93c;
  --frvr-display: 'Lilita One', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --frvr-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--frvr-light);
  font-family: var(--frvr-sans);
  font-size: 16px;
  line-height: 1.5;
}

.frvr-chrome ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.frvr-chrome a {
  text-decoration: none;
}

/* The template part around the header (a <header> or <div>) is what sticks: the header alone would
   only stick within that wrapper's own height */
.wp-site-blocks > :has(> #page-header) {
  position: sticky;
  top: 0;
  z-index: 100;
  margin-block-start: 0;
}

.admin-bar .wp-site-blocks > :has(> #page-header) {
  top: var(--wp-admin--admin-bar--height, 0px);
}

/* --- Header bar --- */

#page-header {
  background: var(--frvr-bar);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* Solid drop edge under the bar, echoing the pop controls' lip */
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.28);
}

#page-header .header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
}

#page-header .header-bar-side {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

#page-header .header-bar-logo {
  display: flex;
  align-items: center;
}

#page-header .frvr-logo {
  display: block;
  width: 105px;
  height: 24px;
}

#page-header .header-bar-nav {
  display: flex;
}

#page-header .nav-item:not(:last-child) {
  margin-right: 16px;
}

#page-header .nav-link {
  position: relative;
  display: block;
  padding: 14px 0;
  color: var(--frvr-light-grey);
  font-family: var(--frvr-display);
  font-size: 16px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.15s ease;
}

/* Yellow like the active item, as on frvr.com */
#page-header .nav-link:hover,
#page-header .nav-link:focus-visible,
#page-header .section-bar-nav a:focus-visible {
  color: var(--frvr-yellow);
}

#page-header .nav-link:focus-visible,
#page-header .section-bar-nav a:focus-visible {
  outline: 2px solid var(--frvr-yellow);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Active item: yellow label with a solid yellow bar on the header's bottom edge (not a pill: the
   section row below uses a lighter treatment, so the two tiers read differently) */
#page-header .nav-item.active .nav-link {
  color: var(--frvr-yellow);
}

#page-header .nav-item.active .nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--frvr-yellow);
}

/* Secondary site links drop off on narrower screens, as on frvr.com; the section you're in stays */
@media (max-width: 991.98px) {
  #page-header .nav-item--2,
  #page-header .nav-item--3,
  #page-header .nav-item--4:not(.active),
  #page-header .nav-item--5:not(.active) {
    display: none;
  }
}

@media (max-width: 575.98px) {
  #page-header .frvr-logo {
    width: 40px;
    height: 24px;
  }
}

@media (max-width: 380px) {
  #page-header .nav-link {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  #page-header .header-bar {
    padding: 0 24px;
  }

  #page-header .header-bar-side {
    gap: 24px;
  }

  #page-header .header-bar-nav {
    margin-left: 24px;
  }

  #page-header .nav-item:not(:last-child) {
    margin-right: 8px;
  }

  #page-header .nav-link {
    padding: 14px 16px;
    font-size: 17px;
  }

  #page-header .nav-item.active .nav-link::after {
    left: 16px;
    right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-header .nav-link {
    transition: none;
  }
}

/* Dark mode toggle, where frvr.com has its account menu */
#page-header .header-scheme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--frvr-light-grey);
  cursor: pointer;
  transition: color 0.15s ease;
}

#page-header .header-scheme:hover {
  color: var(--frvr-yellow);
}

#page-header .header-scheme:focus-visible {
  outline: 2px solid var(--frvr-yellow);
  outline-offset: 2px;
}

#page-header .header-scheme-light,
html[data-scheme='dark'] #page-header .header-scheme-dark {
  display: none;
}

html[data-scheme='dark'] #page-header .header-scheme-light {
  display: block;
}

/* --- Section row: the blog's categories, or support's pages --- */

#page-header .section-bar {
  background: var(--frvr-navy);
  /* Scrolls sideways on phones rather than wrapping */
  overflow-x: auto;
  scrollbar-width: none;
}

#page-header .section-bar::-webkit-scrollbar {
  display: none;
}

#page-header .section-bar-nav {
  display: flex;
  gap: 4px;
  width: max-content;
  padding: 0 16px;
}

#page-header .section-bar-nav a {
  display: block;
  padding: 9px 10px;
  color: var(--frvr-light);
  font-family: var(--frvr-display);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#page-header .section-bar-nav a:hover {
  color: var(--frvr-yellow);
}

#page-header .section-bar-nav .active a {
  color: var(--frvr-yellow);
}

@media (min-width: 768px) {
  #page-header .section-bar-nav {
    padding: 0 30px;
  }
}

/* --- Footer --- */

/* The canvas past the page's end (iOS overscroll, a short page) continues the footer, not white */
html:has(#page-footer) {
  background: #161a3d;
}

#page-footer {
  position: relative;
  padding: 40px 16px 24px;
  background: var(--frvr-bar);
  /* Solid "pop" edge, mirroring the header's drop edge */
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.28);
}

#page-footer a {
  color: var(--frvr-light);
}

#page-footer a:hover {
  color: var(--frvr-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#page-footer p {
  margin: 0;
}

#page-footer .frvr-logo {
  display: block;
}

#page-footer .footer-main {
  display: grid;
  gap: 32px;
}

#page-footer .footer-tagline {
  margin: 14px 0 6px;
  color: var(--frvr-light);
  font-family: var(--frvr-display);
  font-size: 26px;
  line-height: 32px;
  letter-spacing: 0.02em;
}

#page-footer .footer-address,
#page-footer .footer-cols a,
#page-footer .footer-smallprint {
  font-size: 15px;
  line-height: 1.5;
}

#page-footer .footer-address {
  margin: 0;
  font-style: normal;
  color: var(--frvr-light-grey);
}

#page-footer .footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

#page-footer .footer-cols li + li {
  margin-top: 8px;
}

#page-footer .footer-heading {
  margin: 0 0 12px;
  color: var(--frvr-yellow);
  font-family: var(--frvr-display);
  font-size: 18px;
  line-height: 27px;
  letter-spacing: 0.02em;
}

#page-footer .footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#page-footer .footer-smallprint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--frvr-light-grey);
}

#page-footer .footer-social {
  display: flex;
  /* Eight buttons: wrap rather than overflow on the narrowest phones */
  flex-wrap: wrap;
  gap: 12px 10px;
  padding: 0 0 4px;
}

/* Round pop icon buttons (white stroke + lip), each in its network's colour */
#page-footer a.footer-social-btn {
  --fill: #3b82f6;
  --lip: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--fill);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 4px 0 2px var(--lip);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

#page-footer a.footer-social-btn:hover,
#page-footer a.footer-social-btn:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 6px 0 2px var(--lip);
}

#page-footer a.footer-social-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 2px 0 2px var(--lip);
}

#page-footer a.footer-social-btn:focus-visible {
  outline: 3px solid var(--frvr-yellow);
  outline-offset: 4px;
}

#page-footer a.footer-social-btn--youtube { --fill: #ff1f3d; --lip: #b80f27; }
#page-footer a.footer-social-btn--x { --fill: #14171f; --lip: #000; }
#page-footer a.footer-social-btn--facebook { --fill: #1877f2; --lip: #0b4fb0; }
#page-footer a.footer-social-btn--linkedin { --fill: #0a66c2; --lip: #06427f; }
#page-footer a.footer-social-btn--tiktok { --fill: #14171f; --lip: #000; }
#page-footer a.footer-social-btn--spotify { --fill: #1db954; --lip: #12813a; }
#page-footer a.footer-social-btn--googleplay { --fill: #01875f; --lip: #015a3f; }
#page-footer a.footer-social-btn--appstore { --fill: #0d96f6; --lip: #0869ae; }

@media (prefers-reduced-motion: reduce) {
  #page-footer a.footer-social-btn {
    transition: none;
  }

  #page-footer a.footer-social-btn:hover,
  #page-footer a.footer-social-btn:active {
    transform: none;
  }
}

@media (min-width: 576px) {
  #page-footer .footer-social {
    column-gap: 14px;
  }
}

@media (min-width: 768px) {
  #page-footer {
    padding: 56px 40px 28px;
  }

  #page-footer .footer-main {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr);
    gap: 48px;
  }

  #page-footer .footer-tagline-end {
    display: block;
  }
}

/* The theme underlines every link on hover; frvr.com's header links only change colour */
#page-header a:hover {
  text-decoration: none !important;
}

/* Tutorials and FAQs after the blog's categories, set apart: only where the header row above hides them */
#page-header .section-bar-divider {
  display: flex;
  align-items: center;
}

#page-header .section-bar-divider::before {
  content: '';
  width: 1px;
  height: 18px;
  margin: 0 8px 0 4px;
  background: rgba(255, 255, 255, 0.25);
}

@media (min-width: 992px) {
  #page-header .section-bar-divider,
  #page-header .section-bar-divider + li {
    display: none;
  }
}

/*
 * Raptive's (AdThrive's) footer line on production, appended after the footer by its script: privacy
 * preferences, content terms and "A Raptive Partner Site". Styled as the footer's last row.
 */
body .adthrive-footer-message {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 20px;
  margin: 0;
  padding: 14px 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #161a3d;
  /* On phones Raptive sets a bottom margin to keep the line clear of its sticky ad;
     painted navy, not page grey, by copies of the box stepped down less than its height */
  box-shadow: 0 40px 0 #161a3d, 0 80px 0 #161a3d;
  color: #d5daee;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

body .adthrive-footer-message > div,
body .adthrive-footer-message > span {
  margin: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

body .adthrive-footer-message a,
body .adthrive-footer-message a.raptive-content-terms-footer-link {
  color: #fff;
  font: inherit;
  text-decoration: none;
}

body .adthrive-footer-message a:hover,
body .adthrive-footer-message a:focus-visible {
  color: #ffc93c;
  text-decoration: underline;
  text-underline-offset: 3px;
}
