/* ==========================================================================
   LK Risk — Cookie banner (demo)
   A navy card fixed to the bottom of the viewport. Slides in once per
   visitor; the choice is remembered in localStorage only.
   Markup: components/cookie-banner.html · Behaviour: assets/js/cookie-banner.js
   ========================================================================== */

.cookie-banner {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
  z-index: 90; /* below the header (100) so the mobile menu covers it */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-5) var(--space-6);
  max-width: 60rem;
  margin-inline: auto;
  padding: var(--space-6) var(--space-7);
  background-color: var(--navy-950);
  color: var(--navy-200);
  border: 1px solid var(--color-line-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);

  /* Resting state: below the fold, unreachable until revealed */
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(100% + var(--space-7)));
  transition:
    transform var(--duration-slow) var(--ease-out),
    opacity var(--duration-slow) var(--ease-out),
    visibility 0s linear var(--duration-slow);
}

/* The class sets display, so the hidden attribute needs restating */
.cookie-banner[hidden] {
  display: none;
}

.cookie-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    transform var(--duration-slow) var(--ease-out),
    opacity var(--duration-slow) var(--ease-out),
    visibility 0s;
}

/* Gold hairline on the top edge — the site's accent rule */
.cookie-banner::before {
  content: "";
  position: absolute;
  top: -1px;
  left: var(--space-7);
  width: 40px;
  height: 1px;
  background-color: var(--gold-500);
}

.cookie-banner__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--color-line-dark);
  border-radius: 50%;
  color: var(--gold-500);
}

.cookie-banner__icon svg {
  width: 20px;
  height: 20px;
}

.cookie-banner__title {
  margin-bottom: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  color: var(--white);
}

.cookie-banner__text {
  max-width: 38rem;
  font-size: var(--text-sm);
  line-height: 1.6;
}

.cookie-banner__actions {
  display: flex;
  gap: var(--space-3);
}

.cookie-banner__actions .btn {
  min-width: 7.5rem;
}


/* --- Tablet & mobile: copy beside the icon, actions full width below ---- */
@media (max-width: 760px) {
  .cookie-banner {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: var(--space-5);
  }

  .cookie-banner::before {
    left: var(--space-5);
  }

  .cookie-banner__actions {
    grid-column: 1 / -1;
  }

  .cookie-banner__actions .btn {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .cookie-banner {
    bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    gap: var(--space-4);
  }

  .cookie-banner__icon {
    width: 36px;
    height: 36px;
  }

  .cookie-banner__icon svg {
    width: 18px;
    height: 18px;
  }
}
