/* ==========================================================
   TrustCPS Group — Shared Stylesheet
   Tokens, header, nav, footer, btn, card base, responsive.
   Loaded by every root page. Do NOT put page-specific
   styles here. Edit once, applies everywhere.
   ========================================================== */


/* ----------------------------------------------------------
   1. Design tokens
   ---------------------------------------------------------- */
:root {
  /* Background & surface */
  --bg:        #f6f8fb;
  --surface:   #ffffff;
  --surface-2: #f2f5fb;

  /* Text */
  --text:    #0f172a;
  --heading: #0f172a;
  --muted:   #475569;

  /* Borders & shadows */
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);

  /* Brand */
  --brand:   #1f4f8a;
  --brand-2: #2c6fb8;
  --link:    #1d4ed8;

  /* Default header/page accent (pages can override locally) */
  --accent: #0b3c6f;

  /* Spacing & shape */
  --radius:    14px;
  --radius-sm: 10px;
  --maxw:      1120px;
  --pad:       20px;

  /* Position / tag colours */
  --c-phd:     #059669;
  --c-postdoc: #2563eb;
  --c-thesis:  #f59e0b;
  --c-project: #6366f1;

  /* News tag colours */
  --tag-publication: #10b981;
  --tag-award:       #f59e0b;
  --tag-funding:     #2563eb;
  --tag-event:       #64748b;
  --tag-people:      #8b5cf6;
  --tag-service:     #06b6d4;
}


/* ----------------------------------------------------------
   2. Base reset
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto,
               Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef3fb 0%, var(--bg) 40%, #ffffff 100%);
  line-height: 1.55;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }


/* ----------------------------------------------------------
   3. Layout
   ---------------------------------------------------------- */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
}


/* ----------------------------------------------------------
   4. Header
   ---------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 6%, white),
    #ffffff 70%
  );
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, #e5e7eb);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}
.brand-left  { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.brand-right { display: flex; align-items: center; gap: 10px; }


/* ----------------------------------------------------------
   5. Site title pill & TrustCPS badge
   ---------------------------------------------------------- */
.site-title {
  color: var(--accent);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: -.2px;
  text-decoration: none;
  background: color-mix(in srgb, var(--accent) 10%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #e5e7eb);
  border-radius: 8px;
  padding: 6px 12px;
  white-space: nowrap;
}
.site-title:hover {
  background: color-mix(in srgb, var(--accent) 18%, white);
  text-decoration: none;
}

.trustcps-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, #e5e7eb);
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}
.trustcps-badge img  { height: 40px; width: auto; display: block; }
.trustcps-badge span { font-weight: 800; color: var(--brand); font-size: 14px; letter-spacing: 0.2px; }


/* ----------------------------------------------------------
   6. Primary navigation
   ---------------------------------------------------------- */
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
}
.nav a:hover {
  background: color-mix(in srgb, var(--accent) 8%, white);
  color: var(--accent);
  text-decoration: none;
}
.nav a.active,
.nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
  font-weight: 900;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .7);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
}
.nav-mobile { display: none; padding-bottom: 12px; }
.nav-mobile a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(229, 231, 235, .9);
  margin: 8px 0;
}
.nav-mobile a:hover {
  background: color-mix(in srgb, var(--accent) 8%, white);
  text-decoration: none;
}
.nav-mobile a.active,
.nav-mobile a[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
  font-weight: 900;
}
.nav-mobile.is-open { display: block; }


/* ----------------------------------------------------------
   7. "Join Us" nav button (used on every page)
   ---------------------------------------------------------- */
.nav-join {
  background: var(--accent) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  white-space: nowrap !important;
}
.nav-join:hover {
  background: color-mix(in srgb, var(--accent) 80%, black) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}
.nav-join.active,
.nav-join[aria-current="page"] {
  background: #ffffff !important;
  color: var(--accent) !important;
  box-shadow: 0 0 0 2px var(--accent) !important;
}


/* ----------------------------------------------------------
   8. Shared button
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, #e5e7eb);
  background: color-mix(in srgb, var(--brand) 10%, white);
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: color-mix(in srgb, var(--brand) 14%, white);
  text-decoration: none;
}


/* ----------------------------------------------------------
   9. Card base
   ---------------------------------------------------------- */
.card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}


/* ----------------------------------------------------------
   10. Footer
   ---------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 0 34px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.footer-links {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  padding-top: 8px;
}
.footer-links a { color: var(--muted); font-weight: 700; }
.footer-links a:hover { text-decoration: underline; }
.footer-legal { font-size: 13px; color: #64748b; }
.footer-legal a { color: #475569; text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }


/* ----------------------------------------------------------
   11. Responsive — nav collapse (shared across all pages)
   ---------------------------------------------------------- */
@media (max-width: 980px) {
  .nav        { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .container          { padding: 0 14px; }
  .trustcps-badge span { display: none; }
}
