/* shared site-nav supersedes page masthead */
.masthead,.masthead-nav,.masthead-brand{display:none !important;}


*{margin:0;padding:0;box-sizing:border-box;}
html{scroll-behavior:smooth;}

:root{
  /* Core palette — matches Conservation Planet Homepage V8 / First Wave Index */
  --deep:       #000814;
  --deep2:      #000d1a;
  --deep3:      #001020;
  --ocean-deep: #0a3d5c;
  --paper:      #f7f4ef;
  --paper-warm: #ede9e2;
  --paper-card: #ffffff;

  --ink:        #1a1a18;
  --ink-soft:   #3d3d38;
  --ink-muted:  #6e6e6e;
  --rule:       #d4cfc7;

  --cyan:       #00b4d8;
  --cyan-light: #90e0ef;
  --cyan-dim:   rgba(0,180,216,0.12);
  --cyan-border:rgba(0,180,216,0.3);
  --gold:       #c8a84b;
  --gold-border:rgba(200,168,75,0.35);
  --white:      #ffffff;
}

body{
  font-family:'DM Sans',sans-serif;
  background:var(--deep);
  color:var(--white);
  overflow-x:hidden;
}

/* ══ SCROLL PROGRESS ══ */
.scroll-progress{position:fixed;top:0;left:0;width:100%;height:3px;z-index:1000;background:rgba(0,0,0,0.2);pointer-events:none;}
.scroll-progress-fill{height:100%;width:0%;background:var(--cyan);transition:width .1s linear;}

/* ══ MASTHEAD (identical to Homepage V8 / First Wave Index) ══ */
.masthead{
  position:fixed;top:3px;left:0;right:0;z-index:600;height:64px;
  display:flex;align-items:center;justify-content:space-between;padding:0 3rem;
  background:rgba(0,8,20,0.0);backdrop-filter:blur(0px);border-bottom:1px solid transparent;
  transition:background .4s ease, backdrop-filter .4s ease, border-color .4s ease;
}
.masthead.scrolled{background:rgba(0,8,20,0.97);backdrop-filter:blur(20px);border-bottom-color:var(--gold-border);}
.masthead-brand{font-family:'Playfair Display',Georgia,serif;font-size:1.1rem;font-weight:600;color:var(--white);text-decoration:none;letter-spacing:.02em;transition:color .2s;}
.masthead-brand span{color:var(--gold);}
.masthead-brand:hover{color:var(--cyan-light);}
.masthead-nav{display:flex;align-items:center;gap:2.5rem;}
.masthead-link{display:inline-flex;align-items:center;min-height:44px;font-size:.72rem;letter-spacing:.12em;text-transform:uppercase;color:rgba(255,255,255,0.8);text-decoration:none;font-weight:500;position:relative;transition:color .2s;}
.masthead-link::after{content:'';position:absolute;bottom:-3px;left:0;right:0;height:1px;background:var(--cyan);transform:scaleX(0);transform-origin:left;transition:transform .25s ease;}
.masthead-link:hover{color:var(--white);}
.masthead-link:hover::after,.masthead-link.active::after{transform:scaleX(1);}
.masthead-link.active{color:var(--cyan);}
.masthead-hamburger{display:none;flex-direction:column;align-items:center;justify-content:center;gap:5px;cursor:pointer;background:none;border:none;width:44px;height:44px;z-index:10;}
.masthead-hamburger span{display:block;width:22px;height:2px;background:rgba(255,255,255,.75);transition:transform .22s,opacity .22s;}
@media(max-width:768px){
  .masthead{padding:0 1.5rem;}
  .masthead-nav{display:none;flex-direction:column;position:absolute;top:67px;left:0;right:0;background:rgba(0,8,20,0.98);padding:1.5rem 2rem;gap:1.2rem;border-bottom:1px solid var(--gold-border);z-index:299;}
  .masthead-nav.open{display:flex;}
  .masthead-link{font-size:.85rem;}
  .masthead-hamburger{display:flex;}
}

