/*
Theme Name: Success Cycles
Theme URI: https://successcycles.org
Description: Custom theme for the Success Cycles community bike nonprofit. Carries the original bespoke design (animated hero, SVG brand marks, modal donation forms) and adds a native-block-editable blog. Page bodies are editable from the block editor as Custom HTML / native blocks.
Author: Success Cycles
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: successcycles
*/

/* The full visual system lives in assets/styles.css (enqueued in functions.php).
   This file is the WordPress theme header + a few blog-only additions below. */

/* ---- Blog (native posts) — small layer on top of the brand styles ---- */
.sc-blog{max-width:780px;margin:0 auto;padding:7rem 1.5rem 5rem}
.sc-blog .post-card{padding:2rem 0;border-bottom:1px solid rgba(255,255,255,.08)}
.sc-blog .post-card:last-child{border-bottom:0}
.sc-blog h2.post-title{margin:0 0 .4rem;font-size:1.9rem;line-height:1.15}
.sc-blog h2.post-title a{color:inherit;text-decoration:none}
.sc-blog h2.post-title a:hover{color:var(--amber,#f6a821)}
.sc-blog .post-meta{font-size:.85rem;opacity:.65;margin:0 0 1rem;letter-spacing:.02em}
.sc-blog .post-excerpt{opacity:.85;line-height:1.7}
.sc-blog .more-link{display:inline-block;margin-top:1rem;color:var(--amber,#f6a821);text-decoration:none;font-weight:600}
.sc-single{max-width:760px;margin:0 auto;padding:7rem 1.5rem 5rem;line-height:1.75}
.sc-single .post-meta{font-size:.9rem;opacity:.65;margin:0 0 2rem}
.sc-single img{max-width:100%;height:auto;border-radius:12px}
.sc-single h1{font-size:2.6rem;line-height:1.1;margin:0 0 .6rem}
.sc-pager{max-width:780px;margin:2rem auto 0;padding:0 1.5rem;display:flex;justify-content:space-between;gap:1rem}
.sc-pager a{color:var(--amber,#f6a821);text-decoration:none;font-weight:600}

/* ============================================================
   iPhone / mobile optimization (loads after the base styles)
   ============================================================ */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* Anchor jumps (#mission, #how, #donate) shouldn't hide under the fixed nav */
[id]{scroll-margin-top:5rem}

/* Respect the notch / home indicator on iPhones (viewport-fit=cover) */
.nav{padding-left:max(clamp(1.25rem,5vw,3rem),env(safe-area-inset-left));
     padding-right:max(clamp(1.25rem,5vw,3rem),env(safe-area-inset-right))}
.footer{padding-bottom:max(2rem,env(safe-area-inset-bottom))}

/* ---- Hamburger button (hidden on desktop) ---- */
.nav-toggle{display:none;flex-direction:column;justify-content:center;gap:5px;
  width:44px;height:44px;padding:10px;margin:-10px -10px -10px 0;
  background:none;border:0;cursor:pointer;z-index:120}
.nav-toggle span{display:block;width:24px;height:2px;border-radius:2px;
  background:var(--text,#eef3ee);transition:transform .25s var(--ease,ease),opacity .2s}

@media(max-width:760px){
  .nav-toggle{display:flex}

  /* Turn the inline links into a dropdown panel under the bar */
  .nav-links{
    position:absolute;top:100%;left:0;right:0;
    flex-direction:column;align-items:stretch;gap:0;
    padding:.5rem clamp(1.25rem,5vw,2rem) max(1rem,env(safe-area-inset-bottom));
    background:rgba(8,16,12,.97);
    -webkit-backdrop-filter:blur(14px) saturate(140%);backdrop-filter:blur(14px) saturate(140%);
    border-bottom:1px solid rgba(255,255,255,.1);
    box-shadow:0 24px 40px -24px rgba(0,0,0,.7);
    max-height:calc(100svh - 100%);overflow:auto;
    opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-8px);
    transition:opacity .22s ease,transform .22s ease,visibility .22s ease}
  body.nav-open .nav-links{opacity:1;visibility:visible;pointer-events:auto;transform:translateY(0)}

  /* show EVERY link in the open panel (overrides the base hide), big tap targets */
  .nav-links a,
  .nav-links a:not(.btn),
  .nav-links a.nav-page{display:flex !important;align-items:center;min-height:52px;
    font-size:1.08rem;border-bottom:1px solid rgba(255,255,255,.07)}
  .nav-links a.btn{justify-content:center;min-height:52px;margin-top:.9rem;font-size:1rem;border-bottom:0}

  /* keep the bar solid while the menu is open, even at the top of the page */
  body.nav-open .nav{background:rgba(8,16,12,.92);
    -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);
    border-bottom-color:rgba(255,255,255,.08)}

  /* hamburger morphs into an X */
  body.nav-open .nav-toggle span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  body.nav-open .nav-toggle span:nth-child(2){opacity:0}
  body.nav-open .nav-toggle span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
}
