/* TenderGrid's public pages (/guides/, /tenders/, /sources/), copied into dist/ by
   tools/build-public-pages.mjs. The app's colours (src/constants/theme.js): navy #1B2A4A, amber
   #F5A623, line blue #2E5090 / #4A90D9. Lists of tenders are drawn as stations on a busbar, like
   the live numbers on the welcome page. System fonts: nothing is loaded from other sites. */

:root {
  --navy: #1B2A4A;
  --amber: #F5A623;
  --blue: #2E5090;
  --paper: #F5F7FA;
  --ink: #1A1A2E;
  --muted: #5B6472;
  --line: #D8DEE8;
  --surface: #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #4A90D9;
    --paper: #0F172A;
    --ink: #F1F5F9;
    --muted: #A3B0C2;
    --line: #334155;
    --surface: #1E293B;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px; }

/* env(safe-area-inset-…): the installed app on iPhones draws the status bar over the top of the
   page and the home bar over the bottom (black-translucent, public/apple-meta.html), and a phone
   held sideways has the notch at one side (see the end of this file). In a browser these are 0. */
/* Top bar: the navy runs on under the status bar, the logo and links start below it */
.top { background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.top-inner { display: flex; align-items: center; gap: 16px 18px; flex-wrap: wrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand svg { height: 1.35em; width: auto; }
.nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.nav a { color: #fff; text-decoration: none; font-size: 0.95rem; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; }
.button { display: inline-block; background: var(--amber); color: var(--navy) !important; font-weight: 700; text-decoration: none !important; padding: 9px 18px; border-radius: 999px; }
.button:hover { filter: brightness(1.05); }
.button-plain { display: inline-block; font-weight: 600; padding: 9px 4px; }
.top-cta { font-size: 0.95rem; }

/* Page heads */
main { padding: 36px 0 56px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 12px; color: var(--ink); }
h2 { font-size: 1.35rem; line-height: 1.3; letter-spacing: -0.01em; margin: 40px 0 12px; }
h3 { font-size: 1.05rem; line-height: 1.4; margin: 0; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 44em; margin: 0 0 8px; }
.note { color: var(--muted); font-size: 0.92rem; max-width: 46em; }
.country-note { max-width: 46em; margin: 12px 0 0; }
.figure { font-variant-numeric: tabular-nums; font-weight: 700; }

/* Tenders on a busbar: a line down the left, an amber node at each tender */
.bus { list-style: none; margin: 18px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--line); }
.bus > li { position: relative; padding: 0 0 22px 6px; }
.bus > li::before { content: ""; position: absolute; left: -30px; top: 0.35em; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); border: 3px solid var(--paper); }
/* Titles and names from the portals can hold long runs without spaces ("NIT-No.-EE/EDD-II/2026-27/…"):
   let them break instead of widening the page on a phone */
.bus h3, .t-who, .chips li > :first-child { word-break: break-word; overflow-wrap: anywhere; }
.t-who { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.t-buyer + .t-country { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.t-facts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0 0; font-size: 0.92rem; }
.t-facts div { display: flex; gap: 6px; }
.t-facts dt { color: var(--muted); }
.t-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Lists of countries and topics */
.chips { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 24px; }
.chips li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.chips .count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Guides and other text pages */
.prose { max-width: 720px; }
.prose p, .prose li { font-size: 1.04rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 0.95rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; text-align: left; vertical-align: top; }
.prose h3 { margin: 26px 0 8px; }
.prose .note { color: var(--ink); font-size: 1rem; background: var(--surface); border-left: 3px solid var(--amber); padding: 10px 14px; border-radius: 0 6px 6px 0; }
.prose dl.glossary dt { font-weight: 600; margin-top: 14px; }
.prose dl.glossary dd { margin: 2px 0 0; }
.meta { color: var(--muted); font-size: 0.9rem; }
.guide-list { list-style: none; padding: 0; margin: 18px 0 0; }
.guide-list li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.guide-list a { font-weight: 700; font-size: 1.08rem; }
.guide-list p { margin: 4px 0 0; color: var(--muted); }
.source { padding: 18px 0; border-bottom: 1px solid var(--line); }
.source h2 { margin: 0 0 6px; font-size: 1.2rem; }
.source p { margin: 4px 0; max-width: 46em; }
.ad-slot { margin: 28px 0; }
.ad-label { font-size: 0.75rem; color: var(--muted); }

/* The closing call to action */
.cta { margin-top: 44px; padding: 26px 28px; background: var(--navy); color: #fff; border-radius: 14px; }
.cta h2 { margin: 0 0 8px; color: #fff; }
.cta p { margin: 0 0 16px; color: rgba(255, 255, 255, 0.85); max-width: 40em; }
.cta .button-plain { color: #fff; margin-left: 14px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 26px 0 40px; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--muted); font-size: 0.9rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0; }
.foot a { color: var(--muted); }
.foot-brand { display: flex; align-items: center; gap: 8px; margin: 0; }
.foot-brand svg { height: 1.2em; width: auto; }

/* Phones and narrow windows: the logo and "Get started" on the first line, the links on the second */
@media (max-width: 640px) {
  .top-inner { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand cta" "nav nav"; align-items: center; gap: 2px 12px; min-height: 0; padding-top: 10px; padding-bottom: 4px; }
  .brand { grid-area: brand; margin-right: 0; }
  .top-cta { grid-area: cta; padding: 6px 14px; font-size: 0.92rem; }
  .nav { grid-area: nav; gap: 0 20px; }
  .nav a { padding: 7px 0; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  /* Topics and countries two to a line, so the newest tenders aren't far down the page (buyers'
     long names stay one to a line) */
  .chips:not(.chips-buyers) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .chips li { padding: 6px 0; font-size: 0.95rem; }
  h1 { font-size: 1.6rem; }
  .lead { font-size: 1.05rem; }
  main { padding-top: 26px; }
  .cta { padding: 22px 20px; }
  .cta .button-plain { margin-left: 0; display: block; }
  .prose table { display: block; overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
/* Side padding that also keeps clear of the notch of a phone held sideways, in browsers that can
   compute it (the others keep the plain padding above) */
@supports (padding: max(0px)) {
  .wrap { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
  @media (max-width: 600px) {
    .wrap { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
  }
}
