/* PATH: waste-ai/frontend/css/base.css
   Fonts, reset, typography, focus ring, utilities. Logical properties only.
   Load after tokens.css. Font files live in ../assets/fonts/ (see fonts/README note in session). */

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../assets/fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../assets/fonts/IBMPlexSansArabic-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("../assets/fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video, canvas { display: block; max-inline-size: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(ul, ol) { padding-inline-start: var(--space-3); }

/* Document */
body {
  min-block-size: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
html[lang="ar"] body { line-height: var(--lh-body-ar); }
html[lang="ar"] { --font-sans: "IBM Plex Sans Arabic", "Inter", system-ui, "Segoe UI", Tahoma, sans-serif; }

/* Typography */
h1, h2, h3, h4 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  text-wrap: balance;
}
html[lang="ar"] :is(h1, h2, h3, h4) { line-height: var(--lh-heading-ar); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }
p { max-inline-size: 70ch; text-wrap: pretty; }
small, .text-sm { font-size: var(--fs-sm); }
.text-muted { color: var(--color-text-muted); }
a {
  color: var(--color-accent);
  text-underline-offset: 0.2em;
}
a:hover { color: var(--color-accent-hover); }
hr { border: 0; border-block-start: 1px solid var(--color-border); }

/* Keyboard focus */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--radius-sm);
}

/* Layout helpers */
.container {
  inline-size: 100%;
  max-inline-size: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-2);
}
.icon {
  inline-size: 1.5rem;
  block-size: 1.5rem;
  flex: none;
}
.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Bin chips: fill + readable text, 1px border so the chip is visible in both themes */
.bin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-block-size: var(--space-4);
  padding-inline: var(--space-2);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
.bin--blue    { background: var(--bin-blue-bg);    color: var(--bin-blue-fg); }
.bin--green   { background: var(--bin-green-bg);   color: var(--bin-green-fg); }
.bin--yellow  { background: var(--bin-yellow-bg);  color: var(--bin-yellow-fg); }
.bin--red     { background: var(--bin-red-bg);     color: var(--bin-red-fg); }
.bin--black   { background: var(--bin-black-bg);   color: var(--bin-black-fg); }
.bin--brown   { background: var(--bin-brown-bg);   color: var(--bin-brown-fg); }
.bin--grey    { background: var(--bin-grey-bg);    color: var(--bin-grey-fg); }
.bin--special { background: var(--bin-special-bg); color: var(--bin-special-fg); }

/* Reduced motion: no animation anywhere */
@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;
  }
}
