/* ============================================================
   CFC — PROJECTS.HTML PAGE STYLES
   ============================================================ */

*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
    html { scroll-behavior:smooth; }
    
    body {
      font-family: 'Lato', sans-serif;
      color: #f0e8d0;
      overflow-x: hidden;
      background-color: #0D1B3E;
      background-position: center top;
      position: relative;
    }
    /* Overlay to control fade intensity */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-color: rgba(8, 15, 36, 0.93);
      pointer-events: none;
      z-index: 0;
    }
    /* Ensure all direct children sit above the overlay */
    body > * { position: relative; z-index: 1; }
    :root { --navy:#0D1B3E; --royal:#4B0082; --gold:#C9A84C; --gold-l:#E2C06A; }

    #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); }

    .gold-text   { color:var(--gold); }
    .gold-border { border:1px solid var(--gold); }
    .gold-divider { width:80px; height:3px; background:linear-gradient(90deg,transparent,var(--gold),transparent); margin:1rem auto; }

    .nav-link { font-family:'Cinzel',serif; font-size:.8rem; letter-spacing:.08em; color:#f0e8d0; transition:color .2s; padding:.25rem 0; position:relative; }
    .nav-link::after { content:''; position:absolute; bottom:-2px; left:0; right:0; height:2px; background:var(--gold); transform:scaleX(0); transition:transform .25s; }
    .nav-link:hover,
    .nav-link.active  { color:var(--gold); }
    .nav-link:hover::after,
    .nav-link.active::after { transform:scaleX(1); }

    .btn-gold { display:inline-block; padding:.75rem 2rem; background:linear-gradient(135deg,var(--gold-l),var(--gold)); color:#0D1B3E; font-family:'Cinzel',serif; font-weight:700; letter-spacing:.05em; border-radius:4px; transition:transform .2s,box-shadow .2s; }
    .btn-gold:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(201,168,76,.4); }
    .btn-outline { display:inline-block; padding:.75rem 2rem; border:2px solid var(--gold); color:var(--gold); font-family:'Cinzel',serif; font-weight:700; letter-spacing:.05em; border-radius:4px; transition:background .2s,color .2s,transform .2s; }
    .btn-outline:hover { background:var(--gold); color:#0D1B3E; transform:translateY(-2px); }

    #mobile-menu { display:none; }
    #mobile-menu.open { display:block; }

    /* ── Hero ── */
    /* ── Page hero with faded photo background ── */
    .page-hero {
      padding-top:130px; padding-bottom:80px;
      position:relative; overflow:hidden;
      background-color: #080f24;
    }
    /* Real photo layer — faded */
    .page-hero::before {
      content:'';
      position:absolute; inset:0;
      background-image: url('../../../images/projects/hero/groundbreaking-prayer.jpg');
      background-position: center center;
      opacity: 0.72;
      filter: grayscale(5%);
    }
    /* Gradient overlay on top of photo */
    .page-hero::after {
      content:'';
      position:absolute; inset:0;
      background: linear-gradient(
        to bottom,
        rgba(8,15,36,.55) 0%,
        rgba(75,0,130,.35) 50%,
        rgba(8,15,36,.65) 100%
      );
    }
    /* All children must sit above the overlays */
    .page-hero > * { position:relative; z-index:2; }

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

    .pattern-bg { background-image:radial-gradient(circle at 1px 1px,rgba(201,168,76,.06) 1px,transparent 0); background-size:32px 32px; }

    /* ── Timeline ── */
    .timeline-item { display:flex; gap:0; position:relative; }
    .timeline-left { display:flex; flex-direction:column; align-items:center; width:48px; flex-shrink:0; }
    .timeline-dot { width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:1rem; position:relative; z-index:2; }
    .timeline-line { width:2px; flex:1; min-height:24px; }
    .timeline-content { padding-bottom:2.5rem; padding-left:1.25rem; flex:1; }

    .dot-done    { background:linear-gradient(135deg,var(--gold-l),var(--gold)); color:#0D1B3E; }
    .dot-active  { background:linear-gradient(135deg,var(--royal),#6A0DAD); color:var(--gold); border:2px solid var(--gold); box-shadow:0 0 0 4px rgba(201,168,76,.15); }
    .dot-pending { background:rgba(255,255,255,.06); color:#6b7280; border:2px solid rgba(255,255,255,.1); }

    .line-done   { background:linear-gradient(to bottom,var(--gold),rgba(201,168,76,.3)); }
    .line-active { background:linear-gradient(to bottom,rgba(201,168,76,.3),rgba(255,255,255,.05)); }
    .line-pending{ background:rgba(255,255,255,.05); }

    /* ── Progress bar ── */
    .progress-track { width:100%; height:18px; border-radius:999px; background:rgba(255,255,255,.07); border:1px solid rgba(201,168,76,.2); overflow:hidden; position:relative; }
    .progress-fill  { height:100%; border-radius:999px; background:linear-gradient(90deg,#9E7B2E,var(--gold-l)); position:relative; transition:width 2s cubic-bezier(.4,0,.2,1); }
    .progress-fill::after { content:''; position:absolute; top:0; right:0; bottom:0; width:40px; background:linear-gradient(90deg,transparent,rgba(255,255,255,.3)); border-radius:999px; }
    .progress-shine { position:absolute; top:3px; left:4px; right:4px; height:5px; background:rgba(255,255,255,.18); border-radius:999px; }

    /* ── Gallery grid ── */
    .gallery-item { border-radius:12px; overflow:hidden; border:1px solid rgba(201,168,76,.2); aspect-ratio:4/3; cursor:pointer; position:relative; transition:transform .3s,box-shadow .3s,border-color .3s; }
    .gallery-item:hover { transform:scale(1.03); box-shadow:0 12px 35px rgba(0,0,0,.4); border-color:rgba(201,168,76,.6); }
    .gallery-item:hover .gallery-overlay { opacity:1; }
    .gallery-placeholder { width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; }
    .gallery-overlay { position:absolute; inset:0; background:rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .3s; }

    /* ── Budget card ── */
    .budget-card { background:linear-gradient(145deg,rgba(75,0,130,.2),rgba(13,27,62,.9)); border:1px solid rgba(201,168,76,.3); border-radius:16px; }

    /* ── Ticker ── */
    @keyframes tickerScroll { from{transform:translateX(100%)} to{transform:translateX(-100%)} }
    .ticker-inner { animation:tickerScroll 32s linear infinite; white-space:nowrap; }
    .ticker-inner:hover { animation-play-state:paused; }
  
    /* ══ PROJECTS PAGE — MOBILE RESPONSIVENESS ══ */

    /* Phone (≤640px) */
    @media (max-width: 640px) {
      /* Hero */
      .page-hero { padding-top:140px !important; padding-bottom:50px !important; }
      .page-hero h1 { font-size:2.2rem !important; line-height:1.15; }
      .page-hero p  { font-size:.9rem !important; }

      /* Section padding */
      section { padding-left:1rem !important; padding-right:1rem !important; }

      /* Architectural render image */
      .w-full img { max-height:260px !important; }

      /* Stats boxes */
      .text-2xl.gold-text { font-size:1.5rem !important; }

      /* Progress bars */
      .progress-track { height:14px !important; }

      /* Timeline — full width on mobile */
      .timeline-item { flex-direction:column !important; padding-left:0 !important; }
      .timeline-dot  { margin:0 auto .5rem !important; }

      /* Gallery items — 1 col on very small */
      .gallery-item  { height:180px; }

      /* Floating buttons */
      #float-donate  { font-size:.65rem !important; padding:.5rem .8rem !important; bottom:14px !important; right:10px !important; }
      #back-to-top   { width:36px !important; height:36px !important; bottom:14px !important; left:10px !important; }

      /* Lightbox arrows */
      #lightbox button { width:36px !important; height:36px !important; }

      /* CTA section */
      .crm-card, .give-card { padding:1.5rem 1rem !important; }
    }

    /* Tablet (641px–1023px) */
    @media (min-width: 641px) and (max-width: 1023px) {
      .page-hero h1 { font-size:3rem !important; }
      section { padding-left:1.5rem !important; padding-right:1.5rem !important; }
      .gallery-item { height:200px; }
    }

    /* All mobile & tablet (≤1023px) */
    @media (max-width: 1023px) {
      /* Overview image — not too tall */
      #overview-img { max-height:320px !important; }

      /* Phase timeline connector line — hide on mobile */
      .timeline-line { display:none !important; }

      /* Gap fix for stacked grids */
      .gap-14 { gap:2rem !important; }
      .gap-10 { gap:1.5rem !important; }
    }
  
    /* ══════════════════════════════════════════════════
       GLOBAL HORIZONTAL SCROLL FIX
       Prevents any element from causing left/right scroll
       on iPhone SE (375px) and all small screens
    ══════════════════════════════════════════════════ */
    html, body {
      overflow-x: hidden !important;
      max-width: 100vw !important;
    }
    *, *::before, *::after {
      box-sizing: border-box;
      max-width: 100%;
    }
    /* Ticker — clip instead of overflow */
    .ticker-wrap, .ticker-inner, [class*="ticker"] {
      max-width: 100vw !important;
      overflow: hidden !important;
    }
    /* Tables — scroll horizontally within container */
    table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
      max-width: 100%;
      -webkit-overflow-scrolling: touch;
    }
    /* Images — never wider than container */
    img { max-width: 100% !important; height: auto; }
    /* Nav — no overflow */
    nav, #navbar { max-width: 100vw !important; overflow: hidden; }
    /* Hero — clip content */
    .page-hero { overflow: hidden !important; }
    /* Floating elements — keep within screen */
    #float-donate, #float-wa, #back-to-top {
      max-width: calc(100vw - 20px);
    }
    /* Countdown boxes — wrap on tiny screens */
    @media (max-width: 375px) {
      .countdown-box-glass { width: 58px !important; height: 58px !important; }
      .countdown-num { font-size: 1.4rem !important; }
      #float-donate span { display: none; }
      #float-donate { padding: .6rem !important; border-radius: 50% !important; width: 46px; height: 46px; justify-content: center; }
    }
    /* Navbar church name — truncate on tiny screens */
    @media (max-width: 380px) {
      #navbar .font-display { font-size: .75rem !important; }
      #navbar img { width: 38px !important; height: 38px !important; }
    }
  
    /* Donate button — icon only on mobile */
    @media (max-width: 640px) {
      #donate-text { display: none !important; }
      #float-donate {
        width: 46px !important;
        height: 46px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        justify-content: center !important;
      }
    }

