/* drypetfood.com — design system
 * No build step. Fonts loaded via <link> in layout.php.
 *
 * Direction: a trustworthy "modern vet-meets-DTC pet brand" look for a North
 * American audience. Deep pine green reads natural/healthy without the
 * overused cream+serif+terracotta cliché; warm honey is the single accent
 * (the colour of kibble). Signature device: monospace numerals for prices and
 * nutrition data, so the *data itself* carries the personality and signals
 * precision/trust. Spend boldness on the price-per-kg metric; keep the rest quiet.
 */

:root {
  /* Colour */
  --ink:        #1b2a28;   /* primary text */
  --muted:      #56655f;   /* secondary text */
  --paper:      #f4f7f4;   /* page background (cool off-white, not cream) */
  --surface:    #ffffff;   /* cards */
  --mist:       #e6efea;   /* tinted surface / table stripes */
  --line:       #d6e0db;   /* hairlines */
  --pine:       #1f6e60;   /* primary brand / links / buttons */
  --pine-dark:  #134a40;   /* hover / headings accent */
  --honey:      #eca12e;   /* accent: highlights, ratings */
  --clay:       #d4573d;   /* secondary accent: "best value" badge */
  --good:       #2f8f5b;   /* positive (low price/kg, high protein) */

  /* Type */
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.8rem + 0.1vw, 0.89rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.5rem, 1.36rem + 0.7vw, 1.95rem);
  --step-3:  clamp(1.9rem, 1.64rem + 1.3vw, 2.8rem);
  --step-4:  clamp(2.4rem, 1.9rem + 2.4vw, 3.8rem);

  /* Space / shape */
  --gap: 1.25rem;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(19, 74, 64, .06), 0 8px 24px rgba(19, 74, 64, .07);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }

p { margin: 0 0 1rem; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--pine-dark); }

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

/* Layout helpers */
.container { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.eyebrow {
  font: 600 var(--step--1)/1 var(--font-mono);
  letter-spacing: .12em; text-transform: uppercase; color: var(--pine);
  margin: 0 0 .6rem;
}
.lede { font-size: var(--step-1); color: var(--muted); max-width: 60ch; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 1.5rem; padding-block: .85rem; }
.brand { font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--ink); text-decoration: none; }
.brand b { color: var(--pine); }
.nav { display: flex; gap: 1.25rem; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--pine); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 600 var(--step-0)/1 var(--font-body);
  padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pine); color: #fff; }
.btn-primary:hover { background: var(--pine-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--pine); border-color: var(--line); }
.btn-ghost:hover { background: var(--mist); }

/* Hero */
.hero { padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 5vw, 3.5rem); }
.hero h1 { max-width: 16ch; }

/* Product card + spec strip (the signature data treatment) */
.grid { display: grid; gap: var(--gap); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
}
.card .body { padding: 1.1rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card .brandline { font: 600 var(--step--1)/1 var(--font-mono); letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.card h3 { font-size: var(--step-1); }

.badge {
  display: inline-block; font: 600 var(--step--1)/1 var(--font-mono);
  padding: .3rem .55rem; border-radius: 999px; letter-spacing: .03em;
}
.badge-value { background: color-mix(in srgb, var(--good) 14%, #fff); color: var(--good); }
.badge-grainfree { background: var(--mist); color: var(--pine-dark); }

/* Price + price-per-kg: the hero metric, in mono */
.price { font: 700 var(--step-2)/1 var(--font-mono); color: var(--ink); }
.ppk   { font: 600 var(--step--1)/1 var(--font-mono); color: var(--muted); }
.ppk b { color: var(--good); }

/* Spec strip */
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.spec { text-align: center; }
.spec .k { font: 500 var(--step--1)/1 var(--font-body); color: var(--muted); display: block; margin-bottom: .2rem; }
.spec .v { font: 700 var(--step-0)/1 var(--font-mono); color: var(--ink); }

/* Comparison table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.compare { width: 100%; border-collapse: collapse; background: var(--surface); }
table.compare th, table.compare td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
table.compare thead th { font-family: var(--font-display); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.compare tbody tr:nth-child(even) { background: var(--mist); }
table.compare .num { font-family: var(--font-mono); }

/* Rating */
.rating { color: var(--honey); font-family: var(--font-mono); font-weight: 600; }

/* Calculator widget */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: var(--step--1); }
.field input, .field select {
  font: var(--step-0)/1.2 var(--font-body); padding: .6rem .7rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--pine); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 18%, transparent); }
.calc-result { margin-top: 1rem; padding: 1.1rem; border-radius: var(--radius-sm); background: var(--mist); }
.calc-result .big { font: 700 var(--step-3)/1 var(--font-mono); color: var(--pine-dark); }

/* Disclosure + footer */
.disclosure { font-size: var(--step--1); color: var(--muted); background: var(--mist); border-radius: var(--radius-sm); padding: .7rem 1rem; }
.site-footer { background: var(--ink); color: #c9d6d0; padding-block: 3rem; margin-top: 4rem; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; }

/* Forms (newsletter) */
.subscribe { display: flex; gap: .6rem; flex-wrap: wrap; }
.subscribe input[type=email] { flex: 1 1 220px; padding: .7rem .9rem; border-radius: 999px; border: 1px solid var(--line); }
.consent { font-size: var(--step--1); color: var(--muted); display: flex; gap: .5rem; align-items: flex-start; margin-top: .6rem; }

/* Prose (article body) */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

/* Utilities */
.muted { color: var(--muted); }
.hp-field { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

/* Accessibility: skip link + visible focus */
.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 100;
  background: var(--pine); color: #fff; padding: .55rem .9rem; border-radius: var(--radius-sm);
  transition: top .15s ease;
}
.skip-link:focus { top: .5rem; color: #fff; }
a:focus-visible, button:focus-visible, .btn:focus-visible,
[tabindex]:focus-visible, summary:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--pine) 55%, #fff);
  outline-offset: 2px;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 90;
  max-width: 44rem; margin-inline: auto;
  background: var(--ink); color: #e7efea; padding: 1rem 1.1rem;
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.cookie-banner-actions { display: flex; gap: .5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Portion calculator page */
.calc-layout { display: grid; gap: var(--gap); align-items: start; }
@media (min-width: 760px) { .calc-layout { grid-template-columns: 3fr 2fr; } }
.calc-layout .calc-result { position: sticky; top: 1rem; }
.field-legend { font-weight: 600; font-size: var(--step--1); margin-bottom: .35rem; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 8rem; }
.radio-row { display: flex; gap: 1.25rem; }
.radio-row label { font-weight: 500; display: flex; gap: .45rem; align-items: center; }

/* FAQ disclosure list */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: .85rem 0; }
.faq summary:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.faq details p { margin: 0; padding-bottom: 1rem; }

/* Breadcrumb */
.breadcrumb { font-size: var(--step--1); color: var(--muted); margin-bottom: .7rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--pine); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

/* Card title links inherit colour, tint on hover */
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--pine); }

