/* ================================
   KILROY — Full-screen Menu Overlay
   Scope: #site-menu only
   ================================ */

/* Optional: header trigger minimal styling */
.header-btn {
  appearance: none; border:none; background: #fff; color: #111;
  border-radius: 0; padding: 10px 12px; font: inherit; cursor: pointer; 
  height: 100%; width:100%;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .2em;
  font-size: 0.9rem;
}

.header-btn:hover {background: #f8f8f8;}

.header-btn:focus-visible { outline: 2px solid #000; outline-offset: 2px;}

/* Prevent background scroll when open (JS toggles this on <html>) */
.no-scroll { overflow: hidden; }

/* -------- Theme tokens (adjust to taste) -------- */
#site-menu {
  --km-bg: #1f1f1f;
  --km-bg-elev: #242424;
  --km-fg: #ffffff;
  --km-fg-dim: #c7c7c7;
  --km-border: #ffffff;
  --km-frame: #3a3a3a;
  --km-link: #ffffff;
  --km-link-hover: #ffffff;
  --km-accent: #ffffff; /* used for focus ring / caret */
}

/* -------- Overlay shell -------- */
#site-menu.overlay {
  position: fixed; inset: 0; z-index: 1000; color: var(--km-fg);
  background: var(--km-bg);
  display: grid; grid-template-rows: auto 1fr auto;
  border: none;
}
#site-menu[hidden] { display: none !important; }

/* Fade (optional, reduced motion aware) */
@media (prefers-reduced-motion:no-preference) {
  #site-menu.enter { animation: km-fade-in .18s ease-out both; }
  #site-menu.exit  { animation: km-fade-out .12s ease-in both; }
  @keyframes km-fade-in { from { opacity: 0 } to { opacity: 1 } }
  @keyframes km-fade-out { from { opacity: 1 } to { opacity: 0 } }
}

/* -------- Top rail: CLOSE | BRAND | CART -------- */
#site-menu .overlay-rail {
  display: grid; 
  grid-template-columns: 12% 1fr 12%;
  align-itemsms: center;
  background: var(--km-bg);
  width:1500px;
  margin:30px auto 0px;
  border:1px solid var(--km-border);
}
#site-menu .rail-cell {
  min-height: 72px; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--km-border);
}
#site-menu .rail-cell:last-child { border-right: 0; }

#site-menu .rail-btn {
  appearance: none; background: none; border: 0; color: var(--km-fg);
  letter-spacing: .06em; 
  cursor: pointer; padding: 12px 14px; line-height: 1;   
  width: 100%; height: 100%; text-align: center;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .2em;
  font-size: 0.9rem;
}
#site-menu .rail-btn:focus-visible {
  outline: 2px solid var(--km-accent); outline-offset: 2px;
}
#site-menu .rail-brand {
  text-align: center; 
  padding: 0 8px;
  text-transform: uppercase;
  letter-spacing: .3em; 
  font-weight: 600;
  font-size: 2rem;
}

/* -------- Two-column body -------- */
#site-menu .overlay-body {
  display: grid; 
  grid-template-columns: 1fr 1fr;
  min-height: 0; 
  background: var(--km-bg);
  width:1500px;
  margin:0px auto;
  border:1px solid var(--km-border);
  border-top:none;
}
#site-menu .col {
  padding: 28px 36px; min-height: 0;
}
#site-menu .col + .col { border-left: 1px solid var(--km-border); }

/* Section titles */
#site-menu .section-title {
  font-size: 32px; line-height: 1.2;
  margin: 0 0 18px; font-weight: 700;
  color: var(--km-fg);
}

/* Link lists */
#site-menu .menu-list { list-style: none; margin: 0; padding: 0; }
#site-menu .menu-list a {
  display: block; padding: 14px 0; text-decoration: none;
  color: var(--km-link); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; line-height: 1.25;
}
#site-menu .menu-list a:hover { color: var(--km-link-hover); opacity: .85; }
#site-menu .menu-list a:focus-visible {
  outline: 2px solid var(--km-accent); outline-offset: 2px;
}

/* -------- Bottom search bar -------- */
#site-menu .overlay-search {
  display: grid; 
  grid-template-columns: 1fr 56px;
  background: var(--km-bg);
  margin:0px auto 30px;
  width: 1500px;
  border:1px solid var(--km-border);
  border-top:none;
}
#site-menu .search-input {
  appearance: none; border: 0; background: var(--km-bg);
  color: var(--km-fg); padding: 18px 20px;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: .2em;
  font-size: 0.9rem;
}
#site-menu .search-input::placeholder { color: var(--km-fg-dim); opacity: 1; }
#site-menu .search-btn {
  appearance: none; border: 0; border-left: 1px solid var(--km-border);
  background: var(--km-bg); color: var(--km-fg); cursor: pointer;
  font-size: 18px;
}
#site-menu .search-btn:focus-visible {
  outline: 2px solid var(--km-accent); outline-offset: -2px;
}

