/**
 * View: Header & Footer (shared across all views)
 * Root classes: .main-header, .main-footer, .utility-bar
 */

/* Design tokens - map to Journal's existing vars
 * --brand-primary, --brand-darker, --color-accent, --color-border, --color-text-primary
 * are defined globally on :root (see assets/css/shared/_layout-vars.css). Only
 * view-specific tokens remain here. */
.main-header,
.main-footer,
.utility-bar {
  --brand-text-on-primary: var(--color-on-primary);
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
  --spacing-3xl: 64px;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --line-height-relaxed: 1.8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   UTILITY BAR
   ======================================== */

.utility-bar {
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-darker) 100%);
  color: var(--brand-text-on-primary);
  font-size: var(--font-size-sm);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-x: hidden;
}

.utility-link {
  color: var(--brand-text-on-primary);
  font-weight: var(--font-weight-medium);
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

.utility-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--brand-text-on-primary);
  transition: width 0.3s ease;
}

.utility-link:hover {
  opacity: 0.9;
}

.utility-link:hover::after {
  width: 100%;
}

/* Style links inside utility bar (e.g. menuLogin output) */
.utility-bar a {
  color: var(--brand-text-on-primary);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.utility-bar a:hover {
  opacity: 0.9;
}

/* Welcome greeting shown in utility bar when user is logged in */
.utility-welcome {
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.01em;
}

/* Mobile offcanvas welcome label (legacy; offcanvas uses .masthead-offcanvas__user) */
.utility-welcome-mobile {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  padding-top: var(--spacing-xs);
  padding-bottom: var(--spacing-xs);
  letter-spacing: 0.01em;
}

/* ========================================
   MAIN HEADER — Figma masthead (see .masthead-*)
   ======================================== */

header.main-header.masthead-header {
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  padding: 0;
  overflow-x: hidden;
}

/* Toggler hover/focus — layout via Bootstrap ms-auto flex-shrink-0 in navigation.cfm */
header.masthead-header .masthead-toggler:hover,
header.masthead-header .masthead-toggler:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* ── Mobile offcanvas nav (tablet + phone, hidden on desktop via d-lg-none) ── */
.masthead-offcanvas {
  --bs-offcanvas-width: min(100%, 360px);
  background-color: var(--color-bg-surface);
  color: var(--color-text);
  border-left: none;
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
}

.masthead-offcanvas .offcanvas-body {
  overflow-y: auto;
}

.masthead-offcanvas__mark {
  width: 40px;
  height: 40px;
  background: var(--primary-color, #0b2a6f);
  color: var(--color-on-primary);
  font-size: var(--font-size-card-meta);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.masthead-offcanvas__user {
  flex-shrink: 0;
}

.masthead-offcanvas__avatar {
  width: 40px;
  height: 40px;
  background: color-mix(in srgb, var(--primary-color, #0b2a6f) 12%, var(--color-bg-surface));
  color: var(--primary-color, #0b2a6f);
}

.masthead-offcanvas__nav {
  padding: 0.25rem;
}

.masthead-offcanvas__link {
  font-size: var(--font-size-card-title);
  font-weight: 500;
  color: var(--color-text);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.masthead-offcanvas__link:hover,
.masthead-offcanvas__link:focus-visible {
  color: var(--primary-color, #0b2a6f);
  background-color: var(--color-bg-page);
}

.masthead-offcanvas__link.active,
.masthead-offcanvas__link[aria-current="page"] {
  color: var(--primary-color, #0b2a6f);
  background-color: color-mix(in srgb, var(--primary-color, #0b2a6f) 8%, var(--color-bg-surface));
}

.masthead-offcanvas__nav > a.masthead-offcanvas__link {
  text-decoration: none;
}

.masthead-offcanvas__nav > a.masthead-offcanvas__link:not(:hover):not(:focus-visible):not(.active):not([aria-current="page"]) {
  background-color: transparent;
  color: var(--color-text);
}

.masthead-offcanvas__icon {
  width: 36px;
  height: 36px;
  background: color-mix(in srgb, var(--primary-color, #0b2a6f) 10%, var(--color-bg-surface));
  font-size: var(--font-size-sm);
  transition: background-color 0.15s ease;
}

.masthead-offcanvas__link:hover .masthead-offcanvas__icon,
.masthead-offcanvas__link:focus-visible .masthead-offcanvas__icon {
  background: color-mix(in srgb, var(--primary-color, #0b2a6f) 18%, var(--color-bg-surface));
}

.masthead-offcanvas__link:hover .app-icon,
.masthead-offcanvas__link:focus-visible .app-icon,
.masthead-offcanvas__link.active .app-icon,
.masthead-offcanvas__link[aria-current="page"] .app-icon {
  color: var(--primary-color) !important;
}

.masthead-offcanvas__footer {
  flex-shrink: 0;
  background: var(--color-bg-surface);
}

.masthead-offcanvas__account-btn {
  font-weight: 600;
  border-radius: 10px;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.masthead-offcanvas__account a {
  display: block;
  width: 100%;
  text-decoration: none;
}

.masthead-offcanvas__link.nav-item {
  padding: 0.5rem 0.75rem;
}

.masthead-offcanvas .btn-close:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb, 13, 110, 253), 0.25);
}

/* ========================================
   INTERIOR SEARCH BAR (Global Search Bar)
   Shared across all interior pages via views/layout/header.cfm.
   Note: spacing/color tokens are NOT on :root so all var() calls
   use explicit fallback values to guarantee correct rendering on
   every page, regardless of which view-scoped tokens are present.
   ======================================== */

.interior-header {
  background: linear-gradient(135deg, var(--primary-color, #0b2a6f) 0%, var(--brand-darker, #061d47) 100%);
  color: var(--color-on-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.interior-header .search-input {
  height: 48px;
  padding: 0 24px;
  padding-right: 52px;
  font-size: var(--font-size-base);
  line-height: 1.2;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  background-color: var(--color-bg-surface);
  color: var(--color-text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.interior-header .search-input::placeholder {
  color: var(--color-text-secondary);
}

.interior-header .search-input:focus {
  outline: none;
  border-color: var(--primary-color, #0b2a6f);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.interior-header .search-button {
  position: absolute;
  right: 6px;
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary-color, #0b2a6f) 0%, var(--brand-darker, #061d47) 100%);
  color: var(--color-on-primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.interior-header .search-button:hover {
  opacity: 0.95;
  transform: scale(1.05);
}

.interior-header .btn--secondary {
  padding: 12px 24px;
  font-size: var(--font-size-base);
  font-weight: 600;
  background-color: transparent;
  color: var(--color-on-primary) !important;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  text-decoration: none !important;
  transition: all 0.3s ease;
  white-space: nowrap;
  line-height: 1.2;
}

.interior-header .btn--secondary:hover {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--color-on-primary) !important;
}

/* ========================================
   FOOTER
   ======================================== */

.main-footer {
  background: linear-gradient(
    90deg,
    var(--app-gradient-color1, #320270) 0%,
    var(--app-gradient-color2, #7420FF) 50%,
    var(--app-gradient-color3, #3B0F96) 100%
  );
  color: var(--brand-text-on-primary);
  box-shadow: none;
  overflow-x: hidden;
}

body.site-footer-gradient .main-footer {
  background: var(
    --footer-gradient,
    linear-gradient(135deg, var(--color-neutral-900) 0%, var(--color-neutral-700) 60%, var(--color-neutral-500) 100%)
  );
}

body.site-footer-geometric .main-footer {
  position: relative;
  /* Must replace full `background` shorthand — base .main-footer sets a 3-color gradient image */
  background: var(--footer-color, var(--color-neutral-900));
  overflow: hidden;
}

body.site-footer-geometric .main-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      -36deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.04) 14px,
      rgba(255, 255, 255, 0.04) 15px
    ),
    linear-gradient(135deg, rgba(0, 0, 0, 0) 30%, rgba(100, 116, 139, 0.07) 100%);
  background-size: auto, 40% 100%;
  background-position: 0 0, right top;
  background-repeat: repeat, no-repeat;
}

body.site-footer-geometric .main-footer > * {
  position: relative;
  z-index: 1;
}

/* ---- Brand block (left column) ---- */
.main-footer .footer-brand__icon {
  width: 38px;
  height: 38px;
  background-color: var(--color-neutral-700);
  border-radius: 9px;
  font-size: var(--font-size-card-badge);
  font-weight: var(--font-weight-semibold);
  color: var(--color-on-primary);
  letter-spacing: 0.5px;
}

.main-footer img.footer-brand__icon,
.main-footer img.footer-brand__logo {
  width: auto;
  height: auto;
  max-height: 38px;
  max-width: min(180px, 40vw);
  object-fit: contain;
  object-position: left center;
  background: transparent;
  padding: 0;
}

.main-footer .footer-brand__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-on-primary);
  line-height: 1.3;
  letter-spacing: -0.15px;
}

.main-footer .footer-brand__tagline {
  font-size: var(--font-size-article-meta);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.3;
}

/* ---- Column headings (center & right) ---- */
.main-footer .footer-description {
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
  color: rgba(255, 255, 255, 0.5);
}

/* Message may include <p> from CMS — keep muted color (avoid inheriting .main-footer #fff) */
.main-footer .footer-description p {
  margin: 0 0 0.65em;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.main-footer .footer-description p:last-child {
  margin-bottom: 0;
}

.main-footer .footer-heading {
  font-size: var(--font-size-article-meta);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ---- Links ---- */
.main-footer .footer-text {
  font-size: var(--font-size-card-meta);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.main-footer .footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-footer .footer-link {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-card-meta);
  letter-spacing: -0.076px;
  transition: color 0.3s ease;
  text-decoration: none;
}

.main-footer .footer-link:hover {
  color: var(--brand-text-on-primary);
}

/* ---- Contact icons ---- */
.main-footer .footer-text--address .contact-icon {
  margin-top: 2px;
}

/* ---- Bottom bar ---- */
.main-footer .footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  overflow-x: hidden;
}

.main-footer .footer-bottom__inner {
  min-height: 43px;
}

.main-footer .copyright {
  font-size: var(--font-size-card-badge);
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.5;
  margin: 0;
}

.main-footer .copyright a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.main-footer .copyright a:hover {
  color: var(--brand-text-on-primary);
}

.main-footer .copyright a.copyright__link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.main-footer .copyright a.copyright__link:hover {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: underline;
}

.main-footer .copyright a.copyright__attribution {
  color: rgba(255, 255, 255, 0.5);
}

.main-footer .copyright a.copyright__attribution:hover {
  color: var(--brand-text-on-primary);
  text-decoration: none;
}

/* ---- Back to top button ---- */
.main-footer .footer-back-to-top {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: var(--font-size-card-badge);
  font-weight: var(--font-weight-medium);
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.main-footer .footer-back-to-top:hover {
  color: var(--brand-text-on-primary);
}

/* ========================================
   SITE LAYOUT (admin-configured header/footer chrome)
   body.site-header-* / body.site-footer-*
   ======================================== */

/* layouts/default.cfm: body.d-flex.flex-column + main.flex-grow-1. Flex items default to
   min-width: auto, so wide main content can expand past the viewport and cause horizontal
   page scroll; min-width: 0 lets main participate in shrink-to-fit. */
body.d-flex.flex-column.min-vh-100 > main.flex-grow-1 {
  min-width: 0;
  max-width: 100%;
}

/* --- Figma masthead tokens + shared site content box (header / main / footer) --- */
:root {
  --masthead-gradient: linear-gradient(135deg, var(--color-neutral-900) 0%, var(--color-neutral-700) 60%, var(--color-neutral-500) 100%);
  --site-shell-max-width: 1320px;
  --site-shell-gutter: 32px;
  --site-shell-gutter-sm: 16px;
}

.masthead-shell {
  width: 100%;
  max-width: var(--site-shell-max-width);
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-shell-gutter);
  padding-right: var(--site-shell-gutter);
  box-sizing: border-box;
}

@media (max-width: 575.98px) {
  .masthead-shell {
    padding-left: var(--site-shell-gutter-sm);
    padding-right: var(--site-shell-gutter-sm);
  }
}

/*
 * Bootstrap containers add 12px side gutters by default. Pages that use .masthead-shell
 * (header/footer) or main .container (body) already apply --site-shell-gutter, so zero
 * Bootstrap padding at every breakpoint to avoid double inset on desktop.
 */
.container,
.container-fluid,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl {
  padding-left: 0;
  padding-right: 0;
}

/* Legacy body pages that use bare .container instead of .masthead-shell */
main .container {
  max-width: var(--site-shell-max-width);
  width: 100%;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--site-shell-gutter);
  padding-right: var(--site-shell-gutter);
  box-sizing: border-box;
}

@media (max-width: 575.98px) {
  main .container {
    padding-left: var(--site-shell-gutter-sm);
    padding-right: var(--site-shell-gutter-sm);
  }
}

/* Utility strip — Figma: ~38.5px row, uppercase eyebrow, Login right */
.utility-bar.masthead-utility {
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  padding: 0;
  box-shadow: none;
  font-size: inherit;
}

.masthead-utility__inner {
  min-height: 28px;
  padding-top: 0.125rem;
  padding-bottom: 0;
  box-sizing: border-box;
}

.masthead-utility__eyebrow {
  font-size: var(--font-size-article-meta);
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 1.16445px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  display: block;
}

@media (max-width: 767.98px) {
  .masthead-utility__inner {
    min-height: 0;
  }

  .masthead-utility__eyebrow {
    white-space: normal;
    overflow-wrap: anywhere;
    letter-spacing: 0.08em;
    line-height: 1.35;
  }

  .masthead-utility__welcome {
    font-size: var(--font-size-card-badge);
  }
}

@media (min-width: 768px) {
  .masthead-utility__eyebrow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.masthead-utility__site {
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  font-weight: 400;
  letter-spacing: -0.0761719px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.masthead-utility__site:hover {
  color: var(--color-on-primary);
}

.masthead-utility__welcome {
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.masthead-utility__account a,
.masthead-utility__account {
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.masthead-utility__account a {
  text-decoration: none;
  display: inline;
  padding: 0 !important;
  margin: 0 !important;
  border: 0;
  background: transparent;
  font-weight: 400;
  letter-spacing: -0.0761719px;
}

.masthead-utility__account a:hover {
  color: var(--color-on-primary);
}

.masthead-utility__login {
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  font-weight: 400;
  letter-spacing: -0.0761719px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

.masthead-utility__login:hover {
  color: var(--color-on-primary);
}

/* Brand + nav row — layout via Bootstrap utilities in navigation.cfm */
.masthead-main {
  min-height: 90px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.masthead-shell--header {
  overflow-x: clip;
}

.masthead-brand {
  color: inherit;
}

.masthead-brand__mark {
  box-sizing: border-box;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.0761719px;
  color: var(--color-on-primary);
}

/* Site logo: height matches initials mark; width scales for horizontal artwork */
img.masthead-brand__mark,
img.masthead-brand__logo {
  width: auto;
  height: auto;
  max-height: 46px;
  max-width: min(200px, 32vw);
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: none;
  padding: 0;
  flex-shrink: 0;
}


img.masthead-offcanvas__mark {
  width: auto;
  height: auto;
  max-height: 40px;
  max-width: min(160px, 40vw);
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: none;
  padding: 0;
}

.masthead-brand__title {
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: 22px;
  line-height: 30px;
  font-weight: 600;
  letter-spacing: -0.457812px;
  color: var(--color-on-primary);
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

.masthead-brand__tagline {
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  font-weight: 400;
  letter-spacing: -0.0761719px;
  color: rgba(255, 255, 255, 0.65);
  margin: 0;
  min-width: 0;
  max-width: 100%;
}

/* Mobile / tablet: wrap long site titles instead of single-line truncate */
@media (max-width: 991.98px) {
  .masthead-main {
    min-height: 0;
    align-items: center;
  }

  .masthead-brand__title,
  .masthead-brand__tagline {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .masthead-brand__title {
    font-size: var(--font-size-base);
    line-height: 1.3;
    letter-spacing: -0.02em;
  }

  .masthead-brand__tagline {
    font-size: var(--font-size-xs);
    line-height: 1.35;
    letter-spacing: 0;
  }

  img.masthead-brand__mark,
  img.masthead-brand__logo {
    max-height: 40px;
    max-width: min(160px, 38vw);
  }
}

@media (max-width: 767.98px) {
  img.masthead-brand__mark,
  img.masthead-brand__logo {
    max-height: 36px;
    max-width: min(96px, 26vw);
  }

}

@media (min-width: 992px) {
  .masthead-brand__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .masthead-brand__tagline {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Laptop (992–1199): logo + long tagline + custom nav links exceed ~960px content box */
@media (min-width: 992px) and (max-width: 1199.98px) {
  img.masthead-brand__mark,
  img.masthead-brand__logo {
    max-width: min(160px, 18vw);
  }

  /* Tagline duplicates info when a logo is shown; hiding frees horizontal room for nav */
  .masthead-brand__logo ~ .masthead-brand__text .masthead-brand__tagline {
    display: none;
  }

  .masthead-nav {
    gap: 0.375rem !important;
    min-width: 0;
  }

  .masthead-nav__link {
    font-size: var(--font-size-card-meta, 13px);
    line-height: 1.3;
  }

}

.masthead-nav__link {
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--font-size-sm);
  line-height: 21px;
  font-weight: 400;
  letter-spacing: -0.150391px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.masthead-nav__link:hover {
  color: var(--color-on-primary);
}

/* Search row — Figma 5:752 (580×44 input + 12px gap + 95×41.5 Advanced) */
.masthead-search {
  position: relative;
  z-index: 1;
}

.masthead-search__form {
  max-width: 687px; /* 580 + 12 + 95 */
  gap: 12px;
}

.masthead-search__field {
  height: 44px;
  width: 100%;
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
}

@media (min-width: 992px) {
  .masthead-search__field {
    flex: 0 0 580px;
    width: 580px;
    max-width: 580px;
  }
}

.masthead-search__advanced {
  box-sizing: border-box;
  flex: 0 0 95px;
  width: 95px;
  min-width: 95px;
  height: 41.5px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--font-size-card-meta);
  line-height: 20px;
  font-weight: 500;
  letter-spacing: -0.0761719px;
  color: var(--color-on-primary);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .masthead-search__form {
    max-width: none;
  }
}

.masthead-search__icon-btn {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 2;
}

.masthead-search__icon-btn:hover {
  opacity: 0.85;
}

.masthead-search__input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 0 16px 0 48px;
  border: none;
  border-radius: 12px;
  background: var(--color-bg-page);
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--font-size-base);
  line-height: 19px;
  letter-spacing: -0.625px;
  color: var(--color-text);
}

.masthead-search__input::placeholder {
  color: var(--color-text-muted);
}

.masthead-search__input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.masthead-search__advanced:hover {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-on-primary);
}


/* ── Compact search: icon button shown in nav when masthead-search row is hidden ── */
/* Hide the full-width search bar on all conf/session/article detail pages */
.conf-detail-page .masthead-search {
  display: none;
}

/* Query AI: hide masthead search row and compact nav search (page has its own input) */
.queryai-page .masthead-search,
.queryai-page .masthead-compact-search {
  display: none !important;
}
.masthead-compact-search {
  display: none;
  align-items: center;
  position: relative;
}
.conf-detail-page .masthead-compact-search {
  display: flex;
}

.masthead-compact-search__icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.masthead-compact-search__icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.65);
}

.masthead-compact-search__form {
  display: none;
  align-items: center;
  gap: 4px;
}
.masthead-compact-search__form--open {
  display: flex;
}

.masthead-compact-search__input {
  box-sizing: border-box;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--color-bg-page);
  color: var(--color-text);
  padding: 0 10px;
  font-family: var(--font-family, 'Inter', system-ui, sans-serif);
  font-size: var(--font-size-sm);
  line-height: 19px;
  letter-spacing: -0.625px;
  width: 220px;
  min-width: 0;
  transition: outline-color 0.2s ease;
}
.masthead-compact-search__input::placeholder {
  color: var(--color-text-muted);
}
.masthead-compact-search__input:focus {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 2px;
}

.masthead-compact-search__submit,
.masthead-compact-search__close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}
.masthead-compact-search__submit:hover,
.masthead-compact-search__close:hover {
  color: var(--color-on-primary, #fff);
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 767.98px) {
  .masthead-compact-search__input {
    width: 150px;
  }
}

/* --- Variant: gradient (Figma HeaderGradient) --- */
body.site-header-gradient .utility-bar.masthead-utility {
  background: var(--masthead-gradient);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.site-header-gradient header.masthead-header {
  background: var(--masthead-gradient);
  color: var(--color-on-primary);
  overflow: hidden;
}

/* Figma HeaderGradient: 3px bar, transparent edges (rgba(0,0,0,0) ≡ transparent) */
body.site-header-gradient header.masthead-header::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, var(--color-neutral-500) 50%, rgba(0, 0, 0, 0) 100%);
}

/* --- Variant: geometric --- */
body.site-header-geometric .utility-bar.masthead-utility {
  background-color: var(--color-neutral-900);
  background-image: repeating-linear-gradient(
    -36deg,
    transparent,
    transparent 14px,
    rgba(255, 255, 255, 0.04) 14px,
    rgba(255, 255, 255, 0.04) 15px
  );
}

body.site-header-geometric header.masthead-header {
  position: relative;
  background-color: var(--color-neutral-900);
  color: var(--color-on-primary);
  overflow: hidden;
}

/* Geometric masthead is CSS-only; this node stays in DOM for parity but is never shown. */
.masthead-header__geometric-photo {
  display: none;
}

/* Stripes + right-edge wash (Figma: gradient 135deg, #64748B at 0.07 over ~40% width) */
body.site-header-geometric header.masthead-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      -36deg,
      transparent,
      transparent 14px,
      rgba(255, 255, 255, 0.04) 14px,
      rgba(255, 255, 255, 0.04) 15px
    ),
    linear-gradient(135deg, rgba(0, 0, 0, 0) 30%, rgba(100, 116, 139, 0.07) 100%);
  background-size: auto, 40% 100%;
  background-position: 0 0, right top;
  background-repeat: repeat, no-repeat;
}

body.site-header-geometric .masthead-shell--header {
  position: relative;
  z-index: 2;
}

body.site-header-geometric header.masthead-header::after {
  content: '';
  display: block;
  position: relative;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, var(--color-neutral-700) 0%, var(--color-neutral-500) 50%, var(--color-neutral-700) 100%);
}

/* Geometric: shell content sits above the ::before stripe overlay */

/* --- Variant: image overlay (base layers; custom photo from default.cfm when set) --- */
/* Figma HeaderImage: utility strip is a semi-transparent black band (rgba 0,0,0,0.22) over the photo */
body.site-header-image .utility-bar.masthead-utility {
  background: transparent !important; /* wipe admin-driven primary-color gradient; image header only */
}

/*
 * Figma HeaderImage (stack: photo base, flat rgba(15,23,42,0.72), bottom 60px vignette on top)
 * --masthead-header-photo-url from layouts/default.cfm; third layer falls back to slate gradient
 */
body.site-header-image header.masthead-header {
  position: relative;
  background-color: var(--color-neutral-900);
  color: var(--color-on-primary);
  overflow: hidden;
  --masthead-header-photo-layer: var(
    --masthead-header-photo-url,
    linear-gradient(110deg, var(--color-neutral-800) 0%, var(--color-neutral-600) 50%, var(--color-neutral-500) 100%)
  );
  background-image:
    linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, transparent 100%),
    linear-gradient(rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.72)),
    var(--masthead-header-photo-layer);
  background-size: 100% 60px, 100% 100%, cover;
  background-position: center bottom, center, center top;
  background-repeat: no-repeat, no-repeat, no-repeat;
}

/* Tablet/phone: stronger overlay + clip so busy photo layers don’t fight the masthead UI */
@media (max-width: 767.98px) {
  body.site-header-image header.masthead-header {
    overflow: hidden;
    background-image:
      linear-gradient(to top, rgba(0, 0, 0, 0.35) 0%, transparent 100%),
      linear-gradient(rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.78)),
      var(--masthead-header-photo-layer);
    background-size: 100% 48px, 100% 100%, cover;
    background-position: center bottom, center, center top;
    background-repeat: no-repeat, no-repeat, no-repeat;
  }
}

body.site-header-image header.masthead-header::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, var(--color-neutral-500) 50%, rgba(0, 0, 0, 0) 100%);
}

.main-footer .footer-links--2col .footer-link {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Footer — mobile / tablet QA */
@media (max-width: 575.98px) {
  .main-footer .footer-brand__name,
  .main-footer .footer-brand__tagline,
  .main-footer .footer-description,
  .main-footer .footer-text,
  .main-footer .copyright {
    overflow-wrap: anywhere;
    word-break: normal;
  }

}

@media (max-width: 991.98px) {
  .main-footer .footer-bottom__inner {
    align-items: center;
    text-align: center;
  }

  .main-footer .copyright {
    text-align: center;
  }

  .main-footer .footer-links--2col .footer-link {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .main-footer .footer-links--2col {
    row-gap: 0.5rem;
  }
}

@media (max-width: 767.98px) {
  .main-footer .footer-column + .footer-column {
    padding-top: 0.25rem;
  }
}

/* ── Refine filter: mobile collapse toggle (shared across all routes) ── */
.refine-toggle__chevron {
  transition: transform 0.2s ease;
}
[data-bs-toggle="collapse"][aria-expanded="true"] .refine-toggle__chevron {
  transform: rotate(180deg);
}
