/* =========================================================
   Sophia College Staff Onboarding Hub — stylesheet
   Brand: Sophia College crest + Montserrat/Quicksand wordmark,
   per the design handoff in assets/img/README.md.
   Change tokens below and the whole site updates.
   ========================================================= */

/* Montserrat/Quicksand are loaded asynchronously by assets/js/nav.js so a slow or
   blocked font host (some school networks block Google Fonts) never delays the page
   — text renders immediately in the system-font fallback below and swaps in once loaded. */

:root {
  /* --- Brand tokens (from design handoff) --- */
  --color-ink: oklch(0.42 0.01 60);        /* wordmark / headings neutral, ~#5B5B5D */
  --color-text-muted: oklch(0.5 0.01 60);
  --color-text-muted-2: oklch(0.6 0.01 60);
  --color-accent: #C8203F;                  /* crest crimson — primary accent */
  --color-accent-dark: #a81733;
  /* Alternate accents pulled from the crest, pick one to theme a section if useful */
  --color-accent-blue: #2E7DB8;
  --color-accent-green: #4CAF50;
  --color-accent-gold: #F2B705;

  --color-bg: oklch(0.97 0.005 60);
  --color-surface: #ffffff;
  --color-surface-tint: oklch(0.985 0.003 60);
  --color-border: oklch(0.93 0.005 60);
  --color-text: #262626;
  --color-danger: #a4293d;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.08);
  --max-width: 1120px;
  --font-body: 'Quicksand', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Montserrat', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }

a { color: var(--color-accent); }
a:hover { color: var(--color-accent-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-ink);
  line-height: 1.25;
  margin-top: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header / Nav ---------- */
#site-header {
  display: block;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand .crest-img {
  height: 44px;
  width: auto;
  flex-shrink: 0;
}

.wordmark-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.wordmark-line1 {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--color-ink);
  white-space: nowrap;
}

.wordmark-line2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--color-accent);
  margin-top: 2px;
}

nav.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

nav.main-nav a {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

nav.main-nav a:hover,
nav.main-nav a[aria-current="page"] {
  background: var(--color-surface-tint);
  color: var(--color-accent);
}

/* ---------- Nav dropdown groups ---------- */
.nav-group { position: relative; }

.nav-group-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

.nav-group-trigger .chevron {
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.nav-group-trigger:hover,
.nav-group-trigger.active {
  background: var(--color-surface-tint);
  color: var(--color-accent);
}

.nav-group.open .nav-group-trigger .chevron { transform: rotate(180deg); }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 6px;
  flex-direction: column;
  z-index: 50;
}

.nav-group.open .nav-dropdown { display: flex; }

.nav-dropdown a {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 600;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Collapse to the hamburger well before the bar can crowd the crest/wordmark —
   raised from the usual ~880px because the grouped nav still has 7+ top-level
   items to fit alongside a fairly wide logo lockup. */
@media (max-width: 1150px) {
  .nav-toggle { display: inline-flex; }
  nav.main-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 8px 24px 16px;
  }
  nav.main-nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; }

  /* On mobile the whole menu is already a collapsed column, so dropdowns
     expand inline (accordion-style) instead of floating. */
  .nav-group-trigger { width: 100%; justify-content: space-between; }
  .nav-dropdown {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 14px;
    min-width: 0;
  }
  .nav-group.open .nav-dropdown { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #fff;
  padding: 56px 0 64px;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  max-width: 760px;
}

.hero p.lede {
  color: #f7dfe4;
  font-size: 1.1rem;
  max-width: 640px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* Smaller page header used on inner pages instead of the big hero */
.page-header {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #fff;
  padding: 34px 0;
}
.page-header h1 { color: #fff; margin-bottom: 6px; }
.page-header p { color: #f7dfe4; margin: 0; max-width: 700px; }
.breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,0.78); margin-bottom: 10px; }
.breadcrumb a { color: rgba(255,255,255,0.78); }
.breadcrumb a:hover { color: #fff; }

main {
  padding: 44px 0 80px;
}

section { margin-bottom: 48px; }
section:last-child { margin-bottom: 0; }

/* ---------- Cards / grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
}

.card .icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.card h3 { margin-bottom: 2px; font-size: 1.08rem; }
.card p { margin: 0; color: var(--color-text-muted); font-size: 0.92rem; }

.card .tag {
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  background: var(--color-surface-tint);
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- Editable placeholder callouts ---------- */
.editable-note {
  border: 1.5px dashed var(--color-accent-gold);
  background: #fbf6e7;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 18px 0;
  font-size: 0.94rem;
}
.editable-note strong { color: var(--color-ink); }
.editable-note::before {
  content: "✏️ EDIT THIS SECTION";
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: #8a6d00;
  margin-bottom: 6px;
}

.callout {
  border-left: 4px solid var(--color-accent-green);
  background: #eef6f0;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
}
.callout.warn {
  border-left-color: var(--color-danger);
  background: #fbecee;
}
.callout.info {
  border-left-color: var(--color-accent-blue);
  background: #eaf3f9;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: var(--color-accent-dark); color: #fff; }

.btn.btn-light {
  background: #fff;
  color: var(--color-accent);
}
.btn.btn-light:hover { background: #f7dfe4; color: var(--color-accent-dark); }

.btn.btn-outline {
  background: transparent;
  border: 1.5px solid #fff;
  color: #fff;
}
.btn.btn-outline:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ---------- Section nav pills (used on system how-to pages) ---------- */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.pill-row a {
  text-decoration: none;
  background: var(--color-surface-tint);
  border: 1px solid var(--color-border);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}
.pill-row a:hover { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }

/* ---------- Steps ---------- */
ol.steps { padding-left: 0; list-style: none; counter-reset: step; }
ol.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 18px 48px;
  border-left: 2px solid var(--color-border);
  margin-left: 18px;
}
ol.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: -19px;
  top: 0;
  width: 34px;
  height: 34px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
}

/* ---------- Video embed wrapper (responsive 16:9) ---------- */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 16px 0;
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-caption { font-size: 0.85rem; color: var(--color-text-muted); margin-top: -8px; margin-bottom: 16px; }

/* ---------- File list ---------- */
ul.file-list { list-style: none; padding: 0; margin: 16px 0; }
ul.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
ul.file-list a { font-weight: 700; text-decoration: none; }
ul.file-list .file-meta { margin-left: auto; font-size: 0.8rem; color: var(--color-text-muted); }
.file-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--color-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-body);
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}

/* ---------- Accordion (FAQ) ---------- */
.accordion-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--color-surface);
}
.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--color-ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.accordion-trigger:hover { color: var(--color-accent); }
.accordion-trigger .chevron { transition: transform 0.2s ease; flex-shrink: 0; }
.accordion-item.open .chevron { transform: rotate(180deg); }
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
  padding: 0 18px;
  color: var(--color-text-muted);
}
.accordion-item.open .accordion-panel { padding-bottom: 16px; }

