/* HUB2CLOUD Theme v0.3.2
 * Foundation layer on top of Quark 2. Keep this file focused on brand-level
 * overrides so upstream Quark 2 can continue to receive updates safely.
 */

:root,
:root[data-theme="light"] {
  --hub-brand: #00b3c7;
  --hub-brand-strong: #0097aa;
  --hub-footer-bg: #ffffff;
  --hub-footer-surface: #ffffff;
  --hub-footer-text: #111111;
  --hub-footer-muted: #69727a;
  --hub-footer-border: rgba(17, 17, 17, 0.09);
}

:root[data-theme="dark"] {
  --hub-brand: #18c4d7;
  --hub-brand-strong: #48d1df;
  --hub-footer-bg: #050607;
  --hub-footer-surface: #0b0d10;
  --hub-footer-text: #f8fafb;
  --hub-footer-muted: #939da5;
  --hub-footer-border: rgba(255, 255, 255, 0.11);
}

/* ---------- Header ---------- */
#header .navbar-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

#header .navbar-brand svg,
#header .navbar-brand img {
  display: block;
  width: min(236px, 23vw);
  max-height: 38px;
}

#header .navigation {
  align-items: center;
}

#header .navigation > li > a {
  font-weight: 520;
  letter-spacing: -0.01em;
}

#header .hub-nav-cta-item {
  margin-left: 0.4rem;
}

#header .hub-nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.5rem 0.9rem;
  border-radius: 9999px;
  background: var(--q2-text-strong);
  color: var(--q2-bg) !important;
  box-shadow: 0 0 0 1px var(--q2-border-ring), 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

#header .hub-nav-cta:hover {
  transform: translateY(-1px);
  opacity: 0.9;
  box-shadow: 0 0 0 1px var(--q2-border-strong), 0 8px 24px rgba(0, 0, 0, 0.12);
}

.mobile-container .hub-nav-cta-item {
  margin-top: 1rem;
}

.mobile-container .hub-nav-cta {
  display: inline-flex;
  padding: 0.7rem 1rem;
  border-radius: 9999px;
  background: var(--q2-text-strong);
  color: var(--q2-bg) !important;
}

/* ---------- Footer ---------- */
.hub-footer {
  position: relative;
  overflow: hidden;
  margin-top: clamp(4rem, 8vw, 7rem);
  padding: clamp(3.5rem, 7vw, 6rem) 0 1.6rem;
  color: var(--hub-footer-text);
  background:
    radial-gradient(circle at 8% -10%, color-mix(in oklab, var(--hub-brand) 20%, transparent), transparent 34rem),
    var(--hub-footer-bg);
  border-top: 1px solid var(--hub-footer-border);
}

.hub-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--hub-brand) 60%, transparent), transparent);
}

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

.hub-footer-main {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) minmax(0, 2fr);
  gap: clamp(3rem, 7vw, 7rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.hub-footer-brand {
  max-width: 430px;
}

.hub-footer-logo .navbar-brand {
  display: inline-flex;
  margin: 0 0 1.4rem;
}

.hub-footer-logo .navbar-brand svg,
.hub-footer-logo .navbar-brand img {
  width: min(255px, 72vw);
  max-height: 44px;
}

.hub-footer-logo svg {
  color: var(--hub-footer-text);
}

.hub-footer-description {
  max-width: 32rem;
  margin: 0;
  color: var(--hub-footer-muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.hub-footer-contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.48rem;
  margin-top: 1.45rem;
  color: var(--hub-footer-muted);
  font-size: 0.9rem;
}

.hub-footer-contact a:hover {
  color: var(--hub-footer-text);
}

.hub-footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 4rem);
}

.hub-footer-nav h2 {
  margin: 0 0 1.15rem;
  color: var(--hub-footer-text);
  font-family: var(--pico-font-family-sans-serif);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

.hub-footer-nav ul {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hub-footer-nav li {
  margin: 0;
  padding: 0;
}

.hub-footer-nav a {
  color: var(--hub-footer-muted);
  font-size: 0.92rem;
  transition: color 140ms ease;
}

.hub-footer-nav a:hover {
  color: var(--hub-footer-text);
}

.hub-footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding-top: 1.45rem;
  border-top: 1px solid var(--hub-footer-border);
  color: var(--hub-footer-muted);
  font-size: 0.79rem;
  line-height: 1.7;
}

.hub-footer-copyright,
.hub-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
}

