/* Device compatibility: keep the original typography, photographs and colours. */
html {
  --device-header-height: 91px;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--device-header-height) + 16px + env(safe-area-inset-top, 0px));
}

.site-header {
  height: calc(var(--device-header-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
}

/* Physical offsets also work in WebViews that predate the inset shorthand. */
.scene-photo-trigger,
.hero-shade,
.wine-shade,
.photo-viewer,
.photo-viewer-loading,
.photo-viewer-error {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* Main copy remains readable without enlarging the page to read it. */
.hero-description,
.welcome-band p,
.about-copy p:not(.eyebrow),
.wine-copy p:not(.eyebrow),
.section-heading > p,
.menu-row p:not(.price),
.dinner-caption p,
.a-la-carte ul,
.party-ribbon p:not(.eyebrow):not(.small-print):not(.party-condition-label),
.occasion-line p,
.occasion-panel > p:not(.occasion-panel-kicker),
.taste-intro > p:not(.eyebrow),
.check-item > span:nth-of-type(2),
.taste-result p:not(.eyebrow),
#taste-advice-copy,
.chef-copy > p:not(.eyebrow),
.review-card blockquote,
.home-reviews blockquote,
.visit-info > p:not(.small-print),
.faq-answer,
.subhero > p:last-child,
.subhero-with-image > p:last-of-type,
.subpage-cta > p:not(.eyebrow) {
  font-size: 1rem;
  line-height: 1.9;
}

/* Short control labels need room to wrap at large text settings. */
.btn,
.header-booking,
.wine-copy .btn,
.menu-board .btn,
.hero-button,
.text-link,
.occasion-panel .text-link,
.dinner-caption .text-link,
#taste-advice .text-link,
.hero-taste-link,
.desktop-nav a,
.footer-nav,
.occasion-tabs button,
.occasion-panel .occasion-panel-kicker,
.check-meter,
.party-condition-label,
.photo-chip,
.photo-invitation,
.hero-photo-trigger .photo-invitation,
.dialog-close,
#image-dialog [data-menu-zoom]:not(.menu-image-toggle),
#image-dialog > .text-link {
  font-size: .875rem;
}

.eyebrow,
.brand small,
.sound-button,
.hero-kicker,
.menu-label > span,
.menu-row h4 small,
.menu-choice-kicker,
.taste-token-labels,
.menu-note,
.small-print,
.party-ribbon .small-print,
.visit-info .small-print,
.a-la-carte-body p,
.taste-hint,
.dialog-note,
.visit-info dt,
.visit-info dd span,
.qa-banner div > span,
.footer-inner > p,
.footer-inner > small,
.breadcrumb {
  font-size: .75rem;
}

.btn,
.text-link,
.hero-actions,
.menu-row > div,
.check-item > span:nth-of-type(2),
.faq-item summary > span:nth-child(2),
.photo-viewer-copy {
  min-width: 0;
  max-width: 100%;
}

.btn,
.occasion-tabs button,
.menu-choice-label,
.wine-copy h2 {
  white-space: normal;
}

h1, h2, h3, h4,
.hero-description,
.faq-answer,
.review-card blockquote,
.photo-viewer-copy p,
.visit-info dd {
  overflow-wrap: break-word;
}

.menu-row .price,
.btn .arrow,
.text-link > span[aria-hidden="true"],
.check-number,
.check-box {
  flex-shrink: 0;
}

.nav-toggle,
.sound-button,
.dialog-close,
.photo-viewer-button,
.photo-viewer-close,
.photo-viewer-link,
.occasion-tabs button {
  min-width: 44px;
  min-height: 44px;
}

.menu-choice-label { font-size: 1rem; }
.footer-nav { flex-wrap: wrap; }
.taste-token-labels > span { white-space: normal; text-align: center; }
.taste-game .btn, .menu-board .btn, .party-ribbon .btn { min-width: 0; }
.menu-label { flex-wrap: wrap; }
.check-item:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }

/* vh is the fallback for older Safari/WebViews without small viewport units. */
.hero {
  height: calc(100vh - 91px);
  height: calc(100svh - 91px - env(safe-area-inset-top, 0px));
}
.mobile-nav {
  top: calc(var(--device-header-height) + env(safe-area-inset-top, 0px));
  max-height: calc(100vh - 140px);
  max-height: calc(100svh - var(--device-header-height) - 80px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Native dialog and the same bounded panel used by the legacy JS fallback. */
#image-dialog:not([open]) { display: none; }
#image-dialog {
  max-height: 90vh;
  max-height: calc(90svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}
#image-dialog .dialog-image-wrap {
  max-height: 64vh;
  max-height: 64svh;
  -webkit-overflow-scrolling: touch;
}
#image-dialog .dialog-toolbar > p { font-size: 1rem; }
#image-dialog .dialog-note { font-size: .75rem; }
.menu-dialog-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 1390;
  background: #10190fe0;
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
#image-dialog.is-dialog-fallback[open] {
  position: fixed;
  z-index: 1400;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  margin: 0;
  transform: translate(-50%, -50%);
  animation: none;
}

/* Captions can scroll independently of the photograph on compact screens. */
.photo-viewer {
  padding-top: max(22px, env(safe-area-inset-top, 0px));
  padding-bottom: max(26px, env(safe-area-inset-bottom, 0px));
}
.photo-viewer-copy p {
  font-size: 1rem;
  line-height: 1.8;
}
.photo-viewer-link,
.photo-viewer-button,
.photo-viewer-close { font-size: .875rem; }
.photo-viewer-hint { font-size: .75rem; }
.photo-viewer-canvas,
.photo-viewer-info { -webkit-overflow-scrolling: touch; }

@media (max-width: 1120px) {
  .desktop-nav { gap: 14px; }
}

@media (max-width: 800px) {
  html { --device-header-height: 76px; }
  .hero {
    height: calc(100vh - 76px);
    height: calc(100svh - 76px - env(safe-area-inset-top, 0px));
  }
  .hero-actions { flex-wrap: wrap; }
}

@media (max-width: 650px) {
  .photo-viewer {
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .photo-viewer-copy p { max-height: 5.4em; }
}

@media (max-width: 600px) {
  html { --device-header-height: 72px; }
  /* Content determines the height so text zoom cannot clip the invitation. */
  .hero {
    height: auto;
    min-height: 540px;
    min-height: max(540px, calc(100vh - 140px));
    min-height: max(540px, calc(100svh - 152px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    max-height: none;
  }
  .hero-content {
    height: auto;
    min-height: inherit;
    padding-top: 118px;
    padding-bottom: 88px;
  }
  .hero h1 > span { white-space: normal; }
  .hero-description { font-size: 1rem; line-height: 1.9; letter-spacing: 0; }
  .hero-actions .hero-button { min-width: 0; max-width: 100%; }
  .hero-photo-trigger .photo-invitation { font-size: .75rem; }
  .wine-scene { height: auto; min-height: 530px; }
  .wine-copy { height: auto; min-height: 530px; padding-top: 100px; }
  .menu-choice-label { font-size: .875rem; }
  .menu-choice-kicker { font-size: .75rem; letter-spacing: .08em; }
  .occasion-tabs button { padding-inline: 5px; }
  .faq-item summary { overflow-wrap: break-word; }
  .footer-nav { gap: 8px 22px; }
  body { padding-bottom: 80px; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .mobile-dock {
    height: auto;
    min-height: 72px;
    padding: 8px 12px;
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  .mobile-dock a { min-height: 54px; min-width: 0; }
  .mobile-dock .dock-menu { flex-basis: 31%; gap: 5px; font-size: .875rem; }
  .mobile-dock .dock-booking { gap: 5px; padding-inline: 12px; }
  .dock-booking > span:first-child { font-size: 1rem; line-height: 1.4; white-space: normal; }
  .dock-booking small { font-size: .75rem; line-height: 1.5; letter-spacing: 0; }
  .dock-booking > span:last-child { flex-shrink: 0; }
  #image-dialog {
    max-height: 88vh;
    max-height: calc(88svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
  #image-dialog .dialog-image-wrap { max-height: 57vh; max-height: 57svh; }
}

@media (max-height: 560px) {
  #image-dialog[open] { padding: 12px; overflow-y: auto; }
  #image-dialog .dialog-toolbar { position: sticky; top: 0; z-index: 1; gap: 8px; margin-bottom: 10px; background: var(--paper); }
  #image-dialog .dialog-toolbar > p { flex-basis: 110px; }
  #image-dialog .dialog-toolbar-actions { width: auto; }
  #image-dialog .dialog-image-wrap { flex-shrink: 0; max-height: 42vh; max-height: 42svh; }
  #image-dialog .dialog-note { margin: 8px 0 4px; }
  .photo-viewer {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }
  .photo-viewer-info { max-height: 44vh; max-height: 44svh; }
  .photo-viewer-copy p { font-size: .875rem; line-height: 1.7; max-height: 3.4em; }
  .photo-viewer-link { font-size: .875rem; }
}

@media (max-height: 500px) and (orientation: landscape) and (max-width: 1024px) {
  body { padding-bottom: 76px; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .mobile-dock {
    height: auto;
    min-height: 68px;
    padding: 7px 12px;
    padding: 7px max(12px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  .mobile-dock a { min-height: 52px; }
  .mobile-dock .dock-menu { flex-basis: 150px; font-size: .875rem; }
  .mobile-dock .dock-booking { flex-basis: 360px; }
  .dock-booking > span:first-child { font-size: 1rem; line-height: 1.3; white-space: normal; }
  .dock-booking small { font-size: .75rem; line-height: 1.4; letter-spacing: 0; }
  .mobile-nav {
    max-height: calc(100vh - 152px);
    max-height: calc(100svh - var(--device-header-height) - 76px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
