/* Header and the "Alla guider" drawer (theme-parts/header.html, js/40-menu.js).
   The inline row only shows where all its links fit on one line; below that the
   Meny button is the whole navigation. */

/* -- Main bar --------------------------------------------------------- */
/* WP pads every group with a background (1.25em 2.375em); on top of the global
   padding that pushed the wordmark ~40px inside the page's text edge. */
.kr-masthead.gg-masthead {
  padding: 0;
}
.gg-masthead .kr-masthead__main {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}
.gg-masthead .gg-masthead__row {
  width: 100%; /* the flex row otherwise shrink-wraps and centres, pushing the wordmark in */
  gap: 1rem;
}
.gg-masthead .kr-masthead__nav,
.gg-inline-nav .wp-block-navigation__container {
  gap: 1.25rem;
  align-items: center;
}
/* WP sets .wp-block-navigation-item__content to display:block, which pins the
   label to the top of the 44px target. */
.gg-inline-nav .wp-block-navigation-item a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
@media (max-width: 1099px) {
  .gg-masthead .kr-masthead__nav .gg-inline-nav {
    display: none;
  }
}

/* -- Menu button ------------------------------------------------------ */
.gg-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  min-height: 44px;
  padding: 0 1rem;
  font-family: var(--kr-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kr-paper);
  background: var(--kr-ink);
  border: 0;
  border-radius: var(--kr-r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease;
}
.gg-menu-btn:hover {
  background: var(--kr-pencil);
}
.gg-menu-btn:focus-visible {
  outline: 2px solid var(--kr-rea);
  outline-offset: 2px;
}
.gg-menu-btn__icon {
  fill: currentColor;
  flex: none;
}
.gg-menu-btn__long {
  display: none;
}
@media (min-width: 1100px) {
  .gg-menu-btn__short {
    display: none;
  }
  .gg-menu-btn__long {
    display: inline;
  }
}

/* -- Drawer ----------------------------------------------------------- */
.gg-menu[hidden] {
  display: none;
}
.gg-menu {
  position: fixed;
  inset: 0;
  z-index: 100; /* above the sticky CTA and toplist button (60) */
}
.gg-menu__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--kr-ink) 45%, transparent);
  animation: gg-fade 160ms ease-out;
}
.gg-menu__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(100%, 34rem);
  display: flex;
  flex-direction: column;
  background: var(--kr-paper);
  box-shadow: -12px 0 32px -16px color-mix(in srgb, var(--kr-ink) 50%, transparent);
  animation: gg-slide 200ms var(--kr-ease, ease-out);
}
@keyframes gg-fade {
  from { opacity: 0; }
}
@keyframes gg-slide {
  from { transform: translateX(2.5rem); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .gg-menu__backdrop,
  .gg-menu__panel {
    animation: none;
  }
}

.gg-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  border-top: var(--kr-masthead-rule, 4px) solid var(--kr-ink);
  border-bottom: var(--kr-rule-strong);
}
.gg-menu__brand {
  font-family: var(--kr-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--kr-ink);
  text-decoration: none;
}
.gg-menu__brand::after {
  content: ".";
  color: var(--kr-rea);
}
.gg-menu__close {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: 44px;
  padding: 0 0.9rem;
  font-family: var(--kr-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kr-ink);
  background: transparent;
  border: 1px solid var(--kr-dot);
  border-radius: var(--kr-r-sm);
  cursor: pointer;
}
.gg-menu__close:hover {
  border-color: var(--kr-ink);
}
.gg-menu__close:focus-visible {
  outline: 2px solid var(--kr-rea);
  outline-offset: 2px;
}

.gg-menu__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 1.25rem 1.5rem;
}
.gg-menu__group {
  border-bottom: var(--kr-rule);
}
.gg-menu__group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
  font-family: var(--kr-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--kr-ink);
  cursor: pointer;
  list-style: none;
}
.gg-menu__group summary::-webkit-details-marker {
  display: none;
}
.gg-menu__group summary::after {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.3rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-25%) rotate(45deg);
  transition: transform 160ms ease;
}
.gg-menu__group[open] summary::after {
  transform: translateY(25%) rotate(-135deg);
}
.gg-menu__group summary:focus-visible {
  outline: 2px solid var(--kr-rea);
  outline-offset: 2px;
}
.gg-menu__group ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0.9rem;
  display: grid;
  grid-template-columns: 1fr;
  column-gap: 1.25rem;
}
@media (min-width: 30rem) {
  .gg-menu__group ul {
    grid-template-columns: 1fr 1fr;
  }
}
.gg-menu__group a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--kr-serif);
  font-size: 1.0625rem;
  line-height: 1.3;
  color: var(--kr-pencil);
  text-decoration: none;
}
.gg-menu__group a:hover {
  color: var(--kr-ink);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.gg-menu__group a[aria-current="page"] {
  color: var(--kr-ink);
  font-weight: 700;
}
.gg-menu__group a[aria-current="page"]::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--kr-rea);
}

.gg-menu__foot {
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 1.25rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  border-top: var(--kr-rule);
  background: var(--kr-panel);
}
.gg-menu__foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--kr-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kr-grafit);
  text-decoration: none;
}
.gg-menu__foot a:hover {
  color: var(--kr-ink);
}

/* While the drawer is open the page behind it must not scroll, and the floating
   buy/toplist buttons must not sit on top of it. */
html.gg-menu-open,
html.gg-menu-open body {
  overflow: hidden;
}
html.gg-menu-open .kr-stickycta,
html.gg-menu-open .gg-fab {
  visibility: hidden;
}
