/* Synod IntelliCare shared stylesheet. Linked from every page; replaces the old per-page <style> blocks. */

:root {
  --navy: #1F497D;
  --teal: #00B5B5;
  --mid-blue: #2E75B6;
  --light-bg: #F4F7FB;
  --white: #FFFFFF;
  --text-dark: #1A1A2E;
  --text-mid: #4A5568;
  --text-light: #718096;
  --border: #E2E8F0;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(31, 73, 125, 0.10);
  --nav-h: 68px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text-dark); background: var(--white); line-height: 1.6; overflow-x: hidden; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg, video { max-width: 100%; height: auto; }

/* ---------- Header / nav ---------- */
#site-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: var(--nav-h); background: var(--white); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 5%; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); }
.nav-logo-link { flex: 0 1 auto; min-width: 0; display: block; }
.nav-logo-link svg { display: block; width: 400px; max-width: 100%; height: auto; }
.nav-links { display: flex; gap: 1.35rem; list-style: none; align-items: center; }
.nav-links li { white-space: nowrap; }
.nav-links a { color: var(--text-mid); font-size: 0.9rem; font-weight: 500; padding: 4px 0; white-space: nowrap; }
.nav-links a:hover { color: var(--navy); text-decoration: none; }

/* CTA button: block-level so it never wraps mid-text */
.nav-cta { display: inline-block !important; background: var(--teal) !important; color: var(--white) !important; padding: 9px 18px !important; border-radius: 6px; font-weight: 600 !important; line-height: 1.2; white-space: nowrap; }
.nav-cta:hover { background: var(--navy) !important; }

/* Dropdown menus */
.nav-group { position: relative; }
.nav-group::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 16px; }
.nav-submenu { position: absolute; top: calc(100% + 10px); left: -12px; min-width: 320px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 28px rgba(31, 73, 125, 0.14); padding: 0.6rem; display: none; z-index: 1003; }
.nav-submenu a { display: block; padding: 11px 16px; border-radius: 6px; font-size: 0.88rem; line-height: 1.35; color: var(--text-mid); white-space: nowrap; }
.nav-submenu a + a { margin-top: 2px; }
.nav-submenu a:hover { background: var(--light-bg); color: var(--navy); text-decoration: none; }
.nav-group:hover .nav-submenu, .nav-group.open .nav-submenu { display: block; }
.arrow { font-size: 0.85em; margin-left: 3px; }

/* Hamburger */
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 8px; flex: 0 0 auto; }
.hamburger span { display: block; width: 24px; height: 2.5px; background: var(--navy); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.hamburger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Tighten the link row on small desktops so the CTA never clips */
@media (max-width: 1320px) {
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.85rem; }
  .nav-cta { padding: 8px 14px !important; }
}

/* Collapse the nav below 1200px: the full link row does not fit on tablets */
@media (max-width: 1200px) {
  .hamburger { display: flex; }
  .nav-links { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; max-height: calc(100vh - var(--nav-h)); overflow-y: auto; background: var(--white); flex-direction: column; align-items: stretch; gap: 0; padding: 0.5rem 5% 1.5rem; border-top: 1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
  .nav-links.open { display: flex; }
  .nav-links li { white-space: normal; }
  .nav-links > li > a { display: block; padding: 12px 4px; font-size: 1rem; border-bottom: 1px solid var(--border); }
  .nav-links > li:last-child > a { border-bottom: none; }
  .nav-cta { display: block !important; text-align: center; margin-top: 0.75rem; }
  .nav-group::after { display: none; }
  .nav-submenu { position: static; display: none; min-width: 0; box-shadow: none; border: none; border-radius: 0; padding: 0 0 0.5rem 1rem; }
  .nav-submenu a { white-space: normal; padding: 10px 8px; font-size: 0.95rem; }
  .nav-group:hover .nav-submenu { display: none; }
  .nav-group.open .nav-submenu { display: block; }
  .nav-group.open .arrow { display: inline-block; transform: rotate(180deg); }
}

/* Grid and flex children may shrink below their content width (keeps Chart.js canvases from locking the hero wide) */
.hero-inner > *, .grid-2 > *, .grid-3 > *, [style*="grid-template-columns"] > *, [style*="display: flex"] > * { min-width: 0; }
canvas { max-width: 100% !important; }
#hero { padding-top: calc(var(--nav-h) + 40px) !important; }

/* ---------- Layout ---------- */
section { padding: 80px 5% 70px; scroll-margin-top: var(--nav-h); }
section:first-of-type { padding-top: calc(var(--nav-h) + 50px); }
.container { max-width: 1160px; margin: 0 auto; }
.section-label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); margin-bottom: 0.5rem; }
.section-title { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 1rem; }
.section-sub { font-size: 1.05rem; color: var(--text-mid); max-width: 680px; margin-bottom: 2.5rem; }

