/*
 * Site styles that aren't from the WordPress theme: the redesigned footer and the AU/NZ region
 * switcher. Loaded after the theme's style.min.css (src/components/site/Head.astro).
 * Colours and type follow the theme: navy #000054, cyan #00c3ff, blue #0064cf, Calibri.
 */

/* ==========================================================================
   Region switcher (src/components/site/RegionSwitcher.astro)
   ========================================================================== */

.region-switcher__flag {
  border-radius: 0.125rem;
  box-shadow: 0 0 0 1px rgba(0, 0, 84, 0.12);
  flex-shrink: 0;
  height: 0.9375rem;
  object-fit: cover;
  width: 1.25rem;
}

.region-switcher__list,
.region-switcher__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Header: a button opening a small list (src/scripts/theme/region-switcher.ts). */
.site-header__unit--site-toggle {
  margin-inline-end: 1.25rem;
}

.region-switcher--header {
  position: relative;
}

.region-switcher__toggle {
  align-items: center;
  background: transparent;
  border: 0.0625rem solid #c8d5de;
  border-radius: 0.375rem;
  color: #000054;
  cursor: pointer;
  display: flex;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  gap: 0.5rem;
  line-height: 1.48;
  min-height: 2.75rem;
  padding: 0.4375rem 0.625rem 0.4375rem 0.75rem;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
}

.region-switcher__toggle:hover,
.region-switcher--header.is-open .region-switcher__toggle {
  background-color: #e6f2ff;
  border-color: #0064cf;
}

.region-switcher__toggle:focus-visible {
  outline: 0.1875rem solid #0064cf;
  outline-offset: 0.125rem;
}

.region-switcher__accessory {
  color: #0064cf;
  height: 1.25rem;
  transition: rotate 0.2s ease-out;
  width: 1.25rem;
}

.region-switcher--header.is-open .region-switcher__accessory {
  rotate: 180deg;
}

.region-switcher--header .region-switcher__menu {
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 84, 0.16), 0 0 0 0.0625rem rgba(0, 0, 84, 0.06);
  inset-block-start: calc(100% + 0.5rem);
  inset-inline-end: 0;
  min-width: 13.5rem;
  padding: 0.375rem;
  position: absolute;
  z-index: 100;
}

.js .region-switcher--header .region-switcher__menu {
  display: none;
}

.js .region-switcher--header.is-open .region-switcher__menu {
  display: block;
}

.region-switcher--header .region-switcher__link {
  align-items: center;
  border-radius: 0.375rem;
  color: #000054;
  display: flex;
  font-size: 0.9375rem;
  gap: 0.75rem;
  line-height: 1.48;
  padding: 0.625rem 0.75rem;
  text-decoration: none;
}

.region-switcher--header .region-switcher__link:hover {
  background-color: #e6f2ff;
}

.region-switcher--header .region-switcher__link:focus-visible {
  outline: 0.1875rem solid #0064cf;
  outline-offset: -0.1875rem;
}

.region-switcher--header .region-switcher__link[aria-current] {
  font-weight: 700;
}

.region-switcher__check {
  color: #0064cf;
  flex-shrink: 0;
  height: 1.25rem;
  margin-inline-start: auto;
  width: 1.25rem;
}

/* Without JavaScript the header shows both links inline instead of the button. */
.no-js .region-switcher__toggle {
  display: none;
}

.no-js .region-switcher--header .region-switcher__menu {
  background: none;
  box-shadow: none;
  display: flex;
  gap: 0.25rem;
  min-width: 0;
  padding: 0;
  position: static;
}

/* Mobile menu (top of the panel) and footer (bottom bar): both regions as small pills. */
.region-switcher--offcanvas,
.region-switcher--footer {
  align-items: center;
  display: flex;
  gap: 0.625rem;
}

.region-switcher__globe {
  color: #00c3ff;
  height: 1.375rem;
  width: 1.375rem;
}

.region-switcher--offcanvas .region-switcher__list,
.region-switcher--footer .region-switcher__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.region-switcher--offcanvas .region-switcher__link,
.region-switcher--footer .region-switcher__link {
  align-items: center;
  border: 0.0625rem solid transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  font-size: 0.9375rem;
  gap: 0.5rem;
  line-height: 1.48;
  padding: 0.3125rem 0.75rem;
  text-decoration: none;
  transition: background-color 0.2s ease-out, color 0.2s ease-out;
}

