/*
 * Water connection checker.
 *
 * Loaded on page-water-checker.php, and on the service pages that carry the
 * postcode box (see mcf_wc_embed_here() and mcf_enqueue_assets()), so the
 * rest of the site does not carry its weight.
 *
 * Every link is styled at two classes deep or more. A bare class on an <a>
 * loses to .mcf-template a, which would paint it green with no underline.
 */

.mcf-wc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Hero and postcode box ---- */
.mcf-wc-hero {
  background: var(--mcf-green);
  color: var(--mcf-white);
  padding: clamp(56px, 7vw, 96px) var(--mcf-pad) clamp(48px, 6vw, 80px);
  text-align: center;
}
.mcf-wc-hero-inner {
  max-width: 760px;
  margin: 0 auto;
}
.mcf-wc-hero .mcf-label {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--mcf-gold);
}
.mcf-wc-hero h1 {
  font-family: var(--mcf-serif);
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  color: var(--mcf-white);
  margin: 0 0 20px 0;
}
.mcf-wc-hero-sub {
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 auto 32px;
  max-width: 620px;
}

.mcf-wc-form {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.mcf-wc-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 16px 18px;
  background: var(--mcf-white);
  border: 2px solid transparent;
  border-radius: 4px;
  color: var(--mcf-charcoal);
  font-family: var(--mcf-sans);
  font-size: 17px; /* 16px or more, or iOS zooms the page on focus */
  letter-spacing: 0.5px;
  text-transform: uppercase;
  outline: none;
}
.mcf-wc-form input[type="text"]::placeholder {
  color: rgba(42, 38, 34, 0.45);
  text-transform: none;
  letter-spacing: 0;
}
.mcf-wc-form input[type="text"]:focus {
  border-color: var(--mcf-gold);
}
.mcf-wc-form .mcf-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  justify-content: center;
}
.mcf-wc-form .mcf-btn[disabled] {
  opacity: 0.7;
  cursor: progress;
  transform: none;
  box-shadow: none;
}
.mcf-wc-hint {
  margin: 14px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

/* ---- Result ---- */
.mcf-wc-result-wrap {
  background: var(--mcf-cream);
  padding: clamp(40px, 5vw, 64px) var(--mcf-pad);
  scroll-margin-top: 88px; /* clears the fixed nav when scrolled to */
  outline: none;
}
.mcf-wc-result-wrap[hidden] {
  display: none;
}
.mcf-wc-result {
  max-width: 820px;
  margin: 0 auto;
  background: var(--mcf-white);
  border: 1px solid var(--mcf-border);
  border-top: 3px solid var(--mcf-gold);
  border-radius: 8px;
  padding: clamp(24px, 3.2vw, 40px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.06);
}
.mcf-wc-result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.mcf-wc-result-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--mcf-gold-text);
  margin: 0 0 6px 0;
}
.mcf-wc-result-name {
  font-family: var(--mcf-serif);
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  color: var(--mcf-charcoal);
  margin: 0;
}
.mcf-wc-result-note {
  margin: 16px 0 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--mcf-warm-grey);
}
.mcf-wc-badge {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--mcf-cream);
  color: var(--mcf-warm-grey);
}
.mcf-wc-badge--yes {
  background: rgba(28, 61, 47, 0.1);
  color: var(--mcf-green);
}
.mcf-wc-badge--yes::before {
  content: "\2713";
  margin-right: 6px;
}

.mcf-wc-steps {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--mcf-border);
}
.mcf-wc-steps h3 {
  font-family: var(--mcf-serif);
  font-size: 21px;
  font-weight: 400;
  color: var(--mcf-charcoal);
  margin: 0 0 14px 0;
}
.mcf-wc-steps ol {
  list-style: none;
  counter-reset: mcf-wc-step;
  margin: 0;
  padding: 0;
}
.mcf-wc-steps li {
  counter-increment: mcf-wc-step;
  position: relative;
  padding: 0 0 12px 44px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--mcf-text);
}
.mcf-wc-steps li:last-child {
  padding-bottom: 0;
}
.mcf-wc-steps li::before {
  content: counter(mcf-wc-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mcf-green);
  color: var(--mcf-white);
  font-size: 14px;
  font-weight: 600;
  line-height: 28px;
  text-align: center;
}

