/*
  Shared page shell and website sections.
  Colours: the Figma palette as custom properties. Where a Figma use fails WCAG 2.2 AA the semantic
  token below carries the nearest passing value (see the "Contrast overrides" block); a test checks the pairs.
  Font: Outfit (SIL Open Font License) stands in until the brand font is cleared for this site.
  To switch fonts, replace the files in fonts/ and the three font-face blocks.
*/

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/outfit-400.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/outfit-600.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/outfit-700.woff2") format("woff2");
}

:root {
  /* Figma palette */
  --vx-gray-400: #F5F5F6;
  --vx-gray-500: #ECECEC;
  --vx-gray-600: #4B5563;
  --vx-gray-700: #C6C6C6;
  --vx-gray-800: #A09FA0;
  --vx-gray-900: #414042;
  --vx-blue-500: #4E6E8C;
  --vx-blue-600: #2F5578;
  --vx-blue-700: #1D4C75;
  --vx-blue-800: #043866;
  --vx-blue-900: #002841;
  --vx-cyan-500: #CCF3FD;
  --vx-cyan-600: #00C2F3;

  /* Contrast overrides (Figma value fails 4.5:1 or 3:1) */
  --vx-link: #043866;
  --vx-button-bg: #00C2F3;
  --vx-button-text: #043866;
  --vx-status-ok: #15803D;
  --vx-status-bad: #DC2626;
  --vx-status-major: #B91C1C;
  --vx-meta: #4B5563;
  --vx-badge-current-text: #B91C1C;
  --vx-badge-current-bg: #FEE2E2;
  --vx-badge-current-dot: #DC2626;
  --vx-badge-resolved-text: #043866;
  --vx-focus: #043866;
  --vx-focus-on-dark: #FFFFFF;
  --vx-panel: #FFFFFF;

  /* Header and footer surfaces, sampled from the Figma frames */
  --vx-on-dark: #FFFFFF;
  --vx-header-tabs: #163764;
  --vx-header-main: #375474;
  --vx-header-tab-current: #51C0F6;
  --vx-footer-top: #375474;
  --vx-footer-bottom: #183964;

  --vx-wrap: 83.25rem;
  --vx-content: 71rem;
  --vx-radius: 0.375rem;
  --vx-font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: #FFFFFF;
  color: var(--vx-gray-900);
  font-family: var(--vx-font);
  font-size: 1rem;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--vx-link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--vx-focus);
  outline-offset: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--vx-focus-on-dark);
}

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

.skip-link {
  position: absolute;
  top: -5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: #FFFFFF;
  border-radius: var(--vx-radius);
  font-weight: 600;
}

