/* Cookie banner and settings (inc/locals-consent.php). Hidden until html.consent-open, which the head script sets on
   first paint when no choice is stored. Below the menu drawer, search and booking modals (120+), above the tab bar (90). */
.consent{
  display:none; position:fixed; z-index:110; left:24px; bottom:24px; box-sizing:border-box;
  width:min(460px, calc(100vw - 48px)); max-height:calc(100vh - 48px); max-height:calc(100dvh - 48px);
  overflow:auto; overscroll-behavior:contain; padding:20px 22px;
  background:var(--paper); color:var(--ink-2); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow-2); font-size:.95rem; line-height:1.5;
}
.consent-open .consent{ display:block }
.consent [hidden]{ display:none !important }
.consent p{ margin:0; max-width:none }
.consent .consent-intro{ margin-bottom:6px }
.consent-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px }
.consent .consent-title{ color:var(--ink); font-family:var(--f-display); font-weight:700; font-size:1.15rem; line-height:1.25 }
.consent-close{
  display:inline-flex; align-items:center; justify-content:center; flex:none; width:44px; height:44px; margin:-8px -10px -8px 0;
  padding:0; border:0; border-radius:8px; background:none; color:var(--ink-2); cursor:pointer;
}
.consent-close:hover{ background:var(--mist); color:var(--ink) }
.consent-link{ color:var(--teal-ink); text-decoration:underline; text-underline-offset:2px; cursor:pointer }
.consent-link:hover{ color:var(--ink) }

/* Rows: one fixed, two switches */
.consent-rows{ margin:14px 0 0; padding:0; list-style:none; border-top:1px solid var(--line) }
.consent-rows li{ margin:0; padding:6px 0 12px; border-bottom:1px solid var(--line) }
.consent-rows p{ font-size:.875rem; line-height:1.45 }
.consent-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:44px }
label.consent-row{ cursor:pointer }
.consent-name{ color:var(--ink); font-family:var(--f-display); font-weight:640; font-size:1rem }
.consent-state{ color:var(--ink-3); font-size:.875rem; text-align:right }
.consent input[role="switch"]{
  -webkit-appearance:none; appearance:none; position:relative; flex:none; box-sizing:border-box; width:48px; height:28px; margin:0;
  border:2px solid var(--ink-3); border-radius:999px; background:var(--paper); cursor:pointer;
  transition:background-color .15s ease-out, border-color .15s ease-out;
}
.consent input[role="switch"]::before{
  content:""; position:absolute; top:4px; left:4px; width:16px; height:16px; border-radius:50%; background:var(--ink-3);
  transition:transform .15s ease-out, background-color .15s ease-out;
}
.consent input[role="switch"]:checked{ background:var(--teal-ink); border-color:var(--teal-ink) }
.consent input[role="switch"]:checked::before{ background:#fff; transform:translateX(20px) }

/* The two buttons carry the same weight: same colour, same size */
.consent-actions{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:16px }
.consent .consent-btn{ padding:10px 12px; background:var(--teal-ink); color:#fff; border:2px solid var(--teal-ink) }
.consent .consent-btn:hover{ background:var(--footer-bg); border-color:var(--footer-bg) }

/* Room under the page end and around keyboard focus while the banner is up (--consent-h is set by locals-consent.js) */
.consent-open{ scroll-padding-bottom:calc(var(--consent-h, 0px) + 40px) }
.consent-open .site-footer::after{ content:""; display:block; height:calc(var(--consent-h, 0px) + 24px) }

@media (max-width:767.98px){
  .consent{
    left:8px; right:8px; width:auto; padding:16px; font-size:.925rem; line-height:1.45;
    bottom:calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px) + 8px);
    max-height:calc(100vh - var(--bottomnav-h) - 24px);
    max-height:calc(100dvh - var(--bottomnav-h) - env(safe-area-inset-bottom, 0px) - 16px);
  }
  .consent-open{ scroll-padding-bottom:calc(var(--consent-h, 0px) + var(--bottomnav-h) + 24px) }
}
/* Long list on a normal screen: the buttons stay in view while the rows scroll */
@media (min-height:520px){
  .consent-actions{ position:sticky; bottom:-20px; margin:16px -22px -20px; padding:14px 22px 20px; background:var(--paper) }
}
@media (min-height:520px) and (max-width:767.98px){
  .consent-actions{ bottom:-16px; margin:12px -16px -16px; padding:12px 16px 16px }
}
@media (min-height:520px){
  .consent-rows:not([hidden]) ~ .consent-actions{ border-top:1px solid var(--line) }
  .consent-rows li:last-child{ border-bottom:0 }
}
/* Short screens (a phone on its side, 400% zoom): use the whole height */
@media (max-height:519.98px){ .consent{ bottom:8px; max-height:calc(100vh - 16px); max-height:calc(100dvh - 16px) } }

/* Footer "Cookie settings": a button that looks like its neighbours; the text link in the privacy policy */
.footer-grid button.footer-js{ padding-inline:0; border:0; background:none; font-family:inherit; line-height:inherit; text-align:left }
.consent-open-link{ display:inline; padding:0; border:0; background:none; color:var(--teal-ink); font:inherit; text-decoration:underline; text-underline-offset:2px; cursor:pointer }
.consent-open-link:hover{ color:var(--ink) }

@media (prefers-reduced-motion:reduce){ .consent input[role="switch"], .consent input[role="switch"]::before{ transition:none } }
@media (forced-colors:active){ .consent input[role="switch"]{ -webkit-appearance:auto; appearance:auto; width:24px; height:24px } .consent input[role="switch"]::before{ content:none } }
@media print{ .consent{ display:none !important } .consent-open .site-footer::after{ content:none } }
