/* ============================================================
   Global Blessings Mission RCFE — Design System
   "Quiet Luxury, Built for Rest"
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&family=Montserrat:wght@300;400;500;600;700&family=Lato:ital,wght@0,300;0,400;0,700;1,400&family=Noto+Serif+KR:wght@300;400;500;600;700&display=swap');

/* ============================================================
   1. CSS Variables
   ============================================================ */
:root {
  /* Colors */
  --ivory:        #F7F2E9;
  --walnut:       #2B2622;
  --gold:         #B8893B;
  --gold-light:   #D4A855;
  --gold-on-dark: #F0C869;
  --sage:         #5E7E5E;
  --sage-light:   #7FA07F;
  --forest:       #2E6F99;
  --stone:        #E8E0D5;
  --stone-mid:    #C8BEB4;
  --white:        #FFFFFF;
  --overlay:      rgba(43, 38, 34, 0.55);

  /* Typography */
  --font-accent:     'Cormorant Garamond', 'Times New Roman', serif;
  --font-display-en: 'Montserrat', system-ui, sans-serif;
  --font-body-en:    'Lato', system-ui, sans-serif;
  --font-display-kr: 'Noto Serif KR', 'Apple SD Gothic Neo', serif;
  --font-body-kr:    'Noto Serif KR', 'Apple SD Gothic Neo', serif;

  /* Active fonts (switched by lang toggle) */
  --font-display: var(--font-display-en);
  --font-body:    var(--font-body-en);

  /* Type Scale — senior-forward (18px minimum body) */
  --text-xs:   0.875rem;   /*  14px */
  --text-sm:   1rem;       /*  16px */
  --text-base: 1.125rem;   /*  18px — minimum readable */
  --text-lg:   1.25rem;    /*  20px — standard body */
  --text-xl:   1.5rem;     /*  24px */
  --text-2xl:  1.875rem;   /*  30px */
  --text-3xl:  2.25rem;    /*  36px */
  --text-4xl:  2.75rem;    /*  44px */
  --text-5xl:  3.5rem;     /*  56px */
  --text-hero: 4.5rem;     /*  72px */

  /* Spacing (8px grid) */
  --space-1:   0.5rem;
  --space-2:   1rem;
  --space-3:   1.5rem;
  --space-4:   2rem;
  --space-6:   3rem;
  --space-8:   4rem;
  --space-10:  5rem;
  --space-14:  7rem;
  --space-18:  9rem;

  /* Section padding */
  --section-py: 8.75rem;   /* 140px desktop */
  --section-px: 2rem;

  /* Max widths */
  --container:  1200px;
  --container-narrow: 800px;

  /* Transitions */
  --ease-out:       cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-in-out:    cubic-bezier(0.45, 0, 0.55, 1);
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-emphasis:  cubic-bezier(0.22, 1, 0.36, 1);
  --duration-fast: 0.25s;
  --duration-base: 0.45s;
  --duration-slow: 0.7s;

  /* Shadows */
  --shadow-sm:  0 2px 8px rgba(43, 38, 34, 0.08);
  --shadow-md:  0 8px 32px rgba(43, 38, 34, 0.12);
  --shadow-lg:  0 24px 64px rgba(43, 38, 34, 0.16);
}

/* Korean mode overrides */
html[lang="ko"] {
  --font-display: var(--font-display-kr);
  --font-body:    var(--font-body-kr);
}
html[lang="ko"] body {
  letter-spacing: 0;
  word-break: keep-all;
  line-height: 1.9;
}
html[lang="ko"] h1,
html[lang="ko"] h2,
html[lang="ko"] h3,
html[lang="ko"] h4 {
  word-break: keep-all;
  line-height: 1.35;
  letter-spacing: -0.03em;
  font-weight: 700;
}
html[lang="ko"] p {
  word-break: keep-all;
  line-height: 1.9;
}
html[lang="ko"] .eyebrow {
  letter-spacing: 0.06em;
  font-size: var(--text-sm);
}
html[lang="ko"] .btn {
  letter-spacing: 0.02em;
  font-weight: 500;
}

/* ============================================================
   2. Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--walnut);
  background-color: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px 180px;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
ul, ol { list-style: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   3. Typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--walnut);
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

p { font-size: var(--text-lg); line-height: 1.75; }

.text-gold  { color: var(--gold); }
.text-sage  { color: var(--sage); }
.text-ivory { color: var(--ivory); }

.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
/* Left-aligned eyebrow decorative line */
.section-header:not(.center) .eyebrow,
.faith-section__text .eyebrow,
.contact-form-wrap .eyebrow,
.welcome__text .eyebrow,
.about-story__text .eyebrow,
.admin-section__text .eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.faith-section__text .eyebrow { color: var(--gold-on-dark); }
.section-header:not(.center) .eyebrow::before,
.faith-section__text .eyebrow::before,
.contact-form-wrap .eyebrow::before,
.welcome__text .eyebrow::before,
.about-story__text .eyebrow::before,
.admin-section__text .eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background-color: var(--gold);
  flex-shrink: 0;
}

