/*
Theme Name: Christ Spem
Theme URI: https://christspem.org
Author: Christ Spem Team
Author URI: https://christspem.org
Description: Custom theme for Christ Salvation and Praise Evangelical Ministry. Mirrors the original React/Tailwind design on a WordPress foundation. Registers all custom post types (events, sermons, testimonies, gallery albums, bulletins, books, bookstore items) and ACF field groups needed to hold content migrated from the previous Supabase backend.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.7
Requires PHP: 8.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: christspem
Tags: custom-colors, custom-menu, custom-logo, featured-images, full-site-editing, translation-ready
*/

/* =========================================================================
   Design tokens — lifted directly from the React app's tailwind.config.js
   and src/index.css so colors/fonts match exactly.
   ========================================================================= */
:root {
  /* Brand colours */
  --color-primary:          #00508C;   /* Dark logo blue */
  --color-primary-foreground: #FFFFFF;
  --color-secondary:        #4B98D3;   /* Lighter logo blue */
  --color-secondary-foreground: #FFFFFF;
  --color-accent:           #D93644;   /* Logo heart red */
  --color-accent-foreground:#FFFFFF;
  --color-accent-orange:    #F5821F;
  --color-accent-yellow:    #FDB813;

  /* Neutrals */
  --color-bg:               #FFFFFF;
  --color-fg:               #0A0E14;
  --color-muted:            #F1F5F9;
  --color-muted-fg:         #64748B;
  --color-border:           #E2E8F0;
  --color-card:             #FFFFFF;
  --color-card-fg:          #0A0E14;

  /* Layout */
  --container-max:          1400px;
  --container-pad:          1rem;
  --radius:                 0.5rem;
  --radius-lg:              0.75rem;
  --radius-sm:              0.375rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Typography */
  --font-sans:   'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:  'Playfair Display', Georgia, serif;
}

/* =========================================================================
   Reset + base
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75em 0;
  color: var(--color-fg);
}
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p  { margin: 0 0 1em 0; }
a  { color: var(--color-primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--color-secondary); }
img, video { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }

/* =========================================================================
   Layout helpers
   ========================================================================= */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
}
@media (min-width: 768px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px){ .container { padding: 0 2rem; } }

.section { padding: 4rem 0; }
.section-lg { padding: 5rem 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .grid-2 { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* =========================================================================
   Buttons (mimics shadcn `Button` variants)
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--color-primary); color: var(--color-primary-foreground); }
.btn-primary:hover { background: #003F6D; color: #fff; }
.btn-secondary { background: var(--color-secondary); color: var(--color-secondary-foreground); }
.btn-secondary:hover { background: #3A85BC; color: #fff; }
.btn-accent { background: var(--color-accent); color: var(--color-accent-foreground); }
.btn-accent:hover { background: #BC2A36; color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-ghost { background: transparent; color: var(--color-fg); }
.btn-ghost:hover { background: var(--color-muted); }
.btn-lg { padding: 0.875rem 2rem; font-size: 1.05rem; }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.875rem; }

/* =========================================================================
   Cards (mirrors shadcn `Card`)
   ========================================================================= */
.card {
  background: var(--color-card);
  color: var(--color-card-fg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
}
.card:hover { box-shadow: var(--shadow-xl); transform: translateY(-2px); }
.card-image-wrap { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--color-muted); }
.card-image-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-image-wrap img { transform: scale(1.05); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-family: var(--font-serif); font-size: 1.25rem; margin: 0 0 0.5rem 0; color: var(--color-fg); }
.card-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--color-muted-fg); margin-bottom: 0.75rem; flex-wrap: wrap; }
.card-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.card-desc { color: #475569; font-size: 0.95rem; margin-bottom: 1rem; flex: 1; }
.card-footer { padding-top: 0.5rem; }

/* =========================================================================
   Header / Navbar — mirrors Navbar.jsx behaviour (transparent on top, solid on scroll)
   ========================================================================= */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  padding: 1rem 0;
}
.site-header.scrolled {
  background: #ffffff;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  backdrop-filter: none;
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}
.site-logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.site-logo img { height: 3rem; width: auto; }
@media (min-width: 768px) { .site-logo img { height: 3.5rem; } }
.site-logo-text {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  display: none;
}
@media (min-width: 640px) { .site-logo-text { display: inline; } }
.site-header.scrolled .site-logo-text { color: var(--color-primary); }

.nav-desktop { display: none; align-items: center; gap: 1.25rem; }
@media (min-width: 1024px) { .nav-desktop { display: flex; } }
.nav-link {
  position: relative;
  padding-bottom: 4px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}
.nav-link:hover { color: var(--color-accent-yellow); }
.nav-link.active { color: var(--color-accent-orange); font-weight: 600; }
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 2px;
  background-color: currentColor;
  transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.site-header.scrolled .nav-link { color: #334155; }
.site-header.scrolled .nav-link:hover { color: var(--color-primary); }
.site-header.scrolled .nav-link.active { color: var(--color-primary); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius);
  background: transparent;
  border: 0;
  color: #fff;
}
.site-header.scrolled .nav-toggle { color: var(--color-primary); }
@media (min-width: 1024px) { .nav-toggle { display: none; } }

