/* ==================================================================
   Canadian University AI Approaches — site styles
   Hand-written, ~14KB. Replaces the Tailwind 2 CDN build (3.9MB) so
   the directory paints fast on mobile with no render-blocking fetch.
   ================================================================== */

/* ---------- tokens ---------- */
:root {
  --maroon:       #8E1B1B;
  --maroon-deep:  #6B1414;
  --maroon-soft:  #C4685F;
  --maroon-tint:  #FBEEEE;
  --maroon-line:  #EBD3D0;

  --ink:          #1C1917;
  --ink-2:        #453D38;
  --muted:        #6E635C;
  --faint:        #9A8F87;

  --paper:        #F6F4F2;
  --surface:      #FFFFFF;
  --line:         #E4DEDA;
  --line-strong:  #D3CAC4;

  --ok:           #2F6F44;
  --ok-tint:      #EAF3EC;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;

  --shadow-1: 0 1px 2px rgba(28,25,23,.05), 0 1px 3px rgba(28,25,23,.04);
  --shadow-2: 0 2px 6px rgba(28,25,23,.07), 0 8px 24px rgba(28,25,23,.06);
  --shadow-3: 0 12px 40px rgba(28,25,23,.16);

  --wrap: 1180px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--maroon); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
ul { margin: 0; padding: 0; }

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--maroon);
  padding: 10px 16px; border-radius: var(--r-sm); font-weight: 650;
  transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* ==================================================================
   HEADER
   ================================================================== */
.masthead {
  background: var(--maroon);
  color: #fff;
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(0,0,0,.06));
}
.masthead__inner {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 18px;
  padding: 22px 0 20px;
}
.masthead__title { text-decoration: none; color: #fff; display: block; }
.masthead__title h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -.015em;
}
.masthead__tag {
  margin-top: 3px;
  font-size: .875rem;
  color: rgba(255,255,255,.78);
}
.masthead__right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: rgba(255,255,255,.84);
  text-decoration: none;
  font-size: .875rem; font-weight: 550;
  padding: 7px 11px; border-radius: var(--r-sm);
  transition: background .13s, color .13s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.12); }
.nav a[aria-current="page"] {
  color: #fff; background: rgba(0,0,0,.18);
}
.btn-contact {
  background: #fff; color: var(--maroon-deep);
  text-decoration: none; font-weight: 650; font-size: .875rem;
  padding: 9px 17px; border-radius: var(--r-sm);
  transition: transform .13s, box-shadow .13s;
}
.btn-contact:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.2); }

/* ==================================================================
   SIGNATURE: coverage ribbon
   98 ticks, one per institution. Filled = has published guidance.
   ================================================================== */
.ribbon {
  background: var(--maroon-deep);
  padding: 12px 0 13px;
  border-bottom: 1px solid rgba(0,0,0,.15);
}
.ribbon__inner { display: flex; flex-direction: column; gap: 8px; }
.ribbon__ticks {
  display: flex; gap: 2px; width: 100%;
  height: 26px; align-items: flex-end;
}
.tick {
  flex: 1 1 0; min-width: 2px; height: 13px;
  background: rgba(255,255,255,.22);
  border: 0; padding: 0; border-radius: 1px;
  cursor: pointer;
  transition: background .12s ease;
}
.tick--has { background: #E8A9A0; height: 22px; }
.ribbon__ticks:hover .tick { opacity: .5; }
.ribbon__ticks .tick:hover,
.ribbon__ticks .tick:focus-visible { opacity: 1; background: #fff; }
.ribbon__read {
  font-size: .8125rem; color: rgba(255,255,255,.9);
  min-height: 20px;
}
.ribbon__read b { color: #fff; font-weight: 650; }

/* ==================================================================
   FILTER RAIL
   ================================================================== */
.rail {
  position: sticky; top: 0; z-index: 60;
  background: rgba(246,244,242,.93);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.rail__inner { padding: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.rail__row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search {
  position: relative; flex: 1 1 300px; min-width: 0;
}
.search input {
  width: 100%; padding: 11px 38px 11px 38px;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  font-size: .9375rem;
  transition: border-color .13s, box-shadow .13s;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-decoration,
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search input:focus {
  outline: none; border-color: var(--maroon);
  box-shadow: 0 0 0 3px var(--maroon-tint);
}
.search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--faint); pointer-events: none;
}
.search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; color: var(--muted);
  padding: 5px; border-radius: 50%; line-height: 0;
}
.search__clear:hover { background: var(--paper); color: var(--ink); }

.sel {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E635C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 11px center;
  border: 1px solid var(--line-strong); border-radius: var(--r);
  padding: 10px 32px 10px 12px;
  font-size: .875rem; cursor: pointer;
  max-width: 100%;
  transition: border-color .13s;
}
.sel:hover { border-color: var(--muted); }
.sel[data-active="1"] {
  border-color: var(--maroon); background-color: var(--maroon-tint);
  color: var(--maroon-deep); font-weight: 600;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 7px 14px;
  font-size: .8125rem; font-weight: 550; cursor: pointer;
  transition: all .13s;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] {
  background: var(--maroon); border-color: var(--maroon); color: #fff;
}

.rail__meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: .8125rem; color: var(--muted);
}
.rail__count { font-weight: 650; color: var(--ink); }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--maroon); font-size: .8125rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px;
}
.linkbtn:hover { color: var(--maroon-deep); }

