/* Swiss poster layout (Alex's pick, 23 Nov 2026) dressed in Fen Farm Dairy's branding,
   taken from their Shopify theme: Libre Baskerville, charcoal text, muted gold accents,
   a cream band, and the cows logo. Numbered sections and rules instead of boxes.
   Brand colours and the logo are set from client.config.json by app.js. These are fallbacks. */

/* Libre Baskerville (SIL Open Font Licence), served from this site so no request goes to Google Fonts. */
@font-face { font-family: "Libre Baskerville"; font-weight: 400; font-display: swap; src: url("/fonts/libre-baskerville-400.woff2") format("woff2"); }
@font-face { font-family: "Libre Baskerville"; font-weight: 700; font-display: swap; src: url("/fonts/libre-baskerville-700.woff2") format("woff2"); }

:root {
  --primary: #393939;      /* charcoal: text and rules */
  --accent: #9f9070;       /* muted gold: section numbers, small rules (large text only, for contrast) */
  --background: #ffffff;
  --band: #f4e3cb;         /* cream: the band along the top */
  --muted: #6b6b6b;
  --hairline: #d5d5d5;
  --warn-text: #6b4a00;
  --warn-bar: #fab219;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  color: var(--primary);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); line-height: 1.6; letter-spacing: 0.02em; counter-reset: section; }
[hidden] { display: none !important; }

.top, .banner, main { padding-left: clamp(16px, 4vw, 48px); padding-right: clamp(16px, 4vw, 48px); }

.top {
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  align-items: flex-end; justify-content: space-between;
  padding-top: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--primary);
}
.top h1 {
  margin: 0; display: flex; align-items: flex-end; gap: 16px;
  font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 400; letter-spacing: 0.04em; line-height: 1;
}
.top h1 img { display: block; height: clamp(72px, 16vw, 120px); width: auto; }
.top h1 img + span {
  padding-left: 16px; border-left: 1px solid var(--hairline);
  font-size: clamp(1rem, 2.4vw, 1.35rem); text-transform: uppercase; letter-spacing: 0.18em; color: var(--accent);
  font-weight: 700; padding-bottom: 6px;
}
.user { display: flex; gap: 16px; align-items: center; font-size: 0.85rem; color: var(--muted); }
.user .link { color: var(--primary); }

/* Section menu under the header: Dashboard, Retail, Website, Farm (from client.config.json). */
.sections {
  display: flex; gap: 4px clamp(20px, 4vw, 40px); overflow-x: auto;
  padding: 0 clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--hairline);
}
.sections:empty { display: none; }
.sections a {
  padding: 14px 0 12px; border-bottom: 2px solid transparent; white-space: nowrap;
  color: var(--primary); text-decoration: none; text-transform: uppercase;
  font-size: 0.85rem; letter-spacing: 0.16em;
}
.sections a:hover { border-bottom-color: var(--hairline); }
.sections a[aria-current="page"] { border-bottom-color: var(--accent); font-weight: 700; }
@media (max-width: 480px) {
  .sections { gap: 18px; }
  .sections a { font-size: 0.78rem; letter-spacing: 0.08em; }
}

.banner {
  margin: 0; padding-top: 10px; padding-bottom: 10px;
  background: var(--band); color: var(--primary); font-size: 0.85rem; text-align: center;
}

main { padding-top: 36px; padding-bottom: 64px; max-width: 1360px; margin: 0 auto; }

.panel { max-width: 560px; margin: 48px 0; border-top: 1px solid var(--primary); padding-top: 16px; }
.panel h2 { margin: 0 0 4px; font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 400; letter-spacing: 0.03em; line-height: 1.15; }
.panel h2::after { content: ""; display: block; width: 48px; height: 2px; background: var(--accent); margin: 14px 0 6px; }

.button {
  font: inherit; font-size: 0.9rem; letter-spacing: 0.06em; padding: 12px 22px; border: 0; border-radius: 4px;
  background: var(--primary); color: #fff; cursor: pointer;
}
.button:hover { background: #000; }
.link { font: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.grid {
  display: grid; gap: 44px 36px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.tile { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--primary); padding-top: 12px; }
.tile h2 { margin: 0; font-size: 1.2rem; font-weight: 400; letter-spacing: 0.03em; }
.tile h2::before {
  counter-increment: section; content: counter(section, decimal-leading-zero) "   ";
  color: var(--accent); font-weight: 700; white-space: pre;
}
.tile .figure { font-size: clamp(2.6rem, 6vw, 3.8rem); font-weight: 700; letter-spacing: 0.01em; line-height: 1.05; }
.tile .detail { color: var(--muted); font-style: italic; }

.tile ul { list-style: none; margin: 0; padding: 0; }
.tile li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.tile li:first-child { border-top: 1px solid var(--hairline); }
.tile li .note { display: block; font-size: 0.8rem; color: var(--muted); font-style: italic; }
.tile li .value { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }

.tile .counts { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--hairline); }
.tile .count { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hairline); }
.tile .count:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--hairline); }
.tile .count b { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.tile .count span { color: var(--muted); font-size: 0.9rem; }

.empty-section { grid-column: 1 / -1; margin: 0; padding-top: 12px; border-top: 1px solid var(--primary); color: var(--muted); font-style: italic; }

.tile .empty { color: var(--muted); font-style: italic; }
.tile .button { align-self: flex-start; }
.tile .warn {
  margin: 0; padding: 8px 10px; background: var(--band); border-left: 6px solid var(--warn-bar);
  color: var(--warn-text); font-size: 0.85rem;
}
.tile footer { margin-top: auto; padding-top: 8px; font-size: 0.75rem; color: var(--muted); }
