/* Compact, non-modal consent controls shared by every public page. */
.cookie-consent {
  box-sizing: border-box;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  margin: 0;
  padding: 0.75rem max(1rem, calc((100vw - 70rem) / 2));
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0;
  background: rgba(10, 10, 10, 0.9);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-family: 'Montserrat', Arial, sans-serif;
  transition: opacity 180ms ease, background-color 180ms ease, color 180ms ease;
}

.cookie-consent.is-on-dark {
  border-top-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
  color: rgba(12, 12, 12, 0.9);
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent-copy {
  min-width: 0;
  max-width: 100%;
}

.cookie-consent-title {
  margin: 0 0 0.18rem;
  color: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.cookie-consent-text {
  margin: 0;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.45;
  opacity: 0.68;
  overflow-wrap: anywhere;
  white-space: normal;
}

.cookie-consent-link {
  color: inherit;
  text-underline-offset: 0.16em;
}

.cookie-consent-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-consent-button,
.cookie-settings-trigger {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.cookie-consent-button {
  min-height: 2.25rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.72;
  transition: opacity 150ms ease, background-color 150ms ease, color 150ms ease;
}

.cookie-consent-button:hover,
.cookie-consent-button:focus-visible {
  opacity: 1;
}

.cookie-consent-button--accept {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  opacity: 1;
}

.cookie-consent.is-on-dark .cookie-consent-button--accept {
  background: rgba(10, 10, 10, 0.9);
  color: #fff;
}

.cookie-consent-button:focus-visible,
.cookie-settings-trigger:focus-visible {
  outline: 2px solid #4d9eff;
  outline-offset: 3px;
}

.cookie-settings-trigger {
  color: inherit;
  font-size: 0.65rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 0.18em;
  opacity: 0.48;
  transition: opacity 150ms ease;
}

.cookie-settings-trigger:hover,
.cookie-settings-trigger:focus-visible {
  opacity: 0.9;
}

.cookie-settings-trigger--standalone {
  display: block;
  width: fit-content;
  margin: 1.5rem auto;
}

/* Keep the first-view security row clear of the fixed notice. */
.cookie-consent-open .landing-page {
  padding-bottom: clamp(6.75rem, 12vh, 8.5rem);
}

/* At the bottom of the page, keep the footer controls above the fixed bar. */
.cookie-consent-open .site-footer {
  margin-bottom: calc(var(--cookie-consent-clearance, 4rem) + 0.5rem);
}

@media (max-width: 680px) {
  .cookie-consent {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0.75rem max(0.85rem, env(safe-area-inset-right, 0px)) calc(0.75rem + env(safe-area-inset-bottom, 0px)) max(0.85rem, env(safe-area-inset-left, 0px));
  }

  .cookie-consent-actions {
    justify-content: flex-end;
  }

  .cookie-consent-button {
    flex: 1 1 0;
    min-width: 0;
    padding-right: 0.45rem;
    padding-left: 0.45rem;
  }

  .cookie-consent-open .landing-page {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .extraction-canvas--hero {
    transition: height 220ms ease;
  }

  .cookie-consent-open .extraction-canvas--hero {
    height: min(40dvh, 20.5rem);
    min-height: 19rem;
  }
}

@media (max-width: 380px) {
  .cookie-consent-text {
    font-size: 0.64rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent {
    transition: none;
  }
}
