/* Dürfen Hunde …? — web pages, direction "Praxis-Handout" (prototype, candidate 5 of 7).
   The information sheet a vet practice hands out at the counter: an uncoated A4 sheet,
   one monumental title, blocks ranked by weight and rules, three verdict dots that mean
   verdicts and nothing else, a rubber stamp at the foot. Plain HTML + CSS, no scripts,
   fonts self-hosted. */

/* ---------- Fonts (self-hosted, SIL OFL, see fonts/LICENSE.txt) ---------- */

@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-600-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("fonts/bricolage-grotesque-800-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-400italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/atkinson-hyperlegible-next-700-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light dark;

  --ground: #FBF6EE;
  --ink: #1D1D1B;
  --ink-soft: #5C5954;        /* secondary text, 6.4:1 on ground */
  --rule: #C9C2B6;            /* hairlines */
  --rust: #B85A24;            /* rules, borders, marks, large stamp lettering */
  --rust-text: #A04E1E;       /* rust at body size, 5.4:1 on ground */
  --yes: #238B4B;
  --no: #C93636;
  --little: #B97B0C;
  --mark-bg: #F3DCB0;         /* placeholder highlight */
  --mark-ink: #1D1D1B;
  --selection: #EAD2BF;

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --measure: 66ch;
  --text: 1.0625rem;          /* the one body size */
  --small: 0.875rem;          /* the quiet lines: app name, nav, stamp body */
  --leading: 1.55;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #171513;
    --ink: #EBE9E3;
    --ink-soft: #A9A49B;
    --rule: #3C3833;
    --rust: #E89360;
    --rust-text: #E89360;
    --yes: #4CC27A;
    --no: #F06A6A;
    --little: #F0B640;
    --mark-bg: #4A3416;
  --mark-ink: #F7E4C4;        /* mark text tinted from the mark's own hue, not grey */
    --selection: #4A3A2E;
  }
}

/* ---------- Sheet ---------- */

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--text);
  line-height: var(--leading);
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
  border-top: 3px solid var(--rust);   /* the thin rust rule at the head of the sheet */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--selection);
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
  border-radius: 1px;
}

.sheet {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Head: app name, nav line, the title ---------- */

.head {
  padding-top: 0.75rem;
}

.app-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--small);
  letter-spacing: 0.01em;
}

.app-name a {
  color: var(--ink);
  text-decoration: none;
}

.app-name a:hover {
  color: var(--rust-text);
}

/* One quiet text line: pages on the left, languages on the right. */
.line {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  margin-top: 0.5rem;
  padding-block: 0.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: var(--small);
}

.line ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}

.line li + li::before {
  content: "·";
  color: var(--ink-soft);
  margin-inline-end: 0.5rem;
}

.lang li + li::before {
  content: "/";
}

.line a {
  color: var(--ink);
  text-decoration: none;
}

.line a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rust);
}

/* The current page carries a short rust rule under its name: a mark, not a hue. */
.line a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
  text-decoration-color: var(--rust);
}

/* The one monumental moment on the page. */
h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 14vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 2.25rem 0 0;
}

.lede {
  margin: 1.25rem 0 0;
  max-width: 48ch;
  color: var(--ink-soft);
}

/* ---------- Legend: the three verdicts, on the support page only ---------- */

.legend {
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.75rem;
}

.legend li {
  display: grid;
  grid-template-columns: 1.25rem auto 1fr;
  column-gap: 0.75rem;
  align-items: baseline;
}

.legend li::before {
  content: "";
  display: block;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 50%;
  align-self: start;
  margin-top: 0.45em;             /* sits on the first line's x-height, not between two lines */
  background: var(--dot);
}

.legend .yes { --dot: var(--yes); }
.legend .no { --dot: var(--no); }
.legend .little { --dot: var(--little); }

/* The fourth answer of the food list, "Giftig" / "Toxic" (plan 13): the app's level for an
   urgent "no". An ink triangle, as in the app's library, not a fourth verdict colour. */
.legend .toxic::before,
.v.toxic::before {
  background: var(--ink);
  border-radius: 0;
  clip-path: polygon(50% 4%, 100% 96%, 0 96%);
}

.legend strong {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.01em;
  min-width: 5ch;
}

.legend span {
  color: var(--ink-soft);
}

@media (min-width: 40rem) {
  .legend {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
  /* Four answers in two rows of two: four columns left the toxic line five lines long. */
  .legend.four {
    grid-template-columns: repeat(2, 1fr);
  }
  .legend li {
    grid-template-columns: 1.25rem 1fr;
    grid-template-rows: auto auto;
    row-gap: 0.125rem;
  }
  .legend li::before {
    grid-row: 1;
    align-self: center;
    margin-top: 0;
  }
  .legend span {
    grid-column: 2;
  }
}

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

main {
  flex: 1;
  padding-bottom: 3rem;
}

.block {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.block:first-of-type {
  margin-top: 2.5rem;
  border-top: 2px solid var(--ink);
}

/* Headings stay at the body size; rank comes from the display face and its weight. */
h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--text);
  line-height: 1.3;
  letter-spacing: -0.005em;
  margin: 0 0 0.75rem;
  text-wrap: pretty;
}

/* On the privacy sheet each block is headed by a small ink dot: a block mark, not a verdict. */
.dotted h2::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  margin-inline-end: 0.6em;
  vertical-align: 0.1em;
}