.skip-link:focus {
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: var(--vx-wrap);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* Icons are masks so they take the text colour. */
.icon {
  display: inline-block;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  background: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.icon-user {
  -webkit-mask-image: url("img/user.svg");
  mask-image: url("img/user.svg");
}

.icon-phone {
  -webkit-mask-image: url("img/phone.svg");
  mask-image: url("img/phone.svg");
}

.icon-menu {
  -webkit-mask-image: url("img/menu.svg");
  mask-image: url("img/menu.svg");
}

.icon-external {
  -webkit-mask-image: url("img/external.svg");
  mask-image: url("img/external.svg");
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  color: var(--vx-on-dark);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-header a:hover {
  text-decoration: underline;
}

.site-header__tabs {
  background: var(--vx-header-tabs);
}

.tabs {
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tab {
  display: block;
  padding: 0.5rem 0.1rem 0.4rem;
  border-bottom: 3px solid transparent;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.5;
}

.tab.is-current {
  border-bottom-color: var(--vx-header-tab-current);
  color: var(--vx-header-tab-current);
}

.site-header__bar {
  background: var(--vx-header-main);
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  min-height: 3.75rem;
  padding-block: 0.5rem;
}

.logo {
  display: block;
  flex: none;
  line-height: 0;
}

.logo img {
  display: block;
  width: 6rem;
  height: auto;
}

.bar__tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.main-nav {
  flex-basis: 100%;
  order: 3;
  padding-block: 0.5rem;
}

.main-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav__link,
.menu__button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.5rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.menu {
  position: relative;
}

/* A small chevron that turns when the menu is open. */
.menu__button[aria-expanded]:not(.menu__button--icon)::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.menu__button[aria-expanded="true"]:not(.menu__button--icon)::after {
  margin-top: 0.15rem;
  transform: rotate(-135deg);
}

.menu__button--support {
  padding-inline: 1.25rem;
  border-radius: var(--vx-radius);
  background: var(--vx-button-bg);
  color: var(--vx-button-text);
}

.menu__button--support::after {
  display: none;
}

.menu__button--icon {
  width: 2.5rem;
  justify-content: center;
  padding: 0;
}

.menu__list:not([hidden]) {
  display: block;
  margin: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  list-style: none;
}

.menu__list a {
  display: block;
  padding: 0.45rem 0.5rem;
  font-weight: 400;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.25rem;
  font-weight: 700;
  white-space: nowrap;
}

.phone--bar {
  display: none;
}

.phone--keep {
  display: inline-flex;
}

.phone .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* The account and support menus drop down from the bar on every width. */
.bar__tools .menu__list:not([hidden]) {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  min-width: 15rem;
  padding: 0.5rem;
  background: var(--vx-panel);
  border-radius: var(--vx-radius);
  box-shadow: 0 6px 24px rgb(0 40 65 / 25%);
}

.bar__tools .menu__list a {
  color: var(--vx-link);
  text-decoration: underline;
}

/* The panels are white, so their links take the dark ring; the white one is for the dark bar. */
.bar__tools .menu__list a:focus-visible {
  outline-color: var(--vx-focus);
}

/* Below the desktop width the lists open under the tools row, not under their own button, so they cannot leave the screen. */
@media (max-width: 63.999rem) {
  .bar__tools {
    position: relative;
  }

  .bar__tools .menu {
    position: static;
  }

  .bar__tools .menu__list:not([hidden]) {
    max-width: calc(100vw - 2rem);
  }
}

@media (min-width: 64rem) {
  .site-header__tabs .tabs {
    padding-inline-start: 11.5rem;
  }

  .logo img {
    width: 9.5rem;
  }

  .bar {
    flex-wrap: nowrap;
    gap: 3rem;
  }

  .bar__tools {
    gap: 1rem;
  }

  .main-nav,
  .main-nav[hidden] {
    display: block;
    flex: 1;
    order: 0;
    padding: 0;
  }

  .main-nav__list {
    flex-direction: row;
    gap: 1.5rem;
  }

  .main-nav .menu__list:not([hidden]) {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 20;
    min-width: 15rem;
    padding: 0.5rem;
    background: var(--vx-panel);
    border-radius: var(--vx-radius);
    box-shadow: 0 6px 24px rgb(0 40 65 / 25%);
  }

  .main-nav .menu__list a {
    color: var(--vx-link);
    text-decoration: underline;
  }

  .main-nav .menu__list a:focus-visible {
    outline-color: var(--vx-focus);
  }

  .menu-toggle {
    display: none;
  }

  .phone--bar {
    display: inline-flex;
  }

  .phone--panel {
    display: none;
  }
}

/* ---------- Hero and page ---------- */

.hero {
  background: var(--vx-cyan-500);
  color: var(--vx-blue-900);
}

.hero .wrap,
.page {
  max-width: var(--vx-content);
}

.hero h1 {
  margin: 0;
  padding-block: 2.5rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.page {
  margin-inline: auto;
  padding: 2.5rem 1rem 4rem;
}

.page section + section {
  margin-top: 3.5rem;
}

.page h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.page p {
  margin: 0 0 1rem;
}

@media (min-width: 40rem) {
  .hero h1 {
    padding-block: 3.5rem;
    font-size: 2.75rem;
  }

  .page {
    padding-block: 3.5rem 5rem;
  }
}

.message {
  max-width: 36rem;
}

/* ---------- Outage register (partner links) ---------- */

.partner-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  grid-auto-flow: dense;
  gap: 0.25rem 2rem;
  justify-content: start;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

/* On narrow screens the long nbn link takes its own row (sixth in the configured order). */
.partner-links li:nth-child(6) {
  grid-column: 1 / -1;
}

.partner-links a {
  display: inline-block;
  padding-block: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

@media (min-width: 40rem) {
  .partner-links {
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 0.25rem 3.5rem;
  }

  .partner-links li:nth-child(6) {
    grid-column: auto;
  }
}

/* ---------- Buttons ---------- */

.btn,
.step-card__action a,
.coverage__actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  border: 0;
  border-radius: var(--vx-radius);
  background: var(--vx-button-bg);
  color: var(--vx-button-text);
  font: inherit;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover,
.step-card__action a:hover,
.coverage__actions a:hover {
  background: #33CEF5;
  text-decoration: none;
}

/* ---------- Next steps ---------- */

.next-steps h2 {
  text-align: center;
}

.step-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 4.25rem;
  border: 1px solid var(--vx-gray-700);
  border-radius: 0.75rem;
  text-align: center;
}

.step-card__icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0.5rem;
}

.step-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.step-card p {
  margin-bottom: 1.25rem;
}

.page .step-card__action {
  width: 100%;
  margin: auto 0 0;
}

/* Sits under the button; every card reserves the room so the three buttons line up. */
.page .step-card__extra {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  font-size: 0.9375rem;
}

.step-card__extra a {
  display: inline-block;
  padding-block: 0.25rem;
}

@media (min-width: 48rem) {
  .step-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .step-card p {
    max-width: 16rem;
  }
}

/* ---------- Communication dialog ---------- */

.dialog {
  width: calc(100% - 2rem);
  max-width: 40rem;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0.75rem;
  color: var(--vx-gray-900);
}

.dialog::backdrop {
  background: rgb(0 24 49 / 65%);
}

.dialog__panel {
  padding: 1.5rem;
}

.dialog h2 {
  margin: 0 0 1rem;
  text-align: left;
  font-size: 1.5rem;
  font-weight: 600;
}

.dialog p {
  margin: 0 0 1rem;
}

.dialog .btn {
  width: auto;
  min-width: 8rem;
}

@media (min-width: 40rem) {
  .dialog__panel {
    padding: 2rem;
  }
}

/* ---------- Coverage map ---------- */

.coverage {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}

.coverage__art {
  display: block;
  width: 100%;
  height: auto;
}

.coverage__actions {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.coverage__actions a {
  font-size: 0.9375rem;
  white-space: nowrap;
}

.coverage__actions a::before {
  content: "";
  width: 1em;
  height: 1em;
  background: currentColor;
  -webkit-mask: url("img/external.svg") center / contain no-repeat;
  mask: url("img/external.svg") center / contain no-repeat;
}

@media (min-width: 48rem) {
  .coverage {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .coverage__art {
    grid-column: 2;
    grid-row: 1;
  }

  .coverage__text {
    grid-column: 1;
    grid-row: 1;
  }

  .coverage__actions {
    flex-direction: row;
  }

  .coverage__actions a {
    width: auto;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  background: linear-gradient(var(--vx-footer-top), var(--vx-footer-bottom));
  color: var(--vx-on-dark);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding-block: 2.5rem 3rem;
}

.footer-logo {
  display: block;
  justify-self: center;
  margin-bottom: 1.5rem;
  line-height: 0;
}

.footer-logo img {
  display: block;
  width: 10rem;
  height: auto;
}

.footer-columns {
  display: grid;
  grid-template-columns: 1fr;
}

.footer-column,
.footer-social {
  padding: 1.25rem 0.5rem 1rem;
  border-top: 1px solid rgb(255 255 255 / 60%);
}

.footer-heading {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li a {
  display: inline-block;
  padding-block: 0.3rem;
  font-size: 0.9375rem;
}

.footer-social ul {
  display: flex;
  flex-direction: column;
}

.footer-social li a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.25rem;
}

.footer-social li a::after {
  content: "";
  order: -1;
  width: 1.75rem;
  height: 1.75rem;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.social--linkedin a::after {
  background-image: url("img/linkedin.svg");
}

.social--facebook a::after {
  background-image: url("img/facebook.svg");
}

.social--instagram a::after {
  background-image: url("img/instagram.svg");
}

.social--x a::after {
  background-image: url("img/x.svg");
}

.social--youtube a::after {
  background-image: url("img/youtube.svg");
}

.footer-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0 0.5rem 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  text-decoration: underline;
}

.site-footer a.footer-phone {
  text-decoration: underline;
}

.footer-copy {
  margin: 0.5rem 0.5rem 0;
  font-size: 0.9375rem;
}

@media (min-width: 64rem) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) 13.5rem;
    grid-template-areas:
      "columns logo"
      "columns social"
      "columns phone"
      "columns copy";
    grid-template-rows: auto auto auto 1fr;
    column-gap: 2.5rem;
    padding-block: 3.5rem 4rem;
  }

  .footer-logo {
    grid-area: logo;
    justify-self: end;
    margin-bottom: 2rem;
  }

  .footer-columns {
    grid-area: columns;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .footer-column,
  .footer-social {
    padding: 0;
    border-top: 0;
  }

  .footer-social {
    grid-area: social;
    text-align: right;
  }

  .footer-social li a {
    flex-direction: row;
    justify-content: flex-end;
  }

  .footer-social li a::after {
    order: 0;
  }

  .footer-phone {
    grid-area: phone;
    justify-self: end;
    margin: 1.25rem 0 1rem;
  }

  .footer-copy {
    grid-area: copy;
    margin: 0;
    text-align: right;
  }
}

/* ---------- Subscription forms ---------- */

.sub-form {
  max-width: 36rem;
}

.sub-form label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.sub-form input[type="email"],
.sub-form input[type="text"] {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--vx-meta);
  border-radius: var(--vx-radius);
  font: inherit;
}

.sub-form fieldset {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}

.sub-form legend {
  margin-bottom: 0.5rem;
  padding: 0;
  font-weight: 600;
}

.sub-form__group {
  margin-bottom: 1.25rem;
}

.sub-form__check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
}

.sub-form__check input {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
}

.sub-form__check label {
  margin: 0;
  font-weight: 400;
}

.sub-form__error {
  margin: 0 0 0.5rem;
  color: var(--vx-status-major);
  font-weight: 600;
}

.sub-form__summary {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 2px solid var(--vx-status-major);
  border-radius: var(--vx-radius);
}

.sub-form__summary h2 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}

.sub-form__summary p,
.sub-form__summary ul {
  margin: 0;
}

.sub-form__notice {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--vx-link);
  background: #EAF6FD;
}

.sub-form__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (min-width: 40rem) {
  .sub-form .btn {
    width: auto;
    min-width: 12rem;
  }
}
