/* pictonfood.co.nz — a printed price-ledger, not a webpage pretending to be one.
   Monospace throughout, tabular numerals, ruled paper, double-rule ledger
   lines, a punched-perforation divider, and a stamped provenance mark.
   Every colour token below keeps the exact hex values already measured at
   5–13:1 in both themes (see /var/www/picton-data/ACCESSIBILITY-AUDIT.md) —
   only structure, spacing, type scale and decorative (non-text) chrome
   changed in this pass. */

:root {
  --bg:        #f3efe4;
  --bg-raised: #fbf9f2;
  --ink:       #1c1a14;
  --ink-dim:   #5c5748;
  --line:      #c9c2ac;
  --accent:    #a3280f;   /* stamped-ink red, prices */
  --accent-2:  #1f5c3f;   /* ledger green, links */
  --warn:      #a3280f;
  --focus:     #1f5c3f;
  --tag-bg:    #e7e1cf;
  --tag-ink:   #3a3628;

  /* Decorative-only tokens (never used for text): ruled-paper hairlines,
     perforation punches, paper shadow. Kept at low alpha against --ink so
     they read as texture, not as a contrast-bearing boundary. */
  --rule:   rgba(28, 26, 20, .06);
  --rule-2: rgba(28, 26, 20, .1);
  --shadow: rgba(28, 26, 20, .16);

  --font-mono: ui-monospace, "JetBrains Mono", "IBM Plex Mono", "Consolas", "SFMono-Regular", Menlo, monospace;
  --row-rhythm: 1.65rem; /* ruled-paper line spacing, echoes body line-height */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:        #0b0d0a;
    --bg-raised: #11140f;
    --ink:       #d9d3b8;
    --ink-dim:   #8b8570;
    --line:      #33362a;
    --accent:    #ffb703;   /* amber, terminal-style price highlight */
    --accent-2:  #6ee7a0;   /* phosphor green links */
    --warn:      #ffb703;
    --focus:     #6ee7a0;
    --tag-bg:    #1c2118;
    --tag-ink:   #9fd8b3;

    --rule:   rgba(217, 211, 184, .05);
    --rule-2: rgba(217, 211, 184, .09);
    --shadow: rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --bg:        #0b0d0a;
  --bg-raised: #11140f;
  --ink:       #d9d3b8;
  --ink-dim:   #8b8570;
  --line:      #33362a;
  --accent:    #ffb703;
  --accent-2:  #6ee7a0;
  --warn:      #ffb703;
  --focus:     #6ee7a0;
  --tag-bg:    #1c2118;
  --tag-ink:   #9fd8b3;
  --rule:   rgba(217, 211, 184, .05);
  --rule-2: rgba(217, 211, 184, .09);
  --shadow: rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  /* Faint ruled-ledger-paper texture. Confined to the page background —
     content surfaces (table, cards, header, footer) paint their own solid
     background over the top, so the rule lines never sit under running
     text and never affect any contrast pair. */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--row-rhythm) - 1px),
    var(--rule) calc(var(--row-rhythm) - 1px),
    var(--rule) var(--row-rhythm)
  );
}

