/* Home-only accessibility hint and analytics consent controls. */

.home-a11y-hint,
.home-cookie-banner,
.home-cookie-control,
.home-cookie-menu {
  box-sizing: border-box;
  font-family: var(--font-main);
  color: var(--black, #1f1f29);
}

/* The permanent accessibility button remains untouched. This short-lived
   coachmark only points to it and mirrors its action. */
.home-a11y-hint {
  position: fixed;
  z-index: 2290;
  left: calc(var(--g-gutter, 16px) + 52px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--g-gutter, 16px) - 4px);
  max-width: min(360px, calc(100vw - 100px));
  min-height: 44px;
  padding: 12px 16px;
  border: 2px solid var(--black, #1f1f29);
  border-radius: 4px;
  background: var(--bg, #fffaf6);
  color: var(--black, #1f1f29);
  box-shadow: 0 8px 24px rgba(31, 31, 41, 0.18);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
  text-align: left;
  text-wrap: pretty;
  cursor: pointer;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.home-a11y-hint::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 15px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--black, #1f1f29);
  border-bottom: 2px solid var(--black, #1f1f29);
  background: var(--bg, #fffaf6);
  transform: rotate(45deg);
}

.home-a11y-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.home-a11y-hint:hover { background: #ffffff; }
.home-a11y-hint.is-status { cursor: default; }

.home-a11y-hint:focus-visible,
.home-cookie-banner button:focus-visible,
.home-cookie-control:focus-visible,
.home-cookie-menu:focus-visible {
  outline: 3px solid #ffd400;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--black, #1f1f29);
}

/* A visually hidden live region remains available after the visual coachmark
   closes, so its announcement is not tied to the three-second animation. */
.home-addon-live {
  position: absolute;
  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;
}

/* Consent banner. Analytics does not load until the visitor accepts. */
.home-cookie-banner {
  position: fixed;
  z-index: 2400;
  right: var(--g-gutter, 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--g-gutter, 16px));
  width: min(448px, calc(100vw - 2 * var(--g-gutter, 16px)));
  padding: 20px;
  border: 2px solid var(--black, #1f1f29);
  border-radius: 4px;
  background: var(--bg, #fffaf6);
  box-shadow: 0 12px 36px rgba(31, 31, 41, 0.22);
}

.home-cookie-banner[hidden],
.home-cookie-control[hidden],
.home-cookie-menu[hidden],
.home-a11y-hint[hidden] {
  display: none !important;
}

.home-cookie-banner__title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.home-cookie-banner__text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  text-wrap: pretty;
}

.home-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.home-cookie-banner__actions button {
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid var(--black, #1f1f29);
  border-radius: 2px;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

.home-cookie-banner__accept {
  background: var(--black, #1f1f29);
  color: #ffffff;
}

.home-cookie-banner__decline {
  background: transparent;
  color: var(--black, #1f1f29);
}

.home-cookie-banner__actions button:hover { text-decoration: underline; }

/* Desktop, a compact persistent entry point after a choice was stored. */
.home-cookie-control {
  position: fixed;
  z-index: 2280;
  right: var(--g-gutter, 16px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--g-gutter, 16px));
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--black, #1f1f29);
  border-radius: 50%;
  background: var(--bg, #fffaf6);
  color: var(--black, #1f1f29);
  cursor: pointer;
}

.home-cookie-control:hover { background: #ffffff; }
.home-cookie-control svg { width: 22px; height: 22px; pointer-events: none; }

/* Mobile, cookie settings live in the existing menu instead of floating. */
.home-cookie-menu {
  display: none;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

@media (max-width: 39.99em) {
  .home-a11y-hint {
    left: var(--g-margin, 16px);
    right: var(--g-margin, 16px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    max-width: none;
    font-size: 18px;
  }

  .home-a11y-hint::before {
    left: 17px;
    bottom: -9px;
    transform: rotate(-45deg);
  }

  .home-cookie-banner {
    right: 0;
    bottom: 0;
    width: 100%;
    padding: 20px max(16px, var(--g-margin, 16px)) calc(20px + env(safe-area-inset-bottom, 0px));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
  }

  .home-cookie-banner__title,
  .home-cookie-banner__text,
  .home-cookie-banner__actions button {
    font-size: 18px;
  }

  .home-cookie-banner__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-cookie-control { display: none !important; }

  .site-menu__footer .home-cookie-menu {
    display: inline-flex;
    align-items: center;
  }

  /* Keep the requested mobile size even when the site's proportional a11y
     scaler has measured this late-injected control. */
  html.has-topnav:not(.a11y) body .home-a11y-hint[data-a11y-s],
  html.a11y body .home-a11y-hint { font-size: 18px !important; }
}

@media (min-width: 40em) {
  html.a11y body .home-a11y-hint { font-size: 16px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .home-a11y-hint { transition: none; transform: none; }
}

@media (forced-colors: active) {
  .home-a11y-hint,
  .home-cookie-banner,
  .home-cookie-control {
    border: 2px solid ButtonText;
    box-shadow: none;
  }
}
