/* =====================================================================
   assets/css/site.css – design of the NAVIGATION pages (home, school, project).
   Load it AFTER assets/css/base.css (colors, header, breadcrumb, footer are there).
   The gallery pages do NOT load this file: they use assets/css/gallery.css + base.css.
   ===================================================================== */

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 24px 20px 40px; }
main:focus { outline: none; }
.page-title { font-size: 1.7rem; margin: 6px 0 4px; outline: none; }
.page-sub { margin: 0 0 20px; color: var(--muted); font-weight: 600; }

/* ---------- Cards ---------- */
.card-btn {
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  min-height: 120px; padding: 18px 20px;
  background: var(--surface); color: var(--text); text-decoration: none;
  border-radius: var(--radius); box-shadow: var(--hub-shadow);
  border-bottom: 8px solid var(--accent);
  transition: transform 0.15s, box-shadow 0.15s;
}
.card-btn:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(31, 42, 68, 0.18); }
.card-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1.7rem; font-weight: 800;
}
.card-title { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.card-note { font-size: 0.95rem; color: var(--muted); font-weight: 600; }
.card-tag {
  padding: 2px 12px; border-radius: 999px;
  background: #fff4d6; color: #7a5600; font-size: 0.85rem; font-weight: 800;
}
.card-missing { opacity: 0.6; cursor: default; }
.card-missing:hover { transform: none; box-shadow: var(--hub-shadow); }

.intro-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--hub-shadow);
  padding: 20px 22px; margin-bottom: 22px; border-left: 8px solid var(--highlight);
}
.intro-box p { margin: 0; font-weight: 600; }

.empty {
  background: var(--surface); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--hub-shadow); font-weight: 700; color: var(--muted);
}

/* ---------- School cards (home page): 3 per row, centered ---------- */
.grid-schools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.grid-schools .card-btn { align-items: center; text-align: center; min-height: 190px; padding: 22px 14px; }

/* ---------- Class cards (project page): big class name in the circle ---------- */
.grid-classes { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid-classes .card-btn { align-items: center; text-align: center; min-height: 160px; }
.grid-classes .card-badge { width: 72px; height: 72px; font-size: 1.6rem; }
/* a class icon (e.g. the mascot) instead of the class name: light circle with a colored ring */
.card-badge--icon { background: #fff4d6; box-shadow: inset 0 0 0 3px var(--accent); }
.card-badge--icon img { width: 78%; height: 78%; object-fit: contain; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; text-decoration: none; font-weight: 800;
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 999px;
  border: 0; font-family: inherit; font-size: 1rem;
}
.btn:hover { background: var(--accent-dark); }
.btn:focus-visible { outline: 4px solid #ffb703; outline-offset: 3px; }
.btn.disabled { background: #d9dfee; color: #55607d; cursor: not-allowed; }

/* ---------- Search and grade filters (school page) ---------- */
.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;
}
/* the search box takes the whole row; the grade filters always go on the next row */
.toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin: 0 0 10px; }
.search {
  width: 100%; min-width: 0; padding: 10px 18px; border-radius: 999px;
  border: 2px solid #d9dfee; background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 1rem; font-weight: 600;
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  font-family: inherit; font-size: 0.95rem; font-weight: 800; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  border: 2px solid var(--accent); background: var(--surface); color: var(--accent-dark);
}
.filter-btn:hover { background: #eef2fd; }
.filter-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.filter-count { opacity: 0.75; }
.search:focus-visible, .filter-btn:focus-visible { outline: 4px solid #ffb703; outline-offset: 2px; }
.result-count { margin: 0 0 12px; color: var(--muted); font-weight: 700; }

/* ---------- Project cards (school page) ---------- */
.grid { display: grid; gap: 16px; }
.grid-projects { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.project-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--hub-shadow);
  padding: 18px 20px; border-bottom: 8px solid var(--accent);
}
.project-head { display: flex; align-items: center; gap: 10px; }
.project-emoji { font-size: 1.9rem; line-height: 1; }
.project-icon { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.project-title { margin: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.25; }
.project-desc { margin: 0; color: var(--muted); font-weight: 600; }
.project-coordinators { margin: 0; font-size: 0.92rem; font-weight: 600; color: var(--muted); }
.project-label { font-weight: 800; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.chip { padding: 2px 10px; border-radius: 999px; background: #e8eefc; color: #2b4bb5; font-size: 0.85rem; font-weight: 800; }
.project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: auto; padding-top: 4px; }

/* ---------- Responsive, print ---------- */
@media (max-width: 760px) {             /* tablets and phones: one school per row, more compact */
  .grid-schools { grid-template-columns: 1fr; gap: 12px; }
  .grid-schools .card-btn { min-height: 150px; }
}
@media (max-width: 520px) {             /* phones: 2 classes per row */
  .grid-classes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-classes .card-btn { min-height: 130px; padding: 14px 8px; }
  .grid-classes .card-badge { width: 60px; height: 60px; font-size: 1.35rem; }
}
@media print {
  .toolbar { display: none; }
}
