/* ================================
   Johansen Fish Resilience Program
   Multi-Page Theme – Shared Styles
   ================================ */

:root {
  --primary:  #0d5370;
  --primary-d:#0a3f56;
  --accent:   #1ba8c1;
  --dark:     #102f40;
  --soft:     #e8f5f9;
  --white:    #ffffff;
  --gray50:   #f7fafb;
  --gray100:  #eef3f5;
  --gray600:  #4e6a77;
  --gray800:  #1e3340;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:0 8px 32px rgba(0,0,0,.12);
  --transition: .25s ease;
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:'Inter',system-ui,sans-serif;color:var(--gray800);line-height:1.65;background:var(--white)}

/* ---------- UTILITY ---------- */
.container{max-width:1140px;margin:0 auto;padding:0 24px}
.section{padding:80px 0}
.section-light{background:var(--gray50)}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:48px;margin-top:28px}
.intro{font-size:1.12rem;margin-bottom:36px}
.cta-row{display:flex;gap:16px;flex-wrap:wrap;margin-top:28px}

h1{font-size:clamp(2rem,4vw,2.8rem);color:var(--primary);font-weight:800;letter-spacing:-.02em;margin-bottom:8px}
h2{font-size:clamp(1.8rem,3.2vw,2.4rem);color:var(--primary);margin-bottom:20px;font-weight:800;letter-spacing:-.02em}
h3{font-size:1.25rem;color:var(--primary-d);margin-bottom:12px;font-weight:700}
h4{font-size:1.05rem;font-weight:700;margin-bottom:4px}
p{margin-bottom:12px}
a{color:var(--accent);text-decoration:none;transition:color var(--transition)}
a:hover{color:var(--primary)}
ol,ul{padding-left:22px;margin-bottom:12px}
li{margin-bottom:6px}

/* ---------- BUTTONS ---------- */
.btn{display:inline-block;padding:10px 22px;border-radius:6px;font-weight:600;font-size:.92rem;text-decoration:none;transition:all var(--transition)}
.btn-primary{background:var(--accent);color:var(--white)}
.btn-primary:hover{background:var(--primary);color:var(--white)}
.btn-secondary{background:var(--soft);color:var(--primary);border:1px solid var(--accent)}
.btn-secondary:hover{background:var(--accent);color:var(--white)}
.btn-ghost{border:1px solid var(--soft);color:var(--soft);padding:7px 18px;font-size:.85rem}
.btn-ghost:hover{background:var(--soft);color:var(--primary)}
.btn-lg{padding:16px 36px;font-size:1.1rem;border-radius:8px}

/* ---------- NAV ---------- */
.topnav{position:sticky;top:0;z-index:100;background:var(--dark);border-bottom:2px solid var(--accent)}
.nav-inner{display:flex;align-items:center;justify-content:space-between;height:60px;position:relative}

/* Offset anchor scroll for sticky nav */
[id]{scroll-margin-top:80px}
.brand{color:var(--white);font-weight:700;font-size:1.05rem;white-space:nowrap;text-decoration:none;flex-shrink:0}
.menu{list-style:none;display:flex;align-items:center;gap:4px;padding:0;flex-shrink:1;flex-wrap:nowrap}
.menu li a{color:rgba(255,255,255,.85);font-size:.82rem;padding:6px 7px;border-radius:4px;font-weight:500;text-decoration:none;transition:all var(--transition);white-space:nowrap}
.menu li a:hover,.menu li a.active{color:var(--white);background:rgba(255,255,255,.12)}

/* ---------- HERO (homepage) ---------- */
.hero{position:relative;min-height:520px;display:flex;align-items:center;overflow:hidden;background:var(--dark)}
.hero-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:.7}
.hero-overlay{position:absolute;inset:0;background:linear-gradient(135deg,rgba(13,83,112,.6) 0%,rgba(16,47,64,.5) 100%)}
.hero-inner{position:relative;z-index:2;padding:80px 0}
.hero-copy{max-width:780px;margin:0 auto;text-align:center}
.hero h1{color:var(--white);margin:8px 0 12px;line-height:1.15}
.hero p{color:rgba(255,255,255,.9);font-size:1.05rem}
.hero-tag{color:var(--accent);font-weight:600;font-size:.9rem;text-transform:uppercase;letter-spacing:.04em;margin-bottom:4px}
.hero-sub{margin:8px auto 0;font-size:1.08rem;max-width:620px;line-height:1.6;color:rgba(255,255,255,.85)}
.hero-buttons{display:flex;gap:14px;margin-top:28px;flex-wrap:wrap;justify-content:center}

