/*
 * ============================================================
 *  CLEAR IMPACT SYSTEMS - Global Styles
 *  Reset, base typography, utility classes, shared components.
 *  Depends on: tokens.css (must be loaded first)
 * ============================================================
 */

/* ── GOOGLE FONTS ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,600&family=Inter:wght@300;400;500;600;700&display=swap');


/* ── RESET & BOX MODEL ────────────────────────────────────── */

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

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

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

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

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font: inherit;
}

/* ── BASE TYPOGRAPHY ──────────────────────────────────────── */

/*
 * H1–H2: Display/editorial serif (Cormorant Garamond)
 * H3–H6: UI sans (Inter)
 * These are defaults; page-level CSS can override.
 */

h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-md);  }
h6 { font-size: var(--text-base);}

p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  max-width: 68ch;
}

p + p { margin-top: var(--space-4); }

strong { font-weight: var(--weight-semibold); color: var(--color-text-primary); }

/* Eyebrow label - used above section headings */
.eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--cis-gold);
  margin-bottom: var(--space-3);
}

.eyebrow--teal { color: var(--cis-teal); }

/* ── LAYOUT UTILITIES ─────────────────────────────────────── */

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

.container--wide   { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

/* Standard section padding */
.section {
  padding-block: var(--section-pad-y);
}

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

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--cis-white);
}

.section--dark p {
  color: var(--cis-silver-dim);
}

/* Section heading block */
.section-header {
  margin-bottom: var(--space-12);
}

.section-header--centered {
  text-align: center;
}

.section-header--centered p {
  margin-inline: auto;
}

/* Grid system */
.grid {
  display: grid;
  gap: var(--space-8);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Flex utilities */
.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(--space-2); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ── BUTTON COMPONENTS ────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

/* Gold outlined button (matches header "Contact Us") */
.btn--outline-gold {
  color: var(--cis-gold);
  border: 1px solid var(--cis-gold);
  background: transparent;
}
.btn--outline-gold:hover {
  background: var(--cis-gold-glow);
  box-shadow: var(--shadow-gold);
}

/* Solid gold button (primary CTA on light backgrounds) */
.btn--gold {
  color: var(--cis-black);
  background: var(--cis-gold);
  border: 1px solid var(--cis-gold);
}
.btn--gold:hover {
  background: #D9BC60;
  border-color: #D9BC60;
  box-shadow: var(--shadow-gold);
}

/* Teal outlined */
.btn--outline-teal {
  color: var(--cis-teal);
  border: 1px solid var(--cis-teal);
  background: transparent;
}
.btn--outline-teal:hover {
  background: var(--cis-teal-glow);
  box-shadow: var(--shadow-teal);
}

/* Ghost / text link with arrow */
.btn--ghost {
  color: var(--cis-gold);
  background: transparent;
  border: none;
  padding-inline: 0;
  letter-spacing: var(--tracking-wide);
}
.btn--ghost::after {
  content: '→';
  margin-left: var(--space-2);
  transition: transform var(--transition-fast);
}
.btn--ghost:hover::after {
  transform: translateX(4px);
}

/* ── CARD COMPONENT ───────────────────────────────────────── */

.card {
  background: var(--cis-white);
  border: var(--border-rule);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card--dark {
  background: var(--cis-navy-surface);
  border-color: var(--cis-navy-border);
}

.card--dark:hover {
  box-shadow: var(--shadow-gold);
  border-color: var(--cis-gold);
}

/* ── DECORATIVE ELEMENTS ──────────────────────────────────── */

/* Thin gold accent line above section headings */
.accent-line {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--cis-gold);
  margin-bottom: var(--space-4);
}

.accent-line--teal {
  background: var(--cis-teal);
}

.accent-line--centered {
  margin-inline: auto;
}

/* Gold vertical rule (left-border on pull-quotes) */
.pull-quote {
  border-left: 3px solid var(--cis-gold);
  padding-left: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: var(--weight-light);
  color: var(--color-text-primary);
  line-height: var(--leading-snug);
}

/* ── TYPOGRAPHY UTILITY CLASSES ───────────────────────────── */

.text-display {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
}

.text-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.text-gold   { color: var(--cis-gold); }
.text-teal   { color: var(--cis-teal); }
.text-silver { color: var(--cis-silver); }
.text-muted  { color: var(--color-text-muted); }

/* ── DIVIDER ──────────────────────────────────────────────── */

.divider {
  border: none;
  border-top: var(--border-rule);
  margin-block: var(--space-12);
}

.divider--dark {
  border-color: var(--cis-navy-border);
}

/* ── SKIP LINK (accessibility) ────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--cis-gold);
  color: var(--cis-black);
  padding: var(--space-2) var(--space-4);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ── RESPONSIVE BREAKPOINTS ───────────────────────────────── */

/*
 * Mobile-first. Breakpoints:
 *   sm:  640px
 *   md:  768px
 *   lg:  1024px
 *   xl:  1280px
 *   2xl: 1440px
 */

@media (max-width: 1024px) {
  :root {
    --text-4xl: 3.052rem;
    --text-3xl: 2.441rem;
    --section-pad-y: var(--space-16);
  }
}

@media (max-width: 768px) {
  :root {
    --text-4xl: 2.441rem;
    --text-3xl: 1.953rem;
    --text-2xl: 1.563rem;
    --section-pad-y: var(--space-12);
    --section-pad-x: var(--space-4);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .container {
    padding-inline: var(--space-5);
  }
}

@media (max-width: 640px) {
  :root {
    --text-4xl: 1.953rem;
    --text-3xl: 1.563rem;
    --section-pad-y: var(--space-10);
  }
}
