* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  background: #f7f9fb;
}

/* ── Hero ── */

.area-hero {
  position: relative;
  height: 340px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
}

.area-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.6) 100%);
}

.area-hero-inner {
  position: relative;
  z-index: 1;
  max-width: calc(1100px + 3rem);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.area-hero-inner h1 {
  margin: 0 0 0.4rem;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
}

.area-hero-inner p {
  margin: 0 0 1.1rem;
  font-size: 1rem;
  color: rgba(255,255,255,0.88);
}

.area-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.18s;
}

.area-hero-cta:hover { background: #1d4ed8; }

/* ── Intro copy ── */

.area-intro {
  background: #fff;
  border-bottom: 1px solid #e8edf2;
}

.area-intro-inner {
  max-width: calc(1100px + 3rem);
  margin: 0 auto;
  padding: 2rem 1.5rem 1.75rem;
}

.area-intro-inner p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #444;
}

.area-intro-inner p:last-child {
  margin-bottom: 0;
}

/* ── Why families ── */

.why-families {
  background: #fff;
  border-top: 1px solid #e8edf2;
  padding: 3rem 1.5rem;
}

.why-families-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.why-eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.why-eyebrow::before {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") no-repeat center;
}

.why-intro {
  margin: 0 0 2rem;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.why-card {
  border: 1px solid #e8edf2;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.why-card-top {
  padding: 1.25rem 1.25rem 1rem;
  flex: 1;
}

.why-icon {
  width: 44px;
  height: 44px;
  background: #eef4ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.why-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.why-card p {
  margin: 0;
  font-size: 0.82rem;
  color: #555;
  line-height: 1.55;
}

.why-card-photo {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #e8edf2;
}

.why-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.why-card:hover .why-card-photo img {
  transform: scale(1.04);
}

/* ── Section eyebrow (shared: "TOP SCHOOLS" etc.) ── */

.area-section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #2563eb;
}

.area-section-eyebrow svg {
  flex-shrink: 0;
}

/* ── Page layout ── */

.area-page {
  max-width: calc(1100px + 3rem);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.schools-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.data-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

/* ── Cards ── */

.content-card {
  background: #fff;
  border: 1px solid #e8edf2;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.content-card:last-child { margin-bottom: 0; }

.content-card h2 {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

/* ── Schools table ── */

.schools-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.schools-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0.5rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.schools-table th:last-child { text-align: right; }

.schools-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #f8f8f8;
  vertical-align: middle;
}

.schools-table tr:last-child td { border-bottom: none; }

.schools-table td:last-child { text-align: right; }

.school-link {
  color: #0065bd;
  text-decoration: none;
  font-weight: 600;
}

.school-link:hover { text-decoration: underline; }

.school-la {
  font-size: 0.75rem;
  color: #888;
  margin-top: 1px;
}

.rank-num {
  color: #bbb;
  font-size: 0.75rem;
  font-weight: 700;
  width: 1.5rem;
}

.medal {
  font-size: 1.15rem;
  line-height: 1;
}

/* Rating pills (reuse school-page styles) */
.rpill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
  white-space: nowrap;
}
.rpill--excellent, .rpill--very-good, .rpill--good { background:#dcfce7; color:#15803d; }
.rpill--satisfactory, .rpill--weak              { background:#fef9c3; color:#854d0e; }
.rpill--unsatisfactory                           { background:#fee2e2; color:#b91c1c; }

/* ── Property prices ── */

.price-rows { display: flex; flex-direction: column; gap: 0.6rem; }

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
}

.price-type { color: #555; }

.price-val {
  font-weight: 700;
  color: #1a1a1a;
}

.price-vs-scot {
  font-size: 0.72rem;
  color: #888;
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #f0f0f0;
}

/* ── Crime ── */

.crime-rows { display: flex; flex-direction: column; gap: 0; }

.crime-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 0.83rem;
}

.crime-row:last-child { border-bottom: none; }

.crime-label { color: #444; }

.crime-figures {
  text-align: right;
}

.crime-count {
  font-weight: 700;
  color: #1a1a1a;
  font-size: 0.83rem;
}

.crime-rate {
  font-size: 0.71rem;
  color: #888;
}

.crime-source {
  font-size: 0.71rem;
  color: #aaa;
  margin-top: 0.75rem;
}

/* ── Local authority cards ── */

.la-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.la-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
  background: #f8fafc;
  border: 1px solid #e8edf2;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.la-card:hover {
  background: #eef4ff;
  border-color: #bcd3f5;
}

.la-card-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a1a1a;
}

.la-card-count {
  font-size: 0.75rem;
  color: #888;
}

.la-card-arrow {
  margin-top: auto;
  font-size: 0.75rem;
  color: #2563eb;
  font-weight: 600;
}

/* ── Responsive ── */

@media (max-width: 860px) {
  .schools-row { grid-template-columns: 1fr; }
  .data-row { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .why-eyebrow { white-space: normal; }
}

@media (max-width: 720px) {
  .area-hero { height: 260px; }
  .area-hero-inner h1 { font-size: 1.6rem; }
  .la-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .why-grid { grid-template-columns: 1fr; }
  .la-grid { grid-template-columns: 1fr; }
  .area-hero-inner h1 { font-size: 1.35rem; }
}
