/* ============================================================
   THE CHAPEL AT WIMBERLEY — Base Styles
   Reset, body defaults, typography scale, utility classes.
   ============================================================ */

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

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

body {
  background-color: var(--color-cream);
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  border: none;
  background: none;
  appearance: none;
  -webkit-appearance: none;
}

button {
  cursor: pointer;
}

/* ── Typography Hierarchy ── */

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-charcoal);
}

h4, h5, h6 {
  font-family: var(--font-subhead);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-charcoal);
}

h1 {
  font-size: var(--text-hero);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-lg);
}

p {
  max-width: var(--content-width);
  line-height: 1.65;
}

/* ── Eyebrow Labels ── */
/* Usage: <span class="eyebrow">HILL COUNTRY · FISCHER, TX</span> */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}

/* ── Pull Quote ── */
.pull-quote {
  font-family: var(--font-subhead);
  font-style: italic;
  font-size: clamp(var(--text-lg), 2.5vw, var(--text-xl));
  color: var(--color-charcoal);
  line-height: 1.4;
  border-left: 3px solid var(--color-gold);
  padding-left: var(--space-md);
  margin: var(--space-lg) 0;
}

/* ── Calligraphy Accent ── */
/* Usage: sparingly — 2–3 times per page max */
.calligraphy {
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: 400;
}

/* ── Layout Containers ── */

/* Full-width section wrapper — constrains content, pads sides */
.section-wrap, .container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 768px) {
  .section-wrap, .container {
    padding: 0 var(--space-lg);
  }
}

/* Narrower container for body copy */
.content-wrap, .container--narrow {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* Standard section padding */
.section {
  padding: var(--section-pad-v) 0;
}

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

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

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

.section--sage-tint {
  background-color: #eef1ea;
}

.section--charcoal {
  background-color: var(--color-charcoal);
  color: var(--color-white);
}

/* Subtle ornamental divider between same-family sections */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 0;
  margin: 0 auto;
  max-width: 120px;
  color: var(--color-gold);
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.section-divider__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Grid Utilities ── */
.grid-2, .card-grid--2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.grid-3, .card-grid--3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.grid-4, .card-grid--4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .grid-2, .card-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3, .card-grid--3 {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
  .grid-4, .card-grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Flexbox Utilities ── */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Section Header (eyebrow + heading + optional intro para) ── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-header p {
  margin: var(--space-sm) auto 0;
  color: var(--color-mid);
  font-size: var(--text-md);
}

/* ── Divider ── */
.divider {
  width: 48px;
  height: 2px;
  background: var(--color-gold);
  margin: var(--space-md) auto;
}

/* ── Scroll Reveal ── */
/* JS adds .is-visible when element enters viewport */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-smooth),
              transform var(--duration-slow) var(--ease-smooth);
  transition-delay: calc(var(--reveal-delay, 0) * 1ms);
}

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

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── 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;
}

/* ── Aspect Ratio Boxes ── */
.ratio-16-9 {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.ratio-4-3 {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ratio-square {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

/* ── Caption / Metadata Text ── */
.caption {
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--color-mid);
  line-height: 1.4;
}

/* ── Placeholder styling for build-time stubs ── */
.placeholder-img {
  background: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-mid);
  font-size: var(--text-sm);
  font-style: italic;
}
