/* UK search page (tutor-search.asp), from includes/tutor-search-uk.inc. Builds on
   css/subjects.css (the .sj tokens, sections and closing panel), but has its own
   brand blue hero so the search form stands out from the subject and county pages.
   The site's own form styles reach every input, label, fieldset and legend, so the
   rules here are scoped under .sj.

   Layout: the search card on the left, the heading and reassurance on the right
   (stacked below 992px, heading first). Every choice in the card is a group of radio buttons
   drawn as tabs, chips or a switch. */

/* Hero. It 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. The glows and dots are background only. */
.ts-hero
{
  position: relative;
  z-index: 0;
  padding: 18px 0 36px;
  background:
    radial-gradient(900px 420px at 88% -12%, rgba(160, 195, 245, .45), transparent 62%),
    radial-gradient(700px 360px at -5% 112%, rgba(169, 214, 34, .12), transparent 60%),
    linear-gradient(180deg, #3a68ae, #4170b8);
  color: #f3f7fc;
}

/* A field of faint dots behind the heading, fading out towards the card. On a
   wide screen it moves to the right with the heading. */
.ts-hero:before
{
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, .22) 1.2px, transparent 1.3px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(100deg, #000 0%, transparent 52%);
  mask-image: linear-gradient(100deg, #000 0%, transparent 52%);
  pointer-events: none;
}

.ts-hero .sj-crumbs a, .ts-hero .sj-crumbs span
{
  color: #f3f7fc;
}

.ts-hero .sj-crumbs a:hover
{
  color: #fff;
}

.ts-hero .sj-crumbs a + span:before
{
  color: rgba(255, 255, 255, .6);
}

.ts-hero__copy
{
  margin-top: 6px;
}

.sj .ts-hero h1
{
  color: #fff;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -.028em;
}

/* The lime stroke under one word of the heading. It is drawn behind the word and
   takes up no room. */
.ts-mark
{
  position: relative;
  z-index: 0;
  white-space: nowrap;
}

.ts-mark:before
{
  content: "";
  position: absolute;
  top: 78%;
  right: -.04em;
  bottom: 2%;
  left: -.04em;
  z-index: -1;
  border-radius: 999px;
  background: var(--sj-lime);
  transform: rotate(-1deg);
}

.ts-hero__lead
{
  max-width: 520px;
  margin-top: 16px;
  color: #f3f7fc;
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.45;
  text-wrap: pretty;
}

.ts-hero__extra
{
  margin-top: 22px;
}

.ts-points
{
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  color: #f3f7fc;
  font-size: 15.5px;
  font-weight: 500;
}

.ts-points li
{
  display: flex;
  align-items: center;
}

.ts-points .icon
{
  flex: none;
  width: 19px;
  height: 19px;
  margin-right: 9px;
  fill: var(--sj-lime);
}

/* The search card --------------------------------------------------------- */

.sj .ts-search
{
  margin: 22px 0 0;
  color: var(--sj-ink);
}

.sj .ts-search fieldset
{
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Tutor / tutoring jobs: two tabs on the card's top edge, starting at its left
   corner. The card has no curve under them (see .ts-card), so the open tab and
   the card read as one shape. */
.sj .ts-search .ts-kind
{
  display: flex;
  gap: 6px;
}

.sj .ts-kind label, .sj .ts-chipset label, .sj .ts-mode label
{
  position: relative;
  display: block;
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
  font-weight: 400;
  text-transform: none;
  cursor: pointer;
}

/* The radio button covers its label, unseen, so the whole shape can be clicked
   and the keyboard still reaches it. */
.sj .ts-kind input, .sj .ts-chipset input, .sj .ts-mode input
{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.ts-kind label
{
  flex: 1 1 0;
  min-width: 0;
}

.ts-kind span
{
  display: block;
  padding: 12px 10px 11px;
  border-radius: 14px 14px 0 0;
  background: rgba(255, 255, 255, .17);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}

.ts-kind label:hover span
{
  background: rgba(255, 255, 255, .28);
}

.ts-kind input:checked + span
{
  background: #fff;
  color: var(--sj-navy);
}

.ts-kind input:focus-visible + span
{
  outline: 3px solid #fff;
  outline-offset: -5px;
}

.ts-kind input:checked:focus-visible + span
{
  outline-color: var(--sj-blue);
}

/* On a phone the two tabs span the card, so both top corners are square. */
.ts-card
{
  padding: 20px 18px 20px;
  border-radius: 0 0 22px 22px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(6, 16, 34, .34), 0 2px 6px rgba(6, 16, 34, .12);
}

.sj .ts-field label, .sj .ts-group legend
{
  display: block;
  float: none;
  width: auto;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  color: var(--sj-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
}

.sj .ts-search .ts-group
{
  margin-top: 20px;
}

.ts-input
{
  position: relative;
}

.ts-input svg
{
  position: absolute;
  top: 50%;
  left: 18px;
  width: 21px;
  height: 21px;
  margin-top: -10.5px;
  fill: none;
  stroke: var(--sj-slate);
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}

.sj .ts-field input
{
  display: block;
  width: 100%;
  height: 58px;
  margin: 0;
  padding: 0 18px;
  border: 1.5px solid #c6d3e5;
  border-radius: 14px;
  background-color: #fff;
  box-shadow: none;
  color: var(--sj-navy);
  font-family: inherit;
  font-size: 17.5px;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color .15s, box-shadow .15s;
}

.sj .ts-input input
{
  padding-left: 50px;
}

.sj .ts-field input::placeholder
{
  color: #7a879a;
  font-weight: 400;
  opacity: 1;
}

.sj .ts-field input:hover
{
  border-color: #9fb3cf;
}

.sj .ts-field input:focus
{
  border-color: var(--sj-blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(58, 104, 174, .16);
}

.sj .ts-field [aria-invalid="true"]
{
  border-color: #c4372c;
}

/* Shortcuts under the subject box. */
.ts-picks
{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: var(--sj-slate);
  font-size: 14px;
}

.ts-picks span
{
  margin-right: 2px;
}

.sj .ts-picks button
{
  margin: 0;
  padding: 4px 11px;
  border: 1px solid var(--sj-line);
  border-radius: 999px;
  background: var(--sj-tint);
  color: var(--sj-blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: none;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}

.sj .ts-picks button:hover
{
  border-color: var(--sj-blue);
  background: #fff;
}

.sj .ts-picks button:focus-visible
{
  outline: 3px solid var(--sj-blue);
  outline-offset: 2px;
}

/* Level: one chip each. */
.ts-chipset
{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ts-chipset span
{
  display: block;
  padding: 8px 15px;
  border: 1.5px solid #c6d3e5;
  border-radius: 999px;
  background: #fff;
  color: var(--sj-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}

.ts-chipset label:hover span
{
  border-color: var(--sj-blue);
}

.ts-chipset input:checked + span
{
  border-color: var(--sj-blue);
  background: var(--sj-blue);
  color: #fff;
}

.ts-chipset input:focus-visible + span, .ts-mode input:focus-visible + span
{
  outline: 3px solid var(--sj-blue);
  outline-offset: 2px;
}

/* Lessons: an Online / In-person switch, with the postcode beside it. */
.ts-where
{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.sj .ts-mode
{
  display: inline-flex;
  flex: none;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--sj-tint);
}

.ts-mode span
{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  color: var(--sj-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}

.ts-mode svg
{
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ts-mode input:checked + span
{
  background: var(--sj-blue);
  color: #fff;
}

.ts-field--postcode
{
  flex: 1 1 150px;
  min-width: 0;
}

.sj .ts-field--postcode input
{
  height: 50px;
  text-transform: uppercase;
}

.sj .ts-field--postcode input::placeholder
{
  text-transform: none;
}

/* The postcode only matters for in-person lessons. Browsers without :has() just
   keep showing it, which is harmless. */
.ts-search:has(input[value="online"]:checked) .ts-field--postcode
{
  display: none;
}

.ts-error
{
  margin-top: 8px;
  color: #b42318;
  font-size: 14px;
  line-height: 1.4;
}

.sj .ts-go
{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 60px;
  margin: 22px 0 0;
  padding: 0 34px;
  border: 0;
  border-radius: 999px;
  background: var(--sj-lime);
  box-shadow: 0 6px 16px rgba(152, 195, 26, .35);
  color: var(--sj-navy);
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  transition: background-color .15s, box-shadow .15s;
}

.sj .ts-go:hover, .sj .ts-go:focus
{
  background: var(--sj-lime-dark);
  box-shadow: 0 8px 20px rgba(152, 195, 26, .45);
}

.sj .ts-go:focus-visible
{
  outline: 3px solid var(--sj-blue);
  outline-offset: 2px;
}

.ts-go svg
{
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* Quick picks below: subjects and places as buttons, side by side on a wide screen */
.ts-browse__grid
{
  display: grid;
  gap: 40px;
}

.sj a.ts-all
{
  flex: none;
  font-weight: 600;
}

.ts-chips
{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

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

.sj .ts-chips a:hover, .sj .ts-chips a:focus
{
  border-color: var(--sj-blue);
  background: var(--sj-tint);
  color: var(--sj-blue);
}

/* Closing panel, light so it doesn't compete with the blue hero */
.sj-cta.ts-tutor
{
  border: 1px solid var(--sj-line);
  background: #fff;
  color: var(--sj-ink);
}

.sj-cta.ts-tutor h2
{
  color: var(--sj-navy);
}

.sj-cta.ts-tutor p
{
  color: var(--sj-ink);
}

.ts-tutor__actions
{
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 10px;
}

.sj a.sj-btn.ts-btn-line
{
  background: none;
  box-shadow: inset 0 0 0 2px var(--sj-blue);
  color: var(--sj-blue);
}

.sj a.sj-btn.ts-btn-line:hover, .sj a.sj-btn.ts-btn-line:focus
{
  background: var(--sj-blue);
  color: #fff;
}

/* The subject suggestions from jQuery UI, attached to the end of the page. */
.ui-autocomplete.ui-menu
{
  z-index: 60;
  max-height: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #dbe4f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(31, 51, 80, .16);
  font-family: "Figtree", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
}

.ui-autocomplete .ui-menu-item-wrapper
{
  margin: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  color: #2a3a52;
  line-height: 1.3;
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active
{
  margin: 0;
  border: 0;
  background: #f0f4fb;
  color: #1f3350;
}

@media (max-width: 420px)
{
  .ts-kind span
  {
    padding-right: 4px;
    padding-left: 4px;
    font-size: 14.5px;
  }

  .ts-mode span
  {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (min-width: 768px)
{
  .ts-hero
  {
    padding: 22px 0 52px;
  }

  .sj .ts-search
  {
    margin-top: 28px;
  }

  .ts-kind label
  {
    flex: 0 1 auto;
  }

  .ts-kind span
  {
    padding-right: 22px;
    padding-left: 22px;
  }

  /* The tabs no longer reach the right-hand corner, so that one is round again. */
  .ts-card
  {
    padding: 26px 28px 28px;
    border-top-right-radius: 22px;
  }

  .sj .ts-search .ts-group
  {
    margin-top: 22px;
  }
}

@media (min-width: 992px)
{
  .ts-browse__grid
  {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px;
  }

  .sj-cta.ts-tutor
  {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Side by side: the card takes the left column, and the heading and the
   reassurance share the right one, centred against it. The glows and dots move
   over with the card, so the text stays on the plain blue. */
@media (min-width: 992px)
{
  .ts-hero
  {
    padding: 22px 0 60px;
    background:
      radial-gradient(900px 420px at 12% -12%, rgba(160, 195, 245, .45), transparent 62%),
      radial-gradient(700px 360px at 105% 112%, rgba(169, 214, 34, .12), transparent 60%),
      linear-gradient(180deg, #3a68ae, #4170b8);
  }

  .ts-hero:before
  {
    -webkit-mask-image: linear-gradient(260deg, #000 0%, transparent 52%);
    mask-image: linear-gradient(260deg, #000 0%, transparent 52%);
  }

  .ts-hero__grid
  {
    display: grid;
    grid-template-columns: minmax(0, 470px) minmax(0, 1fr);
    grid-template-areas: "form copy" "form extra";
    column-gap: 40px;
    margin-top: 26px;
  }

  .ts-hero__copy
  {
    grid-area: copy;
    align-self: end;
    margin-top: 0;
  }

  .ts-hero__extra
  {
    grid-area: extra;
    align-self: start;
    margin-top: 26px;
  }

  .sj .ts-search
  {
    grid-area: form;
    align-self: center;
    margin-top: 0;
  }

  .ts-points
  {
    flex-direction: column;
    gap: 11px;
    font-size: 17px;
  }
}

@media (min-width: 1200px)
{
  .ts-hero
  {
    padding-bottom: 68px;
  }

  .ts-hero__grid
  {
    grid-template-columns: minmax(0, 580px) minmax(0, 1fr);
    column-gap: 64px;
  }
}

@media print
{
  .ts-search, .ts-points
  {
    display: none;
  }

  .ts-hero
  {
    background: none;
    color: inherit;
  }

  .ts-hero:before
  {
    content: none;
  }
}