/* ---------- PAGE HEADER (subpages) ---------- */
.page-header{background:var(--dark);color:var(--white);padding:52px 0 44px;text-align:center}
.page-header h1{color:var(--white)}
.page-header p{color:rgba(255,255,255,.8);font-size:1.1rem;margin:0}
.page-header-accent{background:linear-gradient(135deg,var(--primary) 0%,var(--dark) 100%);padding:60px 0 52px}

/* ---------- CARDS (Research on homepage) ---------- */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:28px;margin-top:28px}
.card{background:var(--white);border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);transition:transform var(--transition),box-shadow var(--transition)}
.card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg)}
.card img{width:100%;height:210px;object-fit:cover}
.card-body{padding:22px 24px 26px}
.card-body h3{font-size:1.15rem;margin-bottom:8px}
.card-body p{font-size:.93rem;color:var(--gray600);line-height:1.6}
.card-wide{grid-column:1/-1}

/* ---------- RESEARCH BLOCKS (research.html) ---------- */
.research-block{display:grid;grid-template-columns:360px 1fr;gap:36px;margin-bottom:52px;align-items:start}
.research-block img{width:100%;border-radius:var(--radius);object-fit:cover;max-height:260px}
.research-text h2{font-size:1.5rem;margin-bottom:12px}
.research-text p{font-size:.95rem;color:var(--gray600);line-height:1.65}
.research-block-full{grid-template-columns:1fr}

/* ---------- PUBLICATIONS ---------- */
.pub-metrics{display:flex;gap:36px;flex-wrap:wrap;margin:24px 0 20px}
.metric{display:flex;flex-direction:column;align-items:center;text-align:center}
.metric strong{font-size:2.2rem;color:var(--primary);font-weight:800}
.metric span{font-size:.85rem;color:var(--gray600)}
.pub-note{font-size:.95rem;color:var(--gray600);max-width:820px;margin-bottom:16px}
.pub-list{list-style:none;padding:0}
.pub-list li{padding:10px 0;border-bottom:1px solid var(--gray100);font-size:.94rem;line-height:1.55}
.pub-list li:last-child{border:none}
.pub-list-numbered{padding-left:40px;margin-top:16px}
.pub-list-numbered li{padding:8px 0;border-bottom:1px solid var(--gray100);font-size:.92rem;line-height:1.55}
.pub-list-numbered li:last-child{border:none}

/* ---------- TEAM ---------- */
.pi-card{display:grid;grid-template-columns:280px 1fr;gap:36px;background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow);padding:32px;margin-bottom:40px}
.pi-card img{width:100%;border-radius:8px;object-fit:cover}
.pi-info h3{font-size:1.4rem;margin-bottom:8px}
.pi-info p{font-size:.93rem;line-height:1.6}
.pi-links{display:flex;gap:14px;margin-top:12px}
.pi-links a{font-weight:600;font-size:.9rem}
.team-section-title{font-size:1.2rem;color:var(--primary);margin:36px 0 18px;padding-bottom:8px;border-bottom:2px solid var(--soft)}
.team-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:24px}
.team-grid-compact{grid-template-columns:repeat(auto-fill,minmax(240px,1fr))}
.profile{background:var(--white);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);text-align:center}
.profile img{width:140px;height:140px;border-radius:50%;object-fit:cover;margin-bottom:12px;border:3px solid var(--soft)}
.profile h4{font-size:1rem;margin-bottom:4px}
.profile .role{color:var(--accent);font-weight:600;font-size:.85rem;margin-bottom:8px}
.profile p{font-size:.88rem;color:var(--gray600);line-height:1.5;text-align:left}
.profile-compact img{width:100px;height:100px}
.profile-compact h4{font-size:.95rem}
.profile-compact p{font-size:.84rem}
.profile-links{display:flex;gap:12px;justify-content:center;margin-top:8px}
.profile-links a{font-size:.85rem;font-weight:600}

/* ---------- OUTREACH ---------- */
.outreach-highlight{display:grid;grid-template-columns:260px 1fr;gap:28px;background:var(--white);border-radius:var(--radius);padding:28px 32px;box-shadow:var(--shadow);margin-bottom:24px;align-items:start}
.outreach-highlight img{width:100%;border-radius:8px;object-fit:cover;max-height:180px}
.outreach-highlight h3{margin-bottom:10px}
.outreach-highlight p{font-size:.95rem;color:var(--gray600);line-height:1.6}
.outreach-links{display:flex;gap:14px;flex-wrap:wrap;margin-top:16px}

