/* CECOE Resource Library — template cards, search, stage strip, grant updates page. Colours come from the theme's tokens when present. */
:where(:root) {
  --navy: #025529; --navy-dark: #0b2615; --green: #006837; --green-light: #e6f3ec;
  --amber: #f2a900; --ink: #1f2421; --muted: #55625b; --line: #e1e7e3; --bg: #f8f8f8; --card: #ffffff; --radius: 18px;
}
/* Fallback buttons for themes other than CECOE's (zero specificity: any theme rule wins). */
:where(.btn) { display: inline-block; padding: 12px 26px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; border: 2px solid transparent; cursor: pointer; line-height: 1.2; }
:where(.btn-primary) { background: var(--navy); color: #fff; }
:where(.btn-ghost-dark) { border-color: var(--navy); color: var(--navy); background: transparent; }
/* ---------- Search bar & filters ---------- */
.search-bar { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 0; }
.search-bar input[type="search"] {
  width: 100%; max-width: 560px; display: block; margin: 0 auto;
  padding: 12px 18px; font-size: 15px; border: 2px solid var(--line); border-radius: 999px;
  outline: none; transition: border-color .15s ease;
}
.search-bar input[type="search"]:focus { border-color: var(--navy); }
.search-bar #search-no-results, .search-bar #search-count { text-align: center; margin-top: 10px; color: var(--muted); font-size: 14px; }
.search-bar #search-count { color: var(--navy); font-weight: 600; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.chip-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip-btn:hover { border-color: var(--green); color: var(--green); }
.chip-btn.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Process strip ---------- */
.process { background: #fff; border-bottom: 1px solid var(--line); padding: 34px 0; }
.process ol { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: step; }
.process li {
  counter-increment: step; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 14px 14px; font-size: 13.5px; color: var(--muted);
  position: relative;
}
.process li strong { display: block; color: var(--navy); font-size: 14.5px; margin-bottom: 4px; }
.process li::before {
  content: counter(step);
  position: absolute; top: -12px; left: 12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 900px) { .process ol { grid-template-columns: repeat(2, 1fr); row-gap: 22px; } }

/* ---------- Download cards ---------- */
.section-bundle { margin: -10px 0 20px; }
.bundle-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 2px dashed var(--green); color: var(--navy);
  text-decoration: none; font-weight: 700; font-size: 13.5px;
  padding: 9px 18px; border-radius: 999px;
}
.bundle-btn::before { content: "⤓"; font-size: 16px; line-height: 1; }
.bundle-btn:hover { background: var(--green-light); }
.dl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-bottom: 30px; }
@media (max-width: 820px) { .dl-grid { grid-template-columns: 1fr; } }
.dl-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 16px; display: flex; gap: 16px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.dl-card:hover { box-shadow: 0 6px 18px rgba(0, 40, 20, .12); transform: translateY(-2px); }
.file-ico {
  transition: transform .15s ease;
  flex: none; width: 52px; height: 60px; border-radius: 6px; position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff; padding-bottom: 8px;
}
.file-ico::before {
  content: ""; position: absolute; top: 0; right: 0;
  border-style: solid; border-width: 0 14px 14px 0;
  border-color: transparent var(--bg) transparent transparent;
}
.file-ico.docx { background: #2b579a; }
.file-ico.xlsx { background: #217346; }
.file-ico.pdf  { background: #b30b00; }
.file-ico.zip  { background: #6b5618; }
.dl-card:hover .file-ico { transform: scale(1.05); }
.dl-body { display: flex; flex-direction: column; flex: 1; }
.dl-body h3 { color: var(--navy); font-size: 16.5px; line-height: 1.3; }
.dl-body p { font-size: 13.8px; color: var(--muted); margin: 6px 0 12px; }
.dl-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: #7c8a80; margin: -6px 0 12px; }
.dl-stats span { display: inline-flex; align-items: center; gap: 5px; }
.dl-stats span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.dl-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dl-meta { font-size: 12.5px; color: #7c8a80; text-transform: uppercase; letter-spacing: .4px; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--navy); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 13.5px; padding: 8px 18px; border-radius: 999px;
  transition: background .15s ease, transform .1s ease;
}
.dl-btn:hover { background: var(--green); transform: translateY(-1px); }
.dl-btn svg { flex: none; }
/* legacy link style kept for non-card uses */
.dl-link { font-weight: 700; font-size: 14px; text-decoration: none; color: var(--green); }
.dl-link:hover { text-decoration: underline; }

/* ---------- Grant updates page ---------- */
.hero-slim { padding: 46px 0 50px; }
.gu-content { padding-bottom: 54px; }
.gu-content h2 {
  color: var(--navy); font-size: 24px; margin: 40px 0 10px;
  padding-left: 14px; border-left: 5px solid var(--amber);
}
.gu-content h2:first-child { margin-top: 0; }
.gu-content > .wrap > p, .gu-content p { margin-bottom: 14px; color: var(--muted); }
.gu-content .stat-grid { margin-bottom: 10px; }
.gu-content .notice { margin: 10px 0 20px; }
.gu-content ul, .gu-content ol { padding-left: 22px; margin-bottom: 14px; }
.gu-content .submit-card ul, .gu-content .info-box ul { padding-left: 0; }
.updated-on { margin-top: 14px; font-size: 13.5px; color: #ffd34d; font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat-tile {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--navy);
  border-radius: var(--radius); padding: 18px 18px 14px; text-align: center;
}
.stat-tile b { display: block; color: var(--navy); font-size: 24px; line-height: 1.2; }
.stat-tile span { font-size: 13px; color: var(--muted); }
.table-scroll { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.gu-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 14px; }
.gu-table th {
  background: var(--navy); color: #fff; text-align: left; padding: 12px 14px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .4px;
}
.gu-table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.gu-table tr:last-child td { border-bottom: 0; }
.gu-table small { color: var(--muted); }
.chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.chip-active { background: var(--green-light); color: var(--navy); border: 1px solid #bfdccb; }
.chip-closed { background: #eef0f3; color: #5c6670; border: 1px solid #d7dce2; }
.chip-pipeline { background: #fff8e6; color: #6b5618; border: 1px solid #f0dfae; }
.submit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .submit-grid { grid-template-columns: 1fr; } }
.submit-card {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--navy);
  border-radius: var(--radius); padding: 20px 22px;
}
.submit-card h3 { color: var(--navy); font-size: 16.5px; margin-bottom: 10px; }
.submit-card ul { list-style: none; }
.submit-card li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; color: var(--muted); }
.submit-card li:last-child { border-bottom: 0; }
.submit-card a { font-weight: 700; }
.dl-foot { gap: 8px; }
.dl-btn.dl-btn-online { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.dl-btn.dl-btn-online:hover { background: var(--green); color: #fff; }
