/*
 * Cookie consent banner, preferences dialog and consent-gated embed placeholders.
 * Loaded on every front-end page, including the splash page, which skips chrome.css. So
 * this file is self-contained plain CSS. Colours come from the Tailwind @theme tokens
 * (always loaded via tailwind.css), with hex fallbacks.
 */

.cc-banner {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 900; /* above the video modal (z-600) */
  width: min(440px, calc(100vw - 3rem));
  background: var(--color-primary-dark, #1f3b38);
  color: #fff;
  padding: 1.5rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
  font-family: var(--font-body, "Exo", sans-serif);
  animation: cc-rise .45s cubic-bezier(.22, 1, .36, 1) both;
}
.cc-banner[hidden] { display: none; }

.cc-banner__title,
.cc-dialog__title {
  font-family: var(--font-head, "Comfortaa", cursive);
  font-weight: 500;
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 .6rem;
}
.cc-banner__text {
  font-size: .85rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
  margin: 0 0 1.1rem;
}
.cc-banner__text a,
.cc-dialog__intro a { color: var(--color-accent, #d4c9a8); text-decoration: underline; }

.cc-banner__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.cc-banner__actions .cc-btn--link { grid-column: 1 / -1; }

/* Buttons. Accept and Reject get equal weight on the banner, so declining is as
   easy as accepting. */
.cc-btn {
  font-family: var(--font-head, "Comfortaa", cursive);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .8rem 1rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  line-height: 1.2;
}
.cc-btn--primary { background: var(--color-accent, #d4c9a8); color: var(--color-primary-dark, #1f3b38); }
.cc-btn--primary:hover { background: var(--color-accent-light, #e5dcc0); }
.cc-btn--outline { background: transparent; color: var(--color-primary, #2f5651); border-color: var(--color-primary, #2f5651); }
.cc-btn--outline:hover { background: var(--color-primary, #2f5651); color: #fff; }
.cc-btn--link {
  background: none;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: .4rem;
}
.cc-btn--link:hover { color: var(--color-accent, #d4c9a8); }
.cc-btn:focus-visible,
.cc-dialog__close:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--color-accent, #d4c9a8);
  outline-offset: 2px;
}

/* ---- Preferences dialog ---- */
.cc-dialog {
  padding: 0;
  border: none;
  width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  background: #fff;
  color: #2a2a2a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  font-family: var(--font-body, "Exo", sans-serif);
}
.cc-dialog::backdrop { background: rgba(6, 14, 26, .6); }
.cc-dialog__inner { padding: 1.75rem; }
.cc-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.cc-dialog__title { color: var(--color-primary-dark, #1f3b38); font-size: 1.3rem; }
.cc-dialog__close {
  background: none;
  border: none;
  padding: .25rem;
  color: #666;
  cursor: pointer;
  line-height: 0;
}
.cc-dialog__close:hover { color: var(--color-primary, #2f5651); }
.cc-dialog__intro { font-size: .88rem; line-height: 1.6; color: #555; margin: 0 0 1.25rem; }
.cc-dialog__intro a { color: var(--color-primary, #2f5651); }

.cc-cat { border-top: 1px solid #ece8db; padding: 1rem 0; }
.cc-cat__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cc-cat__label {
  font-family: var(--font-head, "Comfortaa", cursive);
  font-weight: 600;
  font-size: .92rem;
  color: var(--color-primary-dark, #1f3b38);
  cursor: pointer;
}
.cc-cat__always {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-primary, #2f5651);
}
.cc-cat__desc { font-size: .82rem; line-height: 1.55; color: #666; margin: .4rem 0 0; }

/* Toggle switch: a real checkbox laid over the visual track. */
.cc-switch { position: relative; flex-shrink: 0; width: 44px; height: 24px; }
.cc-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cc-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #cfcabb;
  transition: background .25s ease;
}
.cc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .25s ease;
}
.cc-switch input:checked + .cc-switch__track { background: var(--color-primary, #2f5651); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }

.cc-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .6rem;
  border-top: 1px solid #ece8db;
  padding-top: 1.25rem;
}

/* ---- Consent-gated embeds (maps, video) ---- */
.consent-embed__placeholder {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  padding: 1.5rem;
  text-align: center;
  background: var(--color-cream, #F1EDE1);
  color: var(--color-primary-dark, #1f3b38);
  font-family: var(--font-body, "Exo", sans-serif);
  font-size: .9rem;
  line-height: 1.55;
}
.consent-embed__placeholder p { margin: 0; max-width: 420px; }
.consent-embed__placeholder .cc-btn--link { color: var(--color-primary, #2f5651); }
.consent-embed--dark .consent-embed__placeholder { background: #0b1620; color: #fff; }
.consent-embed--dark .consent-embed__placeholder .cc-btn--link { color: #fff; }
.consent-embed.is-allowed .consent-embed__placeholder { display: none; }

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

@media (max-width: 640px) {
  .cc-banner { left: .75rem; right: .75rem; bottom: .75rem; width: auto; padding: 1.25rem; }
  .cc-banner__actions { grid-template-columns: 1fr; }
  .cc-dialog__inner { padding: 1.25rem; }
  .cc-dialog__actions .cc-btn { flex: 1 1 100%; }
}

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