.mcf-wc-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 28px;
}
.mcf-wc-result .mcf-wc-extlink {
  font-size: 15px;
  font-weight: 600;
  color: var(--mcf-green);
  text-decoration: underline;
  text-decoration-color: var(--mcf-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.mcf-wc-result .mcf-wc-extlink::after {
  content: " \2197";
}
.mcf-wc-result .mcf-wc-extlink:hover,
.mcf-wc-result .mcf-wc-extlink:focus-visible {
  text-decoration-color: var(--mcf-green);
}
.mcf-wc-caveat {
  margin: 22px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--mcf-warm-grey);
}

/* ---- How it works, in one line under the postcode box ---- */
.mcf-wc-hero-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 30px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.mcf-wc-hero-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.86);
}
.mcf-wc-hero-steps li span {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid var(--mcf-gold);
  border-radius: 50%;
  color: var(--mcf-gold);
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

/* ---- Every council area and its water company ---- */
.mcf-wc-dir {
  /* Stated, not inherited: the page itself has no background colour, so a
     section without one shows whatever the browser paints behind the page. */
  background: var(--mcf-white);
  /* Nothing at the bottom: the small print follows on the same white and
     sets its own distance from the list. */
  padding: var(--mcf-v-space) var(--mcf-pad) 0;
}
.mcf-wc-dir-top {
  max-width: 760px;
  margin: 0 auto 36px;
  text-align: center;
}
.mcf-wc-dir-top .mcf-label,
.mcf-wc-notes-top .mcf-label {
  margin-bottom: 14px;
}
.mcf-wc-dir-top h2,
.mcf-wc-notes-top h2 {
  font-family: var(--mcf-serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--mcf-charcoal);
}
.mcf-wc-dir-top p {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--mcf-warm-grey);
}
.mcf-wc-dir-filter {
  margin-top: 24px;
}
.mcf-wc-dir-filter[hidden] {
  display: none;
}
.mcf-wc-dir-filter input {
  width: 100%;
  max-width: 460px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--mcf-stone);
  border-radius: 4px;
  color: var(--mcf-charcoal);
  font-family: var(--mcf-sans);
  font-size: 16px; /* 16px or more, or iOS zooms the page on focus */
  outline: none;
}
.mcf-wc-dir-filter input:focus {
  border-color: var(--mcf-green);
}
.mcf-wc-dir-top .mcf-wc-dir-count {
  min-height: 22px;
  margin-top: 10px;
  font-size: 14px;
}
.mcf-wc-dir-groups {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto;
}
.mcf-wc-dir-group {
  background: var(--mcf-cream);
  border: 1px solid var(--mcf-border);
  border-radius: 6px;
}
.mcf-wc-dir-group[hidden] {
  display: none;
}
.mcf-wc-dir-group summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}
.mcf-wc-dir-group summary::-webkit-details-marker {
  display: none;
}
.mcf-wc-dir-region {
  font-family: var(--mcf-serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--mcf-charcoal);
}
.mcf-wc-dir-n {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: var(--mcf-warm-grey);
  white-space: nowrap;
}
.mcf-wc-dir-n::after {
  content: "+";
  margin-left: 14px;
  font-size: 22px;
  line-height: 1;
  color: var(--mcf-gold-text);
}
.mcf-wc-dir-group[open] .mcf-wc-dir-n::after {
  content: "\2212";
}
.mcf-wc-dir-table {
  padding: 0 22px 22px;
  overflow-x: auto;
}
.mcf-wc-dir-table table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14.5px;
}
.mcf-wc-dir-table th,
.mcf-wc-dir-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--mcf-border);
  line-height: 1.5;
  text-align: left;
  vertical-align: top;
  color: var(--mcf-text);
}
.mcf-wc-dir-table thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--mcf-gold-text);
}
.mcf-wc-dir-table tbody th {
  width: 24%;
  font-weight: 600;
  color: var(--mcf-charcoal);
}
.mcf-wc-dir-table tbody tr:last-child th,
.mcf-wc-dir-table tbody tr:last-child td {
  border-bottom: 0;
}
.mcf-wc-dir-county {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--mcf-warm-grey);
}
.mcf-wc-dir-table td.mcf-wc-dir-empty {
  color: rgba(107, 99, 88, 0.6);
}
/* The filter hides rows with the hidden attribute. Two classes deep, so the
   phone layout below, which makes rows display: block, cannot bring them back. */
.mcf-wc-dir .mcf-wc-dir-table tr[hidden] {
  display: none;
}

/* ---- Small print under the list: notes on the left, data credits on the right ----
   One block, the same 1100px as the list, so both its edges line up with the
   tables above. It was two centred columns 820px wide, which lined up with
   nothing and read as odd padding. A hairline sets it off from the list. */
