/* Consent banner, cookie-settings dialog, footer legal links and the /legal/* pages. Uses the tokens from site.css. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Footer legal links ---------- */

.legal-links { width: 100%; font-size: 13px; }
.legal-links a,
.legal-links__button {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-links__button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.booking-form__privacy a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Consent banner ---------- */

.consent-banner {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 16px;
  left: 16px;
  max-width: 560px;
  margin-left: auto;
  padding: 22px 24px;
  background: var(--color-paper);
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 40px rgb(26 24 21 / 0.18);
  font-size: 14px;
  line-height: 1.5;
}
.consent-banner__text { margin: 0 0 16px; color: var(--color-ink-soft); }
.consent-banner__text a { text-decoration: underline; text-underline-offset: 3px; }
.consent-banner__actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }

/* Accept and reject share one style on purpose: neither choice may be nudged. */
.consent-button {
  flex: 1 1 120px;
  padding: 12px 20px;
  border: 1px solid var(--color-ink);
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-paper);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

/* ---------- Settings dialog ---------- */

.consent-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 32px 28px 28px;
  border: 1px solid var(--color-ink);
  border-radius: var(--radius-card);
  background: var(--color-paper);
  color: var(--color-ink);
}
.consent-dialog::backdrop { background: rgb(26 24 21 / 0.45); }
.consent-dialog__title { margin: 0 0 8px; font-family: var(--font-serif); font-weight: 400; font-size: 32px; }
.consent-dialog__intro { margin: 0 0 20px; font-size: 14px; color: var(--color-muted); }
.consent-dialog__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.consent-dialog__actions .consent-button { padding: 12px 14px; white-space: nowrap; }
.consent-dialog__close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
}

.consent-setting {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 0;
  border-top: 1px solid var(--color-rule);
}
.consent-setting__title { font-weight: 600; font-size: 15px; }
.consent-setting__text { margin: 4px 0 0; font-size: 13px; color: var(--color-muted); }
.consent-setting__always-on { flex: none; font-family: var(--font-mono); font-size: 12px; color: var(--color-muted); white-space: nowrap; }

.consent-switch { position: relative; flex: none; display: inline-block; width: 44px; height: 24px; }
/* The real checkbox sits invisibly on top of the drawn track, so it stays clickable and keyboard-focusable. */
.consent-toggle { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.consent-switch__track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--color-checkbox-border);
  transition: background 0.15s;
}
.consent-switch__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-paper);
  transition: transform 0.15s;
}
.consent-toggle:checked + .consent-switch__track { background: var(--color-accent); }
.consent-toggle:checked + .consent-switch__track::after { transform: translateX(20px); }
.consent-toggle:focus-visible + .consent-switch__track { outline: 2px solid var(--color-accent); outline-offset: 3px; }

/* ---------- Legal pages ---------- */

.legal-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 72px;
  padding: var(--section-padding) var(--gutter);
  max-width: 1180px;
}
@media (min-width: 960px) {
  .legal-page { grid-template-columns: 260px minmax(0, 760px); }
  .legal-page__header { grid-column: 1 / -1; }
  .legal-page__toc { position: sticky; top: 24px; align-self: start; }
}
.legal-page__header .section-title { margin-bottom: 12px; }
.legal-page__updated { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--color-muted); }
/* Headings carry their own numbers, so the list itself is unnumbered. */
.legal-page__toc ol { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; color: var(--color-muted); }
.legal-page__toc li { padding: 4px 0; }
.legal-page__toc a:hover { color: var(--color-ink); }

.legal-page__body { font-size: 16px; color: var(--color-ink-soft); }
.legal-section { padding-bottom: 28px; scroll-margin-top: 24px; }
.legal-section h2 { margin: 0 0 12px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(24px, 3vw, 34px); color: var(--color-ink); }
.legal-section h3 { margin: 24px 0 6px; font-size: 16px; font-weight: 600; color: var(--color-ink); }
.legal-section p,
.legal-section li { text-wrap: pretty; }
.legal-section a { text-decoration: underline; text-underline-offset: 3px; }
.legal-section code { font-family: var(--font-mono); font-size: 13px; }

.legal-table-wrap { overflow-x: auto; margin: 12px 0; }
.legal-section table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal-section th,
.legal-section td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--color-rule); text-align: left; vertical-align: top; }
.legal-section th { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-muted); }

.legal-missing { background: #ffe9a8; color: var(--color-ink); padding: 0 4px; font-family: var(--font-mono); font-size: 0.85em; }