.filters-toggle { display: none; }

/* ==================================================================
   RESULTS
   ================================================================== */
main { padding: 24px 0 64px; }

.province-head {
  display: flex; align-items: baseline; gap: 12px;
  margin: 34px 0 14px; padding-bottom: 9px;
  border-bottom: 2px solid var(--maroon-line);
}
.province-head:first-child { margin-top: 4px; }
.province-head h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.65rem; color: var(--maroon-deep);
  letter-spacing: -.01em;
}
.province-head span { font-size: .8125rem; color: var(--muted); }

.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  align-items: stretch;
}

/* ---------- institution card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .16s, border-color .16s;
}
.card:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.card[data-open="1"] { border-color: var(--maroon-line); box-shadow: var(--shadow-2); }
.card--empty { background: #FCFBFA; }
.card--target { border-color: var(--maroon); box-shadow: 0 0 0 3px var(--maroon-tint), var(--shadow-2); }

.card__top {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 15px 16px; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start;
  flex: 0 0 auto;
}
.card--empty .card__top { cursor: default; }
.card__name {
  display: block;
  font-size: 1.0625rem; font-weight: 650;
  letter-spacing: -.011em; color: var(--ink);
}
.card__where {
  display: block;
  margin-top: 3px; font-size: .8125rem; color: var(--muted);
}
.card__caret {
  color: var(--maroon); flex-shrink: 0; margin-top: 2px;
  transition: transform .18s ease;
}
.card[data-open="1"] .card__caret { transform: rotate(180deg); }

.card__tags {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 0 16px 14px;
  margin-top: auto; /* pushes tags (+ nodocs/docs after it) to the card's
                        bottom, so short and long cards in the same row
                        line up instead of trailing off at different heights */
}
.tag {
  font-size: .6875rem; font-weight: 600; letter-spacing: .015em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--maroon-tint); color: var(--maroon-deep);
  border: 1px solid var(--maroon-line);
  white-space: nowrap;
}
.tag--n {
  background: var(--paper); color: var(--ink-2); border-color: var(--line);
}
.tag--none {
  background: transparent; color: var(--faint);
  border: 1px dashed var(--line-strong); font-weight: 550;
}
.tag--pdf { background: #FFF6E5; color: #8A5A00; border-color: #F0DFBC; }

/* ---------- documents ---------- */
.docs {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #FCFBFA, var(--surface));
  padding: 4px 16px 14px;
}
.doc {
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.doc:last-child { border-bottom: 0; padding-bottom: 4px; }
.doc__title {
  font-size: .9375rem; font-weight: 620; color: var(--ink);
  margin-bottom: 5px; line-height: 1.35;
}
.doc__untitled { color: var(--ink-2); font-style: italic; font-weight: 550; }
.doc__meta {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px;
}
.doc__summary {
  font-size: .8438rem; color: var(--ink-2);
  margin-bottom: 9px; line-height: 1.5;
}
.doc__unit {
  font-size: .75rem; color: var(--muted); margin-bottom: 8px;
}
.doc__go {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--maroon); color: #fff; text-decoration: none;
  font-size: .8125rem; font-weight: 620;
  padding: 8px 14px; border-radius: var(--r-sm);
  transition: background .13s, transform .13s;
}
.doc__go:hover { background: var(--maroon-deep); transform: translateY(-1px); }

.nodocs {
  padding: 0 16px 16px;
  font-size: .8438rem; color: var(--muted);
}
.nodocs a { font-weight: 600; }

/* ---------- compare checkbox ---------- */
.cmp {
  position: absolute; top: 13px; right: 13px;
  width: 20px; height: 20px; cursor: pointer;
  accent-color: var(--maroon);
}
.card { position: relative; }
.card__top { padding-right: 44px; }

/* ---------- compare bar + overlay ---------- */
.cmpbar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(140%);
  z-index: 90;
  background: var(--ink); color: #fff;
  border-radius: 999px; box-shadow: var(--shadow-3);
  padding: 10px 12px 10px 20px;
  display: flex; align-items: center; gap: 14px;
  font-size: .875rem;
  transition: transform .22s cubic-bezier(.2,.8,.3,1);
  max-width: calc(100vw - 32px);
}
.cmpbar[data-show="1"] { transform: translateX(-50%) translateY(0); }
.cmpbar button {
  border: 0; cursor: pointer; border-radius: 999px;
  font-size: .8125rem; font-weight: 650; padding: 8px 16px;
}
.cmpbar .go { background: #fff; color: var(--ink); }
.cmpbar .go:disabled { opacity: .4; cursor: not-allowed; }
.cmpbar .clr { background: rgba(255,255,255,.14); color: #fff; }

.sheet {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(28,25,23,.55);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.sheet[data-show="1"] { display: flex; }
.sheet__panel {
  background: var(--surface); border-radius: var(--r-lg);
  width: 100%; max-width: 1000px; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-3);
}
.sheet__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.sheet__head h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.sheet__body { overflow: auto; padding: 4px 20px 20px; }
.iconbtn {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  padding: 7px; border-radius: var(--r-sm); line-height: 0;
}
.iconbtn:hover { background: var(--paper); color: var(--ink); }

table.cmp-table { border-collapse: collapse; width: 100%; font-size: .8438rem; }
table.cmp-table th, table.cmp-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px; text-align: left; vertical-align: top;
}
table.cmp-table thead th {
  position: sticky; top: 0; background: var(--surface);
  font-size: .9375rem; font-weight: 650; z-index: 2;
  border-bottom: 2px solid var(--maroon-line);
}
table.cmp-table tbody th {
  font-size: .6875rem; font-weight: 650; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
  width: 150px; background: #FCFBFA;
}
table.cmp-table td ul { list-style: none; }
table.cmp-table td li { margin-bottom: 4px; }
.dash { color: var(--faint); }

/* ---------- empty state ---------- */
.empty {
  text-align: center; padding: 64px 20px;
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
}
.empty h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin-bottom: 6px; }
.empty p { color: var(--muted); font-size: .9375rem; margin-bottom: 16px; }