/* ══ CATEGORY HERO ══ */
.cat-hero{margin-top:calc(var(--site-nav-offset) + 2.75rem);
  position:relative;padding:7.8rem 2rem 4.5rem;background:var(--deep);
  overflow:hidden;
}
/* Category hero background - Rising_Tide_hero, embedded inline as base64 so it
   can never go missing due to a file/folder not traveling with this HTML
   (composite scene: goliath grouper, humpback whales, sea lions, green sea turtle) */
.cat-hero-bg{
  position:absolute;inset:0;
  background-image:url(/assets/images/victories/Rising_Tide_hero.webp);
  background-size:cover;background-position:center 50%;
  opacity:.8;
  filter:brightness(1.15) saturate(1.3);
  /* .8 (up from .75) still holds 5.2:1+ margin on the tightest text color -
     this photo has less headroom than most (going to .85 would only leave
     4.84:1, versus 8-11:1+ margins found for other heroes in this project),
     so most of the "dull" fix here is the added saturation, not just opacity. */
}
.cat-hero::before{
  content:'';position:absolute;inset:0;z-index:1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0,180,216,0.14) 0%, transparent 60%),
    linear-gradient(180deg, rgba(0,8,20,.6) 0%, rgba(0,8,20,.85) 35%, rgba(0,8,20,.85) 55%, var(--deep) 82%);
  /* Text zone (0-55%) unchanged from the verified-safe version. Below 55% there's
     no text - previously this jumped straight to fully solid black at 55%, hiding
     the lower portion of the photo (where the grouper and turtle sit) entirely
     regardless of the photo layer's own opacity. Now it fades out gradually
     through 82% instead, so that part of the image is actually visible. */
  pointer-events:none;
}
.cat-hero-inner{max-width:900px;margin:0 auto;position:relative;z-index:1;text-align:center;}
.cat-back{display:inline-flex;align-items:center;min-height:44px;gap:.5rem;font-size:.75rem;letter-spacing:.08em;color:rgba(255,255,255,.55);text-decoration:none;margin-bottom:2rem;transition:color .2s;}
.cat-back:hover{color:var(--cyan-light);}
.cat-eyebrow{display:inline-flex;align-items:center;gap:.8rem;font-size:.72rem;font-weight:700;letter-spacing:.28em;text-transform:uppercase;color:var(--cyan);margin-bottom:1.4rem;}
.cat-eyebrow-line{display:block;width:24px;height:1px;background:var(--cyan);}
.cat-headline{font-family:'Playfair Display',Georgia,serif;font-size:clamp(2.4rem,6vw,4.2rem);font-weight:700;line-height:1.05;letter-spacing:-.02em;}
.cat-headline em{font-style:italic;font-weight:400;color:var(--cyan-light);}

/* ══ DEFINITION — body + stats, right after the hero (unchanged position) ══ */
.cat-body{font-size:.92rem;color:rgba(255,255,255,.5);max-width:560px;margin:1.75rem auto 0;line-height:1.7;}

/* ══ WAVE DIVIDER ══ */
.wave{display:block;width:100%;height:56px;}

/* ══ STORY GRID ══ */
.grid-zone{background:var(--paper);color:var(--ink);padding:.6rem 2rem 4rem;}
.grid-inner{max-width:1280px;margin:0 auto;}
.grid-note{text-align:center;font-family:'Playfair Display',Georgia,serif;font-style:italic;font-size:.9rem;color:var(--ink-muted);margin-bottom:1.8rem;}

/* ══ GRID INTRO — the category definition, now living right before the list it explains ══ */
.grid-intro{max-width:640px;margin:0 auto 2.4rem;text-align:center;padding-bottom:2rem;border-bottom:1px solid var(--rule);}
.grid-intro-subhead{font-size:1.05rem;color:var(--ink);line-height:1.6;}
.stories-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(258px,1fr));gap:1.1rem;}

