/* Dr. Chef base styles: reset, typography, layout primitives.
   Uses logical properties throughout so one stylesheet serves RTL (Arabic, default) and LTR (English). */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font);
  font-size: var(--text-m);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }   /* components set display, which would otherwise override hidden */
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
figure { margin: 0; }

h1, h2, h3, h4 {
  margin: 0 0 var(--space-3);
  font-weight: var(--weight-black);
  line-height: var(--leading-heading);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-l); }
h4 { font-size: var(--text-m); }
p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--color-link); font-weight: var(--weight-bold); text-underline-offset: 3px; }
a:hover { color: var(--teal); }

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 6px;
}

::selection { background: var(--aqua); color: var(--teal-900); }

/* Layout primitives */
.wrap {
  width: min(var(--container), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

.section { padding-block: var(--space-8); }
.section--tight { padding-block: var(--space-6); }
.section--soft { background: var(--color-surface-soft); }

.stack > * + * { margin-block-start: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.muted { color: var(--color-text-muted); }
.measure { max-width: 60ch; }

.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;
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: -100px;
  z-index: calc(var(--z-header) + 1);
  background: var(--teal);
  color: var(--white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-s);
}
.skip-link:focus { inset-block-start: var(--space-3); color: var(--white); }

/* Leave room for the mobile action bar */
@media (max-width: 960px) {
  body.has-action-bar { padding-bottom: calc(var(--action-bar-h) + env(safe-area-inset-bottom)); }
  .section { padding-block: var(--space-7); }
}

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