.nav-mobile {
  display: none;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 1rem 0;
}
.nav-mobile.open { display: block; }
.nav-mobile .nav-link {
  color: #334155;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  font-size: 1rem;
  display: flex;
}
.nav-mobile .nav-link:hover { background: var(--color-muted); color: var(--color-primary); }
.nav-mobile .nav-link.active { background: rgba(0,80,140,0.1); color: var(--color-primary); }

/* =========================================================================
   Hero section (video background + service times ticker)
   ========================================================================= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  text-align: center;
}
.hero-video-wrap { position: absolute; inset: 0; z-index: 0; }
.hero-video-wrap video {
  position: absolute;
  top: 50%; left: 50%;
  width: 100%; height: 100%;
  min-width: 100vw; min-height: 100vh;
  transform: translate(-50%, -50%);
  object-fit: cover;
  pointer-events: none;
}
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.hero-fallback {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #fff;
}
.hero-content { position: relative; z-index: 1; padding: 0 1.5rem; }
.hero-content h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: #fff; margin-bottom: 1rem; }
.hero-content p { font-size: clamp(1rem, 2.5vw, 1.25rem); max-width: 42rem; margin: 0 auto 2rem; opacity: 0.95; }
.hero-ticker {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 0.85rem 0;
  z-index: 2;
  overflow: hidden;
}
.hero-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 25s linear infinite;
}
.hero-ticker-track > span {
  padding: 0 2rem;
  font-size: 1rem;
}
@media (min-width: 768px) { .hero-ticker-track > span { font-size: 1.125rem; } }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* =========================================================================
   Welcome / content sections
   ========================================================================= */
.welcome-section { background: #fff; padding: 5rem 0; }
.welcome-image-wrap { position: relative; }
.welcome-image-wrap::before {
  content: ''; position: absolute;
  top: -1rem; left: -1rem;
  width: 6rem; height: 6rem;
  border-radius: 999px;
  background: rgba(0,80,140,0.1);
  z-index: 0;
}
.welcome-image-wrap::after {
  content: ''; position: absolute;
  bottom: -1rem; right: -1rem;
  width: 8rem; height: 8rem;
  border-radius: 999px;
  background: rgba(217,54,68,0.1);
  z-index: 0;
}
.welcome-image-wrap img {
  position: relative; z-index: 1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}
.section-heading {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  margin-bottom: 1.5rem;
}
.section-heading-bar {
  width: 5rem; height: 0.25rem;
  background: var(--color-primary);
  margin: 0 0 1.5rem 0;
}
.section-heading-bar.centered { margin-left: auto; margin-right: auto; }
.text-lead { font-size: 1.125rem; color: #475569; margin-bottom: 1rem; }

/* =========================================================================
   Page header (for non-home pages)
   ========================================================================= */
.page-header {
  position: relative;
  padding: 8rem 0 4rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  background-size: cover;
  background-position: center;
}
.page-header::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
}
.page-header .container { position: relative; }
.page-header h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.9); font-size: 1.1rem; max-width: 40rem; margin: 0 auto; }

/* =========================================================================
   Footer — mirrors Footer.jsx
   ========================================================================= */
.site-footer {
  background: #111827;
  color: #fff;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
.site-footer a { color: #D1D5DB; }
.site-footer a:hover { color: var(--color-primary-foreground); }
.footer-brand-text { color: #D1D5DB; font-size: 0.9rem; margin-bottom: 1.5rem; }
.footer-heading {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin-bottom: 0.6rem; font-size: 0.9rem; }
.footer-list a { display: inline-flex; align-items: center; gap: 0.5rem; color: #D1D5DB; }
.footer-social { display: flex; gap: 1rem; margin-top: 1rem; }
.footer-social a {
  color: #D1D5DB;
  transition: color 0.15s;
}
.footer-social a:hover { color: var(--color-secondary); }
.footer-divider {
  border-top: 1px solid #1F2937;
  margin-top: 3rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: #9CA3AF;
}

/* =========================================================================
   Event / sermon / testimony detail pages
   ========================================================================= */
.detail-wrap { max-width: 900px; margin: 0 auto; padding: 3rem 1rem; }
.detail-hero {
  aspect-ratio: 16/7;
  background: var(--color-muted);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  color: var(--color-muted-fg);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}
.detail-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.detail-content { font-size: 1.05rem; color: #334155; }
.detail-content p { margin-bottom: 1.2em; }

/* Audio/video players */
.media-player {
  width: 100%;
  background: #111;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
audio.media-player { padding: 0.5rem; }

/* =========================================================================
   Gallery
   ========================================================================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 768px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; } }
@media (min-width: 1024px){ .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-item {
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--color-muted);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

/* =========================================================================
   Forms
   ========================================================================= */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: #334155;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0,80,140,0.15);
}
.form-textarea { min-height: 8rem; resize: vertical; }

/* =========================================================================
   Utilities
   ========================================================================= */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-muted-fg); }
.bg-muted { background: var(--color-muted); }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; } .mt-6 { margin-top: 1.5rem; } .mt-8 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; } .mb-8 { margin-bottom: 2rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* =========================================================================
   Admin bar offset
   ========================================================================= */
.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* =========================================================================
   WordPress core block styles (alignments, captions) — minimal
   ========================================================================= */
.alignleft { float: left; margin: 0.5rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.5rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; }
.wp-caption, figure { max-width: 100%; margin: 1rem 0; }
.wp-caption-text, figcaption { font-size: 0.875rem; color: var(--color-muted-fg); text-align: center; margin-top: 0.4rem; }
