/*
 * Cookie banner styles (issues #120, #122), shared by the Astro pages and the
 * pages WordPress still serves, so everything is scoped under `.pigsa-consent`
 * / `#consent-tab` and uses ID/attribute-boosted selectors to beat a
 * theme's global `button`/`a`/`h2` rules. Flat design: no shadows. Tokens are
 * the brand tokens of src/styles/global.css, copied because the WordPress
 * pages have no Tailwind. Font sizes are px (a theme may change the root size);
 * spacing stays in rem and assumes a 16px root. The font URL is root-absolute
 * on purpose (this file is also loaded from WordPress pages). Stacking: the
 * Astro defaults (banner 50, tab 30, under the sticky header's 40) can be
 * raised for WordPress pages through the two --pigsa-consent-z-* variables.
 */
@font-face {
  font-family: "PIGSA Consent Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/archivo-variable-latin.woff2") format("woff2");
}

#consent-banner.pigsa-consent,
#consent-tab {
  --c-brand: #bed62f;
  --c-ink: #282828;
  --c-muted: #54595f;
  --c-paper: #fafaf8;
  box-sizing: border-box;
  font-family: "PIGSA Consent Archivo", "Archivo", "Helvetica Neue", Helvetica, Arial, ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-style: normal;
  text-align: left;
  color: var(--c-ink);
}
#consent-banner.pigsa-consent *,
#consent-banner.pigsa-consent *::before,
#consent-banner.pigsa-consent *::after,
#consent-tab *,
#consent-tab::before {
  box-sizing: border-box;
}
#consent-banner.pigsa-consent[hidden],
#consent-tab[hidden],
#consent-banner .pigsa-consent-panel[hidden],
#consent-banner .pigsa-consent-btn[hidden] {
  display: none !important;
}

#consent-banner.pigsa-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--pigsa-consent-z-banner, 50);
  max-height: 90vh;
  overflow-y: auto;
  border-top: 2px dashed var(--c-ink);
  background: var(--c-paper);
}
#consent-banner .pigsa-consent-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
}
#consent-banner .pigsa-consent-title {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--c-ink);
}
#consent-banner .pigsa-consent-text {
  max-width: 48rem;
  margin: 0.25rem 0 0;
  font-size: 14px;
  line-height: 1.25rem;
  color: var(--c-muted);
}
#consent-banner .pigsa-consent-text a {
  font-weight: 600;
  color: var(--c-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
#consent-banner .pigsa-consent-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgb(40 40 40 / 0.4);
}
#consent-banner .pigsa-consent-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
#consent-banner .pigsa-consent-list li {
  margin: 0;
  padding: 0;
}
#consent-banner .pigsa-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0;
  cursor: pointer;
}
#consent-banner .pigsa-consent-label input {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0.125rem 0 0;
  accent-color: var(--c-ink);
}
#consent-banner .pigsa-consent-name {
  font-size: 14px;
  line-height: 1.25rem;
  font-weight: 700;
}
#consent-banner .pigsa-consent-desc {
  margin: 0.25rem 0 0;
  padding-left: 2rem;
  font-size: 14px;
  line-height: 1.25rem;
  color: var(--c-muted);
}
#consent-banner .pigsa-consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1rem;
}
#consent-banner .pigsa-consent-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.5rem 1rem;
  border: 2px solid var(--c-ink);
  border-radius: 0.25rem;
  background: var(--c-brand);
  box-shadow: none;
  font-family: inherit;
  font-style: normal;
  text-shadow: none;
  font-size: 12px;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--c-ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#consent-banner .pigsa-consent-btn-configure {
  grid-column: span 2;
  background: transparent;
}
/* Explicit states: a theme's button:hover/:focus must not recolour the banner. */
#consent-banner .pigsa-consent-btn:hover,
#consent-banner .pigsa-consent-btn:focus,
#consent-banner .pigsa-consent-btn:active {
  background: var(--c-brand);
  color: var(--c-ink);
  text-decoration: none;
  box-shadow: none;
}
#consent-banner .pigsa-consent-btn-configure:hover,
#consent-banner .pigsa-consent-btn-configure:focus,
#consent-banner .pigsa-consent-btn-configure:active {
  background: transparent;
}
#consent-banner .pigsa-consent-btn-save {
  margin-top: 1rem;
}
#consent-banner :focus-visible,
#consent-tab:focus-visible {
  outline: 2px solid var(--c-ink);
  outline-offset: 2px;
}

@media (min-width: 40rem) {
  #consent-banner .pigsa-consent-actions {
    display: flex;
  }
  #consent-banner .pigsa-consent-actions .pigsa-consent-btn {
    width: 10rem;
  }
  #consent-banner .pigsa-consent-btn-save {
    width: auto;
    padding-inline: 2rem;
  }
}
@media (min-width: 48rem) {
  #consent-banner .pigsa-consent-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#consent-tab {
  position: fixed;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: var(--pigsa-consent-z-tab, 30);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.125rem;
  min-height: 0;
  font-style: normal;
  text-shadow: none;
  margin: 0;
  padding: 0 0.625rem;
  border: 2px solid var(--c-ink);
  border-radius: 0.25rem;
  background: var(--c-paper);
  box-shadow: none;
  font-size: 12px;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--c-ink);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
#consent-tab:hover,
#consent-tab:focus,
#consent-tab:active {
  background: var(--c-paper);
  color: var(--c-ink);
  text-decoration: none;
  box-shadow: none;
}
#consent-tab::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
}
#consent-tab svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
}
@media (prefers-reduced-motion: no-preference) {
  #consent-tab {
    animation: pigsa-consent-tab-in 150ms ease-out;
  }
}
@keyframes pigsa-consent-tab-in {
  from {
    opacity: 0;
  }
}
@media print {
  #consent-tab {
    display: none;
  }
}
