/* Watton Medical Practice.
   NHS.UK design system colours and patterns, set in Public Sans.
   The tokens below are the YAML front matter of /DESIGN.md. Change them there first. */

/* Self hosted. Nothing on this site calls a third party font service. */
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/PublicSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/PublicSans-Italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/PublicSans-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/PublicSans-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --blue: #005eb8;
  --dark-blue: #003087;
  --darker-blue: #002163;
  --blue-tint: #e8eff6;
  --text: #212b32;
  --secondary: #4c6272;
  --white: #fff;
  --grey-bg: #f0f4f5;
  --border: #d8dde0;
  --border-strong: #aeb7bd;
  --green: #007f3b;
  --green-dark: #00401e;
  --yellow: #ffeb3b;
  --purple: #330072;
  --dark-pink: #7c2855;

  --measure: 42em;
  --max-width: 1040px;
  --sans: "Public Sans", Arial, "Helvetica Neue", Helvetica, sans-serif;

  --tile-sheen: linear-gradient(180deg, #ffffff 0%, #fbfcfe 58%, #eef4f9 100%);
  --shadow-1: 0 1px 2px rgba(0, 48, 135, 0.07), 0 2px 6px rgba(0, 48, 135, 0.06);
  --shadow-2: 0 2px 4px rgba(0, 48, 135, 0.10), 0 10px 20px rgba(0, 48, 135, 0.11);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background: var(--grey-bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; }

/* Browser surfaces */
::selection { background: var(--dark-blue); color: var(--white); }

a { color: var(--blue); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:visited { color: var(--purple); }
a:hover { color: var(--dark-pink); text-decoration-thickness: 3px; }
a:active { color: var(--text); }
a:focus-visible {
  outline: 4px solid transparent;
  background: var(--yellow);
  color: var(--text);
  box-shadow: 0 -2px var(--yellow), 0 4px var(--text);
  text-decoration: none;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  padding: 12px 16px; background: var(--yellow); color: var(--text);
  font-weight: 700;
}
.skip-link:focus { left: 8px; top: 8px; z-index: 10; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; margin: -1px; padding: 0;
}

/* Header */
.header { background: var(--white); border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  align-items: baseline; justify-content: space-between;
  padding-top: 20px; padding-bottom: 16px;
}
.logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--dark-blue);
}
.logo-mark { width: 52px; height: auto; flex: 0 0 auto; }
.logo-text { display: block; }
.header-right { display: flex; align-items: center; gap: 24px; }
/* NHS identity: the logo is unaltered, on white, with clear space around it. */
.nhs-logo { width: 104px; height: auto; display: block; margin-left: 16px; }
.logo:visited { color: var(--dark-blue); }
.logo:hover { color: var(--dark-blue); }
.logo:hover .logo-name { text-decoration: underline; text-decoration-thickness: 3px; }
.logo-name {
  display: block; font-size: 1.5rem; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.015em;
}
.logo-strap { display: block; font-size: 0.9375rem; font-weight: 400; color: var(--secondary); }
.header-phone { font-weight: 600; font-size: 1rem; line-height: 1.6; }

/* Search. Runs in the browser against a static index, so nothing is sent anywhere. */
.search-bar { background: var(--blue); }
.search-bar .container { padding-top: 18px; padding-bottom: 18px; }
.search { margin: 0; }
.search-label {
  display: block; font-size: 1rem; font-weight: 600;
  color: var(--white); margin-bottom: 8px;
}
.search-row { display: flex; max-width: 42em; }
.search input[type="search"] {
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.5;
  color: var(--text); background: var(--white);
  border: 2px solid var(--white); border-right: 0; border-radius: 4px 0 0 4px;
  padding: 12px 16px; flex: 1 1 auto; min-width: 0; min-height: 52px;
  -webkit-appearance: none; appearance: none;
}
.search input[type="search"]::placeholder { color: var(--secondary); opacity: 1; }
.search input[type="search"]:focus-visible {
  outline: 3px solid var(--text); outline-offset: 0;
  border-color: var(--text); background: var(--yellow); position: relative; z-index: 1;
}
.search button {
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.5;
  color: var(--white); background: var(--green);
  border: 2px solid var(--green); border-radius: 0 4px 4px 0;
  padding: 12px 24px; min-height: 52px; cursor: pointer; flex: 0 0 auto;
}
.search button:hover { background: var(--green-dark); border-color: var(--green-dark); }
.search button:focus-visible {
  background: var(--yellow); color: var(--text);
  border-color: var(--text); outline: 3px solid var(--text); outline-offset: 0;
}

