/* ==========================================================================
   Header + off-canvas drawer
   ========================================================================== */
/* Transparent overlay by default (sits over the hero on every page);
   turns solid white once scrolled into content. */
.trfc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background .3s ease, transform .3s ease, box-shadow .3s ease;
}
/* Legibility gradient behind the logo/menu while transparent */
.trfc-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 150px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .42), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: -1;
  transition: opacity .3s ease;
}
.trfc-header.is-hidden { transform: translateY(-100%); }
.trfc-header.is-scrolled {
  background: var(--trfc-white);
  box-shadow: var(--trfc-shadow-sm);
}
.trfc-header.is-scrolled::before { opacity: 0; }

.trfc-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--trfc-header-height);
  gap: 20px;
  transition: min-height .3s ease;
}
/* Shrink the bar on scroll */
.trfc-header.is-scrolled .trfc-header__inner { min-height: 62px; }

.trfc-header__logo { display: inline-flex; align-items: center; }
.trfc-header__logo img,
.trfc-header__logo .custom-logo {
  height: 68px;
  width: auto;
  transition: height .3s ease;
}
.trfc-header.is-scrolled .trfc-header__logo img,
.trfc-header.is-scrolled .trfc-header__logo .custom-logo { height: 46px; }
.trfc-header__logo-text {
  font-family: var(--trfc-font-head);
  font-weight: 800;
  font-size: 1.25rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.trfc-header.is-scrolled .trfc-header__logo-text { color: var(--trfc-black); text-shadow: none; }

/* Burger — white & box-less over the hero, red box once the header is solid */
.trfc-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  width: 56px;
  height: 52px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-radius: var(--trfc-radius);
  cursor: pointer;
  transition: background .3s ease;
}
.trfc-burger span {
  display: block;
  height: 3px;
  width: 100%;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
  transition: transform .25s ease, opacity .2s ease, background .3s ease;
}
/* Solid header → box-less burger with black bars */
.trfc-header.is-scrolled .trfc-burger { background: transparent; }
.trfc-header.is-scrolled .trfc-burger span { background: var(--trfc-black); box-shadow: none; }
.trfc-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.trfc-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.trfc-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* Full-screen menu overlay */
.trfc-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
}
.trfc-drawer.is-open { visibility: visible; pointer-events: auto; }

.trfc-drawer__panel {
  position: absolute;
  inset: 0;
  background: var(--trfc-white);
  overflow-y: auto;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .3s ease, transform .35s ease;
}
.trfc-drawer.is-open .trfc-drawer__panel { opacity: 1; transform: none; }

.trfc-drawer__inner {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-block: clamp(26px, 5vh, 56px);
}

.trfc-drawer__close {
  position: absolute;
  top: clamp(24px, 4vh, 48px);
  right: clamp(24px, 5vw, 72px);
  z-index: 2;
  background: none;
  border: none;
  color: var(--trfc-black);
  font-size: 2.6rem;
  line-height: 1;
  cursor: pointer;
  transition: color .18s ease;
}
.trfc-drawer__close:hover { color: var(--trfc-red); }

.trfc-drawer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.trfc-drawer__menu li { margin: 0; }
.trfc-drawer__menu a {
  display: inline-block;
  padding: clamp(1px, 0.5vh, 6px) 0;
  color: var(--trfc-black);
  font-family: var(--trfc-font-head);
  font-weight: 800;
  font-size: clamp(1.25rem, 1.4vw + 1.6vh, 2.3rem);
  line-height: 1.12;
  text-align: left;
  transition: color .16s ease, transform .16s ease;
}
.trfc-drawer__menu a:hover,
.trfc-drawer__menu .current-menu-item > a,
.trfc-drawer__menu .current_page_item > a {
  color: var(--trfc-red);
}
.trfc-drawer__menu a:hover { transform: translateX(6px); }
.trfc-drawer__menu .sub-menu {
  list-style: none;
  margin: 0 0 0 24px;
  padding: 0;
}
.trfc-drawer__menu .sub-menu a { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 700; }

.trfc-drawer__foot {
  margin-top: auto;
  padding-top: clamp(20px, 3vh, 40px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}
.trfc-drawer__rule {
  display: block;
  width: 210px;
  max-width: 40vw;
  height: 2px;
  background: var(--trfc-line);
  margin-bottom: clamp(12px, 1.6vh, 20px);
}
.trfc-drawer__address {
  margin: 0;
  color: var(--trfc-muted);
  font-size: 1rem;
  line-height: 1.6;
}
.trfc-drawer__logo {
  width: clamp(110px, 12vw, 160px);
  height: auto;
  flex-shrink: 0;
}

body.trfc-drawer-open { overflow: hidden; }

@media (max-width: 600px) {
  .trfc-drawer__foot { flex-direction: column-reverse; align-items: flex-start; gap: 24px; }
  .trfc-drawer__logo { width: 96px; }
}

/* ---- Homepage: larger logo/burger on the full-height slider ---- */
.trfc-bare-home { background: #000; }
.trfc-bare-home .trfc-header.is-hidden { transform: none; } /* never hide on the static homepage */
.trfc-bare-home .trfc-header__inner { padding-block: clamp(14px, 2vh, 28px); }
.trfc-bare-home .trfc-header__logo img,
.trfc-bare-home .trfc-header__logo .custom-logo { height: clamp(82px, 9vw, 120px); }
.trfc-bare-home .trfc-burger {
  width: 68px;
  height: 58px;
  gap: 9px;
  padding: 0 8px;
}
.trfc-bare-home .trfc-burger span { height: 4px; }

/* ---- Templates without a hero (blog, single, archive, 404): solid header
   from the top so content isn't hidden under the fixed overlay. ---- */
.trfc-solid-header .trfc-header { background: var(--trfc-white); box-shadow: var(--trfc-shadow-sm); }
.trfc-solid-header .trfc-header::before { opacity: 0; }
.trfc-solid-header .trfc-header__logo-text { color: var(--trfc-black); text-shadow: none; }
.trfc-solid-header .trfc-burger { background: transparent; }
.trfc-solid-header .trfc-burger span { background: var(--trfc-black); box-shadow: none; }
.trfc-solid-header .trfc-main { padding-top: var(--trfc-header-height); }

@media (max-width: 600px) {
  .trfc-header__logo img,
  .trfc-header__logo .custom-logo { height: 54px; }
  :root { --trfc-header-height: 78px; }
}
