/* ============================================================
   CHRIST FAMILY CHURCH — MAIN STYLESHEET
   Truth Embassy Digital Hub
   Version: 1.0
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --navy:   #0D1B3E;
  --royal:  #4B0082;
  --gold:   #C9A84C;
  --gold-l: #E2C06A;
  --dark:   #080f24;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  color: #f0e8d0;
  overflow-x: hidden;
  background-color: var(--navy);
  position: relative;
  opacity: 0;
  transition: opacity .15s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-color: rgba(8, 15, 36, 0.93);
  pointer-events: none;
  z-index: 0;
}

body > * { position: relative; z-index: 1; }

img { max-width: 100% !important; height: auto; }

/* ── Typography ── */
.font-display { font-family: 'Cinzel', serif; }
.gold-text    { color: var(--gold); }
.gold-border  { border: 1px solid var(--gold); }

/* ── Gold Divider ── */
.gold-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
  margin: 1rem auto;
}

/* ── Navbar ── */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(8,15,36,.97);
  box-shadow: 0 2px 20px rgba(201,168,76,.2);
  transition: background .4s, box-shadow .4s;
}
#navbar.scrolled {
  background: rgba(5,10,26,1);
  box-shadow: 0 2px 24px rgba(201,168,76,.25);
}

/* Nav links */
.nav-link {
  font-family: 'Cinzel', serif;
  font-size: .72rem;
  letter-spacing: .12em;
  color: rgba(240,232,208,.8);
  text-decoration: none;
  transition: color .2s;
  padding: .25rem 0;
  position: relative;
}
.nav-link:hover,
.nav-link.active {
  color: var(--gold);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* Mobile menu */
#mobile-menu {
  display: none;
  background: rgba(5,10,26,.99);
  border-top: 1px solid rgba(201,168,76,.15);
}
#mobile-menu.open { display: block; }

/* ── Hamburger ── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: all .3s;
}

/* ── Page Hero ── */
.page-hero {
  padding-top: 160px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
  background-color: var(--dark);
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  opacity: 0.13;
  filter: grayscale(30%);
  transition: opacity .4s;
}
.page-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    rgba(8,15,36,.92) 0%,
    rgba(75,0,130,.75) 50%,
    rgba(8,15,36,.92) 100%
  );
}
.page-hero > * { position: relative; z-index: 2; }

/* ── Buttons ── */
.btn-gold {
  display: inline-flex;
  align-items: center;
  padding: .8rem 2rem;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--gold-l), var(--gold));
  color: var(--navy);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .1em;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  border: none;
  cursor: pointer;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,168,76,.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  padding: .8rem 2rem;
  border-radius: 4px;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .1em;
  text-decoration: none;
  transition: all .2s;
  background: transparent;
  cursor: pointer;
}
.btn-outline:hover {
  background: var(--gold);
  color: var(--navy);
  transform: translateY(-2px);
}

/* ── Reveal Animation ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .65s ease, transform .65s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Ticker ── */
.ticker-wrap {
  overflow: hidden !important;
  max-width: 100vw !important;
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-inner {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
  width: max-content;
}

/* ── Pattern Background ── */
.pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(201,168,76,0.06)'/%3E%3C/svg%3E");
}

/* ── Floating WhatsApp ── */
#float-wa {
  position: fixed;
  bottom: 20px; right: 16px;
  z-index: 9999;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.5);
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}
#float-wa:hover {
  transform: scale(1.12);
  box-shadow: 0 6px 28px rgba(37,211,102,.7);
}
#float-wa::before {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0;
  animation: waPulse 2.5s ease-in-out infinite;
}
@keyframes waPulse {
  0%,100% { opacity: 0; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.15); }
}

/* ── Back to Top ── */
#back-to-top {
  position: fixed;
  bottom: 20px; left: 16px;
  z-index: 9999;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-l), var(--gold));
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(201,168,76,.45);
  transition: transform .25s;
}
#back-to-top:hover { transform: scale(1.1); }

/* ── Footer ── */
footer {
  background: linear-gradient(180deg, var(--navy), var(--dark));
  border-top: 1px solid rgba(201,168,76,.15);
}
.footer-link {
  color: #9ca3af;
  text-decoration: none;
  font-size: .8rem;
  transition: color .2s;
}
.footer-link:hover { color: var(--gold); }

/* ── Tables ── */
table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* ── Mobile Global ── */
@media (max-width: 640px) {
  .page-hero { padding-top: 140px !important; padding-bottom: 50px !important; }
  section { padding-left: 1rem !important; padding-right: 1rem !important; }
  #float-wa { bottom: 14px !important; right: 10px !important; }
  #back-to-top { bottom: 14px !important; left: 10px !important; }
}

@media (max-width: 380px) {
  #navbar .font-display { font-size: .75rem !important; }
  #navbar img { width: 38px !important; height: 38px !important; }
}

/* ── Page Transition: Cross Loader ── */
#cfc-page-loader {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(8,15,36,.97);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .08s ease;
}
#cfc-page-loader.show { opacity: 1; pointer-events: all; }

/* Cross shape — 44 × 62 px, bars 12 px wide, crossbeam at y=18 */
.cfc-loader-cross {
  width: 44px; height: 62px; position: relative;
}
/* Faint outline layer */
.cfc-loader-cross::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(201,168,76,.18);
  clip-path: polygon(16px 0,28px 0,28px 18px,44px 18px,44px 30px,28px 30px,28px 62px,16px 62px,16px 30px,0 30px,0 18px,16px 18px);
}
/* Fill layer — rises from bottom via scaleY */
.cfc-loader-fill {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--gold) 0%, var(--gold-l) 100%);
  clip-path: polygon(16px 0,28px 0,28px 18px,44px 18px,44px 30px,28px 30px,28px 62px,16px 62px,16px 30px,0 30px,0 18px,16px 18px);
  transform-origin: bottom center;
  transform: scaleY(0);
  animation: cfcCrossFill 2.4s cubic-bezier(.4,0,.15,1) forwards;
}
@keyframes cfcCrossFill {
  0%   { transform: scaleY(0); }
  18%  { transform: scaleY(0.4); }
  45%  { transform: scaleY(0.68); }
  72%  { transform: scaleY(0.83); }
  88%  { transform: scaleY(0.91); }
  100% { transform: scaleY(1); }
}
