/* ==========================================================================
   ForemanCalc — base.css
   Load after tokens.css.

   Font files to self-host (put them in /wp-content/themes/foremancalc/assets/fonts/):
   1. barlow-semi-condensed-600.woff2   Barlow Semi Condensed SemiBold (600), latin subset
   2. InterVariable.woff2               Inter variable font, weight axis 100-900 (we use 400-600)
   Format: WOFF2 only (supported by every browser on the QA list). No WOFF/TTF fallbacks needed.
   Sources: Barlow Semi Condensed (OFL) from github.com/jpt/barlow; Inter (OFL) from rsms.me/inter.
   Preload both in <head>:
   <link rel="preload" href=".../fonts/InterVariable.woff2" as="font" type="font/woff2" crossorigin>
   <link rel="preload" href=".../fonts/barlow-semi-condensed-600.woff2" as="font" type="font/woff2" crossorigin>
   Viewport meta: <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
   ========================================================================== */

/* ---- Fonts ---- */
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-semi-condensed-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/InterVariable.woff2") format("woff2");
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { padding: 0; background: none; border: 0; cursor: pointer; text-align: inherit; }
table { border-collapse: collapse; }
td, th { padding: 0; text-align: left; }
[hidden] { display: none !important; }

/* ---- Document ---- */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fc-bg);
  color: var(--fc-text);
  font-family: var(--fc-font-body);
  font-size: var(--fc-fs-16);
  line-height: var(--fc-lh-body);
}
main { flex: 1; }
main:focus { outline: none; }

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: var(--fc-fw-semibold); line-height: var(--fc-lh-head); }
strong, b { font-weight: var(--fc-fw-semibold); }
time, .fc-num { font-variant-numeric: tabular-nums; }

.fc-display,
.fc-h1,
.fc-h2,
.fc-h2--content,
.fc-h3,
.fc-title {
  font-family: var(--fc-font-head);
  font-weight: var(--fc-fw-semibold);
  line-height: var(--fc-lh-head);
}
.fc-display { font-size: var(--fc-fs-display); text-wrap: balance; }
.fc-h1 { font-size: var(--fc-fs-h1); overflow-wrap: anywhere; text-wrap: balance; }
.fc-h2 { font-size: var(--fc-fs-h2); }
.fc-h2--content { font-size: var(--fc-fs-h2-content); }
.fc-h3 { font-size: var(--fc-fs-22); }
.fc-title { font-size: var(--fc-fs-22); }

.fc-lead { max-width: 60ch; font-size: var(--fc-fs-lead); color: var(--fc-text-muted); text-wrap: pretty; }
.fc-intro { max-width: var(--fc-measure); color: var(--fc-text-muted); text-wrap: pretty; }
.fc-muted { color: var(--fc-text-muted); }
.fc-meta { font-size: var(--fc-fs-14); color: var(--fc-text-muted); }
.fc-eyebrow { font-size: var(--fc-fs-14); font-weight: var(--fc-fw-semibold); color: var(--fc-accent-text); }
.fc-eyebrow--muted { font-size: var(--fc-fs-13); color: var(--fc-text-muted); }

/* ---- Links ---- */
a { color: var(--fc-accent-text); }
a:hover { color: var(--fc-accent-text-hover); }
.fc-link-strong {
  display: inline-flex;
  align-items: center;
  gap: var(--fc-s-1);
  min-height: var(--fc-tap);
  font-size: var(--fc-fs-15);
  font-weight: var(--fc-fw-semibold);
}

/* ---- Focus ---- */
:focus { outline: none; }
:focus-visible { outline: var(--fc-focus-width) solid var(--fc-focus-color); outline-offset: var(--fc-focus-offset); }
::placeholder { color: var(--fc-text-placeholder); opacity: 1; }

/* ---- Icons (SVG sprite, see partials/icons.svg) ---- */
.fc-icon {
  flex: none;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fc-icon--16 { width: 16px; height: 16px; }
.fc-icon--18 { width: 18px; height: 18px; }
.fc-icon--20 { width: 20px; height: 20px; }
.fc-icon--22 { width: 22px; height: 22px; }
.fc-icon--32 { width: 32px; height: 32px; }
.fc-icon--40 { width: 40px; height: 40px; }

/* ---- Container ---- */
.fc-container {
  max-width: var(--fc-container-max);
  margin: 0 auto;
  padding-left: max(var(--fc-page-x), env(safe-area-inset-left));
  padding-right: max(var(--fc-page-x), env(safe-area-inset-right));
}

/* ---- Page and section rhythm ---- */
.fc-page { padding-bottom: var(--fc-section-y); }
.fc-page__top { padding-top: var(--fc-page-top); }
.fc-section { padding: var(--fc-section-y) 0; }
.fc-section--flush-top { padding-top: 0; }
.fc-section--surface { background: var(--fc-surface); border-top: 1px solid var(--fc-border); border-bottom: 1px solid var(--fc-border); }
.fc-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--fc-s-2) var(--fc-s-6);
  margin-bottom: var(--fc-grid-gap);
}
.fc-section__title { margin-bottom: var(--fc-grid-gap); }
.fc-section__head .fc-section__title { margin-bottom: 0; }

/* ---- Grids ---- */
.fc-grid { display: grid; gap: var(--fc-grid-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
  .fc-grid--2, .fc-grid--3, .fc-grid--4, .fc-grid--cats, .fc-grid--how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fc-grid--cats > :nth-child(5) { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .fc-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fc-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fc-grid--how { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fc-grid--cats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fc-grid--cats > :nth-child(5) { grid-column: auto; }
}
@media (min-width: 1280px) {
  .fc-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Utilities ---- */
.fc-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.fc-stack-4 > * + * { margin-top: var(--fc-s-1); }
.fc-stack-8 > * + * { margin-top: var(--fc-s-2); }
.fc-stack-12 > * + * { margin-top: var(--fc-s-3); }
.fc-mt-8 { margin-top: var(--fc-s-2); }
.fc-mt-12 { margin-top: var(--fc-s-3); }
.fc-mt-16 { margin-top: var(--fc-s-4); }
.fc-mt-24 { margin-top: var(--fc-s-6); }
.fc-mt-gap { margin-top: var(--fc-grid-gap); }
.fc-mt-section { margin-top: var(--fc-section-y); }
.fc-measure { max-width: var(--fc-measure); }

/* Visibility by band. Hidden copies are display:none, so they leave the accessibility tree. */
@media (min-width: 640px) { .fc-only-sm { display: none !important; } }        /* shown <640 */
@media (max-width: 639.98px) { .fc-hide-sm { display: none !important; } }      /* hidden <640 */
@media (max-width: 1023.98px) { .fc-only-desk { display: none !important; } }   /* shown >=1024 */
@media (min-width: 1024px) { .fc-only-mob { display: none !important; } }       /* shown <1024 */
@media (max-width: 1279.98px) { .fc-only-xl { display: none !important; } }     /* shown >=1280 */
@media (min-width: 1280px) { .fc-hide-xl { display: none !important; } }        /* hidden >=1280 */

/* ---- Motion and print ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  [data-noprint] { display: none !important; }
  body { background: var(--fc-surface); }
}
