/* ============================================
   FCAP Portal — Fried Center for the Advancement of Potential
   Brand: navy + coral/gold/blue accents, Montserrat + Open Sans.
   Edit the CSS variables below to retune the brand.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&family=Open+Sans:wght@400;500;600&display=swap');

:root {
  /* FCAP brand palette — pulled from the official FCAP template */
  --fcap-navy:        #1A365D;   /* primary — text, header, hero */
  --fcap-navy-mid:    #2B4C7E;   /* secondary navy */
  --fcap-blue:        #2B6CB0;   /* accent — bright blue */
  --fcap-blue-light:  #4A90D9;   /* accent — lighter blue */
  --fcap-coral:       #D94A38;   /* accent — coral / red */
  --fcap-coral-light: #E8734A;   /* accent — soft coral */
  --fcap-gold:        #F5A623;   /* accent — gold */
  --fcap-cream:       #F7F5F2;   /* page background — warm off-white */

  /* Semantic mappings */
  --brand-primary: var(--fcap-navy);
  --brand-accent:  var(--fcap-coral);
  --brand-soft:    var(--fcap-cream);
  --surface:       #FFFFFF;
  --surface-alt:   #FBF9F6;
  --border:        #E5DFD7;
  --text-strong:   #1A2233;
  --text:          #384055;
  --text-muted:    #6F7588;
  --success:       #1F8F4E;
  --warning:       #C77700;
  --radius:        10px;
  --shadow-sm:     0 1px 2px rgba(26, 54, 93, 0.06), 0 1px 1px rgba(26, 54, 93, 0.04);
  --shadow-md:     0 4px 14px rgba(26, 54, 93, 0.10);
  --maxw:          1280px;
  --sidebar-w:     250px;
  --header-h:      66px;
  --font-body:     'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head:     'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font:          var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--brand-soft);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; margin: 0 0 .5em; font-family: var(--font-head); font-weight: 600; }
h1 { font-size: 30px; letter-spacing: -0.01em; font-weight: 700; }
h2 { font-size: 21px; margin-top: 1.6em; }
h3 { font-size: 16px; margin-top: 1.4em; }
.brand, .section-head h2, .article h1, .hero h1 { font-family: var(--font-head); }
p { margin: 0 0 1em; }
img { max-width: 100%; }

/* ---------- Header ---------- */
.site-header {
  height: var(--header-h);
  background: var(--brand-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.005em;
  font-size: 16px;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: #fff;
  display: inline-grid; place-items: center;
  color: var(--fcap-navy);
  font-weight: 700; font-size: 13px;
  letter-spacing: 0.02em;
  font-family: var(--font-head);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}
.brand-mark svg { display: block; }
.brand-mark img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 3px;
  box-sizing: border-box;
}
.brand-name { font-family: var(--font-head); font-weight: 600; }
.search {
  flex: 1; max-width: 520px;
  position: relative;
}
.search input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 0 14px 0 38px;
  font: inherit;
  outline: none;
  transition: background .15s, border-color .15s;
}
.search input::placeholder { color: rgba(255,255,255,0.7); }
.search input:focus {
  background: #fff;
  color: var(--text-strong);
  border-color: var(--brand-accent);
}
.search input:focus::placeholder { color: var(--text-muted); }
.search .icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  opacity: .85;
  pointer-events: none;
}
.search input:focus + .icon { opacity: .6; filter: invert(.3); }
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  max-height: 420px;
  overflow-y: auto;
  display: none;
}
.search-results.open { display: block; }
.search-results .group {
  padding: 6px 8px;
  border-top: 1px solid var(--border);
}
.search-results .group:first-child { border-top: 0; }
.search-results .group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: 6px 10px 2px;
}
.search-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--text-strong);
}
.search-results a:hover { background: var(--brand-soft); text-decoration: none; }
.search-results .desc {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}
.search-results .empty {
  padding: 18px;
  color: var(--text-muted);
  text-align: center;
}