/* ============================================================
   4. Layout Utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-py);
  position: relative;
}

.section--dark {
  background-color: var(--forest);
  color: var(--ivory);
}
.section--dark h2,
.section--dark h3,
.section--dark p { color: var(--ivory); }

.section--stone { background-color: var(--stone); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.text-center { text-align: center; }

/* ============================================================
   5. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.9rem 2.25rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: 2px;
  border: none;
  transition: all var(--duration-fast) var(--ease-out);
  min-height: 52px;
  white-space: nowrap;
}

.btn--primary {
  background: linear-gradient(135deg, #C49340 0%, #B8893B 55%, #A0782E 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.btn--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-120%) skewX(-20deg);
  transition: transform 0.55s ease;
}
.btn--primary:hover::before { transform: translateX(220%) skewX(-20deg); }
.btn--primary:hover {
  background: linear-gradient(135deg, #D0A045 0%, #C49340 55%, #B0882E 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(184,137,59,0.38);
}

.btn--outline {
  background-color: transparent;
  color: var(--walnut);
  border: 1.5px solid var(--walnut);
}
.btn--outline:hover {
  background-color: var(--walnut);
  color: var(--ivory);
  transform: translateY(-1px);
}

.btn--outline-light {
  background-color: transparent;
  color: var(--ivory);
  border: 1.5px solid rgba(247, 242, 233, 0.6);
}
.btn--outline-light:hover {
  background-color: var(--ivory);
  color: var(--forest);
}

.btn--sage {
  background-color: var(--sage);
  color: var(--white);
}
.btn--sage:hover {
  background-color: var(--sage-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Focus styles — accessibility */
.btn:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================
   6. Gold Divider
   ============================================================ */
.gold-rule {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.gold-rule::before,
.gold-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  max-width: 80px;
}
.gold-rule--left::after { display: none; }
.gold-rule--left::before { max-width: 60px; }

/* ============================================================
   7. Section Header Pattern
   ============================================================ */
.section-header {
  margin-bottom: var(--space-10);
}
.section-header .eyebrow { display: block; margin-bottom: var(--space-2); }
.section-header h2 { margin-bottom: var(--space-3); }
.section-header p { color: #6B6259; max-width: 560px; }
.section-header.center { text-align: center; }
.section-header.center p { margin-inline: auto; }

/* ============================================================
   8. Reveal Animations
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================================
   9. Language Toggle — !important prevents any layout class from overriding hide
   ============================================================ */
html:not([lang="ko"]) .lang-kr { display: none !important; }
html[lang="ko"] .lang-en { display: none !important; }

/* ============================================================
   10. Mobile Sticky Call Bar
   ============================================================ */
.mobile-call-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: linear-gradient(180deg, #1D455F 0%, #132F40 100%);
  border-top: 1px solid rgba(196, 147, 64, 0.38);
  padding: 12px 14px calc(18px + env(safe-area-inset-bottom, 0px));
  gap: 10px;
  transform: translateY(100%);
  transition: transform 0.44s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-call-bar--visible {
  transform: translateY(0);
}
.mobile-call-bar a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.8rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 8px;
  min-height: 52px;
}
.mobile-call-bar a:first-child {
  background: linear-gradient(135deg, #D4A044 0%, #C49340 55%, #A57230 100%);
  color: #fff;
  box-shadow: 0 2px 14px rgba(196, 147, 64, 0.28);
}
.mobile-call-bar a:last-child {
  background-color: rgba(247, 242, 233, 0.07);
  color: rgba(232, 224, 213, 0.88);
  border: 1.5px solid rgba(232, 224, 213, 0.22);
}

/* ============================================================
   11. Responsive
   ============================================================ */
@media (max-width: 1024px) {
  :root { --section-py: 6rem; }
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-3xl); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --section-py: 5rem;
    --section-px: 1.25rem;
  }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--space-3); }
  .mobile-call-bar { display: flex; }
  body { padding-bottom: 76px; }
}

/* ============================================================
   WAVE SECTION DIVIDERS
   ============================================================ */
.wave-divider {
  display: block;
  line-height: 0;
  position: relative;
  z-index: 2;
  margin: -2px 0;
  overflow: hidden;
}
.wave-divider svg {
  display: block;
  width: 200%;
  height: 140px;
  animation: waveFlow 20s linear infinite;
}
@keyframes waveFlow {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .wave-divider svg { animation: none; width: 100%; }
}
@media (max-width: 768px) {
  .wave-divider svg { height: 85px; }
}
@media (max-width: 480px) {
  .wave-divider svg { height: 60px; }
}

/* ============================================================
   Luxury Image Reveal
   ============================================================ */
main img {
  opacity: 0;
  filter: blur(8px) saturate(0.75);
  transform: scale(1.025);
  transition:
    opacity 0.85s var(--ease-editorial),
    filter 1.1s var(--ease-editorial),
    transform 1.1s var(--ease-editorial);
  will-change: opacity, filter, transform;
}
main img.img-loaded {
  opacity: 1;
  filter: none;
  transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
  main img { opacity: 1; filter: none; transform: none; transition: none; }
}