.hub-footer-legal {
  justify-content: flex-end;
}

.hub-footer-legal a:hover {
  color: var(--hub-footer-text);
}

.hub-police-record {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hub-police-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.58rem;
  line-height: 1;
}

@media (max-width: 900px) {
  #header .navbar-brand svg,
  #header .navbar-brand img {
    width: 190px;
  }

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

  .hub-footer-brand {
    max-width: 620px;
  }
}

@media (max-width: 680px) {
  .hub-footer {
    padding-top: 3.25rem;
  }

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

  .hub-footer-bottom {
    flex-direction: column;
  }

  .hub-footer-legal {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .hub-footer-nav-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ========================================================================== */
/* HUB2CLOUD v0.3 — editorial navigation + mobile-first refinements            */
/* Inspired by the spacious, product-led rhythm of nanfu.global, while keeping */
/* HUB2CLOUD's own typography, brand color and component language.             */
/* ========================================================================== */

/* Wider, calmer header on the homepage. */
body.hub-home #header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 55;
  background: color-mix(in oklab, var(--q2-bg) 76%, transparent);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(145%) blur(18px);
  -webkit-backdrop-filter: saturate(145%) blur(18px);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

body.hub-home.scrolled #header {
  background: color-mix(in oklab, var(--q2-bg) 92%, transparent);
  border-bottom-color: var(--q2-divider);
  box-shadow: 0 10px 34px rgba(0,0,0,.035);
}

body.hub-home #header > .container {
  width: min(1420px, calc(100% - 64px));
}

body.hub-home #header .navbar {
  min-height: 78px;
}

body.hub-home.header-animated.scrolled #header .navbar {
  min-height: 66px;
}

body.hub-home #header .navbar-brand svg,
body.hub-home #header .navbar-brand img {
  width: min(206px, 20vw);
  max-height: 34px;
}

body.hub-home #header .dropmenu > ul,
body.hub-home #header .dropmenu ul.navigation {
  gap: .15rem;
}

body.hub-home #header .dropmenu a:not(.hub-nav-cta) {
  position: relative;
  padding: .55rem .78rem;
  border-radius: 0;
  background: transparent !important;
  font-size: .88rem;
  letter-spacing: .005em;
}

body.hub-home #header .dropmenu > ul > li > a:not(.hub-nav-cta)::after {
  content: "";
  position: absolute;
  left: .78rem;
  right: .78rem;
  bottom: .32rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .2s ease;
  opacity: .65;
}

body.hub-home #header .dropmenu > ul > li > a:not(.hub-nav-cta):hover::after,
body.hub-home #header .dropmenu > ul > li > a.active:not(.hub-nav-cta)::after {
  transform: scaleX(1);
  transform-origin: left center;
}

body.hub-home #header .hub-nav-cta {
  min-height: 40px;
  padding: .58rem 1rem;
  border: 1px solid var(--q2-text-strong);
  border-radius: 999px;
  background: var(--q2-text-strong);
  box-shadow: none;
  font-size: .84rem;
  font-weight: 650;
}

body.hub-home #header .hub-nav-cta::after {
  content: "↗";
  margin-left: .36rem;
  font-size: .88em;
  transition: transform .18s ease;
}

body.hub-home #header .hub-nav-cta:hover::after {
  transform: translate(2px,-2px);
}

/* Mobile overlay: intentionally more editorial and immersive than Quark2's
 * default sheet. It follows the active light/dark theme and keeps 48px+ targets. */