.header-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.header-nav a {
  color: rgba(255,255,255,0.85);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.header-nav a:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

/* ---------- Layout ---------- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px;
  align-items: start;
}
.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.sidebar h4 {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 14px 12px 6px;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.sidebar li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.sidebar li a:hover { background: var(--brand-soft); text-decoration: none; color: var(--text-strong); }
.sidebar li a.active {
  background: rgba(229, 114, 0, 0.12);
  color: var(--brand-primary);
  font-weight: 600;
}
.sidebar .nav-icon {
  width: 18px; height: 18px;
  display: inline-grid; place-items: center;
  color: var(--text-muted);
}
.sidebar li a.active .nav-icon { color: var(--brand-accent); }

.content { min-width: 0; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--fcap-navy) 0%, var(--fcap-navy-mid) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 36px 36px 30px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(245,166,35,.30) 0%, rgba(245,166,35,0) 70%);
  pointer-events: none;
}
/* FCAP color stripe motif — pulled from the template */
.hero::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: linear-gradient(
    to right,
    var(--fcap-coral) 0%, var(--fcap-coral) 25%,
    var(--fcap-gold) 25%, var(--fcap-gold) 50%,
    var(--fcap-blue) 50%, var(--fcap-blue) 75%,
    var(--fcap-blue-light) 75%, var(--fcap-blue-light) 100%
  );
}
.hero h1 { color: #fff; font-size: 28px; margin-bottom: 8px; }
.hero p { color: rgba(255,255,255,0.85); max-width: 640px; margin: 0; }
.hero-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  background: var(--fcap-coral);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn:hover { filter: brightness(1.08); text-decoration: none; color: #fff; }
.btn.ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
}
.btn.ghost:hover { background: rgba(255,255,255,0.25); }
.btn.secondary {
  background: var(--surface);
  color: var(--brand-primary);
  border: 1px solid var(--border);
}
.btn.secondary:hover { background: var(--brand-soft); color: var(--brand-primary); }

/* ---------- Card / tile grid ---------- */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 14px; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-strong);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.tile:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #C9D2E2;
}
.tile-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: rgba(43, 108, 176, 0.10);
  color: var(--fcap-blue);
  display: inline-grid; place-items: center;
  margin-bottom: 4px;
  font-size: 18px;
}
.tile:nth-child(4n+2) .tile-icon { background: rgba(217, 74, 56, 0.12); color: var(--fcap-coral); }
.tile:nth-child(4n+3) .tile-icon { background: rgba(245, 166, 35, 0.14); color: #B47000; }
.tile:nth-child(4n+4) .tile-icon { background: rgba(26, 54, 93, 0.10); color: var(--fcap-navy); }
.tile-title { font-weight: 600; font-size: 15px; color: var(--text-strong); }
.tile-desc { font-size: 13px; color: var(--text-muted); margin: 0; }
.tile-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; gap: 10px; align-items: center;
  margin-top: auto;
  padding-top: 6px;
}
.tile-meta .badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge.policy   { background: #E3EBF6; color: var(--fcap-navy); }
.badge.training { background: #FCEEEB; color: #B5341F; }
.badge.sop      { background: #FDF1DD; color: #8C5400; }
.badge.external { background: #E3EEF8; color: var(--fcap-blue); }
.badge.dept     { background: #ECEEF4; color: var(--fcap-navy-mid); }
.badge.locked   { background: #1A365D; color: #fff; }
.badge.new      { background: var(--fcap-coral); color: #fff; }

.tile .ext-icon {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ---------- Document/link list rows ---------- */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.doc-list li:last-child { border-bottom: 0; }
.doc-list li:hover { background: var(--surface-alt); }
.doc-list .file-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--brand-soft);
  display: grid; place-items: center;
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 700;
}
.doc-list .file-icon.pdf  { color: #B5341F; background: #FBE7E3; }
.doc-list .file-icon.docx { color: var(--fcap-blue); background: #E3EEF8; }
.doc-list .file-icon.xlsx { color: #1F8F4E; background: #E9F5EE; }
.doc-list .file-icon.link { color: var(--fcap-coral); background: #FBEFE7; }
.doc-list .file-icon.page { color: var(--fcap-navy); background: #E5EAF2; }
.doc-list .file-icon.ppt  { color: #B47000; background: #FDF1DD; }
.doc-list .doc-title { font-weight: 600; color: var(--text-strong); }
.doc-list .doc-meta { font-size: 12px; color: var(--text-muted); }
.doc-list .doc-action { font-size: 13px; }

/* ---------- Announcements ---------- */
.announce {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-accent);
  border-radius: 8px;
  background: var(--surface-alt);
  margin-bottom: 10px;
}
.announce h3 { margin: 0 0 4px; font-size: 15px; }
.announce p  { margin: 0; font-size: 13px; color: var(--text-muted); }
.announce .date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ---------- Breadcrumbs ---------- */
.crumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--brand-primary); }
.crumbs .sep { margin: 0 6px; opacity: .5; }

/* ---------- Detail page (policy/training body) ---------- */
.article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.article-meta {
  display: flex; flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.article-meta strong { color: var(--text); font-weight: 600; }
.article h2:first-of-type { margin-top: 0; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin-bottom: .35em; }
.article blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--brand-accent);
  background: var(--brand-soft);
  border-radius: 0 6px 6px 0;
  color: var(--text);
}
.callout {
  padding: 14px 16px;
  border-radius: 8px;
  background: #FFF7E8;
  border: 1px solid #F5DDA2;
  color: #6B4900;
  margin: 16px 0;
  font-size: 14px;
}
.callout strong { color: #6B4900; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  margin-top: 40px;
  padding: 22px 24px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--fcap-coral) 0%, var(--fcap-coral) 25%,
    var(--fcap-gold) 25%, var(--fcap-gold) 50%,
    var(--fcap-blue) 50%, var(--fcap-blue) 75%,
    var(--fcap-blue-light) 75%, var(--fcap-blue-light) 100%
  );
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .site-header .inner { gap: 12px; padding: 0 14px; }
  .header-nav { display: none; }
  .hero { padding: 24px; }
  .article { padding: 22px; }
}

/* tiny utilities */
.muted { color: var(--text-muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* ---------- Brand Guide page ---------- */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.swatch {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
}
.swatch-color { height: 96px; }
.swatch-meta { padding: 10px 12px; }
.swatch-name { font-family: var(--font-head); font-weight: 600; color: var(--text-strong); font-size: 14px; }
.swatch-hex  { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.font-sample {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 12px;
}
.font-sample-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.font-sample-line  { font-size: 28px; line-height: 1.2; }
.font-sample-weights { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--text); }

/* ---------- Lock screen (Leadership) ---------- */
.lock-screen {
  max-width: 460px;
  margin: 60px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.lock-screen h1 { margin-top: 14px; }
.lock-icon {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px;
  background: var(--fcap-navy);
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
}
.lock-screen input {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 14px 0;
}
.lock-screen input:focus { outline: 2px solid var(--fcap-blue); outline-offset: 1px; border-color: var(--fcap-blue); }
.lock-error { color: var(--fcap-coral); font-size: 13px; min-height: 18px; }

/* ---------- Communication Board ---------- */
.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--fcap-blue);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.post.coral { border-left-color: var(--fcap-coral); }
.post.gold  { border-left-color: var(--fcap-gold); }
.post.navy  { border-left-color: var(--fcap-navy); }
.post-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.post-title { font-family: var(--font-head); font-weight: 600; color: var(--text-strong); font-size: 16px; }
.post-meta  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.post p { margin: 4px 0 6px; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