.search-results-wrap {
  background: var(--white); border-bottom: 1px solid var(--border);
  padding: 24px 0 8px;
}
.search-results-title { margin: 0 0 8px; font-size: 1.25rem; }
.search-results-title:focus-visible { outline: 3px solid var(--text); outline-offset: 4px; }
.results { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--border); }
.result { margin: 0; border-bottom: 1px solid var(--border); }
.result a { display: block; padding: 14px 0; text-decoration: none; color: var(--blue); }
.result a:visited { color: var(--purple); }
.result a:hover { background: var(--grey-bg); }
.result a:hover .result-title { text-decoration: underline; text-decoration-thickness: 3px; }
.result a:focus-visible { background: var(--yellow); box-shadow: none; color: var(--text); }
.result a:focus-visible .result-desc { color: var(--text); }
.result-title { display: block; font-size: 1.125rem; font-weight: 600; line-height: 1.35; }
.result-desc {
  display: block; font-size: 1rem; line-height: 1.5;
  color: var(--secondary); margin-top: 2px;
}
.result-none { padding: 14px 0; font-size: 1rem; color: var(--text); }
.result-none a { display: inline; padding: 0; }

.nav { background: var(--white); border-top: 1px solid var(--border); }
.nav ul {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 0 28px; margin: 0 auto; padding: 0;
}
.nav li { margin: 0; }
.nav a {
  display: inline-block; padding: 14px 0;
  font-size: 1rem; font-weight: 600; line-height: 1.5;
  border-bottom: 4px solid transparent;
  text-decoration: none;
}
.nav a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--blue); }
.nav a:focus-visible { border-bottom-color: var(--text); }

/* Urgent help bar. Required on every page. */
.urgent { background: var(--dark-blue); color: var(--white); }
.urgent p { margin: 0; padding: 12px 0; font-size: 1rem; line-height: 1.6; }
.urgent a, .urgent a:visited { color: var(--white); font-weight: 600; }
.urgent a:hover { color: var(--white); }
.urgent a:focus-visible { color: var(--text); }

/* Online requests notice. Required on every page. NHS inset pattern. */
.notice { background: var(--white); border-bottom: 1px solid var(--border); }
.notice .container { padding-top: 24px; padding-bottom: 24px; }
.notice-inset { border-left: 10px solid var(--blue); padding-left: 20px; }
.notice h2 { margin: 0 0 8px; font-size: 1.25rem; line-height: 1.3; }
.notice p { max-width: var(--measure); margin: 0 0 12px; font-size: 1rem; }
.notice p:last-child { margin-bottom: 0; }

.breadcrumb ol {
  list-style: none; display: flex; flex-wrap: wrap;
  padding: 16px 0 0; margin: 0; font-size: 1rem;
}
.breadcrumb li { margin: 0; }
.breadcrumb a { display: inline-block; line-height: 1.7; }
.breadcrumb li:not(:last-child)::after {
  content: "\203A"; margin: 0 10px; color: var(--secondary);
}

/* Reading column */
main.content {
  background: var(--white); border: 1px solid var(--border);
  max-width: var(--max-width); margin: 32px auto 64px;
  padding: 40px; width: auto;
}
main.content > * { max-width: var(--measure); overflow-wrap: break-word; }
main.content > *:first-child { margin-top: 0; }
main.content > table { max-width: 100%; }

