/* ==========================================================================
   base.css — Reset, base element styles, and shared utility classes
   ─────────────────────────────────────────────────────────────────────────
   Applies sensible defaults so every higher-level rule starts from a
   consistent baseline. No visual opinion here — just plumbing.
   ========================================================================== */


/* ── Box model reset ────────────────────────────────────────────────────── */

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

* {
  margin: 0; /* Remove all default margins; spacing applied intentionally via CSS */
}


/* ── Document ───────────────────────────────────────────────────────────── */

html {
  -webkit-text-size-adjust: 100%; /* Prevent iOS from auto-scaling text on orientation change */
  scroll-behavior: smooth;        /* Smooth scrolling for anchor nav links */
  overflow-x: hidden;             /* Prevent horizontal scrollbar from any overflowing element */
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--ink-800);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;    /* Crisp text on macOS/iOS */
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;                     /* Prevent horizontal scrollbar on body */
  width: 100%;
}


/* ── Media elements ─────────────────────────────────────────────────────── */

img,
svg {
  display: block;
  max-width: 100%;
}


/* ── Links ──────────────────────────────────────────────────────────────── */

a {
  color: inherit;
  text-decoration: none;
}


/* ── Form elements ──────────────────────────────────────────────────────── */

/* Inherit font from body so inputs don't default to system UI */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}


/* ── Lists ──────────────────────────────────────────────────────────────── */

/* Remove browser-default list chrome; visual styling applied per-component */
ul,
ol {
  list-style: none;
  padding: 0;
}


/* ── Headings ───────────────────────────────────────────────────────────── */

/* Display face for all headings; weight and size tuned per-component */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.01em;
}


/* ── Accessibility utilities ────────────────────────────────────────────── */

/* Visually hides an element while keeping it accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Global focus indicator — amber ring matches brand accent */
:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}


/* ── Layout helpers ─────────────────────────────────────────────────────── */

/* Centred max-width container used on all major sections */
.wrap {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--content-pad);
}

@media (max-width: 480px) {
  .wrap {
    padding-inline: var(--space-4); /* 16px */
  }
}

@media (max-width: 320px) {
  .wrap {
    padding-inline: var(--space-3); /* 12px */
  }
}

/* Small uppercase label used as section eyebrow / category tag */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-amber-dark);
}


/* ── Button base styles ─────────────────────────────────────────────────── */

/* Shared base — size, shape, and transitions for all button variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}

@media (max-width: 480px) {
  .btn {
    padding: var(--space-2) var(--space-4);
  }
}

@media (max-width: 360px) {
  .btn {
    white-space: normal;
    text-align: center;
  }
}

.btn:active {
  transform: translateY(1px); /* Subtle press feedback */
}

/* Primary — amber filled; used for main CTAs (Search, Search this position) */
.btn-primary {
  background: var(--accent-amber);
  color: var(--paper-0);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--accent-amber-dark);
}

/* Ghost — transparent with border; used for secondary actions */
.btn-ghost {
  background: transparent;
  color: var(--ink-800);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink-400);
}

/* Inverse ghost — for use on dark backgrounds */
.btn-ghost-inverse {
  background: transparent;
  color: var(--paper-50);
  border: 1.5px solid var(--line-on-dark);
}

.btn-ghost-inverse:hover {
  border-color: rgba(250, 248, 243, 0.5);
}

/* Icon button — small square/circle for icon-only actions (undo, reset) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  color: var(--ink-600);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-icon:hover {
  border-color: var(--ink-400);
  color: var(--ink-950);
  background: var(--paper-100);
}
