/*
Theme Name: CBBC South - كنيسة المسيح الجنوب
Theme URI: https://cbbcsouthlebanon.org
Author: Built for Christ Bible Baptist Church – South
Description: قالب ووردبريس عربي ثلاثي الأبعاد لكنيسة المسيح المعمدانية الإنجيلية في الجنوب. واجهة RTL، بطل ثلاثي الأبعاد بتقنية WebGL، قارئ للكتاب المقدس عبر injeel.com، وإدارة محتوى للعظات والأحداث ودروس التلمذة من لوحة التحكم.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.2
Text Domain: cbbc
Tags: rtl, church, arabic, three-dimensional, custom-colors, custom-menu, featured-images, threejs
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  --ink: #16283a;
  --navy: #2c3e50;
  --navy-2: #21303f;
  --teal: #4aa0a0;
  --teal-deep: #2e7d7d;
  --teal-soft: #8fc7c7;
  --gold: #f39c12;
  --gold-soft: #fbc97a;
  --bg: #eef5f5;
  --surface: #ffffff;
  --parchment: #f7f1e3;
  --parchment-line: #e7dcc2;
  --text: #1f2d3a;
  --muted: #5c6b78;
  --line: #e3ecec;

  --display: 'Amiri', 'Cairo', serif;
  --body: 'Cairo', system-ui, sans-serif;

  --shadow-sm: 0 2px 8px rgba(22, 40, 58, .06);
  --shadow-md: 0 14px 34px rgba(22, 40, 58, .12);
  --shadow-lg: 0 26px 60px rgba(22, 40, 58, .18);
  --radius: 16px;
  --radius-lg: 26px;
  --wrap: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ==========================================================================
   2. Base
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.85;
  font-weight: 500;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.section { padding: 92px 0; }
.section--tight { padding: 64px 0; }
.bg-parchment { background: var(--parchment); }
.bg-ink { background: var(--ink); color: #eaf3f3; }

/* Section heading -------------------------------------------------------- */
.eyebrow {
  font-family: var(--body);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .22em;
  color: var(--teal-deep);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: 34px; height: 2px;
  background: var(--gold);
  display: inline-block;
}
.heading {
  font-family: var(--display);
  font-weight: 700;
  color: var(--navy);
  font-size: clamp(2rem, 4.4vw, 3.05rem);
  line-height: 1.25;
  margin-top: 14px;
}
.bg-ink .heading { color: #fff; }
.section-head { margin-bottom: 50px; }
.section-head.center { text-align: center; }
.section-head.center .eyebrow { justify-content: center; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 34px;
  border-radius: 999px;
  font-weight: 700;
  font-family: var(--body);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.btn--gold { background: var(--gold); color: #fff; box-shadow: 0 12px 26px rgba(243, 156, 18, .35); }
.btn--gold:hover { background: #df8c0a; transform: translateY(-3px); box-shadow: 0 18px 34px rgba(243, 156, 18, .42); }
.btn--ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--navy); transform: translateY(-3px); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--ink); transform: translateY(-3px); }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }

/* ==========================================================================
   3. Header / nav
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 4px solid var(--teal);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 78px; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__mark { height: 56px; width: 56px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(22,40,58,.18)); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name { font-family: var(--display); font-weight: 700; font-size: 1.42rem; color: var(--navy); }
.brand__sub { font-size: .74rem; font-weight: 700; color: var(--teal-deep); letter-spacing: .04em; }

.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a {
  font-weight: 700; color: var(--navy); position: relative; padding: 6px 0; font-size: 1.02rem;
}
.nav-links a::after {
  content: ""; position: absolute; bottom: -3px; right: 0; left: 0;
  height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: right;
  transition: transform .3s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--teal-deep); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }
.nav-links li.current-menu-item > a, .nav-links li.current_page_item > a { color: var(--teal-deep); }
.nav-links li.current-menu-item > a::after, .nav-links li.current_page_item > a::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; cursor: pointer; flex-direction: column;
  gap: 5px; align-items: center; justify-content: center;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: .3s var(--ease); }

/* ==========================================================================
   4. Hero (3D)
   ========================================================================== */
