/* school-template.css — shared stylesheet for the dynamic school page.
   --brand is set per-school by school.js after the Supabase fetch. */

:root { --brand: #333; }

* { box-sizing: border-box; }

body {
  font-family: 'Oswald', sans-serif;
  margin: 0;
  background: #fafafa;
}

/* ── Nav ── */
.container { display: grid; grid-template-columns: 1fr; }

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 38px;
  background-size: cover;
  background-position: center;
  min-height: 120px;
}

.nav-wrapper > .left-side { display: flex; }

.nav-link-wrapper {
  height: 22px;
  margin-right: 20px;
  border-bottom: 1px solid transparent;
  transition: border-bottom 0.5s;
}
.nav-link-wrapper a { color: white; text-decoration: none; text-transform: uppercase; font-size: 0.9em; }
.nav-link-wrapper:hover { border-bottom: 1px solid white; }

.brand { color: white; font-size: 0.9em; }

/* ── Stat Cards ── */
.flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

.card {
  display: grid;
  grid-template-columns: 300px;
  grid-template-rows: 210px 180px 80px;
  grid-template-areas: "image" "text" "stats";
  border-radius: 18px;
  background: white;
  box-shadow: 5px 5px 15px rgba(0,0,0,0.25);
  text-align: center;
  transition: 0.3s ease;
  cursor: default;
  margin: 30px;
}
.card:hover { transform: scale(1.05); box-shadow: 5px 5px 20px rgba(0,0,0,0.35); }

.card-image {
  grid-area: image;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  background: linear-gradient(145deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #000));
  background-size: cover;
}

.card-text { grid-area: text; margin: 25px; }
.card-text p { color: grey; font-size: 40px; margin: -15px 0 0; font-weight: 300; }
.card-text h2 { margin-top: 0; font-size: 28px; }

.card-stats {
  grid-area: stats;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  background: var(--brand);
}
.card-stats .stat {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
}
.card-stats .border {
  border-left: 1px solid rgba(255,255,255,0.3);
  border-right: 1px solid rgba(255,255,255,0.3);
}
.card-stats .value { font-size: 20px; font-weight: 500; }
.card-stats .type { font-size: 12px; font-weight: 300; text-transform: uppercase; }

/* ── Section headings ── */
.info {
  font-size: 25px;
  margin: 20px 0 -10px 220px;
}

/* ── Fast Facts grid ── */
.facts {
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  margin: 10px 0 20px 220px;
  font-size: 20px;
  font-weight: 200;
  color: #444;
  max-width: 680px;
}
.facts .line {
  padding: 4px 0;
  border-bottom: 1px solid #ddd;
  width: 330px;
}
.facts .line .label { color: black; font-weight: 400; }

/* ── Tables (shared structure) ── */
.tbl-wrap {
  margin: 10px 220px 24px;
}

.tbl {
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9em;
  min-width: 400px;
  border-radius: 5px 5px 0 0;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0,0,0,0.12);
  width: 100%;
}
.tbl thead tr { background-color: var(--brand); color: white; text-align: left; font-weight: bold; }
.tbl th, .tbl td { padding: 12px 15px; word-wrap: break-word; }
.tbl tbody tr { border-bottom: 1px solid #ddd; }
.tbl tbody tr:nth-of-type(even) { background-color: #f3f3f3; }
.tbl tbody tr:last-of-type { border-bottom: 2px solid var(--brand); }

/* ── Not-available placeholder paragraphs ── */
.no-data { margin-left: 220px; color: #aaa; font-style: italic; }

/* ── Loading / error states ── */
.loading {
  text-align: center;
  padding: 80px;
  font-size: 1.4em;
  color: #888;
}
.not-available { color: #aaa; font-style: italic; }

/* ── Floating back button (mobile only) ── */
.floating-back {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.82);
  color: white;
  padding: 14px 22px;
  border-radius: 0;
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
  z-index: 9999;
  box-shadow: 2px -2px 10px rgba(0,0,0,0.25);
  transition: background 0.15s;
}
.floating-back:active { background: #000; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .info { margin-left: 16px; }
  .facts { margin-left: 16px; max-width: calc(100% - 32px); }
  .facts .line { width: auto; }
  .tbl-wrap { margin: 10px 16px 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 0; table-layout: auto; width: 100%; }
  .tbl th, .tbl td { padding: 8px 10px; }
  .no-data { margin-left: 16px; }
  .flex { flex-direction: column; align-items: center; }
  .nav-wrapper { padding: 20px 16px; flex-wrap: wrap; gap: 8px; }
}

@media (max-width: 768px) {
  .floating-back { display: block; }
  .card { grid-template-columns: 280px; }
}
