/*
 * Access To — shared in-app disclaimer.
 *
 * Every published page links this stylesheet and carries the notice markup
 * (see tests/disclaimer.test.mjs, which fails if a page is missing it).
 * Interactive pages also load disclaimer.js with data-acknowledge, which
 * shows a one-time acknowledgment dialog with the full text.
 *
 * Colors follow the site palette (paper / ink / accent). Every text pair
 * below meets WCAG AA (4.5:1).
 *
 * Light only, like the pages that use it: neither the landing page nor the
 * catalog has a dark theme, so a dark notice or dialog would sit as a dark
 * band on a light page. If a page gains a dark theme, add the dark notice
 * and dialog styles under the same condition that page uses.
 */

.a2-disclaimer {
  --a2-bg: #ebe4d6;        /* paper-deep */
  --a2-fg: #0d1220;        /* ink, 14.8:1 on bg */
  --a2-link: #8f2a17;      /* deep accent, 6.6:1 on bg */
  --a2-rule: #c9a24a;
  --a2-focus: #0066cc;      /* 4.4:1, non-text needs 3:1 */
  background: var(--a2-bg);
  color: var(--a2-fg);
  border-bottom: 1px solid var(--a2-rule);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 16px;
  position: relative;
  z-index: 60;
  color-scheme: light;
}
.a2-disclaimer p {
  max-width: 1100px;
  margin: 0 auto;
}
.a2-disclaimer strong { font-weight: 700; }
.a2-disclaimer a {
  color: var(--a2-link);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  /* 44px touch targets: inline padding grows the hit area and the matching
     negative margin keeps the text flow and line height unchanged. */
  padding: 14px 0;
  margin: -14px 0;
}
.a2-disclaimer a[href^="tel:"] { padding: 14px 12px; margin: -14px -12px; }
.a2-disclaimer a:focus-visible,
.a2-ack :focus-visible {
  outline: 3px solid var(--a2-focus);
  outline-offset: 2px;
}

/* ---------- One-time acknowledgment dialog ---------- */
.a2-ack {
  --a2-bg: #f5efe5;        /* paper */
  --a2-fg: #0d1220;        /* ink, 16.3:1 */
  --a2-muted: #3a3730;     /* 10.4:1 */
  --a2-link: #8f2a17;      /* 7.3:1 */
  --a2-btn-bg: #0d1220;
  --a2-btn-fg: #f5efe5;    /* 16.3:1 */
  --a2-rule: rgba(13, 18, 32, 0.2);
  --a2-focus: #0066cc;
  background: var(--a2-bg);
  color: var(--a2-fg);
  border: 2px solid var(--a2-fg);
  border-radius: 4px;
  padding: 0;
  margin: auto;            /* host pages reset * { margin: 0 } */
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.55;
  color-scheme: light;     /* light scrollbar inside the dialog, like the page */
}
.a2-ack::backdrop { background: rgba(13, 18, 32, 0.6); }
.a2-ack-inner {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}
.a2-ack-body {
  overflow-y: auto;
  padding: 20px 20px 8px;
}
.a2-ack h2 {
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 12px;
}
.a2-ack h2:focus { outline: none; }
.a2-ack h2:focus-visible { outline: 3px solid var(--a2-focus); outline-offset: 2px; }
.a2-ack p { margin: 0 0 12px; }
.a2-ack ul { margin: 0 0 12px; padding-left: 20px; }
.a2-ack li { margin-bottom: 8px; }
.a2-ack a { color: var(--a2-link); font-weight: 700; text-underline-offset: 2px; }
.a2-ack .a2-ack-more { color: var(--a2-muted); font-size: 14px; }
.a2-ack-actions {
  border-top: 1px solid var(--a2-rule);
  padding: 12px 20px 16px;
  display: flex;
  justify-content: flex-end;
}
.a2-ack-actions button {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 22px;
  font: inherit;
  font-weight: 700;
  background: var(--a2-btn-bg);
  color: var(--a2-btn-fg);
  border: 2px solid var(--a2-btn-bg);
  border-radius: 3px;
  cursor: pointer;
}
@media (max-width: 480px) {
  .a2-ack-actions button { width: 100%; }
}

/* No animation is used; this block keeps it that way if one is added. */
@media (prefers-reduced-motion: reduce) {
  .a2-disclaimer, .a2-ack, .a2-ack::backdrop { transition: none; animation: none; }
}