/* Explicit contrast rules for navy sections */
.bg-navy { background: var(--navy) !important; color: var(--white) !important; }
.bg-navy .section-title, .bg-navy h1, .bg-navy h2, .bg-navy h3 { color: #FFFFFF !important; }
.bg-navy .section-sub, .bg-navy p { color: rgba(255, 255, 255, 0.9) !important; }
.bg-navy .section-label { color: var(--teal) !important; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.team-grid { grid-template-columns: repeat(2, minmax(0, 380px)); justify-content: center; }

.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.btn-primary { background: var(--teal); color: var(--white); padding: 12px 24px; border-radius: 6px; font-weight: 700; display: inline-block; white-space: nowrap; }
.btn-primary:hover { background: #009999; text-decoration: none; color: var(--white); }
.btn-secondary { background: var(--navy); color: var(--white); padding: 12px 24px; border-radius: 6px; font-weight: 700; display: inline-block; white-space: nowrap; }
.btn-secondary:hover { background: #163d6e; text-decoration: none; color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: 10px 22px; border-radius: 6px; font-weight: 600; display: inline-block; white-space: nowrap; }
.btn-outline:hover { background: var(--navy); color: var(--white); text-decoration: none; }

/* Diagrams and badges */
.diagram-frame { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; box-shadow: var(--shadow); margin-top: 1.5rem; text-align: center; }
.diagram-frame img { max-width: 100%; height: auto; border-radius: 8px; }
.module-thumb-box { background: var(--light-bg); border-radius: 8px; padding: 8px; margin-bottom: 1.2rem; display: flex; justify-content: center; align-items: center; border: 1px solid var(--border); min-height: 120px; }
.module-thumb-box img, .module-thumb-box svg { width: 100%; max-width: 260px; height: auto; display: block; }
.micro-badge { display: inline-flex; align-items: center; gap: 6px; background: rgba(0, 181, 181, 0.12); border: 1px solid var(--teal); color: var(--navy); border-radius: 100px; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; margin-bottom: 0.75rem; }
.cohort-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.75rem; box-shadow: var(--shadow); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; border-top: 4px solid var(--teal); }
.cohort-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--teal), var(--navy)); }

/* Blog and archive */
.blog-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.blog-thumb { background: linear-gradient(135deg, var(--navy), #163d6e); color: var(--white); padding: 1.5rem; font-weight: 700; font-size: 1.1rem; }
.blog-body { padding: 1.5rem; display: flex; flex-direction: column; flex: 1; }
.blog-tag { font-size: 0.72rem; font-weight: 700; color: var(--teal); text-transform: uppercase; margin-bottom: 0.5rem; }
.blog-body h4 { font-size: 1.1rem; color: var(--navy); margin-bottom: 0.5rem; }
.blog-body p { font-size: 0.9rem; color: var(--text-mid); margin-bottom: 1.2rem; flex: 1; }
.resource-link { color: var(--teal); font-weight: 700; font-size: 0.9rem; }
.post-article { max-width: 800px; margin: 0 auto; padding: 100px 5% 60px; }
.post-article h1 { font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 0.5rem; }
.post-meta { font-size: 0.9rem; color: var(--text-light); margin-bottom: 2.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }
.post-body { font-size: 1.05rem; line-height: 1.8; color: var(--text-mid); }
.post-body p { margin-bottom: 1.5rem; }
.post-body a { overflow-wrap: anywhere; word-break: break-word; }
.post-body h2 { font-size: 1.5rem; color: var(--navy); margin: 2rem 0 1rem; }
.post-body h3 { font-size: 1.25rem; color: var(--navy); margin: 1.5rem 0 0.8rem; }
.post-body ul, .post-body ol { margin: 1rem 0 1.5rem 1.5rem; }
.post-body li { margin-bottom: 0.5rem; }
.post-body blockquote { border-left: 4px solid var(--teal); padding-left: 1rem; font-style: italic; color: var(--navy); margin: 1.5rem 0; }

/* ---------- Footer ---------- */
footer { background: var(--text-dark); color: rgba(255, 255, 255, 0.7); padding: 64px 5% 32px; }
.footer-grid { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 2rem; }
.footer-col h4 { font-size: 0.85rem; font-weight: 700; color: var(--white); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col ul a { font-size: 0.85rem; color: rgba(255, 255, 255, 0.65); position: relative; z-index: 10; }
.footer-col ul a:hover { color: var(--teal); text-decoration: none; }
.footer-bottom { max-width: 1160px; margin: 1.5rem auto 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.5); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .team-grid { grid-template-columns: minmax(0, 420px); }
}
@media (max-width: 768px) {
  section { padding: 56px 5% 48px; }
  section:first-of-type { padding-top: calc(var(--nav-h) + 32px); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  /* Inline-styled grids and flex rows in page content collapse to one column */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="display: flex"], [style*="display:flex"] { flex-wrap: wrap; }
  .hero-inner { gap: 2rem !important; }
  #hero { min-height: 0 !important; padding: calc(var(--nav-h) + 28px) 5% 48px !important; }
  #hero h1 { font-size: clamp(1.9rem, 8.5vw, 2.6rem) !important; }
  .section-title { font-size: clamp(1.6rem, 6.5vw, 2.2rem); }
}
@media (max-width: 600px) {
  .btn-primary, .btn-secondary, .btn-outline { display: block; width: 100%; text-align: center; white-space: normal; }
  .btn-primary + .btn-primary, .btn-primary + .btn-outline, .btn-outline + .btn-primary, .btn-secondary + .btn-outline, .btn-outline + .btn-secondary { margin-top: 0.75rem; margin-left: 0 !important; }
}