@media (max-width: 860px) {
  body.hub-home #header > .container {
    width: calc(100% - 28px);
  }

  body.hub-home #header .navbar,
  body.hub-home.header-animated.scrolled #header .navbar {
    min-height: 64px;
  }

  body.hub-home #header .navbar-brand svg,
  body.hub-home #header .navbar-brand img {
    width: min(166px, 48vw);
    max-height: 29px;
  }

  body.hub-home .mobile-menu {
    top: calc(10px + env(safe-area-inset-top, 0px));
    right: 12px;
  }

  body.hub-home button.button_container,
  body.hub-home .button_container {
    width: 44px;
    height: 44px;
    border: 1px solid var(--q2-divider);
    background: color-mix(in oklab, var(--q2-bg-elev) 88%, transparent);
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  body.hub-home .overlay {
    padding:
      calc(5.25rem + env(safe-area-inset-top, 0px))
      max(20px, env(safe-area-inset-right, 0px))
      calc(1.75rem + env(safe-area-inset-bottom, 0px))
      max(20px, env(safe-area-inset-left, 0px));
    background:
      radial-gradient(circle at 90% 0%, color-mix(in oklab, var(--hub-brand) 10%, transparent), transparent 28rem),
      var(--q2-bg);
    transform: translate3d(100%,0,0);
    transition: transform .42s cubic-bezier(.22,.75,.18,1);
  }

  body.hub-home .overlay.open {
    transform: translate3d(0,0,0);
  }

  body.hub-home .overlay .mobile-logo {
    margin: 0 0 clamp(2.2rem, 9vh, 5rem);
  }

  body.hub-home .overlay .mobile-logo .navbar-brand svg,
  body.hub-home .overlay .mobile-logo .navbar-brand img {
    width: min(220px, 64vw);
    max-height: 38px;
  }

  body.hub-home .overlay .overlay-menu > ul {
    border-top: 1px solid var(--q2-divider);
  }

  body.hub-home .overlay .overlay-menu > ul > li {
    border-bottom: 1px solid var(--q2-divider);
  }

  body.hub-home .overlay .overlay-menu > ul > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: .85rem 0;
    font-size: clamp(1.45rem, 7vw, 2.05rem);
    font-weight: 580;
    letter-spacing: -.035em;
  }

  body.hub-home .overlay .overlay-menu > ul > li > a::after {
    content: "↗";
    color: var(--q2-text-muted);
    font-family: var(--pico-font-family-sans-serif);
    font-size: .62em;
    font-weight: 500;
  }

  body.hub-home .overlay .overlay-menu ul ul {
    margin: 0 0 1rem;
    padding-left: 0;
    border-left: 0;
  }

  body.hub-home .overlay .overlay-menu ul ul a {
    min-height: 44px;
    padding: .55rem 0;
    font-size: 1rem;
  }

  body.hub-home .overlay .hub-nav-cta-item {
    margin-top: 1.4rem;
    border: 0 !important;
  }

  body.hub-home .overlay .hub-nav-cta {
    display: flex;
    justify-content: space-between;
    width: 100%;
    min-height: 54px;
    padding: .9rem 1rem;
    border: 1px solid var(--q2-text-strong);
    border-radius: 0;
    color: var(--q2-bg) !important;
    background: var(--q2-text-strong);
    font-size: 1rem;
  }

  body.hub-home .overlay .hub-nav-cta::after {
    content: "↗";
  }

  body.hub-home .overlay > div:last-child {
    margin-top: auto !important;
    padding-top: 1.5rem;
  }
}

/* Footer touch and narrow-screen improvements. */
@media (max-width: 680px) {
  .hub-footer {
    margin-top: clamp(3rem, 12vw, 5rem);
    padding-top: 3rem;
  }

  .hub-footer-main {
    gap: 2.75rem;
  }

  .hub-footer-nav-grid {
    gap: 2.2rem 1.5rem;
  }

  .hub-footer-nav a,
  .hub-footer-contact a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
  }

  .hub-footer-bottom {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

@media (max-width: 430px) {
  .hub-footer-nav-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hub-footer-nav h2 {
    margin-bottom: .75rem;
  }

  .hub-footer-logo .navbar-brand svg,
  .hub-footer-logo .navbar-brand img {
    width: min(220px, 72vw);
  }
}

@media (hover: none), (pointer: coarse) {
  #header .hub-nav-cta:hover,
  .hub-footer a:hover {
    transform: none;
  }
}

/* ========================================================================== */
/* HUB2CLOUD v0.3.1 — navigation, contact and footer coherence                */
/* ========================================================================== */

/* Quark2 renders active navigation as inverse text on a filled chip. The
 * HUB2CLOUD homepage uses an editorial underline instead, so keep the active
 * label readable on the translucent light header. */
body.hub-home #header .dropmenu > ul > li > a.active:not(.hub-nav-cta),
body.hub-home #header .dropmenu > ul > li > a.active:not(.hub-nav-cta):hover {
  color: var(--q2-text-strong) !important;
  background: transparent !important;
}