/* -------- Carets (if you add any collapsibles inside) -------- */
#site-menu .fs-toggle-heading { position: relative; }
#site-menu .fs-toggle-heading .fs-caret {
  display: inline-block; margin-left: .5ch; width: .6em; height: .6em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); translate: 0 0.08em;
}
#site-menu .fs-toggle-heading[aria-expanded="true"] .fs-caret {
  transform: rotate(-135deg); translate: 0 -.1em;
}

/* -------- Responsive -------- */
@media (max-width: 960px) {
  #site-menu .overlay-rail { grid-template-columns: 130px 1fr 130px; }
}
@media (max-width: 800px) {
  #site-menu .overlay-body { grid-template-columns: 1fr; }
  #site-menu .col + .col { border-left: 0; border-top: 1px solid var(--km-border); }
  #site-menu .section-title { font-size: 26px; }
}

/* -------- Utility (visually hidden labels, etc.) -------- */
#site-menu .visually-hidden {
  position: absolute !important; height: 1px; width: 1px; overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* -------- Optional: subtle inner container for edge-to-edge feel -------- */
/* If you want the body to have a slightly different tone than the rail/search */
#site-menu .overlay-body { background: var(--km-bg-elev); }

/* -------- Optional: scrollbar style on supported browsers -------- */
#site-menu *::-webkit-scrollbar { width: 10px; height: 10px; }
#site-menu *::-webkit-scrollbar-thumb { background: var(--km-border); }
#site-menu *::-webkit-scrollbar-track { background: transparent; }

/* FIX: #site-menu should be fixed even without a ".overlay" class */
#site-menu {
  position: fixed;
  inset: 0;
  z-index: 1000;
  color: var(--km-fg);
  background: var(--km-bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: none;
}

/* Keep the simple fade you already set up */
#site-menu.enter { animation: km-fade-in .18s ease-out both; }
#site-menu.exit  { animation: km-fade-out .12s ease-in both; }

/* Hidden still closes it completely */
[hidden] { display: none !important; }

/* === overlay-diagnose (append-only) === */
#site-menu {
position: fixed; inset: 0; z-index: 1000;}
[hidden] { display: none !important; }

:root {
  /* timing sync — adjust to start after overlay/borders/header/search complete */
  --text-start: 520ms;
  --text-gap: 70ms;
  --text-dur: 320ms;
  --text-ease: cubic-bezier(.22,.61,.36,1);
}

/* === Menu text: Clip Reveal Animation === */
.site-menu--open .site-menu__list li {
  animation-name: menuTextClipReveal;
  animation-duration: var(--text-dur);
  animation-timing-function: var(--text-ease);
  animation-fill-mode: both;
  animation-delay: calc(var(--text-start) + var(--text-gap) * var(--i, 0));
  overflow: clip; /* modern alternative to overflow:hidden */
  will-change: clip-path, transform, opacity;
}

@keyframes menuTextClipReveal {
  0%   { opacity: 0; clip-path: inset(100% 0 0 0); transform: translateY(6px); }
  60%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); transform: none; }
}

/* === Clip Reveal for menu text (matches your .enter state) ============== */
:root{
  /* start text AFTER overlay/borders/header/search */
  --text-start: 520ms;
  --text-gap: 70ms;
  --text-dur: 320ms;
  --text-ease: cubic-bezier(.22,.61,.36,1);
}

/* Apply to whatever list markup you use inside the overlay */
#site-menu.enter .menu-list li,
#site-menu.enter .site-menu__list li,
#site-menu.enter nav ul li {
  animation-name: menuTextClipReveal;
  animation-duration: var(--text-dur);
  animation-timing-function: var(--text-ease);
  animation-fill-mode: both;
  animation-delay: calc(var(--text-start) + var(--text-gap) * var(--i, 0));
  overflow: clip; /* modern alternative to overflow:hidden */
  will-change: clip-path, transform, opacity;
}

@keyframes menuTextClipReveal{
  0%   { opacity: 0; clip-path: inset(100% 0 0 0); transform: translateY(6px); }
  60%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); transform: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  #site-menu .menu-list li,
  #site-menu .site-menu__list li,
  #site-menu nav ul li {
    animation-duration: 0.001ms !important;
  }
}

/* Overlay search: keep identical appearance while typing/focused */
#site-menu .overlay-search .search-input {
  outline: none;
  box-shadow: none;
  border: 0;                /* already in your file, but keep it here for certainty */
  appearance: none;
  -webkit-appearance: none; /* Safari/Chrome */
  -webkit-tap-highlight-color: transparent;
}

/* Prevent any visual change on focus/active */
#site-menu .overlay-search .search-input:focus,
#site-menu .overlay-search .search-input:focus-visible,
#site-menu .overlay-search .search-input:active {
  outline: none !important;
  box-shadow: none !important;
}

/* Hide the built-in WebKit “clear (×)” and decoration in search inputs */
#site-menu .overlay-search .search-input::-webkit-search-cancel-button,
#site-menu .overlay-search .search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

/* Hide the old Edge/IE clear button, just in case */
#site-menu .overlay-search .search-input::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}
