/**
 * Base Styles — Reset, Typography, and Global Defaults
 * Mobile-first approach: default styles = mobile
 */

/* ─── Font Face Declarations ─── */
@font-face {
  font-family: 'Playfair Display';
  src: url('../fonts/PlayfairDisplay-Variable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/SourceSans3-Variable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ─── CSS Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Typography ─── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.2;
  font-weight: var(--weight-bold);
}

h1 { font-size: var(--text-h1); margin-bottom: var(--space-lg); }
h2 { font-size: var(--text-h2); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-h3); margin-bottom: var(--space-sm); }
h4 { font-size: var(--text-h4); margin-bottom: var(--space-sm); }

p {
  margin-bottom: var(--space-md);
  max-width: 70ch;
}

/* Section labels — uppercase copper accent text */
.section-label {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

small, .text-small {
  font-size: var(--text-small);
}

.text-caption {
  font-size: var(--text-caption);
  color: var(--color-leather);
}

strong {
  font-weight: var(--weight-semibold);
}

/* ─── Links ─── */
a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible {
  color: var(--color-link-hover);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ─── Images ─── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── Lists ─── */
ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

/* ─── Layout Utilities ─── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding: var(--section-padding);
}

.section--cream {
  background-color: var(--color-cream);
}

.section--parchment {
  background-color: var(--color-parchment);
}

.section--walnut {
  background-color: var(--color-walnut);
  color: var(--color-cream);
}

.section--walnut h2,
.section--walnut h3 {
  color: var(--color-cream);
}

.section--cedar {
  background-color: var(--color-cedar);
  color: var(--color-cream);
}

.section--cedar h2,
.section--cedar h3 {
  color: var(--color-cream);
}

/* ─── Grid Utilities ─── */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Text Alignment ─── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ─── Visually Hidden (screen readers only) ─── */
.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;
}

/* ─── Skip to Content Link ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-walnut);
  color: var(--color-cream);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-toast);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-sm);
}

/* ─── Selection ─── */
::selection {
  background-color: var(--color-copper);
  color: var(--color-cream);
}