a { color: var(--accent-2); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { text-decoration-style: wavy; }
a:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.pf-skip {
  position: absolute; left: -999px; top: 0;
  background: var(--accent-2); color: var(--bg); padding: .5em 1em; z-index: 10;
}
.pf-skip:focus { left: 0; }

.pf-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Reusable punched-perforation divider: a row of round cut-outs, like the
   tear line on a receipt or a ticket stub. Purely decorative. */
.pf-perf {
  height: 11px;
  background-image: radial-gradient(circle at center, var(--bg) 3.5px, transparent 4px);
  background-size: 14px 11px;
  background-repeat: repeat-x;
  background-position: center;
}
/* Reusable ink-stamp badge: a rotated, bordered mark like a rubber stamp
   on an invoice ("PENDING", "NOT ON FILE"). Colour + border + rotation,
   never colour alone. */
.pf-stamp {
  display: inline-block;
  border: 3px solid var(--accent);
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  padding: .35em .7em;
  transform: rotate(-4deg);
  border-radius: 3px;
  opacity: .92;
}

/* ---- header ---- */
.pf-header {
  border-bottom: 6px double var(--ink);
  background: var(--bg-raised);
  padding: 1.1rem 1.25rem .9rem;
}
.pf-header-inner-wrap {
  max-width: 76rem; margin: 0 auto; width: 100%;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: flex-end; justify-content: space-between;
}
.pf-header-inner { display: flex; flex-direction: column; gap: .3rem; }
.pf-logo {
  font-weight: 700; font-size: 1.55rem; text-decoration: none; color: var(--ink);
  letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: .45rem;
}
.pf-logo-mark { color: var(--accent); flex: none; }
.pf-logo em { font-style: normal; color: var(--accent); }
.pf-cursor { color: var(--accent-2); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pf-tagline {
  margin: 0; color: var(--ink-dim); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .13em;
}

.pf-nav { display: flex; gap: .25rem; }
.pf-nav a {
  margin-left: 0; text-decoration: none; color: var(--ink);
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 .75rem; border: 1px solid var(--line);
}
.pf-nav a:hover, .pf-nav a[aria-current] { border-color: var(--ink); color: var(--accent-2); }

/* ---- main / layout ---- */
.pf-main { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.pf-main h1 { font-size: 1.8rem; margin: 0 0 .6rem; letter-spacing: -.01em; line-height: 1.25; }

/* ---- hero / search ---- */
.pf-hero { padding: .25rem 0 1.9rem; margin-bottom: 2.25rem; }
.pf-hero h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem); margin: 0 0 .5rem; max-width: 32ch;
  line-height: 1.25; letter-spacing: -.01em;
}
.pf-hero-sub { color: var(--ink-dim); margin: 0 0 1.6rem; max-width: 58ch; }

.pf-search-card {
  background: var(--bg-raised); border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
}
.pf-search-row {
  display: flex; align-items: stretch; gap: .5rem;
  padding: .2rem;
}
.pf-prompt { padding: 0 0 0 .7rem; align-self: center; color: var(--accent-2); font-weight: 700; font-size: 1.1rem; }
.pf-search-row input[type="search"] {
  flex: 1; border: 0; background: transparent; color: var(--ink);
  font: inherit; padding: .8rem .5rem; min-width: 0; min-height: 44px;
}
.pf-search-row input[type="search"]::placeholder { color: var(--ink-dim); opacity: .8; }
.pf-search-row button {
  border: 0; background: var(--ink); color: var(--bg); font: inherit;
  padding: 0 1.3rem; cursor: pointer; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; font-size: .85rem;
  min-height: 44px;
}
.pf-search-row button:hover { background: var(--accent-2); }

.pf-search-filters {
  display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; align-items: center;
  padding: .75rem 1rem .9rem;
  font-size: .82rem; color: var(--ink-dim);
}
.pf-search-filters label { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; }
.pf-search-filters select {
  font: inherit; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); padding: .55rem .5rem; min-height: 44px;
}

/* ---- browse / lists ---- */
.pf-browse-lede { color: var(--ink-dim); }
.pf-browse-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2.25rem; }
.pf-browse-grid h2, .pf-results h2 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-dim); margin: 0 0 .6rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--ink);
}
.pf-list { list-style: none; margin: 0; padding: 0; }
.pf-list li {
  display: flex; align-items: baseline; gap: .6rem;
  border-bottom: 1px dashed var(--line);
}
.pf-list li a {
  flex: 0 0 auto; text-decoration: none; display: inline-flex; align-items: center;
  padding: .62rem .1rem; margin: -.1rem 0; min-height: 44px;
}
.pf-list li a:hover { color: var(--accent-2); text-decoration: underline wavy; }
.pf-leader {
  flex: 1 1 auto; min-width: 1rem; align-self: center;
  border-bottom: 1px dotted var(--line); height: 0;
}
.pf-list-wide { max-width: 42rem; border-top: 2px solid var(--ink); margin-top: 1rem; }
.pf-count { color: var(--ink-dim); font-size: .82rem; flex: 0 0 auto; white-space: nowrap; }

/* ---- empty state ---- */
.pf-empty {
  border: 2px solid var(--ink); padding: 1.6rem 1.7rem 1.5rem; background: var(--bg-raised);
  max-width: 58rem; box-shadow: 3px 3px 0 var(--shadow);
}
.pf-empty-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: .5rem; }
.pf-empty-heading { font-weight: 700; margin: 0; font-size: 1.15rem; }
.pf-empty p:last-child { margin-bottom: 0; color: var(--ink-dim); max-width: 60ch; }
.pf-empty p a { color: var(--accent-2); }

/* Ghost/skeleton preview of the table layout dishes will populate — bars,
   not invented words, so nothing here reads as a real dish, price or
   venue fact. aria-hidden in markup; a visually-hidden note stands in. */
.pf-ghost { margin-top: 1.4rem; border-top: 1px dashed var(--line); padding-top: 1.1rem; }
.pf-ghost-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-dim); margin: 0 0 .7rem;
}
.pf-ghost-table { width: 100%; border-collapse: collapse; opacity: .8; }
.pf-ghost-table th {
  text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-dim); border-bottom: 2px solid var(--line); padding: .4rem .6rem;
}
.pf-ghost-table th.pf-num { text-align: right; }
.pf-ghost-table td { padding: .65rem .6rem; border-bottom: 1px dashed var(--line); }
.pf-ghost-bar {
  display: block; height: .7em; border-radius: 2px;
  background: var(--line); opacity: .55;
}
.pf-ghost-table td.pf-num .pf-ghost-bar { margin-left: auto; }