.region-switcher--offcanvas .region-switcher__link:hover,
.region-switcher--footer .region-switcher__link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.region-switcher--offcanvas .region-switcher__link[aria-current],
.region-switcher--footer .region-switcher__link[aria-current] {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-weight: 700;
}

.region-switcher--offcanvas .region-switcher__link:focus-visible,
.region-switcher--footer .region-switcher__link:focus-visible {
  outline: 0.1875rem solid #fff;
  outline-offset: 0.125rem;
}

/* ==========================================================================
   Site footer (src/components/site/SiteFooter.astro)
   Mobile first: link groups collapse (<details>); from 48em they're open and laid out as
   columns (src/scripts/theme/site-footer.ts uses the same breakpoint).
   ========================================================================== */

.site-footer--redesign {
  padding-block: 0;
}

.site-footer--redesign a {
  color: inherit;
}

.site-footer--redesign h2,
.site-footer--redesign h3 {
  margin: 0;
}

/* Brand and contact. Phones: logo and social links side by side, contacts in two columns. */
.site-footer__brand {
  display: grid;
  gap: 1.75rem 1rem;
  grid-template-areas: 'identity social' 'contacts contacts';
  grid-template-columns: 1fr auto;
  padding-block: 3rem 2rem;
}

.site-footer__identity {
  grid-area: identity;
}

.site-footer__logo {
  border-radius: 0.375rem;
  display: block;
  width: fit-content;
}

.site-footer__logo:focus-visible {
  outline: 0.1875rem solid #fff;
  outline-offset: 0.25rem;
}

.site-footer__logo img {
  display: block;
  filter: brightness(0) invert(1); /* the blue logo, in white */
  height: auto;
  width: 8.5rem;
}

.site-footer__tagline {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.44;
  margin: 0.875rem 0 0;
  max-width: 21rem;
  text-wrap: pretty;
}