.hub-capability-item[id],
.hub-solution-card[id] {
  scroll-margin-top: 110px;
}

/* ---------- Contact ---------- */
.hub-contact-page #page-wrapper {
  overflow: visible;
}

.hub-contact-shell {
  padding: clamp(6.5rem, 10vw, 9.5rem) 0 clamp(5rem, 9vw, 8rem);
}

.hub-contact-shell > .container {
  width: min(1320px, calc(100% - 64px));
}

.hub-contact-heading {
  padding-bottom: clamp(2.25rem, 5vw, 4.5rem);
  border-bottom: 1px solid var(--q2-divider);
}

.hub-contact-heading .hub-kicker {
  display: block;
  margin-bottom: 1.25rem;
}

.hub-contact-heading h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3.4rem, 7.5vw, 7.2rem);
  font-weight: 560;
  line-height: .94;
  letter-spacing: -.055em;
}

.hub-contact-layout {
  display: grid;
  grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr);
  gap: clamp(4rem, 9vw, 9rem);
  align-items: start;
  padding-top: clamp(3rem, 6vw, 5.5rem);
}

.hub-contact-intro {
  position: sticky;
  top: 110px;
  min-width: 0;
}

.hub-contact-copy {
  max-width: 33rem;
  color: var(--q2-text-muted);
}

.hub-contact-copy > :first-child {
  margin-top: 0;
}

.hub-contact-copy p {
  color: var(--q2-text-muted);
  font-size: clamp(1.03rem, 1.25vw, 1.18rem);
  line-height: 1.78;
}

.hub-contact-details {
  display: grid;
  gap: 0;
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  border-top: 1px solid var(--q2-divider);
}

.hub-contact-details > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--q2-divider);
}

.hub-contact-details dt,
.hub-contact-details dd {
  margin: 0;
}

.hub-contact-details dt {
  color: var(--q2-text-muted);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
}

.hub-contact-details dd,
.hub-contact-details a {
  color: var(--q2-text-strong);
  font-size: .94rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.hub-contact-form {
  min-width: 0;
  padding-top: .2rem;
}

.hub-contact-form .form-wrapper {
  margin: 0;
}

.hub-contact-form .form-wrapper form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 1.4rem;
}

.hub-contact-form .form-field {
  min-width: 0;
  margin: 0;
}

.hub-contact-form .form-field:has(textarea),
.hub-contact-form .form-field:has(select),
.hub-contact-form .form-field:has(.textarea),
.hub-contact-form .buttons,
.hub-contact-form .button-wrapper {
  grid-column: 1 / -1;
}

.hub-contact-form .form-label {
  margin-bottom: .55rem;
  color: var(--q2-text-strong);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
}

.hub-contact-form .form-input,
.hub-contact-form .form-select,
.hub-contact-form input:not([type="hidden"]):not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.hub-contact-form select,
.hub-contact-form textarea {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: .85rem 0;
  border: 0;
  border-bottom: 1px solid var(--q2-border-strong);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--q2-text-strong);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.hub-contact-form textarea {
  min-height: 168px;
  resize: vertical;
}

.hub-contact-form .form-input:focus,
.hub-contact-form .form-select:focus,
.hub-contact-form input:focus,
.hub-contact-form select:focus,
.hub-contact-form textarea:focus {
  outline: none;
  border-bottom-color: var(--hub-brand);
  box-shadow: 0 1px 0 var(--hub-brand);
}

