/*
  Deterministic beautiful-site shell chrome (header burger, drawer, breadcrumbs, footer).
  Loaded after main.css; uses theme CSS variables from the LLM-generated palette.
*/

/* Reference logo ratio (mostbeteg.app: width="800" height="128") */
body.mb-site {
  --mb-logo-ratio: 800 / 128;
  --mb-logo-header-height: 40px;
  --mb-logo-footer-max-width: 24%;
  --mb-logo-footer-max-cap: 30%;
}

/* Burger toggle */
body.mb-site .mb-site-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mb-border, rgba(227, 178, 87, 0.28));
  border-radius: var(--mb-radius-sm, 12px);
  background: rgba(0, 0, 0, 0.22);
  color: var(--mb-text, #fff6dc);
  cursor: pointer;
}

body.mb-site .mb-site-burger__bar {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.mb-site.mb-site-nav-open .mb-site-burger__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.mb-site.mb-site-nav-open .mb-site-burger__bar:nth-child(2) {
  opacity: 0;
}

body.mb-site.mb-site-nav-open .mb-site-burger__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Off-canvas drawer */
body.mb-site .mb-site-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  background: rgba(4, 2, 1, 0.55);
  opacity: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

body.mb-site.mb-site-nav-open .mb-site-drawer {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

body.mb-site .mb-site-drawer__panel {
  width: min(100%, 320px);
  max-width: 100%;
  height: 100%;
  overflow: auto;
  padding: clamp(18px, 4vw, 28px);
  color: var(--mb-text, #fff6dc);
  background:
    linear-gradient(180deg, rgba(35, 15, 7, 0.98), rgba(19, 8, 4, 0.98));
  border-inline-start: 1px solid var(--mb-border, rgba(227, 178, 87, 0.28));
  box-shadow: var(--mb-shadow, 0 22px 70px rgba(0, 0, 0, 0.42));
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

body.mb-site[dir="rtl"] .mb-site-drawer__panel {
  transform: translateX(-100%);
}

body.mb-site.mb-site-nav-open .mb-site-drawer__panel {
  transform: translateX(0);
}

body.mb-site .mb-site-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.mb-site .mb-site-drawer__nav a {
  display: block;
  padding: 12px 14px;
  border-radius: var(--mb-radius-sm, 12px);
  color: var(--mb-text-soft, #ead8b1);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

body.mb-site .mb-site-drawer__nav a:hover,
body.mb-site .mb-site-drawer__nav a:focus-visible {
  color: var(--mb-gold-2, #ffd985);
  border-color: var(--mb-border, rgba(227, 178, 87, 0.28));
  background: rgba(255, 217, 133, 0.08);
}

body.mb-site .mb-site-drawer__nav a[aria-current="page"] {
  color: var(--mb-teal, #63ded2);
  border-color: rgba(99, 222, 210, 0.35);
  background: rgba(99, 222, 210, 0.1);
}

/* Header layout: logo left, actions right (override theme mobile column stack) */
body.mb-site .mb-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 18px);
}

body.mb-site .mb-site-brand {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

body.mb-site .mb-site-header .mb-site-brand__logo {
  display: block;
  height: var(--mb-logo-header-height);
  width: auto;
  aspect-ratio: var(--mb-logo-ratio);
  max-width: none;
}

body.mb-site .mb-site-footer__brand {
  display: block;
  flex-shrink: 0;
  width: min(var(--mb-logo-footer-max-width, 24%), var(--mb-logo-footer-max-cap, 30%));
  max-width: min(var(--mb-logo-footer-max-width, 24%), var(--mb-logo-footer-max-cap, 30%));
}

body.mb-site .mb-site-footer .mb-site-brand__logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--mb-logo-ratio);
  max-width: none;
  object-fit: contain;
}

body.mb-site .mb-site-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Hide legacy horizontal nav when drawer chrome is used */
body.mb-site .mb-site-header__inner > .mb-site-nav,
body.mb-site .mb-site-header__inner > .mb-main-nav {
  display: none;
}

/* Breadcrumbs inside header — compact strip, left-aligned */
body.mb-site .mb-site-header .mb-page-strip {
  border-block: none;
  border-top: 1px solid rgba(227, 178, 87, 0.16);
  background: transparent;
  margin-block-end: 0;
}

body.mb-site .mb-site-header .mb-page-strip__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  width: 100%;
  max-width: calc(var(--mb-container, 1120px) + var(--mb-page-pad, 28px) + var(--mb-page-pad, 28px));
  margin-inline: auto;
  padding-inline: var(--mb-page-pad, clamp(16px, 3.4vw, 28px));
  padding-block: 8px;
}

body.mb-site .mb-site-header .mb-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--mb-muted, #c7ad7d);
  font-size: 0.93rem;
  line-height: 1.5;
}

body.mb-site .mb-breadcrumbs li + li::before {
  content: "/";
  margin-inline-end: 8px;
  color: var(--mb-muted-2, #9f8557);
}

body.mb-site .mb-breadcrumbs a {
  color: var(--mb-gold-2, #ffd985);
  text-decoration: none;
}

body.mb-site .mb-breadcrumbs a:hover,
body.mb-site .mb-breadcrumbs a:focus-visible {
  color: var(--mb-teal, #63ded2);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* Footer: logo + wrapping inline nav links (reference: flex row, not columns) */
body.mb-site .mb-site-footer__top {
  display: grid;
  gap: clamp(16px, 3vw, 28px);
  align-items: center;
}

body.mb-site .mb-footer-nav {
  display: block !important;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0 !important;
  margin: 0;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
}

/* Reference (mostbeteg.app/info): flex-wrap rows, each item grows to fill row width */
body.mb-site .mb-footer-nav__list {
  display: flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

body.mb-site .mb-footer-nav__list > li {
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  min-width: 0;
}

body.mb-site .mb-footer-nav a,
body.mb-site .mb-footer-nav__link {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-width: none;
  padding: 10px clamp(16px, 3vw, 30px) !important;
  border: none !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  color: var(--mb-text-soft, #ead8b1);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.94rem, 1.7vw, 1rem);
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  text-align: center;
  transform: none !important;
  overflow-wrap: anywhere;
}

body.mb-site .mb-footer-nav a:hover,
body.mb-site .mb-footer-nav a:focus-visible,
body.mb-site .mb-footer-nav__link:hover,
body.mb-site .mb-footer-nav__link:focus-visible {
  color: var(--mb-gold-2, #ffd985);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  transform: none;
  background: none;
}

body.mb-site .mb-footer-nav a[aria-current="page"],
body.mb-site .mb-footer-nav__link[aria-current="page"] {
  color: var(--mb-teal, #63ded2);
  background: none;
  border: none;
}

body.mb-site .mb-site-footer__copy {
  margin: 0;
  color: var(--mb-muted, #c7ad7d);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

body.mb-site .mb-site-footer__inner {
  display: grid;
  gap: clamp(16px, 3vw, 24px);
}

@media (min-width: 768px) {
  body.mb-site .mb-site-footer__top {
    grid-template-columns: min(var(--mb-logo-footer-max-width, 24%), var(--mb-logo-footer-max-cap, 30%)) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
  }

  body.mb-site .mb-site-footer__brand {
    width: 100%;
    max-width: none;
  }

  body.mb-site .mb-site-footer__top > .mb-footer-nav {
    justify-self: stretch;
    align-self: center;
  }
}

@media (max-width: 767px) {
  body.mb-site .mb-site-header__inner {
    flex-direction: row !important;
    align-items: center !important;
  }

  body.mb-site .mb-site-header .mb-site-brand {
    justify-content: flex-start !important;
  }

  body.mb-site .mb-site-header .mb-page-strip__inner {
    flex-direction: row !important;
    align-items: center !important;
  }

  /* Stacked footer: logo spans full row width (reference mobile layout) */
  body.mb-site .mb-site-footer__top {
    grid-template-columns: 1fr;
    gap: clamp(20px, 5vw, 28px);
  }

  body.mb-site .mb-site-footer__brand {
    display: block;
    width: 100%;
    max-width: none;
  }

  body.mb-site .mb-site-footer .mb-site-brand__logo {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    aspect-ratio: var(--mb-logo-ratio);
    object-fit: contain;
  }

  body.mb-site .mb-site-btn {
    display: none;
  }

  body.mb-site .mb-site-drawer__cta {
    display: block;
    margin-top: 14px;
  }
}

/* main.css stacks header nav pills at 380px; footer keeps reference row grow layout */
@media (max-width: 380px) {
  body.mb-site .mb-footer-nav a,
  body.mb-site .mb-footer-nav__link {
    flex-basis: auto !important;
  }
}

@media (min-width: 768px) {
  body.mb-site .mb-site-drawer__cta {
    display: none;
  }
}