.site-footer__contacts {
  display: grid;
  gap: 1.25rem 1rem;
  grid-area: contacts;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__contact-type {
  color: rgba(255, 255, 255, 0.7);
  display: block;
  font-size: 0.875rem;
  line-height: 1.44;
  margin-block-end: 0.25rem;
}

.site-footer--redesign .site-footer__contact {
  margin: 0;
  width: fit-content;
}

.site-footer--redesign .site-footer__contact-label {
  font-size: 1.0625rem;
  line-height: 1.3;
}

.site-footer--redesign .site-footer__social {
  align-self: start;
  grid-area: social;
  margin: 0;
  translate: none;
}

/* Link groups */
.site-footer__group {
  border-block-start: 0.0625rem solid rgba(255, 255, 255, 0.2);
}

.site-footer__group:last-child {
  border-block-end: 0.0625rem solid rgba(255, 255, 255, 0.2);
}

.site-footer__group-summary {
  align-items: center;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  list-style: none;
  padding-block: 1.125rem;
}

.site-footer__group-summary::-webkit-details-marker {
  display: none;
}

.site-footer__group-summary:focus-visible {
  outline: 0.1875rem solid #fff;
  outline-offset: 0.125rem;
}

.site-footer__group-title {
  align-items: center;
  color: #00c3ff;
  display: inline-flex;
  font-size: 1.1875rem;
  font-weight: 700;
  gap: 0.625rem;
  line-height: 1.3;
}

.site-footer__group-icon {
  flex-shrink: 0;
}

.site-footer__group-chevron {
  color: #fff;
  flex-shrink: 0;
  transition: rotate 0.2s ease-out;
}

.site-footer__group[open] .site-footer__group-chevron {
  rotate: 180deg;
}

.site-footer__group-body {
  padding-block-end: 1.5rem;
}

.site-footer__services {
  display: grid;
  gap: 1.25rem;
}

.site-footer__service-title {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.44;
  margin-block-end: 0.125rem;
}

.site-footer__links .nav-menu__list {
  column-gap: 1.25rem;
  columns: 2;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links .nav-menu__item {
  break-inside: avoid;
}

.site-footer--redesign .nav-menu:not(.nav-menu--lg) .nav-menu__link {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  padding-block: 0.375rem;
}

.site-footer--redesign .nav-menu__link:hover {
  color: #fff;
}

.site-footer__area-link {
  align-items: center;
  border: 0.0625rem solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.9375rem;
  font-weight: 700;
  gap: 0.5rem;
  line-height: 1.48;
  margin-block-start: 1.25rem;
  padding: 0.4375rem 1rem 0.4375rem 0.75rem;
  text-decoration: none;
  transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
}

.site-footer__area-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: #00c3ff;
}

.site-footer__area-link:focus-visible {
  outline: 0.1875rem solid #fff;
  outline-offset: 0.125rem;
}

.site-footer__area-icon {
  color: #00c3ff;
  height: 1.125rem;
  width: 1.125rem;
}

.site-footer__area-arrow {
  color: #00c3ff;
}

/* Locations */
.site-footer__locations {
  display: grid;
  gap: 1rem;
  padding-block: 2rem;
}

.site-footer__locations-title {
  color: #00c3ff;
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
}

.site-footer__offices {
  display: grid;
  gap: 1.25rem 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__office-address {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  font-style: normal;
  line-height: 1.48;
  text-wrap: pretty;
}

.site-footer__office-name {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 1rem;
  font-weight: 700;
  gap: 0.5rem;
  margin-block-end: 0.25rem;
}

.site-footer__office-icon {
  color: #00c3ff;
  flex-shrink: 0;
  height: 1.25rem;
  width: 1.25rem;
}

.site-footer__office-lines {
  display: block;
}

/* Bottom bar */
.site-footer__bottom {
  align-items: flex-start;
  border-block-start: 0.0625rem solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem 2rem;
  padding-block: 1.5rem 2rem;
}

.site-footer__copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.48;
  margin: 0;
}

.site-footer__abn {
  white-space: nowrap;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__legal-link {
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1.48;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.1875em;
  transition: text-decoration-color 0.2s ease-out;
}

.site-footer__legal-link:hover {
  text-decoration-color: currentColor;
}

.site-footer__legal-link:focus-visible {
  outline: 0.1875rem solid #fff;
  outline-offset: 0.25rem;
}

/* Tablet and up: groups open, laid out as columns. */
@media (min-width: 48em) {
  .site-footer__brand {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem 3rem;
    padding-block: 3.5rem 2.5rem;
  }

  .site-footer__identity {
    flex: 1 1 16rem;
  }

  .site-footer__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2.5rem;
  }

  .site-footer--redesign .site-footer__contact-label {
    font-size: 1.1875rem;
  }

  .site-footer--redesign .site-footer__social {
    align-self: center;
  }

  .site-footer__nav {
    border-block-start: 0.0625rem solid rgba(255, 255, 255, 0.2);
    display: grid;
    gap: 2.5rem 2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-block: 2.5rem;
  }

  .site-footer__group,
  .site-footer__group:last-child {
    border: 0;
  }

  .site-footer__group--services {
    grid-column: 1 / -1;
  }

  .js .site-footer__group-summary {
    cursor: default;
    padding-block: 0 0.75rem;
    pointer-events: none;
  }

  .js .site-footer__group-chevron {
    display: none;
  }

  .site-footer__group-body {
    padding-block-end: 0;
  }

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

  .site-footer__service--long {
    grid-column: span 2;
  }

  .site-footer__links .nav-menu__list {
    columns: 1;
  }

  .site-footer__service--long .nav-menu__list {
    columns: 2;
    column-gap: 2rem;
  }

  .site-footer__locations {
    border-block-start: 0.0625rem solid rgba(255, 255, 255, 0.2);
    padding-block: 2.5rem;
  }

  .site-footer__offices {
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  }

  .site-footer__bottom {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .region-switcher--footer {
    margin-inline-start: auto;
  }
}

/* Desktop: a six-column grid shared by the link groups and the locations, so they line up:
   services take four columns (the long Connectivity list two of them), the other groups one
   each (more groups wrap onto a second row). */
@media (min-width: 64em) {
  .site-footer__nav,
  .site-footer__locations {
    column-gap: 2rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .site-footer__group--services {
    grid-column: span 4;
  }

  .site-footer__contacts {
    justify-content: flex-end;
  }

  .site-footer__locations {
    align-items: start;
  }

  .site-footer__offices {
    column-gap: 2rem;
    grid-column: 2 / -1;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
