/* Website compliance kit: styles for the static cookie popup and preferences dialog (consent.js, 2026-10-08).
 * Set the tokens to the site's brand, then check every pair with scripts/contrast.py: text 4.5:1, borders and focus
 * rings 3:1, white button text on the accent 4.5:1. A file, not injected CSS, so an enforcing CSP needs no
 * 'unsafe-inline' for styles. */
:root {
  /* Covenant Tree Care: pine surfaces, birch-cream ink, Covenant's green accent (checked with contrast.py) */
  --cc-bg: #0c1b13;
  --cc-ink: #f4f0e6; /* 15.6:1 */
  --cc-muted: #cccbbd; /* 10.9:1 */
  --cc-line: #687a6b; /* 3.9:1, the category box */
  --cc-rule: #223227;
  --cc-panel: #122218;
  --cc-accent: #58b167; /* Covenant's lighter green; buttons, links, focus ring */
  --cc-accent-ink: #07180b; /* text on the accent */
  --cc-font: 'Atkinson Hyperlegible Next Variable', 'Atkinson Hyperlegible Next', system-ui, sans-serif;
}

/* The popup (Q818). It never shows on the first paint (consent.js waits for a quarter-screen scroll or 6 seconds), and
   it never sits on a page's main words and buttons: under 768px it is a slim bar on the bottom edge, and while the
   phone call bar (partials/callbar.html, under 900px) is up it rides just above it, so Call stays one tap away; from
   768px it is a compact card in the bottom right corner. Accept all and Reject all stay identical, side by side. */
.cc {
  --cc-callbar: 75px; /* the call bar: 10px + a 54px button + 10px, and its 1px top line */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  max-height: 70vh;
  overflow-y: auto;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: var(--cc-bg);
  color: var(--cc-ink);
  box-shadow: 0 -10px 30px rgba(4, 12, 8, 0.32), 0 0 0 1px rgba(244, 240, 230, 0.12);
  font: 14px/1.45 var(--cc-font);
}
@media (max-width: 899px) {
  body.has-callbar .cc { bottom: calc(var(--cc-callbar) + env(safe-area-inset-bottom)); padding-bottom: 14px; }
}
@media (min-width: 768px) {
  .cc { left: auto; right: 20px; bottom: 20px; width: 360px; padding: 16px 16px 12px; border-radius: 20px; font-size: 14.5px; box-shadow: 0 12px 40px rgba(4, 12, 8, 0.4), 0 0 0 1px rgba(244, 240, 230, 0.12); }
}
@media (min-width: 768px) and (max-width: 899px) {
  body.has-callbar .cc { bottom: calc(var(--cc-callbar) + 16px + env(safe-area-inset-bottom)); padding-bottom: 12px; }
}
.cc-title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.cc-desc { margin: 0; }
.cc a,
.cc-dialog a { color: var(--cc-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cc-actions { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 8px; margin-top: 10px; }
.cc-actions .cc-btn { min-height: 44px; padding: 0 12px; }
@media (min-width: 768px) {
  .cc-actions { grid-template-columns: 1fr 1fr; margin-top: 12px; row-gap: 2px; }
  .cc-manage { grid-column: 1 / -1; }
}
/* Manage preferences: a quiet text button beside or under the two equal choices. A phone shows "Manage"; the button's
   name stays "Manage preferences" for screen readers. */
.cc-manage {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--cc-ink);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--cc-line);
  text-underline-offset: 4px;
  cursor: pointer;
}
.cc-manage:hover { background: var(--cc-panel); text-decoration-color: currentColor; }
.cc-manage:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 2px; }
@media (max-width: 639px) {
  .cc-more-word { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.cc-wide { grid-column: 1 / -1; }
.cc-btn {
  min-height: 46px;
  padding: 0 16px;
  border: 2px solid var(--cc-accent);
  border-radius: 999px;
  background: var(--cc-accent);
  color: var(--cc-accent-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}
.cc-btn-outline { background: transparent; color: var(--cc-accent); }
.cc-btn:focus-visible,
.cc-x:focus-visible,
.cc a:focus-visible,
.cc-dialog a:focus-visible,
.cc-dialog input:focus-visible,
.cc-dialog summary:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 3px; }

/* The preferences dialog (native <dialog>: focus stays inside, Esc closes, focus returns) */
.cc-dialog {
  width: min(600px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--cc-bg);
  color: var(--cc-ink);
  box-shadow: 0 24px 80px rgba(4, 12, 8, 0.5), 0 0 0 1px rgba(244, 240, 230, 0.1);
  font: 15px/1.55 var(--cc-font);
}
.cc-dialog::backdrop { background: rgba(4, 12, 8, 0.6); }
.cc-in { position: relative; padding: 24px; }
@media (min-width: 640px) { .cc-in { padding: 32px; } }
.cc-x {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--cc-muted);
  cursor: pointer;
}
.cc-x:hover { background: var(--cc-panel); }
.cc-dialog .cc-title { padding-right: 44px; font-size: 24px; }
.cc-dialog p { margin: 8px 0 0; }
.cc-note { padding: 12px 16px; border-radius: 12px; background: var(--cc-panel); }
.cc-cats { margin-top: 24px; border: 1px solid var(--cc-line); border-radius: 16px; }
.cc-cat { display: flex; gap: 14px; padding: 16px; }
.cc-cat + .cc-cat { border-top: 1px solid var(--cc-line); }
.cc-cat input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--cc-accent); }
.cc-cat label { font-size: 16px; font-weight: 600; cursor: pointer; }
.cc-cat label span { font-weight: 400; color: var(--cc-muted); }
.cc-cat p { margin: 4px 0 0; font-size: 14px; color: var(--cc-muted); }
.cc-cat details { margin-top: 10px; font-size: 13.5px; }
.cc-cat summary {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--cc-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
/* The table wraps instead of scrolling sideways, so it needs no focusable scroll box at 320 px */
.cc-cat table { width: 100%; margin-top: 8px; border-collapse: collapse; text-align: left; overflow-wrap: anywhere; }
.cc-cat th,
.cc-cat td { padding: 6px 10px 6px 0; vertical-align: top; }
.cc-cat th { color: var(--cc-muted); font-weight: 600; }
.cc-cat td { border-top: 1px solid var(--cc-rule); }
.cc-actions-3 { grid-template-columns: 1fr; margin-top: 24px; }
@media (min-width: 640px) { .cc-actions-3 { grid-template-columns: repeat(3, 1fr); } }
.cc-more { font-size: 13px; color: var(--cc-muted); }
.cc-gpc { margin-left: 6px; }
.cc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
/* A slide only, no fade: it comes up after the first paint, and it moves with the call bar (same 460ms ease). */
@media (prefers-reduced-motion: no-preference) {
  .cc { animation: cc-in 0.35s cubic-bezier(0.16, 1, 0.3, 1); transition: bottom 460ms cubic-bezier(0.16, 1, 0.3, 1); }
}
@keyframes cc-in {
  from { transform: translateY(24px); }
  to { transform: none; }
}
