/* PAR public shell v1 — one header and one footer for every public route. */
:root {
  --public-paper: #f7f4ed;
  --public-surface: #fffdf8;
  --public-ink: #282622;
  --public-text: #60605c;
  --public-gold: #80602b;
  --public-gold-mid: #b79a61;
  --public-hair: rgba(85, 67, 40, .16);
  --public-focus: #31578c;
  --public-content: 1240px;
  --public-gutter: max(24px, calc((100vw - 1376px) / 2));
}

body > .site-header {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  min-height: 78px;
  padding:
    max(12px, env(safe-area-inset-top))
    max(var(--public-gutter), env(safe-area-inset-right))
    10px
    max(var(--public-gutter), env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: clamp(18px, 3vw, 44px);
  border: 0;
  border-bottom: 1px solid rgba(85, 67, 40, .11);
  background: linear-gradient(to bottom, rgba(247, 244, 237, .98), rgba(247, 244, 237, .84));
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

body > .site-header .brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--public-ink);
  text-decoration: none;
}

body > .site-header .brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  box-shadow: none;
}

body > .site-header .brand-copy {
  min-width: 0;
  display: block;
  line-height: 1;
}

body > .site-header .brand-sub {
  display: block;
  color: var(--public-text);
  font: 700 10px/1.15 Inter, sans-serif;
  letter-spacing: .075em;
  text-transform: uppercase;
  white-space: nowrap;
}

body > .site-header .global-nav {
  min-width: 0;
  height: 100%;
  margin: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(14px, 1.7vw, 28px);
}

body > .site-header .global-nav a {
  position: relative;
  min-height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  color: var(--public-text);
  font: 780 11px/1 Inter, sans-serif;
  letter-spacing: .075em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

body > .site-header .global-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--public-gold-mid), transparent);
  opacity: 0;
  transform: scaleX(.45);
  transition: opacity .2s ease, transform .2s ease;
}

body > .site-header .global-nav a:hover,
body > .site-header .global-nav a:focus-visible,
body > .site-header .global-nav a[aria-current="page"] {
  color: var(--public-ink);
}

body > .site-header .global-nav a:hover::after,
body > .site-header .global-nav a:focus-visible::after,
body > .site-header .global-nav a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}

body > .site-header .header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
}

body > .site-header .login-button {
  min-width: 110px;
  min-height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(115, 88, 43, .3);
  border-radius: 999px;
  color: var(--public-ink);
  background: rgba(255, 253, 248, .78);
  box-shadow: inset 0 0 0 1px rgba(205, 177, 115, .16), 0 10px 28px rgba(68, 53, 31, .07);
  font: 800 11px/1 Inter, sans-serif;
  letter-spacing: .1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

body > .site-header .login-button:hover {
  transform: translateY(-1px);
  border-color: var(--public-gold-mid);
  background: var(--public-surface);
}

.public-footer {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 72px), var(--public-content));
  margin: clamp(76px, 9vw, 132px) auto 0;
  padding: 28px 0 calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--public-hair);
  color: var(--public-text);
  background: transparent;
}

/* Footer already contains support/legal controls: floating launchers must not
   cover its text or duplicate the cookie action while the footer is visible. */
html.public-footer-visible .sw-btn.sw-root,
html.public-footer-visible .par21-home-support,
html.public-footer-visible #par21-consent-open {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.public-footer__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.public-footer__brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--public-ink);
  font: 800 18px/1 Urbanist, Inter, sans-serif;
  letter-spacing: .08em;
  text-decoration: none;
}

.public-footer__brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.public-footer__descriptor {
  margin: 0;
  color: var(--public-text);
  font: 700 10px/1.3 Inter, sans-serif;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
}

.public-footer__contact {
  justify-self: end;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--public-ink);
  font: 760 13px/1 Inter, sans-serif;
  letter-spacing: .035em;
  text-decoration: none;
}

.public-footer__links {
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  border-top: 1px solid rgba(85, 67, 40, .1);
}

.public-footer__links a,
.public-footer__links .footer-cookie-settings {
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  border: 0;
  color: var(--public-ink);
  background: transparent;
  font: 650 12px/1.35 Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.public-footer__links a:hover,
.public-footer__links a:focus-visible,
.public-footer__links .footer-cookie-settings:hover,
.public-footer__links .footer-cookie-settings:focus-visible {
  color: var(--public-gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.public-footer__legal {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 8px 28px;
  color: var(--public-text);
  font: 600 10px/1.4 Inter, sans-serif;
}

.public-footer__legal span:nth-child(2) {
  text-align: center;
}

.public-footer__legal span:nth-child(3) {
  text-align: right;
}

body > .site-header :focus-visible,
.public-footer :focus-visible {
  outline: 3px solid var(--public-focus);
  outline-offset: 3px;
}

@media (max-width: 1120px) {
  body > .site-header {
    min-height: 116px;
    padding: max(9px, env(safe-area-inset-top)) 18px 0;
    grid-template-columns: 1fr auto;
    grid-template-rows: 52px 48px;
    gap: 0 18px;
  }

  body > .site-header .global-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-left: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    gap: 6px;
    overflow: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body > .site-header .global-nav::-webkit-scrollbar {
    display: none;
  }

  body > .site-header .header-actions {
    grid-column: 2;
    grid-row: 1;
  }

  body.tool-detail-page > main {
    padding-top: 116px;
  }
}

@media (max-width: 760px) {
  body > .site-header .brand-logo {
    width: 38px;
    height: 38px;
  }

  body > .site-header .brand-sub {
    font-size: 8px;
    letter-spacing: .04em;
  }

  body > .site-header .global-nav {
    gap: 5px;
  }

  body > .site-header .global-nav a {
    min-width: 0;
    min-height: 48px;
    justify-content: center;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
    font-size: clamp(8.4px, 2.45vw, 10px);
    line-height: 1.08;
    letter-spacing: .035em;
    text-transform: none;
  }

  body > .site-header .login-button {
    min-width: 82px;
    min-height: 42px;
    padding: 0 15px;
  }

  .public-footer {
    width: calc(100% - 36px);
    margin-top: 76px;
    padding-top: 28px;
    text-align: center;
  }

  .public-footer__top {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .public-footer__brand,
  .public-footer__descriptor,
  .public-footer__contact {
    justify-self: center;
    text-align: center;
  }

  .public-footer__links {
    margin-top: 16px;
    padding-top: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 4px 12px;
  }

  .public-footer__links a,
  .public-footer__links .footer-cookie-settings {
    justify-content: center;
    font-size: 11px;
  }

  .public-footer__links .footer-cookie-settings {
    grid-column: 1 / -1;
  }

  .public-footer__legal {
    grid-template-columns: 1fr;
    gap: 4px;
    font-size: 9px;
    line-height: 1.35;
  }

  .public-footer__legal span {
    text-align: center;
  }
}

@media (max-width: 360px) {
  body > .site-header .brand-sub {
    max-width: 154px;
    white-space: normal;
  }

  body > .site-header .global-nav {
    gap: 4px;
  }

  body > .site-header .global-nav a {
    font-size: 8.4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body > .site-header .global-nav a::after,
  body > .site-header .login-button {
    transition: none;
  }
}
