/* ============================================================
   UCR — Unity Church of Raleigh
   Design System: Variables · Reset · Base · Layout · Utilities
   ============================================================ */

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

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Color Palette */
  --color-indigo:        #1E2A4A;
  --color-indigo-dark:   #141d35;
  --color-indigo-mid:    #2d3f6b;
  --color-gold:          #C9952A;
  --color-gold-light:    #e8b04a;
  --color-gold-dark:     #a87820;
  --color-cream:         #F9F7F2;
  --color-cream-dark:    #f0ece3;
  --color-slate:         #6B7A99;
  --color-slate-light:   #9aa5bd;
  --color-text:          #1a1f2e;
  --color-text-muted:    #5a6070;
  --color-white:         #FFFFFF;
  --color-border:        #e2ddd4;
  --color-overlay:       rgba(20, 29, 53, 0.62);
  --color-overlay-deep:  rgba(20, 29, 53, 0.78);

  /* Typography */
  --font-heading:  'Lora', Georgia, 'Times New Roman', serif;
  --font-body:     'Inter', system-ui, -apple-system, sans-serif;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;
  --text-6xl:   3.75rem;

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-7:   1.75rem;
  --space-8:   2rem;
  --space-10:  2.5rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-20:  5rem;
  --space-24:  6rem;
  --space-32:  8rem;

  /* Layout */
  --container-max:    1200px;
  --container-wide:   1400px;
  --container-narrow:  760px;

  /* Borders & Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;
  --border-width: 1px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(30, 42, 74, 0.08), 0 1px 2px rgba(30, 42, 74, 0.06);
  --shadow-md:  0 4px 12px rgba(30, 42, 74, 0.10), 0 2px 4px rgba(30, 42, 74, 0.06);
  --shadow-lg:  0 10px 30px rgba(30, 42, 74, 0.12), 0 4px 8px rgba(30, 42, 74, 0.08);
  --shadow-xl:  0 20px 50px rgba(30, 42, 74, 0.15), 0 8px 16px rgba(30, 42, 74, 0.10);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Header */
  --header-utility-height: 40px;
  --header-nav-height:     88px;
  --header-total:          128px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ── Inline paragraph links ────────────────────────────────── */
p a {
  color: var(--color-gold);
  text-decoration: underline;
  text-decoration-color: rgba(201, 149, 42, 0.4);
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

p a:hover,
p a:focus-visible {
  color: var(--color-gold-dark);
  text-decoration-color: var(--color-gold-dark);
}

.section--indigo p a {
  color: var(--color-gold-light);
  text-decoration-color: rgba(232, 176, 74, 0.4);
}

.section--indigo p a:hover,
.section--indigo p a:focus-visible {
  color: var(--color-white);
  text-decoration-color: var(--color-white);
}

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-indigo);
  font-weight: 600;
}

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

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

/* ── Container ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

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

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

/* ── Typography Scale ──────────────────────────────────────── */
.display-xl {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, var(--text-6xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, var(--text-5xl));
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.display-md {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, var(--text-4xl));
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: clamp(1.875rem, 3.5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 2.5vw, var(--text-4xl)); }
h3 { font-size: clamp(1.25rem, 2vw, var(--text-3xl)); }
h4 { font-size: clamp(1.125rem, 1.5vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

.text-sm     { font-size: var(--text-sm); }
.text-base   { font-size: var(--text-base); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }

.text-muted  { color: var(--color-text-muted); }
.text-gold   { color: var(--color-gold); }
.text-indigo { color: var(--color-indigo); }
.text-white  { color: var(--color-white); }

.font-light    { font-weight: 300; }
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.italic { font-style: italic; }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.lead {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--color-text-muted);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  display: block;
  margin-bottom: var(--space-3);
}

/* ── Sections ──────────────────────────────────────────────── */
.section {
  padding-block: var(--space-20);
}

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

.section--lg {
  padding-block: var(--space-32);
}

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

.section--indigo h1,
.section--indigo h2,
.section--indigo h3,
.section--indigo h4,
.section--indigo p,
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark p {
  color: var(--color-white);
}

.section--indigo .eyebrow,
.section--dark .eyebrow {
  color: var(--color-gold-light);
}

.section--indigo .lead,
.section--dark .lead {
  color: var(--color-slate-light);
}

.section-header {
  margin-bottom: var(--space-12);
}

.section-header.text-center {
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

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

.grid-auto-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-auto-4 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

/* ── Spacing Utilities ─────────────────────────────────────── */
.mt-2  { margin-top: var(--space-2); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ── Dividers ──────────────────────────────────────────────── */
.divider {
  width: 64px;
  height: 3px;
  background: var(--color-gold);
  border: none;
  margin: var(--space-6) 0;
  border-radius: var(--radius-full);
}

.divider--center {
  margin-inline: auto;
}

/* ── Page Header (inner pages) ─────────────────────────────── */
.page-hero {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: var(--header-total);
}

.page-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 29, 53, 0.45) 0%, rgba(20, 29, 53, 0.0) 60%);
  pointer-events: none;
}

.page-hero__content {
  position: relative;
  z-index: 1;
  padding-block: var(--space-16);
  color: var(--color-white);
}

.page-hero__content h1 {
  color: var(--color-white);
}

.page-hero__content .eyebrow {
  color: var(--color-gold-light);
}

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

@media (max-width: 768px) {
  :root {
    --header-utility-height: 0px;
    --header-nav-height: 64px;
    --header-total: 64px;
  }

  .header-inner { height: var(--header-total); }
  .site-logo img { height: 52px; }

  .section        { padding-block: var(--space-12); }
  .section--sm    { padding-block: var(--space-8); }
  .section--lg    { padding-block: var(--space-20); }
  .container      { padding-inline: var(--space-4); }

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

  .page-hero { min-height: 240px; }
  .page-hero__content { padding-block: var(--space-12); }
}

@media (max-width: 480px) {
  .section { padding-block: var(--space-10); }
  .container { padding-inline: var(--space-4); }
}

/* ── Video Modal ──────────────────────────────────────────────── */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.video-modal[hidden] { display: none; }

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
  animation: modal-fade-in 0.25s ease;
}

.video-modal__container {
  position: relative;
  width: min(860px, 100%);
  animation: modal-slide-in 0.28s ease;
}

.video-modal__close {
  position: absolute;
  top: -2.4rem;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.video-modal__close:hover,
.video-modal__close:focus-visible {
  opacity: 1;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.video-modal__embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.video-modal__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

body.modal-open { overflow: hidden; }

@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
