/*
Theme Name: Social Care Stories
Theme URI: https://socialcarebd.org/stories/
Author: Social Care
Author URI: https://socialcarebd.org/
Description: Lightweight theme for the Social Care "Stories from the Field" section. Matches the main socialcarebd.org website. Built for speed and SEO; works with Rank Math.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: social-care
*/

:root {
  --blue: #1180BD;
  --blue-dark: #0B3A5B;
  --blue-light: #1493D6;
  --blue-pale: #E8F5FD;
  --sky: #8AD0F4;
  --gold: #F9A825;
  --gold-dark: #F57F17;
  --wa: #25D366;
  --text: #1a1a2e;
  --text-mid: #444;
  --text-soft: #666;
  --border: #dde4ef;
  --bg-light: #F4F8FF;
  --radius: 14px;
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-md: 0 6px 28px rgba(17,128,189,0.14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Poppins', system-ui, sans-serif; color: var(--text); line-height: 1.75; background: #fff; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; margin: 0 auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,0.97); backdrop-filter: blur(10px); box-shadow: 0 2px 20px rgba(0,0,0,0.06); }
.header-inner { display: flex; align-items: center; gap: 16px; padding: 10px 24px; max-width: 1180px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blue-dark); }
.brand img { width: 40px; height: 40px; }
.brand svg { display: block; height: 21px; width: auto; }
.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-mid); font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.main-nav a:hover, .main-nav a.current { color: var(--blue); background: var(--blue-pale); }
.nav-cta { background: var(--gold); color: #1a1a2e !important; font-weight: 600 !important; border-radius: 999px !important; padding: 9px 18px !important; text-decoration: none; font-size: 0.88rem; white-space: nowrap; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--blue-dark); margin: 5px 0; border-radius: 2px; }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff; box-shadow: 0 12px 24px rgba(0,0,0,0.08); display: none; margin: 0; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 16px 16px; }
  .header-inner > .nav-cta { display: none; }
}

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); color: #fff; padding: 64px 0 56px; text-align: center; }
.hero .crumbs { font-size: 0.85rem; opacity: 0.85; margin-bottom: 10px; }
.hero .crumbs a { color: #fff; text-decoration: none; }
.hero .crumbs a:hover { text-decoration: underline; }
.hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.8rem); line-height: 1.2; margin: 10px auto 12px; max-width: 900px; font-weight: 800; }
.hero h1 span { color: var(--gold); }
.hero p { max-width: 720px; margin: 0 auto; opacity: 0.93; font-size: 1.04rem; }
.tag { display: inline-block; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 14px; border-radius: 999px; text-decoration: none; }
.post-meta { margin-top: 14px; font-size: 0.88rem; opacity: 0.9; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Category chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 26px 0 6px; margin: 0; list-style: none; }
.chips a { display: inline-block; padding: 7px 16px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.86rem; color: var(--text-mid); text-decoration: none; background: #fff; }
.chips a:hover, .chips .current a { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; padding: 30px 0 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: transform .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-img { aspect-ratio: 16/10; background: var(--blue-pale); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); text-decoration: none; }
.card h2 { font-size: 1.08rem; line-height: 1.4; margin: 6px 0 8px; }
.card h2 a { color: var(--blue-dark); text-decoration: none; }
.card h2 a:hover { color: var(--blue); }
.card p { color: var(--text-soft); font-size: 0.9rem; margin: 0 0 12px; flex: 1; }
.card time { font-size: 0.8rem; color: var(--text-soft); }
.empty { text-align: center; padding: 60px 0; color: var(--text-soft); }

.pagination { display: flex; gap: 8px; justify-content: center; padding: 10px 0 60px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text-mid); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- Article ---------- */
.article { padding: 40px 0 20px; }
.featured { margin: -10px 0 30px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); }
.entry { font-size: 1.02rem; color: var(--text-mid); }
.entry h2 { font-size: 1.5rem; color: var(--blue-dark); margin: 38px 0 12px; line-height: 1.3; }
.entry h3 { font-size: 1.18rem; color: var(--blue-dark); margin: 28px 0 10px; }
.entry p { margin: 0 0 18px; }
.entry ul, .entry ol { margin: 0 0 20px 22px; padding: 0; }
.entry li { margin-bottom: 6px; }
.entry strong { color: var(--text); }
.entry a { font-weight: 500; }
.entry figure { margin: 24px 0; }
.entry figcaption { font-size: 0.85rem; color: var(--text-soft); text-align: center; margin-top: 6px; }
.entry img { border-radius: 10px; }
.entry blockquote { margin: 24px 0; padding: 16px 22px; border-left: 4px solid var(--blue-light); background: var(--blue-pale); border-radius: 0 10px 10px 0; }
.entry table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 0.95rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.entry th { background: var(--blue); color: #fff; text-align: left; padding: 10px 14px; }
.entry td { padding: 10px 14px; border-top: 1px solid var(--border); }
.entry tr:nth-child(even) td { background: var(--bg-light); }
.entry .wp-block-gallery { gap: 10px; }
.entry .wp-block-embed { margin: 24px 0; }

/* "At a glance" box from the Project Report pattern */
.entry .sc-glance { background: var(--blue-pale); border: 1px solid #cfe7f7; border-radius: var(--radius); padding: 20px 24px; margin: 0 0 28px; }
.entry .sc-glance h2 { margin-top: 0; font-size: 1.1rem; }
.entry .sc-glance table { margin: 0; background: #fff; }
.entry .sc-glance td:first-child { font-weight: 600; color: var(--blue-dark); width: 38%; }
.entry .sc-faq h3 { font-size: 1.04rem; margin-bottom: 4px; }

/* ---------- CTA + related ---------- */
.cta-box { margin: 40px 0 10px; background: linear-gradient(135deg, var(--blue-dark), var(--blue)); color: #fff; border-radius: var(--radius); padding: 30px; text-align: center; }
.cta-box h2 { margin: 0 0 8px; font-size: 1.35rem; }
.cta-box p { margin: 0 auto 18px; max-width: 560px; opacity: 0.93; }
.btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; font-size: 0.93rem; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-wa { background: var(--wa); color: #fff; }
.btn-gold { background: var(--gold); color: #1a1a2e; }
.btn-ghost { border: 1.5px solid rgba(255,255,255,0.7); color: #fff; }
.programme-link { margin: 26px 0 0; padding: 14px 18px; border: 1px dashed var(--sky); border-radius: 10px; font-size: 0.95rem; }
.related { padding: 30px 0 60px; }
.related h2 { text-align: center; color: var(--blue-dark); font-size: 1.4rem; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-dark); color: rgba(255,255,255,0.82); padding: 54px 0 0; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 12px; }
.footer-brand img { width: 44px; height: 44px; }
.footer-brand svg { height: 22px; width: auto; display: block; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 0.95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: rgba(255,255,255,0.82); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 40px; padding: 18px 0; text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.6); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- WordPress core ---------- */
.alignwide { margin-left: -60px; margin-right: -60px; }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
@media (max-width: 900px) { .alignwide { margin-left: 0; margin-right: 0; } }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: 0.85rem; color: var(--text-soft); }