/* ==================================================================
   PROSE (about + insights)
   ================================================================== */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 24px; margin-bottom: 18px;
}
.panel h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.45rem; margin-bottom: 10px; color: var(--ink);
}
.lede { color: var(--ink-2); font-size: .9375rem; }
.narrow { max-width: 800px; margin: 0 auto; }

.prose { font-size: .9375rem; color: var(--ink-2); line-height: 1.65; }
.prose > * + * { margin-top: 14px; }
.prose h3 {
  font-size: 1.0625rem; font-weight: 650; color: var(--ink);
  margin-top: 24px; letter-spacing: -.005em;
}
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--maroon-deep); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose blockquote {
  border-left: 3px solid var(--maroon-line);
  background: var(--maroon-tint);
  padding: 12px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: .8438rem; color: var(--maroon-deep);
}
.prose blockquote p + p { margin-top: 8px; }
.prose code {
  background: var(--paper); padding: 2px 6px;
  border-radius: 4px; font-size: .875em;
}
.prose hr { border: 0; border-top: 1px solid var(--line); }

/* ---------- insight accordion ---------- */
.insight {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  margin-bottom: 12px; overflow: hidden;
}
.insight[open] { border-color: var(--maroon-line); box-shadow: var(--shadow-2); }
.insight > summary {
  list-style: none; cursor: pointer; padding: 17px 20px;
  display: flex; align-items: center; gap: 13px;
}
.insight > summary::-webkit-details-marker { display: none; }
.insight > summary:hover { background: #FCFBFA; }
.insight__emoji { font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.insight__title {
  flex: 1; font-family: var(--serif); font-weight: 500;
  font-size: 1.1875rem; color: var(--ink); letter-spacing: -.01em;
}
.insight__caret { color: var(--maroon); flex-shrink: 0; transition: transform .18s; }
.insight[open] .insight__caret { transform: rotate(180deg); }
.insight__body { padding: 2px 20px 22px; }

/* ---------- reflection prompt ---------- */
.prompt {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--maroon);
  border-radius: var(--r);
  padding: 16px 18px; margin: 18px 0 4px;
  box-shadow: var(--shadow-1);
}
.prompt__label {
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 6px;
}
.prompt__text {
  font-family: var(--serif); font-size: 1.0625rem;
  line-height: 1.45; color: var(--ink);
}
.prompt__text strong { font-weight: 600; color: var(--maroon-deep); }
.prompt__foot {
  margin-top: 9px; display: flex; gap: 14px; align-items: center;
  font-size: .8125rem;
}
.prompt__foot a { font-weight: 600; text-decoration: none; }
.prompt__foot a:hover { text-decoration: underline; }

/* ==================================================================
   FOOTER
   ================================================================== */
.foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px; margin-top: 40px;
  font-size: .8125rem; color: var(--muted);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.foot a { font-weight: 600; }
.foot__src { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.dot--live { background: var(--ok); }
.dot--cached { background: #C99A3A; }

/* ==================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr; }
  .province-head h2 { font-size: 1.4rem; }
}

@media (max-width: 700px) {
  .wrap { padding: 0 14px; }
  .masthead__inner { padding: 16px 0 14px; gap: 12px; }
  .masthead__right { width: 100%; justify-content: space-between; }
  .nav { gap: 0; margin-left: -11px; }
  .nav a { padding: 6px 9px; font-size: .8125rem; }
  .btn-contact { padding: 8px 14px; }

  .ribbon { padding: 10px 0; }
  .ribbon__inner { gap: 9px; }
  .ribbon__ticks { height: 20px; gap: 1px; }
  .tick { height: 10px; min-width: 1px; }
  .tick--has { height: 17px; }
  .ribbon__read { font-size: .75rem; }

  /* collapse the filter controls behind a toggle on small screens */
  .filters-toggle {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: var(--r); padding: 10px 14px;
    font-size: .875rem; font-weight: 600; cursor: pointer;
  }
  .filters-toggle[aria-expanded="true"] {
    background: var(--maroon); border-color: var(--maroon); color: #fff;
  }
  .filters-toggle .badge {
    background: var(--maroon); color: #fff; border-radius: 999px;
    font-size: .6875rem; padding: 1px 7px; font-weight: 700;
  }
  .filters-toggle[aria-expanded="true"] .badge { background: rgba(255,255,255,.25); }
  .rail__collapsible { display: none; }
  .rail__collapsible[data-open="1"] { display: flex; }
  .sel { flex: 1 1 140px; }

  .sheet { padding: 0; align-items: flex-end; }
  .sheet__panel { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
  table.cmp-table { font-size: .8125rem; }
  table.cmp-table tbody th { width: 108px; }
  table.cmp-table th, table.cmp-table td { padding: 9px 8px; }

  .panel { padding: 18px; }
  .insight > summary { padding: 15px 16px; }
  .insight__body { padding: 2px 16px 18px; }
  .insight__title { font-size: 1.0625rem; }
  .foot { flex-direction: column; gap: 8px; }
}

@media print {
  .rail, .ribbon, .cmpbar, .cmp, .btn-contact, .nav { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; }
  .docs { display: block !important; }
}