/* ==========================================================================
   RoadTrips — Base, Reset & Typography
   ========================================================================== */

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--rt-font-body);
  font-size: var(--rt-text-body);
  line-height: 1.65;
  color: var(--rt-text);
  background-color: var(--rt-bg);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Accessible Focus Ring */
:focus-visible {
  outline: 2px solid var(--rt-accent);
  outline-offset: 3px;
}

/* Skip to main content link for screen readers & keyboard users */
.rt-skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--rt-dark);
  color: var(--rt-text-light);
  padding: 12px 20px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--rt-radius-sm);
  transition: top var(--rt-transition-fast);
}

.rt-skip-link:focus {
  top: 20px;
}

/* Selection Highlight */
::selection {
  background-color: var(--rt-accent);
  color: #FFFFFF;
}

/* Media Elements */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--rt-font-display);
  color: var(--rt-text);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--rt-text-h1); }
h2 { font-size: var(--rt-text-h2); }
h3 { font-size: var(--rt-text-h3); }
h4 { font-size: var(--rt-text-h4); }

p {
  margin-bottom: 1.25em;
  color: var(--rt-text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

p.rt-lead {
  font-size: var(--rt-text-lead);
  line-height: 1.7;
  color: var(--rt-text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--rt-transition-fast);
}

/* Eyebrows & Editorial Labels */
.rt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-2);
  font-family: var(--rt-font-body);
  font-size: var(--rt-text-meta);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rt-accent);
  margin-bottom: var(--rt-space-3);
}

.rt-eyebrow.on-dark {
  color: #E28C67;
}

.rt-eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1.5px;
  background-color: currentColor;
}

/* Container Utilities */
.rt-container {
  width: 100%;
  max-width: var(--rt-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--rt-container-pad);
  padding-right: var(--rt-container-pad);
}

.rt-reading-width {
  max-width: var(--rt-reading-width);
  margin-left: auto;
  margin-right: auto;
}

.rt-wide-media {
  max-width: var(--rt-wide-media);
  margin-left: auto;
  margin-right: auto;
}

/* Section Spacing System */
.rt-section {
  padding-top: clamp(64px, 8vw, 128px);
  padding-bottom: clamp(64px, 8vw, 128px);
  position: relative;
}

.rt-section-compact {
  padding-top: clamp(48px, 5vw, 80px);
  padding-bottom: clamp(48px, 5vw, 80px);
}

.rt-section-dark {
  background-color: var(--rt-dark);
  color: var(--rt-text-light);
}

.rt-section-dark h1,
.rt-section-dark h2,
.rt-section-dark h3,
.rt-section-dark h4 {
  color: var(--rt-text-light);
}

.rt-section-dark p {
  color: var(--rt-text-light-secondary);
}

.rt-section-surface {
  background-color: var(--rt-surface);
}

/* Buttons & Interactive Links */
.rt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--rt-space-3);
  font-family: var(--rt-font-body);
  font-size: var(--rt-text-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 14px 28px;
  border-radius: var(--rt-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--rt-transition-fast), border-color var(--rt-transition-fast), color var(--rt-transition-fast), transform var(--rt-transition-fast);
  white-space: nowrap;
}

.rt-btn-primary {
  background-color: var(--rt-dark);
  color: var(--rt-text-light);
  border-color: var(--rt-dark);
}

.rt-btn-primary:hover {
  background-color: #2D322B;
  color: #FFFFFF;
  transform: translateY(-1px);
}

.rt-btn-accent {
  background-color: var(--rt-accent);
  color: #FFFFFF;
  border-color: var(--rt-accent);
}

.rt-btn-accent:hover {
  background-color: var(--rt-accent-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.rt-btn-ghost-light {
  background-color: rgba(244, 240, 232, 0.08);
  color: var(--rt-text-light);
  border-color: rgba(244, 240, 232, 0.28);
  backdrop-filter: blur(8px);
}

.rt-btn-ghost-light:hover {
  background-color: rgba(244, 240, 232, 0.2);
  border-color: var(--rt-text-light);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.rt-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--rt-space-2);
  font-size: var(--rt-text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--rt-text);
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: gap var(--rt-transition-fast), border-color var(--rt-transition-fast), color var(--rt-transition-fast);
}

.rt-link-arrow svg {
  width: 16px;
  height: 16px;
  transition: transform var(--rt-transition-fast);
}

.rt-link-arrow:hover {
  color: var(--rt-accent);
  border-bottom-color: var(--rt-accent);
}

.rt-link-arrow:hover svg {
  transform: translateX(4px);
}

.on-dark .rt-link-arrow {
  color: var(--rt-text-light);
}

.on-dark .rt-link-arrow:hover {
  color: #E28C67;
  border-bottom-color: #E28C67;
}

/* Reduced Motion Override */
@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;
  }
}