/* ---------- SOFTWARE ---------- */
.software-card{display:grid;grid-template-columns:280px 1fr;gap:36px;background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow);padding:32px}
.software-card img{width:100%;border-radius:8px;object-fit:cover}
.software-info h3{font-size:1.3rem;margin-bottom:10px}
.software-info h4{font-size:1rem;color:var(--primary-d);margin:16px 0 8px}
.software-info p,.software-info li{font-size:.93rem;color:var(--gray600);line-height:1.55}
.software-downloads{display:flex;gap:14px;flex-wrap:wrap;margin-top:20px}

/* ---------- NEWS ---------- */
.news-grid{display:grid;gap:24px;margin-top:24px}
.news-item{display:grid;grid-template-columns:180px 1fr;gap:24px;background:var(--white);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow);align-items:start}
.news-item img{width:100%;border-radius:6px;object-fit:cover;max-height:130px}
.news-body time{font-size:.8rem;color:var(--accent);font-weight:600;text-transform:uppercase}
.news-body h4{font-size:1rem;margin:4px 0 6px;color:var(--gray800)}
.news-body p{font-size:.9rem;color:var(--gray600);line-height:1.5;margin-bottom:6px}
.news-body a{font-weight:600;font-size:.88rem}
.news-item.no-image{grid-template-columns:1fr}
.news-gallery{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.news-gallery img{width:100px;height:72px;object-fit:cover;border-radius:4px;cursor:pointer;transition:transform .2s}
.news-gallery img:hover{transform:scale(1.05)}
.news-video{margin-top:10px;position:relative;padding-bottom:56.25%;height:0;overflow:hidden;border-radius:6px}
.news-video iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0}
.section-sub{font-size:1.05rem;color:var(--gray600);margin-top:-12px;margin-bottom:8px}

/* news filter/sort bar */
.news-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:20px}
.news-controls label{font-size:.85rem;font-weight:600;color:var(--gray600);margin-right:2px}
.news-controls select,.news-filter-btn{font-family:inherit;font-size:.82rem;font-weight:600;padding:6px 14px;border-radius:20px;border:1.5px solid var(--gray100);background:var(--white);color:var(--gray800);cursor:pointer;transition:all var(--transition)}
.news-filter-btn:hover,.news-filter-btn.active{background:var(--accent);color:var(--white);border-color:var(--accent)}
.news-controls select:focus{outline:2px solid var(--accent);outline-offset:1px}
.news-controls .sort-sep{width:1px;height:24px;background:var(--gray100);margin:0 6px}

