/* The site header and footer, shared by the storefront and the booking
   page. Both load this one file, so a header or footer draws the same on
   both at every width; the template stylesheet restyles it after. The
   booking page does not load storefront.css (ADR 0014), so nothing here may
   rely on it: every rule says what it needs, and the browser defaults and
   the booking app's reset are evened out below.

   Header styles (centered, floating, overlay) sit after the base header;
   the header element carries header-<style>, the footer footer-<variant>. */

/* ---------- Layout tokens the chrome reads ----------
   The storefront body sets the rest of its tokens in storefront.css. These
   two live here so the booking page has them too. :where keeps them weakest,
   so a template may tune them on its body class. */
:where(body) {
  --page-width: 68rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

/* Large screens get a wider column, so the page doesn't float in the middle. */
@media (min-width: 1440px) {
  :where(body) {
    --page-width: 74rem;
  }
}

/* ---------- Even ground ----------
   What the storefront gets from storefront.css or the browser, and the
   booking page from its CSS reset, said once so both start the same. */
:where(.site-header, .site-footer) .wrap {
  width: min(var(--page-width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

:where(.site-header, .site-footer) a {
  text-decoration: none;
}

:where(.site-header, .site-footer) a:hover {
  text-decoration: underline;
}

:where(.site-header, .site-footer) :is(img, svg) {
  display: block;
  max-width: none;
}

/* Text for screen readers only, such as the staff sign-in icon's name. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Headings may use the template's display face; a tenant's chosen font sets
   --display-font too, so their choice wins everywhere. */
:is(.footer-name, .brand-name) {
  font-family: var(--display-font, var(--font-family));
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
  color: var(--card-foreground);
  line-height: 1.5;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  height: 2rem;
  width: auto;
}

.brand-name[hidden],
.brand-logo[hidden] {
  display: none;
}

/* The type is set, not inherited from the browser's button defaults, so the
   button is the same size on the storefront and the booking page. */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: inherit;
  cursor: pointer;
}

.header-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--nav-gap, 1rem);
}

/* Just above the fold, a long menu shares the row with the logo and the
   Book button, so its links sit closer. */
@media (min-width: 900px) and (max-width: 1099px) {
  .nav-links {
    --nav-gap: 0.85rem;
  }
}

.nav-links a {
  color: inherit;
  white-space: nowrap;
}

.cta {
  display: inline-block;
  white-space: nowrap;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
}

.cta:hover {
  text-decoration: none;
  filter: brightness(1.05);
}

.cta-lg {
  padding: 0.7rem 1.2rem;
  font-size: 1.05rem;
}

/* ---------- Footer ---------- */
.site-footer {
  line-height: 1.55;
  border-top: 1px solid var(--border);
  padding: clamp(2rem, 5vw, 3rem) 0;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 3rem;
  justify-content: space-between;
}

.footer-brand {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  max-width: 24rem;
}

.footer-name {
  color: var(--foreground);
  font-weight: 600;
  font-size: 1rem;
}

.footer-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-content: start;
}

.footer-contact {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}

.social-links {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--foreground);
  transition: background-color 120ms ease, color 120ms ease;
}

.social-link:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  text-decoration: none;
}

.social-link.social-custom {
  padding: 0 0.9rem;
  font-size: 0.85rem;
}

/* Footer variants. simple is one row; columns gives each part its column;
   centered stacks everything in the middle. */