.hero {
  position: relative;
  min-height: clamp(560px, 88vh, 860px);
  display: flex; align-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 78% 8%, rgba(74,160,160,.55) 0%, rgba(74,160,160,0) 48%),
    radial-gradient(120% 120% at 12% 92%, rgba(243,156,18,.28) 0%, rgba(243,156,18,0) 46%),
    linear-gradient(160deg, #1b3346 0%, #1f3a4d 38%, #16283a 100%);
  color: #fff;
}
.hero__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; opacity: 0; transition: opacity 1.1s ease;
}
.hero__canvas.is-ready { opacity: 1; }
/* fallback emblem when WebGL unavailable */
.hero__fallback {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  opacity: .25; pointer-events: none;
}
.hero__fallback img { width: min(60%, 460px); filter: drop-shadow(0 20px 50px rgba(0,0,0,.4)); }
.hero.webgl-ok .hero__fallback { display: none; }

.hero__veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to left, rgba(22,40,58,.80) 0%, rgba(22,40,58,.40) 42%, rgba(22,40,58,0) 80%);
}
.hero__inner { position: relative; z-index: 3; max-width: 640px; padding: 60px 0; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-weight: 700; letter-spacing: .2em; font-size: .8rem; color: var(--gold-soft);
  margin-bottom: 18px;
}
.hero__eyebrow::before { content: ""; width: 30px; height: 2px; background: var(--gold); }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.18;
  color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.35);
}
.hero h1 .accent { color: var(--gold-soft); }
.hero__verse {
  font-family: var(--display);
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  color: #e6f1f1; margin: 22px 0 32px;
  border-right: 3px solid var(--gold); padding-right: 18px;
  font-weight: 400;
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__scroll {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 3; color: rgba(255,255,255,.7); font-size: .78rem; font-weight: 700;
  letter-spacing: .15em; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero__scroll span.dot {
  width: 24px; height: 38px; border: 2px solid rgba(255,255,255,.45); border-radius: 14px;
  position: relative;
}
.hero__scroll span.dot::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 8px; border-radius: 4px; background: var(--gold-soft);
  animation: scrolldot 1.6s var(--ease) infinite;
}
@keyframes scrolldot { 0%{opacity:0;transform:translate(-50%,0)} 40%{opacity:1} 80%{opacity:0;transform:translate(-50%,12px)} }

/* ==========================================================================
   5. Verse band
   ========================================================================== */
.verse-band {
  background:
    linear-gradient(160deg, var(--teal-deep), var(--teal));
  color: #fff; text-align: center; padding: 64px 0; position: relative; overflow: hidden;
}
.verse-band::before {
  content: "✝"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22rem; color: rgba(255,255,255,.06); pointer-events: none;
}
.verse-band p {
  position: relative; font-family: var(--display); font-size: clamp(1.4rem, 3vw, 2.1rem);
  max-width: 880px; margin: 0 auto; line-height: 1.7; font-weight: 400;
}
.verse-band .ref { display: block; margin-top: 14px; font-family: var(--body); font-size: 1rem; font-weight: 700; color: var(--gold-soft); letter-spacing: .05em; }

/* ==========================================================================
   6. Service times
   ========================================================================== */
.service-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.service-card {
  background: var(--surface); border-radius: var(--radius); padding: 34px 28px;
  box-shadow: var(--shadow-sm); text-align: center; position: relative; overflow: hidden;
  border: 1px solid var(--line);
  transform-style: preserve-3d; transition: box-shadow .3s var(--ease);
}
.service-card::before {
  content: ""; position: absolute; top: 0; right: 0; left: 0; height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}
.service-card .day { font-weight: 700; color: var(--teal-deep); font-size: .92rem; letter-spacing: .04em; }
.service-card .title { font-family: var(--display); font-size: 1.55rem; color: var(--navy); margin: 8px 0 12px; }
.service-card .time {
  display: inline-block; background: var(--bg); border: 1px solid var(--line);
  padding: 7px 20px; border-radius: 999px; font-weight: 700; color: var(--gold);
}

/* ==========================================================================
   7. Resource cards (sermons / events / lessons)
   ========================================================================== */
.resource-list { display: grid; gap: 22px; }
.resource-list.cols-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  padding: 28px; position: relative; overflow: hidden;
  transform-style: preserve-3d; transition: box-shadow .35s var(--ease), transform .1s linear;
  border-inline-end: 5px solid var(--gold);
}
.card:hover { box-shadow: var(--shadow-md); }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.card h3 { font-family: var(--display); font-size: 1.55rem; color: var(--navy); line-height: 1.3; }
.card .meta { color: var(--muted); font-weight: 600; font-size: .95rem; margin-top: 4px; }
.card .badge {
  background: var(--gold); color: #fff; font-weight: 700; font-size: .85rem;
  padding: 6px 14px; border-radius: 999px; white-space: nowrap; box-shadow: 0 6px 14px rgba(243,156,18,.3);
}
.card .badge--teal { background: var(--teal-deep); box-shadow: 0 6px 14px rgba(46,125,125,.3); }
.card p.body { color: #2a3640; margin-top: 12px; font-weight: 600; }

.card audio { width: 100%; margin-top: 18px; border-radius: 999px; }
.card__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.chip {
  background: none; border: 1px solid var(--navy); color: var(--navy);
  padding: 9px 18px; border-radius: 10px; cursor: pointer; font-weight: 700; font-family: var(--body);
  font-size: .95rem; transition: .25s var(--ease);
}
.chip:hover { background: var(--navy); color: #fff; }
.transcript { display: none; margin-top: 16px; padding: 18px; background: var(--parchment); border-radius: 12px; border: 1px solid var(--parchment-line); }
.transcript.is-open { display: block; }
.transcript p { font-weight: 600; color: #3a3326; }

/* featured latest sermon ------------------------------------------------- */
.featured {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 0;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
  background: var(--surface); border: 1px solid var(--line);
}
.featured__media {
  background: linear-gradient(150deg, var(--navy), var(--ink));
  display: flex; align-items: center; justify-content: center; padding: 40px;
  position: relative; overflow: hidden;
}
.featured__media img { width: min(62%, 230px); filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }
.featured__media::after {
  content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(243,156,18,.35), transparent 65%); top: -80px; left: -80px;
}
.featured__body { padding: 44px; }
.featured__body .tag { color: var(--teal-deep); font-weight: 700; letter-spacing: .12em; font-size: .8rem; }
.featured__body h3 { font-family: var(--display); font-size: 2rem; color: var(--navy); margin: 10px 0; }

/* ==========================================================================
   8. About
   ========================================================================== */
.prose { max-width: 820px; margin: 0 auto; }
.prose h3 { font-family: var(--display); color: var(--teal-deep); font-size: 1.7rem; margin: 28px 0 12px; }
.prose p { color: #2a3640; font-weight: 600; }
.belief-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 18px; }
.belief {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow-sm);
}
.belief .mark { color: var(--gold); font-size: 1.5rem; line-height: 1; flex: none; }
.belief p { margin: 0; font-weight: 600; }

/* ==========================================================================
   9. Constitution
   ========================================================================== */
.cons-intro { max-width: 860px; margin: 0 auto 44px; text-align: center; font-size: 1.18rem; color: var(--navy); font-weight: 600; }
.cons-list { display: grid; gap: 18px; max-width: 980px; margin: 0 auto; }
.cons-item {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
  border-inline-start: 4px solid var(--teal); box-shadow: var(--shadow-sm); overflow: hidden;
}
.cons-item__btn {
  width: 100%; text-align: start; background: none; border: none; cursor: pointer;
  padding: 22px 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-family: var(--display); font-size: 1.35rem; color: var(--navy); font-weight: 700;
}
.cons-item__btn .plus { color: var(--gold); font-size: 1.5rem; transition: transform .3s var(--ease); flex: none; }
.cons-item.is-open .cons-item__btn .plus { transform: rotate(45deg); }
.cons-item__body { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.cons-item.is-open .cons-item__body { max-height: 1400px; }
.cons-item__inner { padding: 0 26px 24px; color: #2a3640; font-weight: 600; line-height: 1.95; }
.cons-item__inner ul { margin: 10px 24px 0; list-style: disc; }
.cons-item__inner li { margin-bottom: 6px; }

/* ==========================================================================
   10. YouTube embeds
   ========================================================================== */
.yt-embed {
  position: relative; width: 100%; max-width: 920px; margin: 0 auto;
  aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.08); background: #000;
}
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.card .yt-embed { box-shadow: var(--shadow-sm); border-color: var(--line); }
@supports not (aspect-ratio: 16 / 9) {
  .yt-embed { height: 0; padding-bottom: 56.25%; }
}
.bible-reader {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); border: 1px solid var(--line); padding: 34px; max-width: 1000px; margin: 0 auto;
}
.bible-nav { display: flex; gap: 14px; flex-wrap: wrap; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 2px solid var(--bg); }
.bible-select {
  padding: 13px 16px; font-family: var(--body); font-size: 1.02rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--navy);
  flex: 1 1 200px; cursor: pointer;
}
.bible-stage { position: relative; min-height: 560px; border-radius: 14px; overflow: hidden; background: var(--parchment); border: 1px solid var(--parchment-line); }
.bible-stage iframe { width: 100%; height: 620px; border: none; display: none; background: #fff; }
.bible-placeholder { text-align: center; color: var(--muted); padding: 80px 24px; }
.bible-placeholder .mark { font-size: 3rem; color: var(--teal-soft); }
.bible-ext { text-align: center; margin-top: 18px; display: none; }

/* ==========================================================================
   11. Page hero (interior)
   ========================================================================== */
.page-hero {
  background: linear-gradient(155deg, var(--navy) 0%, var(--ink) 100%);
  color: #fff; padding: 84px 0 64px; position: relative; overflow: hidden; text-align: center;
}
.page-hero::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(74,160,160,.4), transparent 65%);
}
.page-hero::before {
  content: ""; position: absolute; left: -120px; bottom: -160px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(243,156,18,.28), transparent 65%);
}
.page-hero .eyebrow { color: var(--gold-soft); }
.page-hero .eyebrow::before { background: var(--gold); }
.page-hero h1 { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.4rem); position: relative; }
.page-hero .crumb { margin-top: 14px; color: rgba(255,255,255,.7); font-weight: 600; position: relative; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: #cddada; padding: 64px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 44px; }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.footer-brand img { height: 60px; width: 60px; object-fit: contain; }
.footer-brand .name { font-family: var(--display); font-size: 1.3rem; color: #fff; }
.site-footer h4 { color: #fff; font-family: var(--display); font-size: 1.35rem; margin-bottom: 16px; }
.site-footer p { color: #aebfbf; font-weight: 500; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: var(--gold-soft); font-weight: 600; }
.footer-links a:hover { color: #fff; }
.contact-line { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.contact-line .ico { color: var(--teal-soft); flex: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 44px; padding-top: 22px; text-align: center; font-size: .9rem; color: #8ea3a3; }

/* WhatsApp float --------------------------------------------------------- */
.wa-float {
  position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 1200;
  width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 30px rgba(37,211,102,.45);
  transition: transform .25s var(--ease);
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 30px; height: 30px; }

/* ==========================================================================
   13. Reveal animation
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   14. Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .featured { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .belief-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 78px; inset-inline: 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md);
    max-height: 0; overflow: hidden; transition: max-height .35s var(--ease);
  }
  .nav-links.is-open { max-height: 460px; }
  .nav-links a { width: 100%; padding: 16px 22px; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .service-grid { grid-template-columns: 1fr; }
  .resource-list.cols-2 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
  .hero__scroll span.dot::after { animation: none; }
}
