/* ==========================================================================
   Cookie consent — banner + preferences dialog.
   Tokens come from theme.css; no violet/retired names here.
   ========================================================================== */

.cc[hidden] { display: none; }

/* ---- bottom bar --------------------------------------------------------- */

/* Full-bleed band pinned to the bottom, not an inset floating card. */
.cc-bar {
  position: fixed;
  inset: auto 0 0;
  z-index: 1060;
  background: var(--navy);
  border-top: 1px solid var(--navy-line);
  box-shadow: 0 -18px 44px rgba(11, 26, 22, .18);
  transform: translateY(100%);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}

.cc.is-in .cc-bar { transform: none; }

/* The bar is dismissed while the dialog is open so they never stack. */
.cc.is-panel .cc-bar { transform: translateY(100%); }

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

.cc-bar-in {
  display: grid;
  gap: 1.1rem;
  padding-block: clamp(1.1rem, 2.4vw, 1.5rem);
  align-items: center;
}

@media (min-width: 900px) {
  .cc-bar-in { grid-template-columns: minmax(0, 1fr) auto; gap: 2.5rem; }
}

.cc-copy b {
  display: block;
  margin-bottom: .3rem;
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
}

.cc-copy p {
  margin: 0;
  max-width: 68ch;
  font-size: .92rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .72);
}

.cc-copy a {
  color: var(--lime);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-copy a:hover { color: var(--white); }

.cc-acts {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

@media (min-width: 900px) { .cc-acts { flex-wrap: nowrap; justify-content: flex-end; } }

/* ---- buttons ------------------------------------------------------------ */

.cc-btn {
  flex: 1 1 auto;
  min-height: 44px;                 /* comfortable touch target on a phone */
  padding: .7rem 1.25rem;
  border: 1.5px solid var(--lime);
  border-radius: 999px;
  background: var(--lime);
  color: var(--navy);
  font-family: var(--font-h);
  font-size: .92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .25s, border-color .25s, color .25s;
}

.cc-btn:hover { background: var(--lime-deep); border-color: var(--lime-deep); }

.cc-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, .28);
  color: var(--white);
}

.cc-btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .5);
  color: var(--white);
}

.cc-btn:focus-visible,
.cc-x:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}

/* ---- dialog ------------------------------------------------------------- */

.cc-panel[hidden] { display: none; }

.cc-panel {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: grid;
  place-items: end center;
  padding: 0;
  background: rgba(11, 26, 22, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

@media (min-width: 720px) {
  .cc-panel { place-items: center; padding: 1.5rem; }
}

.cc-sheet {
  width: 100%;
  max-width: 34rem;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-lg);
  overflow: hidden;
}

@media (min-width: 720px) { .cc-sheet { border-radius: var(--r-lg); } }

.cc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.35rem;
  border-bottom: 1px solid var(--line);
}

.cc-head h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -.015em;
  color: var(--ink);
}

.cc-x {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--body);
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.cc-x:hover { border-color: var(--acc); background: var(--acc-soft); color: var(--acc); }
.cc-x svg { width: 14px; height: 14px; fill: currentColor; }

.cc-body {
  padding: .35rem 1.35rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cc-cat { padding: 1.05rem 0; border-bottom: 1px solid var(--line-2); }
.cc-cat:last-child { border-bottom: 0; }

.cc-cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.cc-cat.is-locked .cc-cat-top { cursor: default; }

.cc-cat-label {
  font-family: var(--font-h);
  font-size: .98rem;
  font-weight: 600;
  color: var(--ink);
}

.cc-always {
  flex: none;
  padding: .25rem .6rem;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  font-family: var(--font-h);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.cc-cat p {
  margin: .45rem 0 0;
  padding-right: 3.8rem;
  font-size: .89rem;
  line-height: 1.6;
  color: var(--body);
}

/* toggle */
.cc-switch { position: relative; flex: none; width: 48px; height: 28px; }

.cc-switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.cc-switch i {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #CBD6D1;
  transition: background .25s;
}

.cc-switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(11, 26, 22, .25);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}

.cc-switch input:checked + i { background: var(--acc); }
.cc-switch input:checked + i::after { transform: translateX(20px); }
.cc-switch input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .cc-switch i, .cc-switch i::after { transition: none; }
}

.cc-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  padding: 1.1rem 1.35rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

/* Dialog sits on white, so the ghost buttons need the light treatment. */
.cc-foot .cc-btn--ghost {
  border-color: var(--line);
  color: var(--ink);
  background: var(--white);
}

.cc-foot .cc-btn--ghost:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ---- footer reopen link ------------------------------------------------- */

.cc-reopen {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.cc-reopen:hover { text-decoration: underline; }

@media print { .cc { display: none !important; } }