.hub-contact-form .buttons,
.hub-contact-form .button-wrapper {
  margin: .5rem 0 0;
}

.hub-contact-form .buttons button,
.hub-contact-form .buttons input[type="submit"],
.hub-contact-form .button-wrapper button,
.hub-contact-form .button-wrapper input[type="submit"] {
  min-width: 180px;
  min-height: 50px;
  padding: .8rem 1.35rem;
  border: 1px solid var(--q2-text-strong);
  border-radius: 0;
  background: var(--q2-text-strong);
  color: var(--q2-bg) !important;
  box-shadow: none;
  font-weight: 650;
}

/* ---------- Footer ---------- */
.hub-footer {
  margin-top: clamp(4rem, 7vw, 6rem);
  padding: clamp(3.75rem, 7vw, 6rem) 0 1.5rem;
  background: var(--hub-footer-bg);
}

.hub-footer::before {
  opacity: .45;
}

.hub-footer > .container {
  width: min(1320px, calc(100% - 64px));
}

.hub-footer-grid {
  display: grid;
  grid-template-columns: minmax(290px, 1.55fr) repeat(3, minmax(130px, .62fr));
  gap: clamp(2.25rem, 5vw, 5.5rem);
  align-items: start;
  padding-bottom: clamp(3.2rem, 6vw, 5rem);
}

.hub-footer-brand {
  max-width: 420px;
}

.hub-footer-logo .navbar-brand {
  margin-bottom: 1.45rem;
}

.hub-footer-description {
  max-width: 27rem;
  font-size: .94rem;
  line-height: 1.75;
}

.hub-footer-contact {
  gap: .5rem;
  margin-top: 1.5rem;
}

.hub-footer-nav h2 {
  margin: .25rem 0 1.3rem;
  font-size: .72rem;
  letter-spacing: .1em;
}

.hub-footer-nav h2::before {
  display: none;
}

.hub-footer-nav ul {
  gap: .72rem;
}

.hub-footer-nav a {
  font-size: .91rem;
}

.hub-footer-bottom {
  align-items: center;
  padding-top: 1.35rem;
}

@media (max-width: 980px) {
  .hub-footer-grid {
    grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(100px, .7fr));
    gap: 2.25rem;
  }
}

@media (max-width: 820px) {
  .hub-contact-shell > .container,
  .hub-footer > .container {
    width: calc(100% - 36px);
  }

  .hub-contact-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hub-contact-intro {
    position: static;
  }

  .hub-contact-form .form-wrapper form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .hub-footer-brand {
    grid-column: 1 / -1;
    max-width: 560px;
    padding-bottom: .5rem;
  }
}

@media (max-width: 560px) {
  .hub-contact-shell {
    padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  }

  .hub-contact-heading h1 {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .hub-contact-layout {
    padding-top: 2.5rem;
  }

  .hub-contact-form .form-wrapper form {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }

  .hub-contact-form .form-field,
  .hub-contact-form .buttons,
  .hub-contact-form .button-wrapper {
    grid-column: 1;
  }

  .hub-contact-form .buttons button,
  .hub-contact-form .buttons input[type="submit"],
  .hub-contact-form .button-wrapper button,
  .hub-contact-form .button-wrapper input[type="submit"] {
    width: 100%;
  }

  .hub-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.25rem 1.5rem;
  }

  .hub-footer-brand {
    grid-column: 1 / -1;
  }

  .hub-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .hub-footer-legal {
    justify-content: flex-start;
  }
}

@media (max-width: 380px) {
  .hub-footer-grid {
    grid-template-columns: 1fr;
  }

  .hub-footer-brand {
    grid-column: 1;
  }
}


/* ========================================================================== */
/* HUB2CLOUD v0.3.2 — visually centered footer                                */
/* ========================================================================== */

/* Keep the footer itself centered in the viewport. v0.3.1 used a deliberately
 * brand-heavy 1.55fr column which made the whole composition look left-heavy
 * even though the outer container was technically centered. */
.hub-footer > .container {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}