.mcf-wc-small {
  background: var(--mcf-white);
  /* Overlaps the list's section by a pixel, with a pixel more padding to
     match. At some zoom levels two same-coloured sections that only touch
     can show a hairline of whatever is behind the page. */
  margin-top: -1px;
  padding: 41px var(--mcf-pad) clamp(56px, 7vw, 88px);
}
.mcf-wc-small-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 1px solid var(--mcf-border);
}
/* No list, so no notes: the credits take the full width. */
.mcf-wc-small--solo .mcf-wc-small-inner {
  grid-template-columns: minmax(0, 1fr);
}
.mcf-wc-small h3 {
  margin: 0 0 14px;
  font-family: var(--mcf-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--mcf-gold-text);
}
.mcf-wc-small p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--mcf-warm-grey);
}
.mcf-wc-small p + p {
  margin-top: 12px;
}
.mcf-wc-small p strong {
  font-weight: 600;
  color: var(--mcf-charcoal);
}
.mcf-wc-small-credits p {
  font-size: 12.5px;
  line-height: 1.65;
}
.mcf-wc-small-credits p + p {
  margin-top: 10px;
}
/* Two classes deep, so these beat .mcf-template a. */
.mcf-wc-small p a {
  color: var(--mcf-warm-grey);
  text-decoration: underline;
}
.mcf-wc-small p a:hover {
  color: var(--mcf-green);
}

/* ---- How water supply areas work ---- */
.mcf-wc-notes {
  background: var(--mcf-cream);
  padding: var(--mcf-v-space) var(--mcf-pad);
}
.mcf-wc-notes-top {
  text-align: center;
  margin-bottom: 40px;
}
.mcf-wc-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.mcf-wc-note {
  background: var(--mcf-white);
  border: 1px solid var(--mcf-border);
  border-radius: 6px;
  padding: 28px 26px;
}
.mcf-wc-note h3 {
  font-family: var(--mcf-serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--mcf-charcoal);
  margin-bottom: 10px;
}
.mcf-wc-note p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--mcf-warm-grey);
}
.mcf-wc-note p a {
  display: inline-block;
  margin: 10px 18px 0 0;
  font-weight: 600;
  color: var(--mcf-green);
  text-decoration: underline;
  text-decoration-color: var(--mcf-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.mcf-wc-note p a:hover,
.mcf-wc-note p a:focus-visible {
  text-decoration-color: var(--mcf-green);
}
/* The FAQ section is cream everywhere else. Here it follows a cream section,
   so it goes white to keep the two apart. */
.mcf-wc-notes + .mcf-faq {
  background: var(--mcf-white);
}
.mcf-wc-notes + .mcf-faq .mcf-faq-item {
  background: var(--mcf-cream);
}

/* ---- Quote form anchor ---- */
.mcf-template #quote {
  scroll-margin-top: 72px;
}

/* ---- Postcode box on a service page ---- */
.mcf-wc-embed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  background: var(--mcf-cream-dark);
  padding: clamp(36px, 4.5vw, 56px) var(--mcf-pad);
}
.mcf-wc-embed-copy h2 {
  font-family: var(--mcf-serif);
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 400;
  line-height: 1.2;
  color: var(--mcf-charcoal);
  margin-bottom: 8px;
}
.mcf-wc-embed-copy p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--mcf-warm-grey);
}
.mcf-wc-embed .mcf-wc-form {
  margin: 0;
  max-width: none;
}
.mcf-wc-embed .mcf-wc-form input[type="text"] {
  border-color: var(--mcf-stone);
}
.mcf-wc-embed .mcf-wc-form input[type="text"]:focus {
  border-color: var(--mcf-green);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
  .mcf-wc-embed {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .mcf-wc-notes-grid {
    grid-template-columns: 1fr;
    max-width: 640px;
  }
  /* The small print stacks: notes first, credits under them. */
  .mcf-wc-small-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}
/* On a phone each council becomes a small block: its name, then one line per
   column that has something in it. */
@media (max-width: 760px) {
  .mcf-wc-dir-group summary {
    padding: 16px;
  }
  .mcf-wc-dir-table {
    padding: 0 10px 10px;
    overflow-x: visible;
  }
  .mcf-wc-dir-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
  .mcf-wc-dir-table table,
  .mcf-wc-dir-table tbody,
  .mcf-wc-dir-table tr,
  .mcf-wc-dir-table th,
  .mcf-wc-dir-table td {
    display: block;
    width: auto;
  }
  .mcf-wc-dir-table tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--mcf-border);
  }
  .mcf-wc-dir-table tbody tr:last-child {
    border-bottom: 0;
  }
  .mcf-wc-dir-table tbody th {
    width: auto;
    padding: 0 0 4px;
    border: 0;
    font-size: 16px;
  }
  .mcf-wc-dir-table td {
    padding: 1px 0;
    border: 0;
    font-size: 14.5px;
  }
  .mcf-wc-dir-table td::before {
    content: attr(data-label) ": ";
    color: var(--mcf-warm-grey);
  }
  .mcf-wc-dir-table td.mcf-wc-dir-empty {
    display: none;
  }
  .mcf-wc-hero-steps {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 640px) {
  .mcf-wc-form {
    flex-direction: column;
  }
  .mcf-wc-form .mcf-btn {
    width: 100%;
  }
  .mcf-wc-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .mcf-wc-actions .mcf-btn {
    justify-content: center;
  }
  .mcf-wc-result .mcf-wc-extlink {
    text-align: center;
  }
}