h1, h2, h3, h4 { text-wrap: balance; }
h1 {
  font-size: 2.25rem; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.015em; margin: 0 0 24px;
}
h2 {
  font-size: 1.625rem; font-weight: 700; line-height: 1.25;
  letter-spacing: -0.01em; margin: 48px 0 12px;
}
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; margin: 32px 0 8px; }
h4 { font-size: 1.0625rem; font-weight: 600; margin: 24px 0 8px; }
p, ul, ol, table { margin: 0 0 16px; }
li { margin-bottom: 8px; }
main.content li { line-height: 1.6; }
/* Inline links: vertical padding grows the touch area without moving the line.
   line-height does not change an inline box, so padding is what counts here. */
main.content a:not(.button) { line-height: 1.6; padding: 3px 0; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
img { max-width: 100%; height: auto; }
blockquote {
  margin: 24px 0; padding-left: 20px;
  border-left: 10px solid var(--blue); color: var(--text);
}

/* Catchment check on the register page */
.catchment {
  background: var(--grey-bg); border-left: 10px solid var(--blue);
  padding: 20px 24px; margin: 24px 0; max-width: var(--measure);
}
.catchment h3 { margin: 0 0 8px; font-size: 1.125rem; }
.catchment p, .catchment ul { font-size: 1rem; }
.catchment > *:last-child { margin-bottom: 0; }
.catchment-row { display: flex; max-width: 24em; margin-top: 8px; }
.catchment label { display: block; font-weight: 600; font-size: 1rem; }
.catchment input {
  font-family: var(--sans); font-size: 1.0625rem; line-height: 1.5;
  border: 2px solid var(--secondary); border-right: 0; border-radius: 4px 0 0 4px;
  padding: 10px 14px; min-height: 48px; flex: 1 1 auto; min-width: 0;
  text-transform: uppercase;
}
.catchment input:focus-visible {
  outline: 3px solid var(--text); border-color: var(--text); background: var(--yellow);
}
.catchment button {
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 600;
  color: var(--white); background: var(--blue); border: 2px solid var(--blue);
  border-radius: 0 4px 4px 0; padding: 10px 20px; min-height: 48px;
  cursor: pointer; flex: 0 0 auto;
}
.catchment button:hover { background: var(--dark-blue); border-color: var(--dark-blue); }
.catchment button:focus-visible {
  background: var(--yellow); color: var(--text); border-color: var(--text);
}
.catchment-answer:empty { display: none; }
.catchment-answer { font-weight: 600; margin-top: 12px; }
.catchment-note { color: var(--secondary); margin-top: 12px; }

/* Buttons */
.button {
  display: inline-block;
  background: var(--green); color: var(--white) !important;
  font-family: var(--sans); font-size: 1.0625rem; font-weight: 600;
  line-height: 1.5; padding: 13px 24px;
  border: 2px solid transparent; border-radius: 4px;
  text-decoration: none; box-shadow: 0 4px 0 var(--green-dark);
  margin: 0 8px 12px 0;
}
.button:visited { color: var(--white) !important; }
.button:hover { background: #00662f; color: var(--white) !important; }
.button:active { box-shadow: none; transform: translateY(4px); }
.button:focus-visible {
  background: var(--yellow); color: var(--text) !important;
  border-color: var(--text); box-shadow: 0 4px 0 var(--text);
}
.button-secondary {
  background: var(--white); color: var(--blue) !important;
  border-color: var(--blue); box-shadow: 0 4px 0 var(--blue);
}
.button-secondary:visited { color: var(--blue) !important; }
.button-secondary:hover { background: var(--grey-bg); color: var(--dark-blue) !important; }
.actions { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 0; }
.actions > .button { flex: 0 0 auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: 1.0625rem; }
caption { text-align: left; font-weight: 600; padding-bottom: 8px; }
th, td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
thead th { border-bottom: 2px solid var(--text); font-weight: 600; }
.content table {
  display: block; width: max-content; max-width: 100%;
  overflow-x: auto; border: 1px solid var(--border);
}

/* Home: lockup */
.lockup { background: var(--blue-tint); border-bottom: 1px solid var(--border); }
.lockup .container { padding-top: 48px; padding-bottom: 40px; }
.lockup-inner {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 40px; align-items: center;
}
.lockup-art {
  width: 100%; height: auto; max-width: 420px; justify-self: end;
  border-radius: 4px; box-shadow: var(--shadow-1);
}
.lockup h1 {
  font-size: 2.75rem; font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--dark-blue); margin: 0 0 12px;
}
.lockup-lead {
  max-width: 34em; font-size: 1.1875rem; color: var(--text); margin: 0 0 28px;
}
.lockup-note {
  max-width: 38em; font-size: 1rem; line-height: 1.55;
  color: var(--secondary); margin: 16px 0 0;
}
.lockup-note a { line-height: 1.6; padding: 3px 0; display: inline-block; }

/* Home: bands */
.band { padding: 8px 0 40px; }
.band-white { background: var(--white); }
.band h2 { margin-top: 40px; }
.band p { max-width: var(--measure); }
.band-accredit { padding-bottom: 32px; }

/* Trailing "go to" links at the foot of a band need a tap target of their own. */
.band > .container > p > a { display: inline-block; padding: 5px 0; line-height: 1.6; }

/* Home: the task index. Ruled rows, not cards. */
.tasks {
  list-style: none; padding: 0; margin: 24px 0 0;
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
.task {
  margin: 0; background: var(--tile-sheen);
  border: 1px solid var(--border); border-radius: 4px;
  box-shadow: var(--shadow-1);
  transition: box-shadow 140ms ease-out, transform 140ms ease-out;
}
.task:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.task a { display: block; padding: 18px 20px; text-decoration: none; border-radius: 3px; }
.task a:hover .task-title { text-decoration: underline; text-decoration-thickness: 3px; }
.task a:focus-visible {
  background: var(--yellow); box-shadow: none; outline: 3px solid var(--text);
  outline-offset: -3px;
}
.task:has(a:focus-visible) { box-shadow: none; transform: none; background: var(--yellow); }
.task a:focus-visible .task-title,
.task a:focus-visible .task-desc { color: var(--text); }
.task a { color: var(--blue); }
.task a:visited { color: var(--purple); }
.task-title {
  display: block; font-size: 1.25rem; font-weight: 600;
  line-height: 1.3; color: inherit;
}
.task-desc {
  display: block; font-size: 1rem; line-height: 1.5;
  color: var(--secondary); margin-top: 2px;
}

.link-list { list-style: none; padding: 0; margin: 16px 0; max-width: none; }
.link-list li { margin: 0; border-bottom: 1px solid var(--border); }
.link-list li:first-child { border-top: 1px solid var(--border); }
.link-list a { display: block; padding: 12px 0; line-height: 1.5; }

.news-list {
  list-style: none; padding: 0; margin: 16px 0; max-width: none;
  display: grid; gap: 12px;
}
.news-item {
  margin: 0; padding: 16px 20px;
  background: var(--tile-sheen); border: 1px solid var(--border);
  border-radius: 4px; box-shadow: var(--shadow-1);
  transition: box-shadow 140ms ease-out, transform 140ms ease-out;
}
.news-item:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.news-item .date {
  margin: 0 0 2px; font-size: 0.9375rem; font-weight: 600;
  color: var(--secondary);
}
.news-item h3 { margin: 0; font-size: 1.1875rem; font-weight: 600; line-height: 1.4; }
.news-item h3 a { display: inline-block; line-height: 1.4; }

.badges {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 28px 32px; max-width: none;
}
.badge {
  margin: 0; background: var(--tile-sheen);
  border: 1px solid var(--border); border-radius: 4px;
  box-shadow: var(--shadow-1); padding: 18px 20px;
  transition: box-shadow 140ms ease-out, transform 140ms ease-out;
}
.badge:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.badge img {
  display: block; width: auto; max-width: 100%;
  max-height: 54px; margin-bottom: 12px;
}
.badge, .badge a { display: flex; flex-direction: column; height: 100%; }
.badge a { justify-content: flex-start; }
.badge img { margin-top: auto; }
.badge span {
  display: block; font-size: 0.9375rem; line-height: 1.45; color: var(--secondary);
}
.badge a { display: block; text-decoration: none; padding: 4px 0; }
.badge a span { color: var(--blue); font-weight: 600; }
.badge a:visited span { color: var(--purple); }
.badge a:hover span { text-decoration: underline; text-decoration-thickness: 3px; }
.badge a:focus-visible { background: var(--yellow); box-shadow: none; }
.badge a:focus-visible span { color: var(--text); }

/* Footer */
.footer {
  background: var(--white); border-top: 4px solid var(--blue);
  padding-top: 32px; font-size: 1rem;
}
.footer-inner {
  display: grid; grid-template-columns: minmax(200px, 18em) 1fr;
  gap: 32px 48px; padding-bottom: 8px;
}
.footer-address p { margin: 0 0 12px; }
.footer-address a { display: inline-block; line-height: 1.7; }
.footer-links {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px;
}
.footer-links li { margin: 0; }
.footer-links a { display: inline-block; padding: 7px 0; line-height: 1.6; }
.footer-meta {
  color: var(--secondary); font-size: 0.9375rem;
  border-top: 1px solid var(--border); margin-top: 16px;
  padding-top: 12px; padding-bottom: 24px;
}
.footer-meta p { margin: 0; }
.footer-meta a { display: inline-block; margin-right: 24px; padding: 7px 0; line-height: 1.7; }

/* Phone */
@media (max-width: 767px) {
  body { font-size: 1.125rem; }
  .header-inner { display: block; padding-top: 16px; padding-bottom: 12px; }
  .logo-name { font-size: 1.3125rem; }
  .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .logo-mark { width: 40px; }
  .nhs-logo { width: 56px; margin-left: 0; }
  .header-right { flex-direction: column; align-items: flex-end; gap: 6px; }
  .header-phone { padding: 2px 0; }
  .search-row { max-width: none; }
  .search button { padding: 12px 16px; }
  .search input[type="search"] { width: 100%; flex: 1 1 auto; min-width: 0; }
  .badges { grid-template-columns: 1fr; gap: 24px; }
  .nav ul {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px; padding: 0;
  }
  .nav li { border-bottom: 1px solid var(--border); }
  .nav li:nth-last-child(-n+2) { border-bottom: 0; }
  .nav a {
    display: block; padding: 13px 0; border-bottom: 0;
    border-left: 4px solid transparent;
  }
  .nav a[aria-current="page"] {
    border-bottom: 0; border-left-color: var(--blue); padding-left: 12px;
  }
  .lockup .container { padding-top: 32px; padding-bottom: 32px; }
  .lockup-inner { grid-template-columns: 1fr; gap: 24px; }
  .lockup-art { max-width: 100%; justify-self: stretch; order: -1; }
  .lockup h1 { font-size: 2rem; }
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.4375rem; margin-top: 36px; }
  .actions { display: block; }
  .button { display: block; width: 100%; text-align: center; }
  main.content { margin: 16px auto 40px; padding: 24px 16px; border-left: 0; border-right: 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-links { grid-template-columns: 1fr; }
  .footer-meta a { display: block; margin-right: 0; }
}

/* Two columns once there is room */
@media (min-width: 768px) {
  .tasks { grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 0; }
  .task { border-top: 1px solid var(--border); border-bottom: 0; }
  .link-list { columns: 2; column-gap: 48px; }
  .link-list li, .link-list li:first-child { border: 0; break-inside: avoid; }
  .link-list a { padding: 8px 0; }
}

@media print {
  .nav, .notice, .skip-link, .breadcrumb { display: none; }
  body { background: #fff; font-size: 12pt; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .task:hover, .news-item:hover, .badge:hover { transform: none; }
}