h3 {
  font-family: var(--body);
  font-weight: 700;
  font-size: var(--text);
  line-height: inherit;
  margin: 1.5rem 0 0.25rem;
  text-wrap: pretty;
}

h2 + h3 {
  margin-top: 0;
}

p,
ul,
dl {
  margin: 0 0 1rem;
  max-width: var(--measure);
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 10 4 4;
}

p:last-child,
ul:last-child,
dl:last-child {
  margin-bottom: 0;
}

main ul {
  padding-inline-start: 1.25rem;
}

main li + li {
  margin-top: 0.5rem;
}

main li::marker {
  color: currentColor;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rust);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--rust-text);
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 700;
}

/* Placeholders the owner fills in, visible on purpose. */
mark {
  background: var(--mark-bg);
  color: var(--mark-ink);
  padding: 0 0.2em;
  border-radius: 2px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Inline verdict words in running text keep their dot beside them. */
.v {
  white-space: nowrap;
}

.v::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  margin-inline-end: 0.3em;
  vertical-align: 0.05em;
  background: var(--dot);
}

.v.yes { --dot: var(--yes); }
.v.no { --dot: var(--no); }
.v.little { --dot: var(--little); }

/* A listed "Weiß ich nicht" / "Don't know" (plan 16): an ink ring, no verdict colour. */
.v.unknown::before {
  background: transparent;
  box-shadow: inset 0 0 0 0.12em var(--ink);
}

/* Postal address (Impressum only). */
address {
  font-style: normal;
  line-height: var(--leading);
}

address p {
  margin-bottom: 0.75rem;
}

.meta {
  color: var(--ink-soft);
}

/* ---------- Food list (de/lebensmittel.html, en/foods.html; tools/build_site_list.py) ----------
   The same sheet as a ruled ledger: a letter opens under an ink rule, the entries stand between
   hairlines, the name on the left and its answer on the right of one row. Inside an entry the
   rank runs answer, other names, sources: the name and the app's lines at the body size, the
   other names and the sources in the quiet size, the sources behind a native disclosure.
   Letters are plain anchors; the browser's own search finds a food, its other names too. */

.letters {
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

.letters ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

main .letters li + li {
  margin-top: 0;
}

.letters a {
  display: inline-flex;
  align-items: center;
  min-width: 2.75rem;               /* a 44px target per letter, the letter on the sheet's edge */
  min-height: 2.75rem;
  justify-content: flex-start;
  font-family: var(--display);
  font-weight: 800;
  text-decoration: none;
}

.letters a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

/* A letter opens like the first block: an ink rule, stronger than the hairlines between entries. */
.block.letter {
  border-top: 2px solid var(--ink);
  scroll-margin-top: 1rem;
}

.letter h2 {
  margin-bottom: 0;
}

.foods,
.sources ul {
  list-style: none;
  padding: 0;
  margin: 0;
  -webkit-hyphens: manual;          /* a food name is never hyphenated (owner, 02.11.2026) */
  hyphens: manual;
}

.food {
  padding-block: 0.875rem 0.375rem; /* the disclosure's own padding makes up the foot */
}

main .foods .food + .food {
  margin-top: 0;
  border-top: 1px solid var(--rule);
}

/* The name with its answer on the right; the answer moves under a long name on a narrow screen. */
.food-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
}

.food h3 {
  margin: 0;
}

.food p {
  margin: 0;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.food-lines {
  margin-top: 0.125rem;
}

.aka,
.sources {
  font-size: var(--small);
  color: var(--ink-soft);
}

.food .aka {
  margin-top: 0.25rem;
}

/* "3 Quellen": a quiet line that opens in place, underlined in rust like every link. */
.sources summary {
  display: block;
  width: fit-content;
  list-style: none;
  padding-block: 0.375rem 0.5rem;   /* a 36px target without loosening the entry */
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rust);
  text-underline-offset: 0.2em;
}

.sources summary::-webkit-details-marker {
  display: none;
}

.sources summary:hover {
  color: var(--rust-text);
  text-decoration-thickness: 2px;
}

.sources[open] summary {
  color: var(--ink);
}

.sources ul {
  padding-bottom: 0.5rem;
}

main .sources li + li {
  margin-top: 0.5rem;
}

/* The page under its publisher's name, as the app's sources sheet shows it. */
.where {
  display: block;
  overflow-wrap: anywhere;          /* a long page name never widens the sheet */
}

/* ---------- Foot: the stamp ---------- */

footer {
  padding-block: 1.5rem 3rem;
  border-top: 1px solid var(--rule);
}

.stamp {
  display: inline-block;
  max-width: 100%;
  padding: 0.875rem 1.125rem 1rem;
  border: 2px solid var(--rust);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--ground), inset 0 0 0 2px var(--rust);
  transform: rotate(-1.4deg);
  transform-origin: left center;
  margin: 0.75rem 0 0 0.25rem;
  font-size: var(--small);
  line-height: 1.4;
}

.stamp-title {
  margin: 0 0 0.25rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;             /* large text: rust at 4.3:1 is allowed here */
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--rust-text);
  text-transform: uppercase;
}

.stamp p {
  margin: 0;
}

.stamp ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.5rem;
}

.stamp li + li::before {
  content: "·";
  color: var(--ink-soft);
  margin-inline-end: 0.5rem;
}

.stamp a {
  color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .stamp {
    transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  }
  .stamp:hover {
    transform: rotate(-0.4deg);
  }
}

@media print {
  body {
    border-top-color: #000;
  }
  .line {
    display: none;
  }
}
