/* Total RV – Global styles, typography, design tokens, layout primitives */

:root {
  --color-text: #1a1a1a;
  --color-text-muted: #555;
  --color-bg: #fff;
  --color-primary: #0066cc;
  --color-primary-hover: #0052a3;
  --font-sans: system-ui, -apple-system, sans-serif;
  --line-height: 1.5;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Fluid base font: 15px on the narrowest phones → 18px on wide screens */
html {
  font-size: clamp(15px, 1.5vw, 18px);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Global image safety — prevent overflow and preserve aspect ratio */
img,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scoped to bare links only — Tailwind-classed <a> buttons keep their own text colour */
a:not([class]) {
  color: var(--color-primary);
}

a:not([class]):hover {
  color: var(--color-primary-hover);
}

/* Scroll-reveal: elements with data-reveal animate in when visible */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section spacing utility */
.section-gap {
  padding-top: clamp(4rem, 8vw, 7rem);
  padding-bottom: clamp(4rem, 8vw, 7rem);
}

/* Minimum touch target size for all interactive elements */
button,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"],
select {
  min-height: 44px;
  cursor: pointer;
}

/* Inventory detail page: constrained layout and responsive content */
.inventory-detail-main {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem;
}
.inventory-detail-main a,
.inventory-detail-main p,
.inventory-detail-main h1 {
  overflow-wrap: break-word;
  word-wrap: break-word;
}
