/* ==========================================================================
   Breeder Portal - base: reset, document defaults, typography, utilities
   No component styling here. Everything reads tokens.css.
   ========================================================================== */

/* Inter (variable 100-900, Latin subset). Other characters (the peso sign, for one) come from the next font in --font-sans. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght.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;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-gutter: stable;           /* no layout shift when a scrollbar appears */
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-weight: var(--fw-regular);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"], .p-reset-list { list-style: none; padding: 0; margin: 0; }

h1 { font-size: var(--fs-2xl); line-height: var(--lh-tight); font-weight: var(--fw-semibold); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-lg);  line-height: var(--lh-snug);  font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-md);  line-height: var(--lh-snug);  font-weight: var(--fw-semibold); }

a { color: var(--c-primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }
hr { border: 0; border-top: 1px solid var(--c-divider); margin: 0; }
[hidden] { display: none !important; }
/* portal-browser.js is replacing this page (wrong browser on a phone, or the right one on browser.aspx): draw nothing meanwhile */
html[data-p-leaving] body { visibility: hidden; }

/* Keyboard focus is always visible; the mouse never sees a ring on buttons */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection { background: var(--c-primary-soft-border); color: var(--c-text); }

/* an open sheet freezes the page behind it (scrollbar-gutter keeps the width, so nothing jumps) */
html.p-scroll-lock { overflow: hidden; }

/* ---- Text utilities ---- */
.p-text-danger { color: var(--c-danger-text); }
.p-mr-auto     { margin-right: auto; }
.p-text-2      { color: var(--c-text-2); }
.p-text-3      { color: var(--c-text-3); }
.p-text-xs     { font-size: var(--fs-xs); line-height: var(--lh-snug); }
.p-text-sm     { font-size: var(--fs-sm); line-height: var(--lh-snug); }
.p-text-lg     { font-size: var(--fs-lg); }
.p-strong      { font-weight: var(--fw-semibold); }
.p-medium      { font-weight: var(--fw-medium); }
.p-num         { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.p-right       { text-align: right; }
.p-center      { text-align: center; }
.p-nowrap      { white-space: nowrap; }
.p-truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.p-break       { overflow-wrap: anywhere; }
.p-mono        { font-family: var(--font-mono); font-size: 0.92em; }
.p-overline    { font-size: var(--fs-xs); line-height: var(--lh-snug); font-weight: var(--fw-semibold); color: var(--c-text-3); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---- Layout utilities (kept short on purpose: pages should not need their own CSS) ---- */
.p-stack   { display: flex; flex-direction: column; gap: var(--sp-4); }
.p-stack-2 { display: flex; flex-direction: column; gap: var(--sp-2); }
.p-stack-3 { display: flex; flex-direction: column; gap: var(--sp-3); }
.p-stack-6 { display: flex; flex-direction: column; gap: var(--sp-6); }
.p-row     { display: flex; align-items: center; gap: var(--sp-2); }
.p-row-3   { display: flex; align-items: center; gap: var(--sp-3); }
.p-row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.p-wrap    { flex-wrap: wrap; }
.p-grow    { flex: 1 1 auto; min-width: 0; }
.p-shrink-0 { flex-shrink: 0; }
.p-grid-2  { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
@media (max-width: 359px) { .p-grid-2 { grid-template-columns: minmax(0, 1fr); } }   /* very small phones: one field per row so a date is never clipped */
.p-mt-2 { margin-top: var(--sp-2); } .p-mt-3 { margin-top: var(--sp-3); } .p-mt-4 { margin-top: var(--sp-4); } .p-mt-6 { margin-top: var(--sp-6); }
.p-mb-2 { margin-bottom: var(--sp-2); } .p-mb-4 { margin-bottom: var(--sp-4); }

.p-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Put a block first on phones only (desktop keeps document order) */
.p-order-first-mobile { order: -1; }
@media (min-width: 768px) { .p-order-first-mobile { order: 0; } }

/* Show on phones only / hide on phones */
/* (the one place !important is allowed besides [hidden] and reduced motion: a visibility utility must beat any component's display) */
@media (max-width: 767px) { .p-only-desktop { display: none !important; } }
@media (min-width: 768px) { .p-only-mobile  { display: none !important; } }

/* ---- Motion preference ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