/* Admin shell */
body.admin { background: var(--mist); }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--ink); color: #c9d6d0; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.admin-sidebar .brand { color: #fff; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: .25rem; }
.admin-sidebar nav a { color: #c9d6d0; padding: .5rem .6rem; border-radius: var(--radius-sm); }
.admin-sidebar nav a:hover,
.admin-sidebar nav a[aria-current] { background: rgba(255,255,255,.08); color: #fff; }
.admin-sidebar form { margin-top: auto; }
.admin-main { padding: clamp(1.25rem, 3vw, 2.5rem); max-width: 1100px; }
.admin-auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.admin-auth .card { width: min(100%, 26rem); }
.admin-error { background: color-mix(in srgb, var(--bad, #c0392b) 12%, #fff); color: var(--bad, #c0392b); border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: var(--step--1); margin-bottom: 1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.stat-card .n { font: 700 var(--step-3)/1 var(--font-mono); color: var(--pine-dark); }
.stat-card .k { font-size: var(--step--1); color: var(--muted); }
@media (max-width: 720px) { .admin-shell { grid-template-columns: 1fr; } }

/* Admin: flash, tables, forms */
.flash { border-radius: var(--radius-sm); padding: .7rem 1rem; margin-bottom: 1rem; font-size: var(--step--1); }
.flash-success { background: color-mix(in srgb, var(--good) 14%, #fff); color: var(--good); }
.flash-error { background: color-mix(in srgb, var(--bad, #c0392b) 12%, #fff); color: var(--bad, #c0392b); }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table thead th { font: 600 var(--step--1) var(--font-display); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.admin-table tbody tr:hover { background: var(--mist); }
.admin-table .num { font-family: var(--font-mono); }
.admin-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.btn-sm { padding: .35rem .6rem; font-size: var(--step--1); }
.btn-danger { background: var(--bad, #c0392b); color: #fff; }
.btn-danger:hover { background: #a93226; color: #fff; }
.admin-form { max-width: 720px; }
.admin-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0 0 1.5rem; }
.admin-form legend { font: 700 var(--step-0) var(--font-display); padding: 0 .4rem; }
.field .help { font-size: var(--step--2); color: var(--muted); font-weight: 400; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 1rem; }
.checks { columns: 2; }
.checks label { display: flex; gap: .45rem; align-items: center; font-weight: 400; margin-bottom: .35rem; }
textarea { font: var(--step-0)/1.4 var(--font-body); padding: .6rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); width: 100%; min-height: 8rem; }
.form-actions { display: flex; gap: .7rem; align-items: center; margin-top: 1rem; }
.card h2 a { color: inherit; }
.card h2 a:hover { color: var(--pine); }

/* Articles */
.article-list { display: grid; gap: 1rem; max-width: 52rem; }
.article-hero { width: 100%; height: auto; border-radius: var(--radius); }
.prose { /* article body sits in readable measure */ }
.mentions { list-style: none; counter-reset: mention; padding: 0; display: grid; gap: 1rem; margin: 1rem 0 0; max-width: 52rem; }
.mentions > li { counter-increment: mention; position: relative; }
.mentions > li::before {
  content: counter(mention); position: absolute; z-index: 1; top: -.6rem; left: -.6rem;
  width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--pine); color: #fff;
  font: 700 var(--step--1)/1.8rem var(--font-mono); text-align: center;
}
