/*
  Pet Doctor — shared styles for the public legal pages.
  No external fonts, scripts, images or trackers. No cookies.
*/

:root {
  --bg: #fffdf8;
  --surface: #ffffff;
  --surface-alt: #fff4e0;
  --text: #2b2622;
  --muted: #5f564e;
  --border: #e6dccd;
  --accent: #b4461f;
  --accent-text: #ffffff;
  --link: #1f5fa8;
  --link-visited: #6a3d9a;
  --focus: #1f5fa8;
  --note-bg: #eef5ff;
  --note-border: #b8cfee;
  --radius: 12px;
  --measure: 46rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916;
    --surface: #24211d;
    --surface-alt: #2e2924;
    --text: #f1ebe3;
    --muted: #c4b9ac;
    --border: #463f37;
    --accent: #f08a5d;
    --accent-text: #1b1916;
    --link: #8fc1ff;
    --link-visited: #c9a7f0;
    --focus: #8fc1ff;
    --note-bg: #1f2a38;
    --note-border: #3b5577;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

/* ---------- Layout ---------- */

.site-header,
main,
.site-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: underline;
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
}

.lang-switch a {
  display: inline-block;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  line-height: 1.6;
}

.lang-switch a:hover {
  border-color: var(--accent);
}

main {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.site-footer {
  padding-top: 1.25rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

/* ---------- Typography ---------- */

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 2rem 0 0.75rem;
}

h1 {
  font-size: 1.85rem;
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

strong {
  font-weight: 700;
}

.meta {
  color: var(--muted);
  margin-top: -0.25rem;
}

.lead {
  font-size: 1.125rem;
}

/* ---------- Blocks ---------- */

.summary {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0 1.5rem;
}

.summary h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0.25rem;
}

.summary ul {
  margin-bottom: 0.25rem;
}

.note {
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 1rem 0 1.25rem;
}

.note p:last-child {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  min-height: 2rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-align: center;
  line-height: 1.9rem;
}

.button {
  display: inline-block;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: none;
}

.button:visited {
  color: var(--accent-text);
}

.button:hover {
  filter: brightness(1.08);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.cards li {
  margin: 0;
}

.cards a {
  display: block;
  height: 100%;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--accent);
}

.cards strong {
  display: block;
  color: var(--link);
  font-size: 1.05rem;
}

.cards span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Tables (scroll inside their own box, never the page) ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 44rem;
  font-size: 0.95rem;
}

caption {
  text-align: left;
  padding: 0.75rem 0.9rem 0.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.9rem;
  border-top: 1px solid var(--border);
}

thead th {
  background: var(--surface-alt);
  border-top: 0;
  font-weight: 700;
}

tbody th {
  font-weight: 700;
  min-width: 11rem;
}

td ul {
  margin: 0;
  padding-left: 1.1rem;
}

/* ---------- Accessibility helpers ---------- */

.skip-link {
  position: absolute;
  left: 16px;
  top: -10rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
}

.skip-link:focus {
  top: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- Print ---------- */

@media print {
  .site-header nav,
  .skip-link,
  .site-footer nav {
    display: none;
  }

  [hidden] {
    display: block !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  table {
    min-width: 0;
  }
}
