/*
 * Dilano V14 - Always-visible, shrinking frosted header.
 * This overrides the V3/V9 header styles without replacing styles.css.
 * site.js (already installed) adds .is-scrolled after the first 16px.
 */
:root {
  --dilano-header-expanded: 120px;
  --dilano-header-compact: 74px;
  --dilano-header-motion: 340ms cubic-bezier(.22, 1, .36, 1);
}

/* Fixed from the outset: no position switch and no document jump on scrolling. */
.site-header.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  isolation: isolate;
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: box-shadow 340ms ease, border-color 340ms ease;
}

/* Separate fading layers make gradient -> frosted white a smooth transition. */
.site-header::before,
.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  transition: opacity var(--dilano-header-motion), background-color var(--dilano-header-motion);
}
.site-header::before {
  background-color: rgba(255,255,255,.90);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  opacity: 0;
}
.site-header.header-overlay::after {
  background: linear-gradient(180deg, rgba(5,11,20,.78), rgba(5,11,20,0));
  opacity: 1;
}
.site-header.header-solid::before {
  background-color: rgba(255,255,255,.98);
  opacity: 1;
}
.site-header.is-scrolled::before {
  background-color: rgba(255,255,255,.90);
  opacity: 1;
}
.site-header.is-scrolled::after { opacity: 0; }
.site-header.is-scrolled {
  border-bottom-color: rgba(30,61,103,.11);
  box-shadow: 0 7px 28px rgba(13,34,65,.10);
}
.site-header.header-solid:not(.is-scrolled) {
  border-bottom-color: rgba(30,61,103,.09);
  box-shadow: 0 2px 14px rgba(13,34,65,.035);
}

.site-header .header-content {
  min-height: var(--dilano-header-expanded);
  transition: min-height var(--dilano-header-motion);
}
.site-header.is-scrolled .header-content {
  min-height: var(--dilano-header-compact);
}
.site-header .brand {
  transition: padding var(--dilano-header-motion);
}
.site-header .brand img {
  width: 235px;
  transition: width var(--dilano-header-motion), max-height var(--dilano-header-motion);
}
.site-header.is-scrolled .brand {
  padding-block: 1px;
}
.site-header.is-scrolled .brand img {
  width: 170px;
  max-height: 67px;
}
.site-header .primary-nav a {
  transition: color 250ms ease, padding var(--dilano-header-motion), text-shadow 250ms ease;
}
.site-header.is-scrolled .primary-nav a {
  padding-block: 11px;
}
.site-header.header-overlay.is-scrolled .primary-nav a {
  color: #30415a;
  text-shadow: none;
}
.site-header.header-overlay.is-scrolled .primary-nav a:is(:hover, .current) {
  color: var(--blue, #2269BF);
}
.site-header .nav-toggle {
  transition: width var(--dilano-header-motion), height var(--dilano-header-motion),
              background-color 250ms ease, border-color 250ms ease, color 250ms ease;
}
.site-header.header-overlay.is-scrolled .nav-toggle {
  color: var(--blue, #2269BF);
  background: rgba(34,105,191,.06);
  border-color: rgba(34,105,191,.18);
}

/* The menu and privacy pages start below the initially full-height fixed header. */
.page-menu { padding-top: var(--dilano-header-expanded); }
html { scroll-padding-top: calc(var(--dilano-header-compact) + 16px); }

@media (max-width:1120px) {
  :root { --dilano-header-expanded: 105px; --dilano-header-compact: 70px; }
  .site-header .brand img { width: 200px; }
  .site-header.is-scrolled .brand img { width: 158px; max-height: 62px; }
}
@media (max-width:820px) {
  :root { --dilano-header-expanded: 96px; --dilano-header-compact: 68px; }
  .site-header .brand img { width: 166px; }
  .site-header.is-scrolled .brand img { width: 135px; max-height: 53px; }
  .site-header .primary-nav a,
  .site-header.is-scrolled .primary-nav a { padding: 13px 15px; }
  .site-header.is-scrolled .nav-toggle { width: 40px; height: 40px; }
  /* The original drop-down stays solid white, readable over any page content. */
  .site-header .primary-nav.open { z-index: 2; }
}
@media (max-width:620px) {
  :root { --dilano-header-expanded: 84px; --dilano-header-compact: 60px; }
  .site-header .brand img { width: 143px; }
  .site-header.is-scrolled .brand img { width: 120px; max-height: 48px; }
  .site-header.is-scrolled .nav-toggle { width: 38px; height: 38px; }
}

/* No blur support? Keep a legible opaque background after scrolling. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header.is-scrolled::before { background-color: rgba(255,255,255,.97); }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header::before, .site-header::after,
  .site-header .header-content, .site-header .brand, .site-header .brand img,
  .site-header .primary-nav a, .site-header .nav-toggle { transition: none !important; }
}
