@import url("/towc-heritage-type.css");
header.towc-site-header[data-mds-masthead] {
  position: relative;
  display: grid;
  place-items: center;
  height: 78px;
  min-height: 78px;
  padding: 0;
  background: #080808;
  border-bottom: 1px solid #ffffff18;
}
[data-mds-masthead] .towc-header-brand {
  display: block;
  width: 148px;
  height: 74px;
  margin: 0;
}
[data-mds-masthead] .towc-header-brand picture { display: block; height: 100%; }
[data-mds-masthead] .towc-header-brand img { display: block; width: 100%; height: 100%; object-fit: contain; }
[data-mds-masthead] .home-menu-trigger, .mds-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 46px;
  box-sizing: border-box;
  width: 46px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid #ffffff30;
  border-radius: 24px;
  background: #151311;
  color: #f4eee5;
  font: 600 13px/1 system-ui, sans-serif;
  cursor: pointer;
}
[data-mds-masthead] .home-menu-trigger { position: absolute; inset-inline-start: clamp(12px, 4vw, 48px); top: 50%; transform: translateY(-50%); }
[data-mds-masthead] .home-menu-trigger:hover, .mds-drawer-close:hover { border-color: #c9a36a; }
[data-mds-masthead] .home-menu-trigger svg, .mds-drawer-close svg { width: 20px; height: 20px; flex: none; }
.mds-menu-label { display: none; }
html:has(.mds-drawer[open]) { overflow: hidden; }
.mds-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(calc(100% - 20px), 356px);
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-inline-end: 1px solid #c9a36a40;
  background: #171411;
  color: #f4eee5;
  overscroll-behavior: contain;
}
.mds-drawer[open] { animation: mds-drawer-enter 200ms ease-out both; }
.mds-drawer::backdrop { background: rgb(4 3 2 / 72%); animation: mds-dim-enter 200ms ease-out both; }
.mds-drawer-frame { min-height: 100%; padding: 0 20px max(20px, env(safe-area-inset-bottom)); }
.mds-drawer-heading {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 0 12px;
  border-bottom: 1px solid #c9a36a40;
  background: #171411;
}
.mds-drawer-heading h2 { margin: 0; font: 400 30px/1.12 Georgia, serif; }
.mds-drawer #towc-mobile-nav { display: grid; position: static; width: 100%; max-width: none; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 17px; margin: 0; padding: 16px 0 2px; }
.mds-menu-group > p { margin: 0 0 5px; color: #e7c391; font: 650 11px/1.5 system-ui, sans-serif; letter-spacing: .12em; }
.mds-drawer #towc-mobile-nav .mds-menu-group > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border-bottom: 1px solid #ffffff16;
  color: #f4eee5;
  text-decoration: none;
  font: 550 15px/1.35 system-ui, sans-serif;
}
.mds-menu-group > a:hover, .mds-menu-group > a[aria-current="page"] { background: #c9a36a19; color: #f4d39e; }
.mds-menu-group > a[aria-current="page"] { box-shadow: inset 2px 0 #c9a36a; }
.mds-menu-group > a svg { width: 16px; height: 16px; color: #c9a36a; flex: none; }
[data-mds-masthead] button:focus-visible, .mds-drawer :is(a, button):focus-visible { outline: 2px solid #e7c391; outline-offset: 2px; }
@keyframes mds-drawer-enter { from { transform: translateX(-100%); } }
@keyframes mds-dim-enter { from { opacity: 0; } }
@media (min-width: 768px) {
  header.towc-site-header[data-mds-masthead] { height: 110px; min-height: 110px; }
  [data-mds-masthead] .towc-header-brand { width: 234px; height: 104px; }
  .mds-menu-label { display: inline; }
}
@media (prefers-reduced-motion: reduce) {
  .mds-drawer[open], .mds-drawer::backdrop { animation: none; }
}

/* Heritage Universal 011 — one compact masthead control and consistent brand on existing MDS pages. */
body:not(.mds-home) header.towc-site-header[data-mds-masthead]{display:flex;justify-content:flex-start;align-items:center;gap:0;height:70px;min-height:70px;padding:0 4vw;border-bottom:1px solid #edb747;background:#080808;box-sizing:border-box}
body:not(.mds-home) header[data-mds-masthead] .towc-header-brand{display:block;width:min(62vw,340px);height:86%;margin:0;flex:none;background:url('/brand/towc-heritage-wordmark.svg') left center/contain no-repeat}
body:not(.mds-home) header[data-mds-masthead] .towc-header-brand picture{display:none}
html body header[data-mds-masthead] .home-menu-trigger,html body .mds-drawer .mds-drawer-close{box-sizing:border-box;flex:0 0 44px;width:44px!important;min-width:44px;max-width:44px;height:44px;min-height:44px;padding:0!important;border:0;background:transparent;color:#edb747;border-radius:6px!important}
html body header[data-mds-masthead] .home-menu-trigger{position:absolute;inset-inline-start:auto;left:auto;right:2.1vw;top:50%;transform:translateY(-50%)}
html body header[data-mds-masthead] .home-menu-trigger svg,html body .mds-drawer .mds-drawer-close svg{width:26px;height:26px}
html body [data-mds-masthead] .mds-menu-label{display:none}
html body .mds-drawer .mds-drawer-close:focus-visible{outline:2px solid #edb747;outline-offset:2px}
body:not(.mds-home) [data-mds-masthead] .heritage-search{position:absolute;right:calc(2.1vw + 46px);top:50%;transform:translateY(-50%);width:44px;height:44px;display:grid;place-items:center;color:#edb747;text-decoration:none}
@media(min-width:801px){body:not(.mds-home) header.towc-site-header[data-mds-masthead]{height:86px;min-height:86px}body:not(.mds-home) header[data-mds-masthead] .towc-header-brand{width:min(34vw,515px)}}

/* Heritage 012: live wordmark takes precedence over archived image fallback. */
html body header[data-mds-masthead] .towc-header-brand:has(.heritage-wordmark-live){position:static;transform:none;display:flex;align-items:center;justify-content:flex-start;background:none;min-width:0;text-decoration:none;overflow:visible}
html body header[data-mds-masthead] .towc-header-brand:has(.heritage-wordmark-live) picture{display:none}
html body header[data-mds-masthead] .heritage-wordmark-live{display:inline-flex;align-items:baseline;gap:.16em;white-space:nowrap;font:700 clamp(16px,2.75vw,44px)/1.1 "Heritage Editorial",Georgia,serif;letter-spacing:-.055em;color:#f7ead0}
html body header[data-mds-masthead] .heritage-wordmark-signature{position:relative;color:#edb747;font:400 1.34em/1 "Heritage Signature","Brush Script MT",cursive;letter-spacing:-.045em}
.heritage-wordmark-signature:after{content:"";position:absolute;left:8%;right:4%;bottom:-.10em;height:.095em;border-radius:70% 95% 75% 50%;background:#edb747;transform:rotate(-5deg)}
@media(max-width:800px){html body header[data-mds-masthead] .heritage-wordmark-live{font-size:clamp(15px,4.1vw,29px)}}

/* Heritage 013: normalize live brand alignment across shared MDS mastheads. */
html body header[data-mds-masthead] .towc-header-brand:has(.heritage-wordmark-live){flex-direction:row;align-items:center;justify-content:flex-start;align-self:stretch;height:auto;min-height:44px;padding:0;gap:0;float:none;inset:auto;margin:0}
html body header[data-mds-masthead] .heritage-wordmark-live{align-self:center;margin:0;padding:0 0 .10em;line-height:1.15}
@media(max-width:1050px){
 html body header.towc-site-header[data-mds-masthead]{display:grid;grid-template-columns:minmax(0,1fr) 44px 44px;align-items:center;justify-content:stretch;gap:2px;padding-inline:clamp(12px,4vw,32px)}
 html body header[data-mds-masthead] .towc-header-brand:has(.heritage-wordmark-live){width:100%;max-width:none;min-width:0}
 html body header[data-mds-masthead] .heritage-wordmark-live{font-size:clamp(16px,5.1vw,36px)}
 html body header[data-mds-masthead] .heritage-search,html body header[data-mds-masthead] .home-menu-trigger{position:static;inset:auto;transform:none;width:44px;height:44px;margin:0;align-self:center;justify-self:center;border:0}
}

/* Heritage 014: explicit grid cells prevent legacy absolute offsets from displacing either control. */
@media(max-width:1050px){
 html body header.towc-site-header[data-mds-masthead]{display:grid!important;grid-template-columns:minmax(0,1fr) 44px 44px;grid-template-rows:minmax(0,1fr);align-items:center!important;justify-items:stretch;box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:0 clamp(12px,4vw,32px)!important;column-gap:2px;row-gap:0}
 html body header.towc-site-header[data-mds-masthead]::before,html body header.towc-site-header[data-mds-masthead]::after{content:none;display:none}
 html body header.towc-site-header[data-mds-masthead]>.towc-header-brand{grid-column:1;grid-row:1;min-width:0;max-width:100%;width:100%;align-self:center;justify-self:stretch}
 html body header.towc-site-header[data-mds-masthead]>.heritage-search{grid-column:2;grid-row:1}
 html body header.towc-site-header[data-mds-masthead]>.home-menu-trigger{grid-column:3;grid-row:1}
 html body header.towc-site-header[data-mds-masthead]>:is(.heritage-search,.home-menu-trigger){position:static!important;inset:auto!important;transform:none!important;width:44px!important;height:44px!important;min-width:44px;max-width:44px;min-height:44px;max-height:44px;align-self:center;justify-self:center;margin:0!important;padding:0!important;display:grid!important;place-items:center;border:0}
}