.hub-footer-grid {
  grid-template-columns: minmax(300px, 1.25fr) repeat(3, minmax(130px, 1fr));
  gap: clamp(2rem, 4vw, 4.25rem);
  justify-content: center;
}

.hub-footer-brand {
  width: 100%;
  max-width: 460px;
  justify-self: start;
  text-align: left;
}

.hub-footer-logo,
.hub-footer-logo .navbar-brand,
.hub-footer-description,
.hub-footer-contact,
.hub-footer-contact span {
  text-align: left;
}

.hub-footer-logo .navbar-brand {
  justify-content: flex-start;
}

.hub-footer-nav {
  justify-self: center;
  width: min(100%, 170px);
  text-align: left;
}

/* If there is no ICP / police / privacy / terms content, a lone copyright line
 * should sit on the visual centre instead of occupying the left half of a
 * justify-between row. */
.hub-footer-bottom-single {
  justify-content: center;
  text-align: center;
}

.hub-footer-bottom-single .hub-footer-copyright {
  width: 100%;
  justify-content: center;
}

@media (max-width: 980px) {
  .hub-footer > .container {
    width: min(920px, calc(100% - 48px));
  }

  .hub-footer-grid {
    grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(110px, 1fr));
    gap: 2rem;
  }
}

@media (max-width: 820px) {
  .hub-footer > .container {
    width: calc(100% - 36px);
  }

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

  .hub-footer-brand {
    grid-column: 1 / -1;
    max-width: 620px;
    justify-self: start;
  }

  .hub-footer-nav {
    justify-self: start;
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hub-footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hub-footer-brand {
    grid-column: 1 / -1;
  }

  .hub-footer-bottom-single {
    align-items: center;
  }
}

@media (max-width: 380px) {
  .hub-footer-grid {
    grid-template-columns: 1fr;
  }

  .hub-footer-brand {
    grid-column: 1;
  }
}

/* ========================================================================== */
/* HUB2CLOUD v0.4.1 — footer nav structure reset                              */
/* ========================================================================== */

/* Pico/Quark applies flex layout to <nav>. A footer column is semantic <nav>
 * containing a heading + list, so without an explicit reset the heading and
 * the list become two horizontal flex children. Keep each column vertical. */
.hub-footer-nav {
  display: block !important;
  min-width: 0;
}

.hub-footer-nav > h2,
.hub-footer-nav > ul {
  width: 100%;
}

.hub-footer-nav > ul,
.hub-footer-nav > ul:first-of-type,
.hub-footer-nav > ul:last-of-type {
  display: grid !important;
  grid-template-columns: 1fr;
  align-items: start;
  justify-content: stretch;
  margin: 0;
  padding: 0;
}

.hub-footer-nav > ul > li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.hub-footer-nav > ul > li > a {
  display: inline-flex;
  width: auto;
  margin: 0;
  padding: 0;
}

/* ========================================================================== */
/* HUB2CLOUD v0.4.1 — footer/contact stability                                */
/* ========================================================================== */

/* Footer columns are semantic <nav> elements. Quark/Pico treats nav as flex,
 * so explicitly keep each footer column vertical. */
.hub-footer-nav {
  display: block !important;
  min-width: 0;
}

.hub-footer-nav > h2,
.hub-footer-nav > ul {
  width: 100%;
}

.hub-footer-nav > ul,
.hub-footer-nav > ul:first-of-type,
.hub-footer-nav > ul:last-of-type {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: .72rem;
  margin: 0 !important;
  padding: 0 !important;
}

.hub-footer-nav > ul > li {
  display: block !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

.hub-footer-nav > ul > li > a {
  display: inline-flex !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Keep the footer's visual centre stable even when the brand address wraps. */
.hub-footer > .container {
  margin-inline: auto;
}

.hub-footer-brand,
.hub-footer-nav {
  min-width: 0;
}

.hub-footer-contact span,
.hub-footer-contact a {
  overflow-wrap: anywhere;
}

/* Desktop contact is intentionally two-column; mobile collapses only when the
 * viewport actually becomes narrow. */
@media (min-width: 821px) {
  .hub-contact-layout {
    grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr) !important;
  }
}