/* news category tags */
.news-tag{display:inline-block;font-size:.7rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:3px 10px;border-radius:20px;margin-bottom:4px;color:var(--white)}
.tag-publication{background:#2e86ab}
.tag-team{background:#a23b72}
.tag-outreach{background:#f18f01}
.tag-software{background:#3a9679}
.tag-research{background:#6c5ce7}

/* ---------- CALLOUT (Donations CTA) ---------- */
.callout{background:linear-gradient(135deg,var(--primary) 0%,var(--dark) 100%);text-align:center;padding:72px 24px}
.callout h2{color:var(--white)}
.callout p{color:rgba(255,255,255,.9);max-width:660px;margin:0 auto 28px;font-size:1.08rem}

/* ---------- CALLOUT BOX (Join page) ---------- */
.callout-box{background:var(--soft);border-left:4px solid var(--accent);border-radius:0 var(--radius) var(--radius) 0;padding:28px 32px;margin-top:40px}
.callout-box h3{margin-bottom:10px}
.callout-box p{font-size:.95rem}

/* ---------- DONATIONS PAGE ---------- */
.donate-cta-top{display:grid;grid-template-columns:1fr 340px;gap:48px;align-items:start}
.donate-general-box{background:var(--soft);border-radius:var(--radius);padding:32px;text-align:center}
.donate-general-box h3{margin-bottom:12px;color:var(--primary)}
.donate-general-box p{font-size:.95rem;color:var(--gray600);margin-bottom:20px}
.signature{font-style:italic;color:var(--primary);font-weight:600;margin-top:20px}

.donor-project{background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow);margin-bottom:32px;overflow:hidden}
.donor-project-header{background:var(--dark);color:var(--white);padding:24px 32px}
.donor-project-header h3{color:var(--white);font-size:1.3rem;margin-bottom:4px}
.donor-subtitle{color:rgba(255,255,255,.8);font-size:.95rem;margin-bottom:10px}
.donor-meta{display:flex;gap:24px;flex-wrap:wrap}
.donor-amount{background:rgba(255,255,255,.12);padding:4px 12px;border-radius:4px;font-size:.85rem;font-weight:600;color:var(--accent)}
.donor-status{background:rgba(27,168,193,.2);padding:4px 12px;border-radius:4px;font-size:.85rem;font-weight:600;color:var(--accent)}
.donor-status.urgent{background:rgba(220,80,60,.2);color:#e8563a}
.donor-project-body{padding:28px 32px}
.donor-project-img{float:right;width:300px;margin:0 0 20px 28px;border-radius:8px;box-shadow:var(--shadow)}
.donor-project-body p{font-size:.95rem;color:var(--gray600);line-height:1.65}
.donor-project-body h4{font-size:1rem;color:var(--primary-d);margin:16px 0 8px}
.donor-project-body ul{margin-bottom:20px}
.donor-project-body li{font-size:.93rem;color:var(--gray600)}

/* ---------- FOOTER ---------- */
.footer{background:var(--dark);color:rgba(255,255,255,.7);text-align:center;padding:36px 24px;font-size:.88rem}
.footer a{color:var(--accent)}

/* =========== HAMBURGER BUTTON =========== */
.hamburger{display:none;background:none;border:none;color:var(--white);font-size:1.6rem;cursor:pointer;padding:4px 8px;line-height:1}

/* =========== RESPONSIVE =========== */

/* --- Tablet (≤900px) --- */
@media(max-width:900px){
  .two-col,.pi-card,.software-card,.research-block,.donate-cta-top{grid-template-columns:1fr}
  .pi-card img{max-height:300px}
  .team-grid{grid-template-columns:1fr 1fr}
  .news-item{grid-template-columns:1fr}
  .news-item img{max-height:240px;object-position:center 20%}
  .outreach-highlight{grid-template-columns:1fr}
  .outreach-highlight img{max-height:220px}
  .donor-project-img{float:none;width:100%;max-height:260px;object-fit:cover;margin:0 0 20px 0}
  .pub-metrics{gap:24px}
}

/* --- Mobile (≤600px) --- */
@media(max-width:600px){
  /* Hamburger toggle */
  .hamburger{display:block}
  .menu{display:none;flex-direction:column;position:absolute;top:60px;left:0;right:0;background:var(--dark);padding:12px 24px 20px;border-bottom:2px solid var(--accent);gap:0;z-index:99}
  .menu.menu-open{display:flex}
  .menu li a{display:block;padding:10px 0;font-size:.95rem}
  .menu li a.btn.btn-ghost{text-align:center;margin-top:8px;padding-left:26px;padding-right:26px}

  /* General spacing */
  .section{padding:52px 0}
  .container{padding:0 16px}
  .cta-row{justify-content:center}

  /* Hero */
  .hero{min-height:auto}
  .hero-inner{padding:36px 0}
  .hero-copy{text-align:center}
  .hero-tag{font-size:.8rem}
  .hero h1{font-size:1.6rem}
  .hero-sub{font-size:.95rem;margin:8px auto 0;padding:0 8px}
  .hero-buttons{justify-content:center}

  /* Page headers */
  .page-header{padding:36px 0 28px}
  .page-header h1{font-size:1.5rem}

  /* Two-col about section */
  .two-col{gap:24px}

  /* Cards grid */
  .cards{grid-template-columns:1fr}

  /* Publications metrics — 2×2 centered grid */
  .pub-metrics{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:20px 36px;align-items:center}
  .metric{min-width:120px;align-items:center;text-align:center}
  .metric strong{font-size:1.8rem}

  /* News items */
  .news-item{grid-template-columns:1fr}
  .news-item img{max-height:200px;width:100%;object-position:center 20%}

  /* Homepage news cards — show full images */
  #news .news-item img{max-height:200px;object-fit:cover;object-position:center 20%}

  /* PI card */
  .pi-card{grid-template-columns:1fr;text-align:center;padding:20px}
  .pi-card img{max-width:200px;max-height:200px;margin:0 auto;border-radius:50%}
  .pi-info h3{font-size:1.15rem}
  .pi-info p{font-size:.9rem}
  .pi-links{justify-content:center}

  /* Team grid */
  .team-grid,.team-grid-compact{grid-template-columns:1fr}
  .profile img{width:110px;height:110px}

  /* Research blocks */
  .research-block{gap:20px;margin-bottom:36px}
  .research-text h2{font-size:1.25rem}

  /* Software card */
  .software-card{padding:20px}

  /* Outreach */
  .outreach-highlight{padding:20px}

  /* Donations */
  .donor-project-header,.donor-project-body{padding:20px}
  .donate-general-box{padding:20px}

  /* News controls */
  .news-controls{flex-wrap:wrap;gap:6px}
  .news-filter-btn{padding:5px 10px;font-size:.78rem}
  .news-controls .sort-sep{display:none}

  /* Footer */
  .footer{padding:28px 16px;font-size:.82rem}
}

/* Fish Homes 4-image gallery */
.fish-homes-gallery{float:right;width:680px;margin:0 0 20px 28px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.fish-homes-gallery img{width:100%;border-radius:6px;box-shadow:var(--shadow);aspect-ratio:16/10;object-fit:cover}
/* Per-project image sizes */
#muddy-waters .donor-project-img{width:600px}
#herbivores .donor-project-img{width:600px}
#infrastructure .donor-project-img{width:600px}
@media(max-width:900px){
  .fish-homes-gallery{float:none;width:100%;margin:0 0 20px 0}
  #muddy-waters .donor-project-img,#herbivores .donor-project-img,#infrastructure .donor-project-img{float:none;width:100%;margin:0 0 20px 0}
}

/* Team member hover-to-reveal details */
.profile{position:relative;overflow:hidden;transition:box-shadow var(--transition)}
.profile:hover{box-shadow:var(--shadow-lg);z-index:2}
.profile-hover{max-height:0;overflow:hidden;opacity:0;transition:max-height .4s ease, opacity .3s ease, padding .3s ease;padding:0 16px;background:var(--soft);border-top:1px solid var(--gray100);margin:0 -20px;font-size:.88rem;color:var(--gray600);line-height:1.55}
.profile:hover .profile-hover,.profile.profile-active .profile-hover{max-height:300px;opacity:1;padding:12px 16px}
.profile-hover p{margin:0}
.profile-compact{overflow:hidden}
.profile-compact .profile-hover{font-size:.82rem}
.profile-compact:hover .profile-hover,.profile-compact.profile-active .profile-hover{max-height:200px}

/* Outreach media coverage grid */
.media-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:24px;margin-top:24px}
.media-card{background:var(--white);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden;transition:transform var(--transition),box-shadow var(--transition)}
.media-card:hover{transform:translateY(-4px);box-shadow:var(--shadow-lg)}
.media-card img{width:100%;height:200px;object-fit:cover}
.media-card-body{padding:20px}
.media-card-body h3{font-size:1.05rem;margin-bottom:.5rem;color:var(--primary)}
.media-card-body p{font-size:.9rem;color:var(--gray600);margin-bottom:1rem;line-height:1.5}
@media(max-width:600px){.media-grid{grid-template-columns:1fr}}

/* Video thumbnail play button */
.video-thumb-link {
  display: inline-block;
  position: relative;
  text-decoration: none;
}
.video-thumb-link .play-btn {
  display: block;
  text-align: center;
  margin-top: 0.5rem;
  font-weight: 600;
  color: #c00;
  font-size: 1.1rem;
}
.video-thumb-link:hover .play-btn {
  text-decoration: underline;
}

/* Inline YouTube watch link */
.play-btn-link {
  display: inline-block;
  font-weight: 600;
  color: #c00;
  margin: 0.5rem 0;
}
.play-btn-link:hover {
  text-decoration: underline;
}

/* ---------- LIGHTBOX ---------- */
.lightbox-overlay{position:fixed;inset:0;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;z-index:9999;opacity:0;pointer-events:none;transition:opacity .25s ease;cursor:zoom-out}
.lightbox-overlay.active{opacity:1;pointer-events:auto}
.lightbox-overlay img{max-width:92vw;max-height:90vh;border-radius:6px;box-shadow:0 4px 40px rgba(0,0,0,.5);object-fit:contain}
.lightbox-close{position:absolute;top:18px;right:24px;color:#fff;font-size:2rem;font-weight:700;cursor:pointer;line-height:1;z-index:10000;background:none;border:none;text-shadow:0 1px 4px rgba(0,0,0,.6)}
.lightbox-close:hover{color:var(--accent)}
