/* Shared site navigation.
   The logo sits in the middle of the bar and every link lives behind the
   hamburger on the right, at every screen size. The shared header
   (resources/views/partials/header.blade.php) writes the <link> for this file, so only pages with a
   shared header load it. Phone-size tweaks live in mobile.css, which loads
   first, so those overrides are marked !important to win the cascade. */

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 8px 40px;
  position: relative;
}

/* The spacer matches the width of the toggle so the logo lands dead centre. */
.site-nav-spacer { width: 44px; height: 1px; justify-self: start; }
.site-nav-logo { justify-self: center; display: inline-flex; }
.site-nav-logo img { height: 64px; width: auto; display: block; }
/* the main site's one-line wordmark: smaller letters, same 64px of header */
.site-nav-logo img.site-nav-wordmark { height: 34px; margin: 15px 0; }
.site-nav-toggle-wrap { position: static; justify-self: end; }

.site-nav-toggle {
  background: transparent;
  border: none;
  color: #a19c90;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 70; /* stay above the open panel so the X can close it */
}
.site-nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: #a19c90;
  position: relative;
  transition: background 0.2s ease;
}
.site-nav-toggle span::before,
.site-nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 26px;
  height: 2px;
  background: #a19c90;
  transition: transform 0.25s ease, top 0.25s ease, background 0.2s ease;
}
.site-nav-toggle span::before { top: -8px; }
.site-nav-toggle span::after  { top:  8px; }
.site-nav-toggle:hover span,
.site-nav-toggle:hover span::before,
.site-nav-toggle:hover span::after { background: #fff; }

/* Open: the three bars cross into an X. */
.site-nav-toggle-wrap:has(.site-nav-menu.open) .site-nav-toggle span {
  background: transparent;
}
.site-nav-toggle-wrap:has(.site-nav-menu.open) .site-nav-toggle span::before {
  top: 0;
  transform: rotate(45deg);
}
.site-nav-toggle-wrap:has(.site-nav-menu.open) .site-nav-toggle span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* The panel drops out of the hamburger and hangs on the right, deep enough
   for the links and no more. `top` and `max-height` are set inline by the
   toggle: the <header> is a transformed containing block, so the panel is
   placed explicitly rather than trusting viewport units. The public pages'
   fade-in animation leaves that transform behind; pages without it (the
   partner portal, admin) get it here, or the panel lands a strip too high. */
header:has(> .site-nav) { transform: translateY(0); }
.site-nav-menu {
  position: fixed;
  right: 0;
  width: min(320px, 82vw);
  background: #686461;
  border-bottom-left-radius: 16px;
  box-shadow: -10px 14px 30px rgba(0, 0, 0, 0.35);
  display: none;
  z-index: 60;
  overflow-y: auto;
  /* Each link slides in from 16px to the right of where it lands. They are
     full width now, so that nudge hangs over the edge for a moment, and
     overflow-y alone would turn overflow-x into `auto` and flash a scrollbar. */
  overflow-x: hidden;
}
.site-nav-menu.open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 16px 0 22px;
  transform-origin: top right;
  animation: siteNavIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes siteNavIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Each link (or group) slides in just after the panel. */
.site-nav-menu.open > * { animation: siteNavLinkIn 0.32s ease both; }
.site-nav-menu.open > :nth-child(1) { animation-delay: 0.07s; }
.site-nav-menu.open > :nth-child(2) { animation-delay: 0.11s; }
.site-nav-menu.open > :nth-child(3) { animation-delay: 0.15s; }
.site-nav-menu.open > :nth-child(4) { animation-delay: 0.19s; }
.site-nav-menu.open > :nth-child(5) { animation-delay: 0.23s; }
.site-nav-menu.open > :nth-child(6) { animation-delay: 0.27s; }
.site-nav-menu.open > :nth-child(7) { animation-delay: 0.31s; }
.site-nav-menu.open > :nth-child(8) { animation-delay: 0.35s; }
.site-nav-menu.open > :nth-child(9) { animation-delay: 0.39s; }
.site-nav-menu.open > :nth-child(10) { animation-delay: 0.43s; }
.site-nav-menu.open > :nth-child(11) { animation-delay: 0.47s; }
.site-nav-menu.open > :nth-child(12) { animation-delay: 0.51s; }
@keyframes siteNavLinkIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.site-nav-menu a {
  display: block;
  width: 100%;
  color: #fff;
  text-decoration: none;
  font-size: 19px;
  padding: 11px 26px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav-menu a:hover { background: rgba(255, 255, 255, 0.06); color: #fbbf24; }

/* A heading that opens a short list of links under it (Architecture &
   Inspired Designs, and Interiors; the list is in config/site.php). It looks like a link, with a chevron that
   turns when the list is open. */
.site-nav-parent {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%;
  background: transparent; border: 0; cursor: pointer;
  color: #fff;
  font-size: 19px;
  line-height: 1.3;
  padding: 11px 26px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav-parent::after {
  content: ''; flex: 0 0 auto;
  width: 8px; height: 8px; margin-top: -4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease, margin-top 0.25s ease;
}
.site-nav-group.open .site-nav-parent::after { transform: rotate(-135deg); margin-top: 4px; }
.site-nav-parent:hover { background: rgba(255, 255, 255, 0.06); color: #fbbf24; }
.site-nav-sub { display: none; padding: 2px 0 8px; background: rgba(0, 0, 0, 0.08); }
.site-nav-group.open .site-nav-sub { display: block; }
.site-nav-menu .site-nav-sub a { font-size: 16px; padding: 8px 26px 8px 44px; }
/* the sub links are already in view when the list opens; no slide in */
.site-nav-menu.open .site-nav-sub a { animation: none; }
/* the page you are on */
.site-nav-menu a[aria-current="page"] { color: #fbbf24; }
