/* ============================================================
   Southern Motors — CSS Reset & Base Styles
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Links --- */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent-hover); }
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Lists --- */
ul, ol { list-style: none; }

/* --- Images & Media --- */
img, video, svg {
  display: block;
  max-width: 100%;
}

/* --- Buttons --- */
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --- Inputs --- */
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* --- Headings --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  color: var(--color-text-primary);
  font-weight: var(--weight-bold);
}

/* --- Horizontal Rule --- */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   Layout Utilities
   ============================================================ */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 768px) {
  .container { padding-inline: var(--sp-4); }
}

.section {
  padding-block: var(--sp-20);
}

.section--sm {
  padding-block: var(--sp-12);
}

.section--lg {
  padding-block: var(--sp-24);
}

/* Grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* Flex helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--sp-2); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* Text utilities */
.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-muted { color: var(--color-text-muted); }

/* Visually hidden (accessibility) */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Image / Media Placeholders
   ============================================================ */

/* Replace these with actual <img> tags by swapping the div for an img
   and setting src="path/to/your/image.jpg"                        */
.img-placeholder {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-border) 100%);
}

.img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255,255,255,0.08) 50%,
    transparent 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.aspect-video   { aspect-ratio: 16/9; }
.aspect-photo   { aspect-ratio: 4/3;  }
.aspect-card    { aspect-ratio: 3/2;  }
.aspect-square  { aspect-ratio: 1/1;  }

/* ============================================================
   Skeleton Loading
   ============================================================ */

.skeleton {
  background: linear-gradient(
    110deg,
    var(--color-bg-tertiary) 25%,
    var(--color-border) 50%,
    var(--color-bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-md);
}

.skeleton--text { height: 1em; border-radius: var(--radius-sm); }
.skeleton--heading { height: 1.5em; width: 60%; border-radius: var(--radius-sm); }

/* ============================================================
   Scroll-Reveal Animation
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Section Headers
   ============================================================ */

.section-header {
  text-align: center;
  margin-bottom: var(--sp-12);
}

.section-header__label {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-3);
}

.section-header__title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--color-text-primary);
  margin-bottom: var(--sp-4);
  line-height: var(--leading-tight);
}

.section-header__subtitle {
  font-size: var(--text-md);
  color: var(--color-text-secondary);
  max-width: 600px;
  margin-inline: auto;
  line-height: var(--leading-relaxed);
}

@media (max-width: 640px) {
  .section-header__title { font-size: var(--text-2xl); }
}