.story-card{
  display:flex;flex-direction:column;
  background:var(--paper-card);border:1px solid var(--rule);
  padding:1.3rem 1.3rem 1.15rem;
  text-decoration:none;color:inherit;
  transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease;
}
.story-card:hover{transform:translateY(-4px);border-color:var(--cyan-border);box-shadow:0 14px 32px rgba(10,61,92,.12);}
.story-card-img{
  position:relative;
  aspect-ratio:16/10;overflow:hidden;background:var(--rule);
  margin:-1.3rem -1.3rem 1rem;
}
.story-card-num{
  position:absolute;top:.7rem;left:.7rem;z-index:2;
  font-family:'Playfair Display',Georgia,serif;font-size:.72rem;font-weight:600;
  color:var(--white);letter-spacing:.03em;
  background:rgba(0,8,20,.55);backdrop-filter:blur(3px);
  padding:.28rem .55rem;
}
.story-card-img img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .5s ease;}
.story-card:hover .story-card-img img{transform:scale(1.045);}
.story-card-location{font-size:.72rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--ocean-deep);margin-bottom:.5rem;}
.story-card-title{font-family:'Playfair Display',Georgia,serif;font-size:1.1rem;font-weight:600;color:var(--ink);line-height:1.22;margin-bottom:.5rem;}
.story-card-hook{
  font-size:.82rem;color:var(--ink-muted);line-height:1.5;margin-bottom:1rem;flex:1;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.story-card-stat{display:flex;align-items:baseline;gap:.55rem;padding-top:.85rem;border-top:1px solid var(--rule);}
.story-card-stat-num{font-family:'Playfair Display',Georgia,serif;font-size:1.4rem;font-weight:700;color:var(--ocean-deep);white-space:nowrap;}
.story-card-stat-label{font-size:.72rem;color:var(--ink-muted);line-height:1.28;}
.story-card-link{margin-top:.8rem;font-size:.72rem;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ocean-deep);display:flex;align-items:center;gap:.4rem;}
.story-card-link span{transition:transform .2s;}
.story-card:hover .story-card-link span{transform:translateX(3px);}

/* ══ CLOSING / BACK LINK ══ */
.cat-closing{background:var(--deep2);padding:4rem 2rem 4.5rem;text-align:center;}
.cat-closing-text{font-family:'Playfair Display',Georgia,serif;font-style:italic;font-size:1.1rem;color:rgba(255,255,255,.5);margin-bottom:1.6rem;}
.cat-closing-primary{display:inline-flex;align-items:center;gap:.6rem;padding:.9rem 2.2rem;background:var(--cyan);color:var(--deep);font-size:.8rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;text-decoration:none;border:2px solid var(--cyan);transition:background .25s,border-color .25s,transform .25s;margin-bottom:1rem;}
.cat-closing-primary:hover{background:var(--cyan-light);border-color:var(--cyan-light);transform:translateY(-2px);}
.cat-closing-secondary{display:inline-flex;align-items:center;min-height:44px;font-size:.72rem;letter-spacing:.08em;color:rgba(255,255,255,.45);text-decoration:none;transition:color .2s;}
.cat-closing-secondary:hover{color:var(--cyan-light);}

/* ══ FADE-IN ══ */
.fade-in{opacity:0;transform:translateY(16px);transition:opacity .6s ease,transform .6s ease;}
.fade-in.visible{opacity:1;transform:translateY(0);}

a:focus-visible,button:focus-visible{outline:2px solid var(--cyan-light);outline-offset:2px;}
@media(max-width:640px){
}

@media(max-width:640px){
  .cat-hero{padding:6.5rem 1.5rem 3.4rem;}
  .grid-zone{padding:.6rem 1.25rem 4rem;}
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  .fade-in{transition:none;opacity:1;transform:none;}
  .story-card:hover{transform:none;}
}