.footer-columns .footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 720px) {
  .footer-columns .footer-inner {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

.footer-columns .footer-menu {
  flex-direction: column;
}

.footer-centered .footer-inner {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.footer-centered .footer-brand {
  justify-items: center;
}

.footer-centered .social-links,
.footer-centered .footer-menu {
  justify-content: center;
}

@media (max-width: 640px) {
  .footer-simple .footer-inner {
    flex-direction: column;
    gap: 1.5rem;
  }
}

.staff-nav-link {
  display: none;
}

.staff-sign-in {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.staff-sign-in:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
  text-decoration: none;
}

/* Above that width a long menu gives way instead of the Book button: a label
   longer than 12em is cut short (its title shows it whole), a full row of
   links wraps onto a second line, and a long company name shrinks with an
   ellipsis. The buttons keep their size. The overlay's open menu has room and
   is left alone. */
@media (min-width: 900px) {
  .site-header:not(.header-overlay) .header-end,
  .site-header:not(.header-overlay) .nav-links {
    min-width: 0;
  }

  .site-header:not(.header-overlay) .nav-links {
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 0.25rem;
  }

  .header-centered .nav-links {
    justify-content: center;
  }

  .site-header:not(.header-overlay) .nav-links a {
    max-width: 12em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-header .brand {
    min-width: min(6em, 100%);
  }

  .site-header .brand-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .site-header :is(.brand-logo, .header-book, .staff-sign-in, .nav-toggle) {
    flex-shrink: 0;
  }
}

/* The menu folds behind a button below tablet-landscape width, so a long
   menu never pushes the Book button off the header. */
@media (max-width: 899px) {
  .nav-toggle {
    display: inline-block;
  }

  .header-book {
    order: -1;
  }

  .staff-sign-in {
    display: none;
  }

  .staff-nav-link {
    display: block;
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 3.6rem;
    flex-direction: column;
    align-items: stretch;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem 1rem;
    z-index: 10;
  }

  .nav-links.is-open {
    display: flex;
  }

  .header-inner {
    position: relative;
  }
}

/* ---------- Header styles ---------- */
/* ---------- Centered: the logo above a centered menu ---------- */
@media (min-width: 900px) {
  .header-centered .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    row-gap: 0.85rem;
    padding-block: 1.1rem 0;
  }

  .header-centered .header-end {
    display: contents;
  }

  .header-centered .brand {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    flex-direction: column;
    text-align: center;
  }

  .header-centered .brand-name {
    font-size: 1.35rem;
  }

  .header-centered .header-book {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .header-centered:has(.staff-sign-in) .header-book {
    margin-right: 3rem;
  }

  .header-centered .staff-sign-in {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }

  .header-centered .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    gap: var(--nav-gap, 2rem);
    padding-block: 0.8rem;
    border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  }
}

/* ---------- Floating: a rounded bar inset over the page ---------- */
.header-floating {
  position: sticky;
  top: 0.75rem;
  z-index: 30;
  width: min(calc(var(--page-width, 68rem) + 2.5rem), calc(100% - 2 * var(--gutter, 1rem)));
  margin: 0.75rem auto 0;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 32px -14px rgb(0 0 0 / 0.28);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
}

.header-floating .header-inner {
  width: auto;
  padding: 0.45rem 0.5rem 0.45rem 1.35rem;
}

/* Just above the fold a long menu shares the bar, so the bar's own padding eases. */
@media (min-width: 900px) and (max-width: 1099px) {
  .header-floating .header-inner {
    padding-left: 0.9rem;
    gap: 0.6rem;
  }
}

.header-floating .header-book {
  border-radius: 999px;
}

.header-floating .brand img {
  max-height: 2.25rem;
}

@media (max-width: 899px) {
  .site-header.header-floating .nav-links {
    top: calc(100% + 0.5rem);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.35);
  }
}

/* ---------- Overlay: the menu opens full screen at every width ---------- */
.header-overlay .nav-toggle {
  display: inline-block;
  position: relative;
  z-index: 60;
  min-width: 4.75rem;
}

.header-overlay .staff-sign-in {
  display: none;
}

.site-header.header-overlay .nav-links {
  display: none;
}

.site-header.header-overlay .nav-links.is-open {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vh, 1.25rem);
  padding: 5rem 1.5rem 3rem;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-transform: none;
  animation: header-overlay-in 220ms ease-out;
}

.site-header.header-overlay .nav-links.is-open a {
  color: var(--foreground);
}

.site-header.header-overlay .nav-links.is-open a:hover {
  color: var(--primary-text);
  text-decoration: none;
}

.site-header.header-overlay .nav-links.is-open .staff-nav-link {
  display: block;
  margin-top: 1.5rem;
  padding-top: 0;
  border: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* A blurred header would hold the fixed menu inside itself, so the blur
   and any transform come off while the menu is open. A sticky header still
   stacks the menu at its own level, so it rises above the booking wizard's
   fixed action bar (z-index 30) while open. */
.site-header.header-overlay:has(.nav-links.is-open) {
  z-index: 70;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none;
  filter: none;
}

/* The logo, the button, and the Book link stay above the open menu. */
.header-overlay:has(.nav-links.is-open) .brand,
.header-overlay:has(.nav-links.is-open) .header-book {
  position: relative;
  z-index: 60;
}

/* The name sits on the menu's page color now, not on the header's. */
.header-overlay:has(.nav-links.is-open) .brand {
  color: var(--foreground);
}

.header-overlay:has(.nav-links.is-open) .nav-toggle {
  border-color: color-mix(in srgb, var(--foreground) 30%, transparent);
  color: var(--foreground);
  background: var(--background);
}

body:has(.header-overlay .nav-links.is-open) {
  overflow: hidden;
}

@keyframes header-overlay-in {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header.header-overlay .nav-links.is-open {
    animation: none;
  }
}

/* The booking page draws a social mark as a masked span, the storefront as
   an inline svg; both take the same size and the link's color. */
.social-icon {
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.social-link :is(svg, .social-icon) {
  width: 1.05rem;
  height: 1.05rem;
}