/* ---------- Checklist ---------- */
ul.checklist { list-style: none; padding: 0; }
ul.checklist li {
  padding: 8px 0 8px 30px;
  position: relative;
  border-bottom: 1px dashed var(--color-border);
}
ul.checklist li:last-child { border-bottom: none; }
ul.checklist li::before {
  content: "☐";
  position: absolute;
  left: 0;
  color: var(--color-accent-green);
  font-size: 1.1rem;
}

/* ---------- Table ---------- */
table.info-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.info-table th, .info-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}
.info-table th {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-surface-tint);
}

/* ---------- Map placeholder ---------- */
.map-frame {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-tint) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40"><path d="M0 40L40 0" stroke="%23e3ddce" stroke-width="2"/></svg>');
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  text-align: center;
  padding: 20px;
}

/* ---------- Footer (two-tier, matching sophiacollege.qld.edu.au) ---------- */
#site-footer {
  display: block;
  margin-top: 60px;
}

.site-footer-top {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  padding: 40px 24px;
}
.site-footer-top h3 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.site-footer-top .footer-address {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  margin: 0 0 26px;
}
.site-footer-top .footer-address a { color: #fff; text-decoration: underline; }
.site-footer-top .footer-address a:hover { color: #fff; opacity: 0.85; }

.footer-quicklinks-label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-bottom: 10px;
}

.footer-quicklinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}
.footer-quicklinks a {
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1.5px solid rgba(255,255,255,0.45);
  padding: 8px 16px;
  border-radius: 999px;
}
.footer-quicklinks a:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  color: #fff;
}

.footer-legal-links {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  margin: 0;
}
.footer-legal-links a { color: rgba(255,255,255,0.9); }
.footer-legal-links a:hover { color: #fff; }

.site-footer-bottom {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 16px 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}
.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom-inner .editable-note { font-size: 0.8rem; padding: 10px 14px; margin: 0; }

.back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-ink);
  color: #fff;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 7px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.back-to-top:hover { background: var(--color-accent); color: #fff; }

/* ---------- Password gate ---------- */
#auth-gate {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-box {
  background: #fff;
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--color-accent);
  padding: 36px 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-md);
  text-align: center;
}
.auth-box .crest-img {
  height: 64px;
  width: auto;
  margin: 0 auto 14px;
}
.auth-box h2 { margin-bottom: 6px; }
.auth-box p { color: var(--color-text-muted); font-size: 0.92rem; }
.auth-box input[type="password"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
  margin: 14px 0 8px;
}
.auth-box .btn { width: 100%; justify-content: center; }
.auth-error { color: var(--color-danger); font-size: 0.85rem; min-height: 18px; margin-bottom: 4px; }
.auth-hint { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 14px; }

body.auth-locked { overflow: hidden; }
body.auth-locked #page-content { display: none; }
