/* UK subject and county pages: /all-subjects.asp, /all-subjects/<category>/,
   /locations/county/ and /locations/county/<county>/, linked by
   includes/subjects-uk.inc. Everything is scoped to .sj so the shared header, menu
   and footer stay as they are. The colours match css/home.css, and the Figtree
   @font-face is in css/topmenu.css, which every UK page loads. */

.sj
{
  --sj-navy: #1f3350;
  --sj-ink: #2a3a52;
  --sj-slate: #56657b;
  --sj-blue: #3a68ae;
  --sj-tint: #f0f4fb;
  --sj-line: #dbe4f1;
  --sj-lime: #a9d622;
  --sj-lime-dark: #98c31a;
  --sj-shadow: 0 14px 32px rgba(31, 51, 80, .13);
  /* Brand blue panel (was navy until 2026-11-08). Navy stays for text only. */
  --sj-surface: radial-gradient(520px 260px at 100% 0%, rgba(160, 195, 245, .38), transparent 65%), linear-gradient(110deg, #3a68ae 0%, #4170b8 100%);

  background: #fff;
  color: var(--sj-ink);
  font-family: "Figtree", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.sj *, .sj *:before, .sj *:after
{
  box-sizing: border-box;
}

.sj [hidden]
{
  display: none !important;
}

.sj h1, .sj h2, .sj h3
{
  margin: 0;
  color: var(--sj-navy);
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.sj h1
{
  font-size: clamp(34px, 3.7vw, 50px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.022em;
}

.sj h2
{
  font-size: clamp(23px, 2.1vw, 28px);
  line-height: 1.2;
  letter-spacing: -.01em;
}

/* :where keeps these below the single-class rules further down. */
:where(.sj) p, :where(.sj) ul, :where(.sj) li
{
  margin: 0;
  padding: 0;
  color: inherit;
  list-style: none;
}

.sj a
{
  color: var(--sj-blue);
  text-decoration: none;
}

.sj a:hover, .sj a:focus
{
  color: var(--sj-navy);
}

.sj a:focus-visible, .sj input:focus-visible
{
  outline: 3px solid var(--sj-blue);
  outline-offset: 2px;
}

.sj b
{
  font-weight: 600;
}

/* Read out, not shown. It keeps the link text "Maths Tutors" on the cards. */
.sj-sr, .sj-cat__list .sj-word, .sj-pops .sj-word
{
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero. The photo comes first in the markup, so it sits on top on a phone. This
   must stay a plain block: the shared menu's items hang below the blue bar, and a
   new formatting context here would be squeezed beside them. z-index keeps it under
   the menu's dropdowns. */
.sj-hero
{
  position: relative;
  z-index: 0;
  background: var(--sj-tint);
}

/* The photo melts into the hero's tint instead of stopping at a hard line: at the
   bottom on a phone, on the left on a wide screen. */
.sj-hero__photo
{
  overflow: hidden;
  height: clamp(150px, 40vw, 280px);
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}

.sj-hero__photo img
{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sj-hero__inner
{
  position: relative;
  z-index: 1;
  padding-top: 18px;
  padding-bottom: 28px;
}

.sj-hero--plain .sj-hero__inner
{
  padding-top: 26px;
}

.sj-crumbs
{
  margin-bottom: 12px;
  color: var(--sj-slate);
  font-size: 14px;
}

.sj-crumbs a, .sj-crumbs span
{
  color: var(--sj-slate);
}

.sj-crumbs a:hover
{
  color: var(--sj-navy);
  text-decoration: underline;
}

.sj-crumbs a + a:before, .sj-crumbs a + span:before
{
  content: "/";
  display: inline-block;
  margin: 0 8px;
  color: #9aa8bb;
  text-decoration: none;
}

.sj-hero__lead
{
  margin-top: 12px;
  color: var(--sj-ink);
  font-size: clamp(16px, 1.35vw, 18px);
  line-height: 1.45;
  text-wrap: pretty;
}

.sj-filter
{
  position: relative;
  display: block;
  margin: 20px 0 0;
  font-weight: 400;
}

.sj-filter svg
{
  position: absolute;
  top: 50%;
  left: 18px;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  fill: none;
  stroke: var(--sj-slate);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.sj-filter input
{
  display: block;
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0 18px 0 48px;
  border: 1px solid var(--sj-line);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 51, 80, .08);
  color: var(--sj-navy);
  font: inherit;
  font-size: 17px;
  -webkit-appearance: none;
  appearance: none;
}

.sj-filter input::placeholder
{
  color: var(--sj-slate);
  opacity: 1;
}

/* Category tabs */
.sj-tabs
{
  border-bottom: 1px solid var(--sj-line);
  background: #fff;
}

.sj-tabs ul
{
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}

.sj-tabs ul::-webkit-scrollbar
{
  display: none;
}

.sj-tabs a
{
  display: block;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--sj-ink);
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color .15s;
}

.sj-tabs a:hover, .sj-tabs a:focus
{
  background: var(--sj-tint);
  color: var(--sj-navy);
}

.sj-tabs a[aria-current]
{
  background: var(--sj-blue);
  color: #fff;
}

/* Sections */
.sj-section
{
  padding: 40px 0;
}

.sj-section--tint
{
  background: var(--sj-tint);
}

.sj-section--tint + .sj-section--tint
{
  padding-top: 0;
}

.sj-section--end
{
  padding-bottom: 56px;
}

.sj-head
{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.sj-status
{
  flex: none;
  color: var(--sj-slate);
  font-size: 15px;
}

/* Most popular cards */
.sj-pops
{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.sj-pops li
{
  position: relative;
}

.sj-pops a
{
  position: relative;
  display: block;
  height: 100%;
  min-height: 92px;
  padding: 16px 44px 38px 18px;
  border: 1px solid var(--sj-line);
  border-radius: 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.sj-pops a:after
{
  content: "";
  position: absolute;
  top: 21px;
  right: 20px;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--sj-blue);
  border-right: 2px solid var(--sj-blue);
  transform: rotate(45deg);
  transition: transform .15s;
}

.sj-pops a:hover, .sj-pops a:focus
{
  border-color: #b9cae4;
  box-shadow: var(--sj-shadow);
}

.sj-pops b
{
  display: block;
  color: var(--sj-navy);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.sj-pops .sj-count
{
  position: absolute;
  bottom: 14px;
  left: 19px;
  color: var(--sj-slate);
  font-size: 14px;
  pointer-events: none;
}

/* A to Z list */
.sj-list
{
  margin-top: 18px;
  padding: 8px;
  border: 1px solid var(--sj-line);
  border-radius: 16px;
  background: #fff;
}

.sj-list li, .sj-cat__list li
{
  position: relative;
  break-inside: avoid;
}

.sj-list a, .sj-cat__list a
{
  display: block;
  padding: 9px 66px 9px 12px;
  border-radius: 8px;
  color: var(--sj-slate);
  line-height: 1.3;
  transition: background-color .15s;
}

.sj-list a:hover, .sj-list a:focus, .sj-cat__list a:hover, .sj-cat__list a:focus
{
  background: var(--sj-tint);
  color: var(--sj-slate);
}

/* Room for a count with a word after it, such as "134 tutors". */
.sj-list--labels a
{
  padding-right: 100px;
}

.sj-list b, .sj-cat__list b
{
  color: var(--sj-navy);
}

.sj-list a:hover b, .sj-cat__list a:hover b
{
  color: var(--sj-blue);
}

.sj-list .sj-count, .sj-cat__list .sj-count
{
  position: absolute;
  top: 9px;
  right: 12px;
  color: var(--sj-slate);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: none;
}

.sj-none
{
  margin-top: 16px;
  font-size: 17px;
}

/* Category cards */
.sj-cats
{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.sj-cat
{
  display: flex;
  overflow: hidden;
  border: 1px solid var(--sj-line);
  border-radius: 16px;
  background: #fff;
}

.sj-cat__photo
{
  display: block;
  overflow: hidden;
  flex: none;
  width: 104px;
}

.sj-cat__photo img
{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sj-cat__body
{
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px;
}

.sj h3
{
  font-size: 20px;
  line-height: 1.2;
}

.sj h3 a
{
  color: var(--sj-navy);
}

.sj h3 a:hover
{
  color: var(--sj-blue);
}

.sj-cat__meta
{
  margin-top: 2px;
  color: var(--sj-slate);
  font-size: 14px;
}

.sj-cat__list
{
  display: none;
}

.sj-more
{
  margin-top: 8px;
  font-weight: 700;
}

.sj-more:after
{
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  vertical-align: 1px;
  transform: rotate(45deg);
}

/* All subjects page: shown in place of the sections above while searching. */
.sj-results
{
  display: none;
}

.sj--searching .sj-results
{
  display: block;
  padding-top: 40px;
}

.sj--searching .sj-browse
{
  display: none;
}

/* Closing panel */
.sj-cta
{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 28px 24px;
  border-radius: 20px;
  background: var(--sj-surface);
  color: #f3f7fc;
}

.sj-cta h2
{
  color: #fff;
}

.sj-cta p
{
  margin-top: 6px;
  color: #f3f7fc;
}

.sj-cta ul
{
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 12px;
  font-size: 15px;
}

.sj-cta .icon
{
  flex: none;
  width: 17px;
  height: 17px;
  margin: -2px 8px 0 0;
  fill: var(--sj-lime);
}

.sj a.sj-btn
{
  display: inline-block;
  flex: none;
  padding: 13px 30px;
  border-radius: 999px;
  background: var(--sj-lime);
  color: var(--sj-navy);
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color .15s;
}

.sj a.sj-btn:hover, .sj a.sj-btn:focus
{
  background: var(--sj-lime-dark);
  color: var(--sj-navy);
}

@media (min-width: 600px)
{
  .sj-list
  {
    columns: 2;
    column-gap: 12px;
  }

  .sj-cats
  {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sj-cta
  {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 32px 36px;
  }
}

@media (min-width: 768px)
{
  .sj-pops
  {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .sj-pops--wide
  {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sj-section
  {
    padding: 48px 0;
  }

  .sj-section--tint + .sj-section--tint
  {
    padding-top: 0;
  }

  .sj-section--end
  {
    padding-bottom: 64px;
  }
}

@media (min-width: 992px)
{
  /* Fills the top right of the hero, flush with the menu and the screen edge. */
  .sj-hero__photo
  {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: calc(50% - 30px);
    height: auto;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 34%);
    mask-image: linear-gradient(to right, transparent, #000 34%);
  }

  .sj-hero__inner
  {
    padding-top: 0;
    padding-bottom: 0;
  }

  .sj-hero__copy
  {
    width: calc(50% - 40px);
    min-height: 330px;
    padding-top: 30px;
    padding-bottom: 38px;
  }

  /* No photo (county pages): the copy takes a readable width instead of half. */
  .sj-hero--plain .sj-hero__copy
  {
    width: auto;
    max-width: 720px;
    min-height: 0;
    padding-top: 34px;
    padding-bottom: 46px;
  }

  .sj-hero--plain .sj-filter
  {
    max-width: 560px;
  }

  .sj-list
  {
    columns: 3;
  }

  .sj-cats
  {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .sj-cat
  {
    flex-direction: column;
  }

  .sj-cat__photo
  {
    width: auto;
    height: 148px;
  }

  .sj-cat__body
  {
    padding: 16px 18px;
  }

  /* The rows hover wider than the text, so the text lines up with the heading. */
  .sj-cat__list
  {
    display: block;
    flex: 1;
    margin: 8px -8px 0;
  }

  .sj-cat__list a
  {
    padding: 7px 56px 7px 8px;
    font-size: 15px;
  }

  .sj-cat__list .sj-count
  {
    top: 7px;
    right: 8px;
  }

  .sj-more
  {
    margin-top: 10px;
  }
}

/* Photos fade in once loaded: the img's onload adds .is-in. They only start hidden
   where scripts run, so a browser without scripts (or without this media query)
   just shows them. Same timings as the homepage hero. */
@keyframes sj-fade
{
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sj-settle
{
  from { transform: scale(1.08); }
  to { transform: none; }
}

@media (scripting: enabled)
{
  .sj-hero__photo img, .sj-cat__photo img
  {
    opacity: 0;
  }

  .sj-hero__photo.is-in img, .sj-cat__photo.is-in img
  {
    animation: sj-fade .9s ease-out both;
  }
}

@media (scripting: enabled) and (prefers-reduced-motion: no-preference)
{
  .sj-hero__photo.is-in img
  {
    animation: sj-fade .9s ease-out both, sj-settle 2.4s cubic-bezier(.2, .7, .2, 1) both;
  }
}

@media (prefers-reduced-motion: no-preference)
{
  .sj-pops a:hover, .sj-pops a:focus
  {
    transform: translateY(-2px);
  }

  .sj-cat__photo img
  {
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
  }

  .sj-cat:hover .sj-cat__photo img
  {
    transform: scale(1.05);
  }

  .sj-pops a:hover:after, .sj-pops a:focus:after
  {
    transform: translateX(3px) rotate(45deg);
  }
}

@media print
{
  .sj-hero__photo, .sj-filter, .sj-tabs, .sj-cta
  {
    display: none;
  }
}

/* ---------- /locations/ and the London region pages (lc) ----------
   locations/default.asp and locations/london/pick-london-loc.asp. Their text,
   links and headings are the old pages' own (SEO pages), only laid out anew. */
.lc-intro p
{
  margin-top: 12px;
  color: var(--sj-ink);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.55;
}

.lc-all
{
  margin-top: 24px;
  color: var(--sj-slate);
  font-size: 15px;
}

.lc-all p
{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0;
}

.sj .lc-all a
{
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  background: var(--sj-lime);
  color: var(--sj-navy);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: background-color .15s;
}

.sj .lc-all a:hover, .sj .lc-all a:focus
{
  background: var(--sj-lime-dark);
  color: var(--sj-navy);
}

.lc-regions
{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}

/* London region pages: no heading above the list, so no gap either */
.sj-section.lc-areas-wrap
{
  padding-top: 4px;
}

.lc-areas-wrap .sj-list.lc-areas
{
  margin-top: 0;
}

.lc-region
{
  padding: 22px 24px 18px;
  border: 1px solid var(--sj-line);
  border-radius: 18px;
  background: #fff;
}

.sj .lc-region h2
{
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.sj .lc-region h2 ~ h2
{
  margin-top: 22px;
}

.sj .lc-region ul
{
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 16px;
}

.sj .lc-region li
{
  margin: 0;
  padding: 0;
  list-style: none;
  break-inside: avoid;
}

.sj .lc-region a
{
  display: block;
  margin: 0 -8px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--sj-ink);
  font-weight: 600;
  line-height: 1.3;
  transition: background-color .15s, color .15s;
}

.sj .lc-region a:hover, .sj .lc-region a:focus
{
  background: var(--sj-tint);
  color: var(--sj-blue);
}

/* London region pages: the other regions as pills, the current one filled */
.lc-others
{
  margin-top: 18px;
}

.sj .lc-others__label
{
  color: var(--sj-ink);
  font-size: 15px;
  font-weight: 700;
}

.lc-others ul
{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.sj .lc-others a
{
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--sj-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sj-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  transition: border-color .15s, color .15s;
}

.sj .lc-others a:hover, .sj .lc-others a:focus
{
  border-color: var(--sj-blue);
  color: var(--sj-blue);
}

.sj .lc-others a[aria-current]
{
  border-color: var(--sj-blue);
  background: var(--sj-blue);
  color: #fff;
}

.sj .lc-areas a
{
  padding-right: 12px;
  color: var(--sj-ink);
  font-weight: 600;
}

@media (min-width: 640px)
{
  .lc-regions
  {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lc-region--london
  {
    grid-column: 1 / -1;
  }

  .sj .lc-region--london ul
  {
    columns: 3;
  }
}

@media (min-width: 992px)
{
  .lc-regions
  {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sj .lc-region--london ul
  {
    columns: 5;
  }
}

@media (min-width: 1200px)
{
  .sj-list.lc-areas
  {
    columns: 4;
  }
}

/* Subject-county pages (default-subloc.asp, pick-county-subloc.asp): the old
   "(12)" counts, kept as they were, sit at the right of each row */
.sj .sj-list .counter
{
  position: absolute;
  top: 9px;
  right: 12px;
  display: inline;
  float: none;
  margin: 0;
  padding: 0;
  color: var(--sj-slate);
  font-size: 14px;
  line-height: 1.45;
  pointer-events: none;
}

.sj .lc-areas.sj-list--labels a
{
  padding-right: 64px;
}

/* County list for one subject (default-subloc.asp): "144 areas" as a soft badge */
.sj .lc-counties .sj-count
{
  top: 8px;
  right: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sj-tint);
  color: var(--sj-slate);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  transition: background-color .15s, color .15s;
}

.sj .lc-counties li:hover .sj-count
{
  background: #fff;
  color: var(--sj-blue);
}

.sj .lc-counties.sj-list--labels a
{
  padding-right: 104px;
}