/* ---- results / tables ---- */
.pf-sort { font-size: .82rem; color: var(--ink-dim); margin: .25rem 0 1rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.pf-sort a {
  text-decoration: none; display: inline-flex; align-items: center;
  padding: .7rem .35rem; margin: -.7rem -.1rem; min-height: 44px;
}
.pf-sort a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: underline; }

.pf-table-wrap {
  overflow-x: auto; border: 2px solid var(--ink);
  background: var(--bg-raised); box-shadow: 3px 3px 0 var(--shadow);
}
.pf-table { border-collapse: collapse; width: 100%; min-width: 42rem; font-size: .92rem; }
.pf-table th, .pf-table td {
  padding: .7rem .7rem; border-bottom: 1px solid var(--line); text-align: left;
  vertical-align: middle;
}
.pf-table th:first-child, .pf-table td:first-child { border-right: 1px solid var(--line); }
.pf-table thead th {
  background: var(--bg-raised); border-bottom: 3px double var(--ink);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-dim);
  white-space: nowrap;
}
.pf-table tbody tr:nth-child(even) { background: var(--rule); }
.pf-table tbody tr:hover { background: var(--rule-2); }
.pf-table tbody tr:last-child td { border-bottom: 0; }
.pf-table .pf-num, th.pf-num { text-align: right; }
.pf-table td a {
  display: block; text-decoration: none; min-height: 44px;
  padding: .7rem .7rem; margin: -.7rem -.7rem;
}
.pf-table td a:hover { color: var(--accent-2); text-decoration: underline wavy; }
.pf-price { font-weight: 700; color: var(--accent); }
.pf-note { color: var(--ink-dim); font-size: .85rem; }
.pf-unknown { color: var(--ink-dim); font-style: italic; }
.pf-stale { color: var(--warn); }
.pf-checked { font-size: .85rem; color: var(--ink-dim); white-space: nowrap; }

.pf-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.pf-tag {
  background: var(--tag-bg); color: var(--tag-ink); font-size: .72rem;
  padding: .18rem .5rem; border: 1px solid var(--line); border-radius: 2px;
}

/* ---- dish / venue detail ---- */
.pf-breadcrumb { font-size: .78rem; color: var(--ink-dim); margin-bottom: 1.4rem; }
.pf-breadcrumb a {
  text-decoration: none; display: inline-flex; align-items: center;
  padding: .8rem .25rem; margin: -.8rem -.05rem; min-height: 44px;
}
.pf-dish h1, .pf-venue h1, .pf-about h1 { margin-bottom: .35rem; font-size: 1.7rem; letter-spacing: -.01em; }
.pf-dish-meta, .pf-venue-meta { color: var(--ink-dim); margin-top: 0; }
.pf-dish-meta a, .pf-venue-meta a {
  display: inline-flex; align-items: center; padding: .7rem .2rem; margin: -.7rem -.1rem; min-height: 44px;
}
.pf-dish-price {
  font-size: 2rem; font-weight: 700; margin: 1.1rem 0; color: var(--accent);
  display: inline-block; padding: .5rem 0;
  border-top: 3px double var(--ink); border-bottom: 3px double var(--ink);
}
.pf-dish-desc { max-width: 60ch; }
.pf-provenance { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 1.4rem 0; font-size: .9rem; }
.pf-provenance dt { color: var(--ink-dim); text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; align-self: center; }
.pf-provenance dd { margin: 0; align-self: center; }
.pf-provenance dd a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 0; margin: -.4rem 0; }
.pf-related { margin-top: 1.75rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.pf-related a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .1rem; margin: -.5rem -.1rem; }

.pf-lede { color: var(--ink-dim); max-width: 62ch; }

.pf-notfound { padding: 3rem 0 2rem; text-align: center; }
.pf-notfound h1 { font-size: 2.75rem; margin: 0 0 1rem; color: var(--ink-dim); letter-spacing: .05em; }
.pf-notfound p a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .2rem; }

/* ---- about ---- */
.pf-about h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-dim); margin: 1.75rem 0 .5rem; padding-bottom: .4rem; border-bottom: 1px dashed var(--line); }
.pf-about p, .pf-about li { max-width: 62ch; }
.pf-about ul { padding-left: 1.2rem; }
.pf-about li { margin-bottom: .4rem; }

/* ---- footer ---- */
.pf-footer {
  max-width: 76rem; margin: 0 auto; padding: 1.6rem 1.25rem 3rem;
  color: var(--ink-dim); font-size: .82rem;
}
.pf-footer p { margin: 0; }
.pf-footer a {
  display: inline-flex; align-items: center; min-height: 44px; padding: .3rem .15rem; margin: -.3rem -.05rem;
}

@media (max-width: 30rem) {
  .pf-header { padding: 1rem .9rem .8rem; }
  .pf-main { padding: 1.5rem .9rem 3rem; }
  .pf-dish-price { font-size: 1.6rem; }
}

@media print {
  .pf-header, .pf-footer, .pf-nav { display: none; }
  body { background: #fff; color: #000; }
}
