/* Shared across every page (dashboard, profile, legal, auth): accessibility
   baseline, footer, legal-document typography, cookie consent, settings
   pages. Uses the design tokens from style.css (profile.css defines aliases
   for the same names). */

/* =========================================================================
   Accessibility baseline (WCAG 2.2 AA) — shared by every page
   ========================================================================= */

/* Visible keyboard focus everywhere. Mouse clicks don't show the ring
   (:focus-visible), keyboard navigation always does. */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}
.input-field:focus-visible,
.form-field input:focus-visible, .form-field select:focus-visible, .form-field textarea:focus-visible,
.comment-input:focus-visible, .topbar-search input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 1px;
}

/* Form controls get a ≥3:1 boundary */
.form-field input, .form-field select, .form-field textarea { border-color: var(--input-border); }

/* Dark theme: keep white text on the navy welcome gradient ≥4.5:1 by
   starting it from a deeper navy than the dark-mode --action. */
[data-theme='dark'] .welcome-card-navy {
  background: linear-gradient(135deg, #2A4270 0%, var(--heart) 100%) !important;
}

/* Skip link — first focusable element on each page */
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-main);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
}
.skip-link:focus { top: 12px; }

/* Visually hidden but available to screen readers */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================================
   Site footer, legal pages, cookie consent
   ========================================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 3rem;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.site-footer-inner { max-width: 960px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; align-items: center; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
.site-footer a, .legal-links a, .legal-link-btn { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover, .legal-links a:hover, .legal-link-btn:hover { color: var(--text-main); }
.legal-link-btn { font: inherit; font-size: inherit; padding: 0; background: none; border: none; cursor: pointer; }
.legal-links { font-size: 0.72rem; color: var(--text-muted); line-height: 1.7; padding: 0.75rem 0.25rem 0; }
.legal-links ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.15rem 0.75rem; }

.legal-doc { max-width: 780px; margin: 0 auto; padding: 2rem 1.25rem 3rem; color: var(--text-main); line-height: 1.7; }
.legal-doc h1 { font-family: var(--font-display); font-size: 2.3rem; line-height: 1.15; margin-bottom: 0.5rem; }
.legal-doc h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.15rem; margin: 2rem 0 0.6rem; letter-spacing: 0; }
.legal-doc h3 { font-family: var(--font-body); font-weight: 700; font-size: 0.98rem; margin: 1.25rem 0 0.4rem; letter-spacing: 0; }
.legal-doc p, .legal-doc li { font-size: 0.93rem; }
.legal-doc p { margin: 0 0 0.8rem; }
.legal-doc ul, .legal-doc ol { margin: 0 0 0.9rem 1.3rem; }
.legal-doc li { margin-bottom: 0.3rem; }
.legal-doc a { color: var(--action); text-underline-offset: 2px; }
.legal-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 0.5rem 0 1.2rem; font-size: 0.85rem; display: block; overflow-x: auto; }
.legal-doc th, .legal-doc td { border: 1px solid var(--border-strong); padding: 0.5rem 0.65rem; text-align: left; vertical-align: top; }
.legal-doc th { background: var(--surface-alt); font-weight: 700; }
.legal-callout { border: 1px solid var(--border-strong); border-left: 4px solid var(--action); background: var(--surface); border-radius: var(--radius-md); padding: 0.85rem 1rem; margin: 1rem 0 1.25rem; font-size: 0.88rem; }
.owner-todo { background: color-mix(in oklab, var(--accent) 18%, var(--surface)); border: 1px dashed var(--badge-text); color: var(--text-main); border-radius: 4px; padding: 0 4px; font-size: 0.86em; }
.legal-toc { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.75rem 1rem; background: var(--surface); margin-bottom: 1.5rem; }
.legal-toc ol { margin-bottom: 0; columns: 2; column-gap: 2rem; }
@media (max-width: 640px) { .legal-toc ol { columns: 1; } .legal-doc h1 { font-size: 1.9rem; } }

