/* Public web · design system v2 (docs/design/design-system.md, ADR-0031).
   Same tokens as the app: petsky.cl sky/lilac, glass with backdrop-filter, Fraunces in
   titles, Plus Jakarta Sans in the interface and Work Sans in body text. On a clinic page,
   clinic.js replaces --accent/--bg/--fg/--soft with its brand and recomputes --muted and --accent-text
   so text meets AA (4.5:1) over the background. */
:root {
  color-scheme: light;
  --bg: #f8faff;
  --fg: #1b2747;
  --muted: #4f5a78;
  --accent: #5e4391;          /* lilac 700: primary button (white on top 8.4:1) */
  --accent-text: #5e4391;     /* links and accent text over the background */
  --on-accent: #ffffff;
  --soft: #f1e8f8;
  --sky: #a2d2ff;
  --lilac: #cdb4db;
  --blush: #ffc8dd;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-border: rgba(255, 255, 255, 0.7);
  --border: rgba(27, 39, 71, 0.12);
  --shadow: 0 12px 32px -8px rgba(31, 47, 94, 0.18), 0 2px 6px rgba(31, 47, 94, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --danger: #b01f33;
  --on-danger: #ffffff;
  --warn-bg: #fff1d1;
  --warn-fg: #7a4e00;
  --focus: #1f5fa8;
  --radius: 28px;
  --radius-sm: 14px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font: 'Work Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Dark mode (Pet Sky only: a brand with its own background is set inline by clinic.js). */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1022;
    --fg: #e8edfb;
    --muted: #a9b3cf;
    --accent: #cdb4db;
    --accent-text: #d9c6e6;
    --on-accent: #1b1530;
    --soft: #241c3a;
    --sky: #1f5fa8;
    --lilac: #5e4391;
    --blush: #7a3150;
    --glass: rgba(22, 29, 54, 0.66);
    --glass-strong: rgba(22, 29, 54, 0.84);
    --glass-border: rgba(255, 255, 255, 0.1);
    --border: rgba(232, 237, 251, 0.14);
    --shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --danger: #ff8a98;
    --on-danger: #2a0910;
    --warn-bg: #3a2a08;
    --warn-fg: #ffd98a;
    --focus: #a2d2ff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--fg);
  background-color: var(--bg);
}
/* 165° gradient and color blobs (sky, lilac, pink) derived from the accent; fixed layer behind
   the content (no background-attachment: fixed, which repaints on every scroll on the phone). */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(520px 520px at 0% 0%, color-mix(in srgb, var(--sky) 55%, transparent), transparent 70%),
    radial-gradient(620px 620px at 100% 100%, color-mix(in srgb, var(--lilac) 50%, transparent), transparent 70%),
    radial-gradient(380px 380px at 30% 45%, color-mix(in srgb, var(--blush) 30%, transparent), transparent 70%),
    linear-gradient(165deg, color-mix(in srgb, var(--bg) 88%, var(--sky)) 0%, var(--bg) 45%, color-mix(in srgb, var(--bg) 90%, var(--lilac)) 100%);
}
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.top { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 18px 16px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.01em; text-decoration: none; color: var(--fg); }
.tag {
  font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: var(--muted);
  padding: 4px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border);
}
main { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; }
.muted { color: var(--muted); }

/* Glass: translucent with blur; without support or with "reduce transparency", a nearly opaque fill. */
.poster, .hero, .panel {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
  backdrop-filter: saturate(170%) blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .poster, .hero, .panel { background: var(--glass-strong); }
}
@media (prefers-reduced-transparency: reduce) {
  .poster, .hero, .panel { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.poster { padding: 28px; }
.kicker {
  margin: 0; font-family: var(--font-ui); font-size: 13px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--danger);
}
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em; }
h1 { margin: 6px 0 14px; font-size: clamp(36px, 8vw, 60px); line-height: 1.04; overflow-wrap: anywhere; }
.emergency {
  display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px;
  background: var(--danger); color: var(--on-danger); font-family: var(--font-ui); font-weight: 600; font-size: 14px;
}
.photo-wrap img { width: 100%; max-height: 440px; object-fit: cover; border-radius: 20px; display: block; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; margin: 20px 0; }
.facts dt { font-family: var(--font-ui); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.description { font-size: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--glass-strong); color: var(--fg);
  font-family: var(--font-ui); font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  box-shadow: 0 2px 6px rgba(31, 47, 94, 0.06);
  transition: transform 200ms var(--ease), background-color 200ms var(--ease), box-shadow 200ms var(--ease);
}
.button:hover { background: var(--soft); }
.button:active { transform: scale(0.98); }
.button.primary {
  background: var(--accent); color: var(--on-accent); border-color: transparent;
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.button.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }

.qr-block { display: flex; align-items: center; gap: 18px; margin: 18px 0; flex-wrap: wrap; }
#qr { width: 168px; height: 168px; padding: 10px; background: #fff; border-radius: 18px; }
#qr svg { width: 100%; height: 100%; }
.qr-text { margin: 0; flex: 1 1 200px; }
.url { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.warning { background: var(--warn-bg); color: var(--warn-fg); padding: 14px 16px; border-radius: 20px; font-size: 15px; }
.warning strong { font-family: var(--font-ui); }
.foot { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; color: var(--muted); font-size: 14px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  body::before { display: none; }
  :root { --fg: #1b2747; --muted: #44506e; --danger: #b01f33; --warn-bg: #fff1d1; --warn-fg: #7a4e00; }
  body { background: #fff; color: var(--fg); }
  .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .poster { box-shadow: none; padding: 0; border: 0; background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  h1 { font-size: 64px; }
  .photo-wrap img { max-height: 11cm; }
  #qr { width: 5cm; height: 5cm; padding: 0; }
}

/* H9 · Clinic page and clinic brand on the notice. */
body.clinic-page { font-family: var(--font); }
.clinic { display: grid; gap: 16px; }
.hero { position: relative; overflow: hidden; padding: 28px; }
.hero::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--soft)));
}
.logo { max-height: 72px; max-width: 280px; display: block; margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 6vw, 48px); margin: 0 0 8px; }
.welcome { font-size: 17px; margin: 0 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.panel { padding: 22px 24px; }
.panel h2 { font-size: 22px; margin: 0 0 12px; }
.contact, .social { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.contact .k, .social .k { display: inline-block; min-width: 92px; color: var(--muted); font-family: var(--font-ui); font-size: 13px; font-weight: 600; }
.contact a, .social a { overflow-wrap: anywhere; }
.address { margin: 12px 0; }
.map { display: block; text-decoration: none; }
.map-tiles { position: relative; width: 100%; max-width: 300px; height: 200px; overflow: hidden; border-radius: 20px; background: var(--soft); }
.map-inner { position: absolute; width: 768px; height: 768px; }
.map-inner img { position: absolute; width: 256px; height: 256px; }
.pin { position: absolute; left: 150px; top: 100px; width: 18px; height: 18px; margin: -18px 0 0 -9px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4); }
.map-credit { font-size: 12px; color: var(--muted); }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.hours dt { color: var(--muted); }
.hours dd { margin: 0; font-weight: 600; }
.clinic-badge { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 18px; text-decoration: none; margin: 8px 0 14px; box-shadow: 0 8px 20px -10px rgba(31, 47, 94, 0.35); }
.clinic-badge img { height: 32px; width: 32px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.clinic-badge small { display: block; font-size: 12px; opacity: 0.9; font-family: var(--font-ui); }
.clinic-badge strong { display: block; font-size: 16px; font-family: var(--font-ui); }
