/* ───────────────────────────────────────────────────────────────────────────
   C'noté — cookie consent banner
   Bottom slide-up sheet · friendly tone · equal-weight buttons.
   Uses the v4 design tokens from style.css.
   ─────────────────────────────────────────────────────────────────────────── */

/* The wrapper is fixed bottom; hidden by default; visible class slides it up. */
.cnote-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: none;
  background: var(--paper-soft, #FBFAF5);
  color: var(--ink, #0F0F0E);
  border-top: 1px solid var(--line, rgba(15, 15, 14, 0.10));
  box-shadow: 0 -8px 32px rgba(15, 15, 14, 0.08);
  font-family: var(--sans, system-ui, -apple-system, sans-serif);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cnote-consent--visible {
  display: block;
  transform: translateY(0);
}

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

.cnote-consent__container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 760px) {
  .cnote-consent__container {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
  }
  .cnote-consent__lead {
    flex: 1 1 520px;
    min-width: 0;
    max-width: 640px;
  }
  .cnote-consent__actions {
    flex: 0 0 auto;
  }
  .cnote-consent__panel {
    flex: 1 1 100%;
  }
}

.cnote-consent__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
  color: var(--ink, #0F0F0E);
  line-height: 1.3;
}

.cnote-consent__body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2, #2E2D2A);
  margin: 0;
}

/* ── Buttons — equal visual weight (D-05) ─────────────────────────────────── */
.cnote-consent__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

@media (min-width: 760px) {
  .cnote-consent__actions {
    flex-direction: row;
    width: auto;
    gap: 10px;
  }
}

.cnote-consent__btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 10px 18px;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--r-md, 10px);
  cursor: pointer;
  transition: background-color 160ms var(--ease, ease), border-color 160ms var(--ease, ease), color 160ms var(--ease, ease);
  text-align: center;
}
.cnote-consent__btn:focus-visible {
  outline: 2px solid var(--clay-deep, #B84F2E);
  outline-offset: 2px;
}

.cnote-consent__btn--accept {
  background: var(--ink, #0F0F0E);
  color: var(--paper, #F7F4ED);
  border-color: var(--ink, #0F0F0E);
}
.cnote-consent__btn--accept:hover {
  background: var(--clay-deep, #B84F2E);
  border-color: var(--clay-deep, #B84F2E);
}

.cnote-consent__btn--reject {
  background: transparent;
  color: var(--ink, #0F0F0E);
  border-color: var(--line-strong, rgba(15, 15, 14, 0.22));
}
.cnote-consent__btn--reject:hover {
  background: var(--paper-edge, #EFEADD);
  border-color: var(--ink-3, #6B6862);
}

.cnote-consent__btn--customize {
  background: transparent;
  color: var(--ink-2, #2E2D2A);
  border-color: var(--line, rgba(15, 15, 14, 0.10));
}
.cnote-consent__btn--customize:hover {
  background: var(--paper-edge, #EFEADD);
  color: var(--ink, #0F0F0E);
  border-color: var(--ink-3, #6B6862);
}

/* ── Customize panel ──────────────────────────────────────────────────────── */
.cnote-consent__panel {
  width: 100%;
  border-top: 1px solid var(--line, rgba(15, 15, 14, 0.10));
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cnote-consent__panel[hidden] { display: none; }

.cnote-consent__panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink, #0F0F0E);
}

.cnote-consent__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, rgba(15, 15, 14, 0.10));
}
.cnote-consent__row:last-of-type { border-bottom: 0; }

.cnote-consent__row-text {
  flex: 1 1 auto;
  min-width: 0;
}

.cnote-consent__row-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink, #0F0F0E);
  margin-bottom: 2px;
  cursor: pointer;
}

.cnote-consent__row-desc {
  font-size: 0.84rem;
  color: var(--ink-3, #6B6862);
  margin: 0;
  line-height: 1.45;
}

/* Switch toggle */
.cnote-consent__switch {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 40px;
  height: 24px;
  margin-top: 2px;
}
.cnote-consent__toggle-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.cnote-consent__switch-track {
  position: absolute;
  inset: 0;
  background: var(--line-strong, rgba(15, 15, 14, 0.22));
  border-radius: 999px;
  transition: background-color 160ms var(--ease, ease);
}
.cnote-consent__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--paper-soft, #FBFAF5);
  border-radius: 50%;
  transition: transform 160ms var(--ease, ease);
  box-shadow: 0 1px 3px rgba(15, 15, 14, 0.15);
}
.cnote-consent__toggle-input:checked + .cnote-consent__switch-track {
  background: var(--ink, #0F0F0E);
}
.cnote-consent__toggle-input:checked + .cnote-consent__switch-track::after {
  transform: translateX(16px);
}
.cnote-consent__toggle-input:focus-visible + .cnote-consent__switch-track {
  outline: 2px solid var(--clay-deep, #B84F2E);
  outline-offset: 2px;
}
.cnote-consent__switch--locked .cnote-consent__toggle-input {
  cursor: not-allowed;
}
.cnote-consent__switch--locked .cnote-consent__switch-track {
  background: var(--ink-4, #9B978D);
  opacity: 0.7;
}

.cnote-consent__panel-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 4px;
}

@media (min-width: 760px) {
  .cnote-consent__panel-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .cnote-consent__panel-actions .cnote-consent__btn {
    width: auto;
  }
}

.cnote-consent__privacy {
  font-size: 0.84rem;
  color: var(--ink-3, #6B6862);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cnote-consent__privacy:hover { color: var(--clay-deep, #B84F2E); }

/* ── Tiny screens: ensure body is readable ─────────────────────────────── */
@media (max-width: 380px) {
  .cnote-consent__container { padding: 16px 16px; }
  .cnote-consent__title { font-size: 1rem; }
  .cnote-consent__body { font-size: 0.88rem; }
}