.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 99999;
  max-width: 720px; margin: 0 auto;
  background: var(--surface); color: var(--text-main);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); padding: 1.1rem 1.25rem;
}
.cookie-banner h2 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; margin-bottom: 0.35rem; letter-spacing: 0; }
.cookie-banner p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.85rem; }
.cookie-banner a { color: var(--action); }
.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
/* Accept and Reject share identical styling so neither is visually favoured */
.cookie-actions .btn { flex: 1 1 160px; padding: 0.6rem 1rem; font-size: 0.85rem; }
.cookie-prefs { margin: 0.75rem 0 0.9rem; display: flex; flex-direction: column; gap: 0.6rem; }
.cookie-pref-row { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); }
.cookie-pref-row input { margin-top: 0.3rem; width: 18px; height: 18px; accent-color: var(--action); flex-shrink: 0; }
.cookie-pref-row label { font-weight: 700; font-size: 0.88rem; }
.cookie-pref-row .desc { font-size: 0.8rem; color: var(--text-muted); }

/* Settings-style pages (privacy settings, unsubscribe) */
.settings-card { padding: 1.5rem; margin-bottom: 1.25rem; }
.settings-card h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.4rem; letter-spacing: 0; }
.settings-card p { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0.75rem; }
.toggle-row { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0; border-top: 1px solid var(--border); }
.toggle-row:first-of-type { border-top: none; }
.toggle-row input[type="checkbox"] { width: 20px; height: 20px; margin-top: 0.2rem; accent-color: var(--action); flex-shrink: 0; }
.toggle-row label { font-weight: 650; font-size: 0.9rem; }
.toggle-row .desc { font-size: 0.8rem; color: var(--text-muted); }
.status-msg { font-size: 0.85rem; font-weight: 600; margin-top: 0.6rem; min-height: 1.3em; }
.status-msg.is-error { color: var(--like-active); }
.status-msg.is-ok { color: var(--action); }
.btn-danger { background: transparent; color: var(--like-active); border: 1.5px solid var(--like-active); }
.btn-danger:hover { background: color-mix(in oklab, var(--like-active) 10%, transparent); }
.btn-danger-solid { background: var(--like-active); color: #fff; border: none; }
[data-theme='dark'] .btn-danger-solid { color: #0D1220; }

/* Registration consent block */
.consent-check { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.82rem; color: var(--text-main); line-height: 1.5; margin: 0.25rem 0 0.75rem; }
.consent-check input { width: 18px; height: 18px; margin-top: 0.15rem; accent-color: var(--action); flex-shrink: 0; }
.consent-check a { color: var(--action); font-weight: 600; }
.field-hint { font-size: 0.74rem; color: var(--text-muted); margin: -0.9rem 0 1rem; line-height: 1.45; }

/* Closed modals stay in the DOM at opacity 0 — hide them from keyboard and
   screen readers too (visibility), but delay it so the fade-out still plays. */
.modal-overlay:not(.active) { visibility: hidden; transition: opacity 0.2s ease, visibility 0s linear 0.2s; }
.modal-overlay.active { visibility: visible; }

/* Business information list (about.html#business) */
.business-info { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 0.55rem 1rem; font-size: 0.88rem; line-height: 1.55; }
.business-info dt { font-weight: 700; color: var(--text-main); }
.business-info dd { margin: 0; color: var(--text-main); }
@media (max-width: 560px) { .business-info { grid-template-columns: 1fr; } .business-info dd { margin-bottom: 0.4rem; } }

/* Point-of-collection notices next to form submit buttons */
.form-notice { font-size: 0.78rem; line-height: 1.55; color: var(--text-muted); background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0.65rem 0.8rem; }
.form-notice ul { margin: 0.25rem 0 0 1.1rem; }
.form-notice a { color: var(--action); }

/* Independent-community disclaimer in the shared footer */
.independence-note { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; flex-basis: 100%; line-height: 1.5; }
