/* base.css — Push to Start Australia (PTS) reset, webfonts, base typography, layout
   primitives, landmark base styling, and the global focus ring.

   This file is intentionally free of page-specific component styling — those
   live in site.css (public) and admin.css (Admin Builder). It depends on the
   tokens declared in tokens.css (loaded first). */

/* =======================================================================
   Self-hosted webfonts (Requirement 9: font-display: swap).

   NOTE FOR DEPLOYMENT: the actual webfont binaries are NOT yet committed to
   fonts/ (the directory currently holds only a .gitkeep). These @font-face
   rules reference the expected self-hosted file paths so that, once the
   subset .woff2 files are added to fonts/ as part of the seed-asset step,
   typography "just works" with no further CSS changes. Until then the
   robust fallback stacks in tokens.css (--font-display / --font-body) keep
   the site legible and on-brand. Weights are limited to those actually used
   (body 400/500, display 600/700) to keep the payload small.

   To enable: drop the matching .woff2 files into fonts/ with these names.
   ======================================================================= */

/* Display serif (editorial Didone) — headings and vehicle names. */
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/PlayfairDisplay-Variable.woff2") format("woff2-variations"),
    url("../fonts/PlayfairDisplay-SemiBold.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* Body sans (characterful humanist/grotesque) — body and UI copy.
   "P2S Sans" is the project's self-hosted body face name; until the binary is
   added, --font-body falls back to a system grotesque stack. */
@font-face {
  font-family: "P2S Sans";
  src: url("../fonts/P2SSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "P2S Sans";
  src: url("../fonts/P2SSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* =======================================================================
   Modern reset
   ======================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;   /* prevent iOS font upscaling on rotate */
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* =======================================================================
   Base element typography
   ======================================================================= */

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-3);          /* 16px base — mobile minimum to avoid zoom */
  font-weight: var(--fw-body);
}

/* Headings use the editorial display serif with tight leading. */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-heading);
  color: var(--text-primary);
}

/* Fluid hero/display headline via clamp() — scales 32px → 64px. */
h1 {
  font-size: clamp(var(--fs-7), 5vw + 1rem, var(--fs-11));
  line-height: var(--lh-display);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(var(--fs-6), 3vw + 0.5rem, var(--fs-8));
}

h3 {
  font-size: var(--fs-7);
}

h4 {
  font-size: var(--fs-6);
}

h5,
h6 {
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  line-height: var(--lh-heading);
}

p {
  line-height: var(--lh-relaxed);
  max-width: var(--content-narrow);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

strong,
b {
  font-weight: var(--fw-display-bold);
}

/* Prices and other numeric runs align with tabular figures. */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* =======================================================================
   Layout primitives
   ======================================================================= */

/* Centred content column with responsive gutters. */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Screen-reader-only utility (used for skip links and visually hidden labels). */
.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;
}

/* Skip-to-content link: hidden until focused, then anchored top-left.
   (Skip-link markup/behaviour is wired in task 15; base styling lives here.) */
.skip-link {
  position: absolute;
  left: var(--space-8);
  top: var(--space-8);
  z-index: 100;
  padding: var(--space-8) var(--space-16);
  background-color: var(--accent);
  color: var(--accent-contrast);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-medium);
  transform: translateY(-150%);
  transition: transform var(--motion-fast) var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
  text-decoration: none;
}

/* =======================================================================
   Landmark base styling (minimal spacing only; components style the rest)
   ======================================================================= */

header,
footer {
  width: 100%;
}

main {
  display: block;
}

footer {
  margin-top: var(--space-64);
  padding-block: var(--space-32);
}

/* =======================================================================
   Visible focus ring (Requirement 8.4)
   2–4px solid --accent on any keyboard-focused interactive control.
   ======================================================================= */

:focus-visible {
  outline: var(--focus-ring-width) solid var(--accent);
  outline-offset: var(--focus-ring-offset);
  border-radius: var(--radius-sm);
}

/* Remove the default ring only where focus-visible is supported, so mouse
   clicks don't show a ring while keyboard focus still does. */
:focus:not(:focus-visible) {
  outline: none;
}

/* =======================================================================
   Reduced-motion baseline (decorative motion specifics handled in task 15)
   ======================================================================= */

@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;
  }
}
