/* ============================================================
   Cookie banner and preferences dialog (js/cookie-consent.js).
   Pale blue and maroon, the homepage palette.
   ============================================================ */
:root {
  --cc-blue:   #bed5eb;
  --cc-blue-2: #e3eef8;
  --cc-maroon: #640a22;
  --cc-cream:  #f7f6ee;
}

.cc-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2000;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--cc-blue);
  color: var(--cc-maroon);
  border: 1.5px solid var(--cc-maroon);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(100, 10, 34, 0.18);
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
  animation: cc-rise 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cc-rise {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.cc-banner-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem 2rem;
  padding: 1.25rem 1.5rem;
}

.cc-banner-copy { flex: 1 1 auto; }

.cc-title {
  margin: 0 0 0.35rem;
  font-family: 'Cormorant', Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--cc-maroon);
}

.cc-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--cc-maroon);
}

.cc-link {
  color: var(--cc-maroon);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
}

/* Accept and Refuse share one style on purpose: Law 25 asks that
   saying no be as easy as saying yes. */
.cc-btn {
  min-width: 7.5rem;
  padding: 0.7rem 1.25rem;
  border: 1.5px solid var(--cc-maroon);
  border-radius: 999px;
  background: var(--cc-maroon);
  color: var(--cc-cream);
  font: 500 0.875rem/1 'Roboto', Helvetica, Arial, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.cc-btn:hover {
  background: var(--cc-cream);
  color: var(--cc-maroon);
}

.cc-btn--text {
  min-width: 0;
  padding: 0.7rem 0.5rem;
  border-color: transparent;
  background: transparent;
  color: var(--cc-maroon);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-btn--text:hover {
  background: transparent;
  text-decoration-thickness: 2px;
}

.cc-btn:focus-visible,
.cc-close:focus-visible,
.cc-switch:focus-visible,
.cc-link:focus-visible,
.cc-footer-link:focus-visible {
  outline: 2px solid var(--cc-maroon);
  outline-offset: 3px;
}

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

.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(38, 24, 52, 0.45);
  font-family: 'Roboto', Helvetica, Arial, sans-serif;
}

.cc-dialog {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 2rem 1.75rem 1.5rem;
  background: var(--cc-blue);
  color: var(--cc-maroon);
  border: 1.5px solid var(--cc-maroon);
  border-radius: 6px;
  outline: none;
}

.cc-dialog .cc-title { font-size: 1.75rem; padding-right: 2rem; }
.cc-dialog .cc-text { margin-bottom: 1.25rem; }
.cc-dialog .cc-actions { margin-top: 1.5rem; }
.cc-dialog .cc-actions .cc-link { margin-right: auto; font-size: 0.875rem; }

.cc-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--cc-maroon);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.cc-close:hover { background: var(--cc-blue-2); }

.cc-row {
  padding: 1rem 1.1rem;
  margin-top: 0.6rem;
  background: var(--cc-blue-2);
  border: 1px solid rgba(100, 10, 34, 0.25);
  border-radius: 4px;
}

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

.cc-row-title { font-weight: 500; font-size: 0.95rem; }

.cc-row-on {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.cc-row-desc {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Toggle switch */
.cc-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 2.75rem;
  height: 1.5rem;
  margin: 0;
  border: 1.5px solid var(--cc-maroon);
  border-radius: 999px;
  background: var(--cc-cream);
  cursor: pointer;
  transition: background 0.2s;
}

.cc-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--cc-maroon);
  transition: transform 0.2s;
}

.cc-switch:checked { background: var(--cc-maroon); }
.cc-switch:checked::after { background: var(--cc-cream); transform: translateX(1.2rem); }

body.cc-locked { overflow: hidden; }

/* ---- Footer link ---- */

.cc-footer {
  margin: 1.5rem 0 0;
  text-align: center;
}

.cc-footer-link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---- Small screens ---- */

@media (max-width: 760px) {
  .cc-banner { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; }
  .cc-banner-inner { flex-direction: column; align-items: stretch; padding: 1.1rem 1.1rem 1rem; }
  .cc-actions { justify-content: stretch; }
  .cc-banner .cc-btn { flex: 1 1 auto; min-width: 0; }
  .cc-banner .cc-btn--text { flex: 1 1 100%; order: 3; padding: 0.4rem; }
}

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