/* ============================================
   Schools Page — Styles
   ============================================ */

/* ---- Schools Hero ---- */
.schools-hero {
  padding: var(--space-12) 0 var(--space-8);
  background: var(--color-bg);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-bottom: var(--space-6);
}
.back-link:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.schools-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.schools-hero-sub {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

.schools-stats {
  display: flex;
  gap: var(--space-6);
}

.schools-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Filter Bar ---- */
.schools-filter-bar {
  position: sticky;
  top: 56px;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-3) 0;
}

.schools-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.school-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.school-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition-interactive);
}
.school-filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.school-filter-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.rating-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.rating-dot.outstanding { background: #2e7d32; }
.rating-dot.good { background: #1565c0; }

.school-filter-pill.active .rating-dot.outstanding { background: rgba(255,255,255,0.8); }
.school-filter-pill.active .rating-dot.good { background: rgba(255,255,255,0.8); }

/* ---- Schools Grid ---- */
.schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: var(--space-4);
}

/* ---- School Card ---- */
.school-card {
  background: var(--color-surface);
  border: 1px solid oklch(from var(--color-text) l c h / 0.08);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.school-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.school-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.school-title-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.school-brandmark {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.school-brandmark-img {
  width: 76%;
  height: 76%;
  object-fit: contain;
}

.school-brandmark-fallback-text {
  display: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xs);
  color: var(--color-primary);
  letter-spacing: 0.04em;
}

.school-brandmark.brandmark-fallback .school-brandmark-img {
  display: none;
}

.school-brandmark.brandmark-fallback .school-brandmark-fallback-text {
  display: inline-flex;
}

.school-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.school-rating-tag {
  display: inline-flex;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.school-rating-tag.outstanding {
  background: #e8f5e9;
  color: #2e7d32;
}
.school-rating-tag.good {
  background: #e3f2fd;
  color: #1565c0;
}
[data-theme="dark"] .school-rating-tag.outstanding {
  background: #1b3a1e;
  color: #66bb6a;
}
[data-theme="dark"] .school-rating-tag.good {
  background: #0d2744;
  color: #64b5f6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .school-rating-tag.outstanding {
    background: #1b3a1e;
    color: #66bb6a;
  }
  :root:not([data-theme]) .school-rating-tag.good {
    background: #0d2744;
    color: #64b5f6;
  }
}

.school-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.school-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
}
.school-meta-tag svg {
  width: 12px;
  height: 12px;
}

.school-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.school-card.expanded .school-summary {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.school-highlights {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.school-highlights-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-faint);
}

.school-highlights-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.school-highlights-list li {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text-muted);
}

.school-card.expanded .school-highlights-list {
  gap: var(--space-2);
}

.school-expand-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
}
.school-expand-btn:hover {
  text-decoration: underline;
}

.school-detail-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.school-detail-row svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-text-faint);
}

.school-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.school-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.school-link:hover {
  text-decoration: underline;
}
.school-link svg {
  width: 14px;
  height: 14px;
}

.school-link.ofsted-link {
  color: var(--color-secondary);
}

/* ---- Rating Badge in Section Headers ---- */
.rating-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.outstanding-badge {
  background: #e8f5e9;
  color: #2e7d32;
}
.good-badge {
  background: #e3f2fd;
  color: #1565c0;
}
[data-theme="dark"] .outstanding-badge {
  background: #1b3a1e;
  color: #66bb6a;
}
[data-theme="dark"] .good-badge {
  background: #0d2744;
  color: #64b5f6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .outstanding-badge {
    background: #1b3a1e;
    color: #66bb6a;
  }
  :root:not([data-theme]) .good-badge {
    background: #0d2744;
    color: #64b5f6;
  }
}

/* ---- Section visibility for filters ---- */
.section.section-hidden {
  display: none;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .schools-grid {
    grid-template-columns: 1fr;
  }
  .schools-stats {
    gap: var(--space-4);
  }
  .schools-hero h1 {
    font-size: clamp(1.5rem, 1.2rem + 2vw, 2.5rem);
  }
}
