/* Master CMS — cookie consent. Uses the active theme's CSS variables. */

.cc-root, .cc-root * { box-sizing: border-box; }
.cc-root { font-family: var(--font-body, system-ui, sans-serif); font-size: 15px; line-height: 1.5; color: #1f2937; }
.cc-root [hidden] { display: none !important; }
html.cc-lock { overflow: hidden; }

.cc-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 99990; }

/* ---- Banner ---- */
.cc-banner {
  position: fixed; z-index: 99995; background: #fff; color: #1f2937;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, .18); border-top: 4px solid var(--color-primary, #4B5563);
}
.cc-pos-bottom .cc-banner {
  left: 0; right: 0; bottom: 0; padding: 1.1rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between;
}
.cc-pos-bottom .cc-banner-text { flex: 1 1 420px; max-width: 880px; }
.cc-pos-center .cc-banner {
  left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 2rem));
  border: 0; border-radius: var(--radius-md, 16px); padding: 1.75rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.cc-banner-title { display: block; font-size: 1.05rem; margin-bottom: .2rem; font-family: var(--font-heading, inherit); }
.cc-banner-text p { margin: 0; color: #4b5563; }
.cc-policy-link, .cc-modal a { color: var(--color-primary, #4B5563); text-decoration: underline; }
.cc-banner-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.cc-pos-center .cc-banner-actions { margin-top: 1.25rem; }

/* ---- Buttons: Reject and Accept deliberately share one style ---- */
.cc-btn {
  font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; padding: .65rem 1.3rem;
  border-radius: var(--radius-sm, 999px); border: 2px solid var(--color-primary, #4B5563); line-height: 1.2;
}
.cc-btn-solid { background: var(--color-primary, #4B5563); color: #fff; }
.cc-btn-outline { background: #fff; color: var(--color-primary, #4B5563); }
.cc-btn:hover { filter: brightness(.93); }
.cc-btn:focus-visible, .cc-close:focus-visible, .cc-cat-toggle:focus-visible, .cc-switch input:focus-visible + .cc-slider {
  outline: 3px solid #2563eb; outline-offset: 2px;
}

/* ---- Preferences dialog ---- */
.cc-modal {
  position: fixed; z-index: 99999; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem);
  background: #fff; border-radius: var(--radius-md, 16px); box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; overflow: hidden;
}
.cc-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.5rem; border-bottom: 1px solid #e5e7eb; }
.cc-modal-head h2 { margin: 0; font-size: 1.25rem; font-family: var(--font-heading, inherit); }
.cc-close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: #6b7280; padding: .1rem .5rem; border-radius: 6px; }
.cc-modal-body { padding: 1rem 1.5rem; overflow-y: auto; }
.cc-modal-intro { margin: 0 0 1rem; color: #4b5563; }
.cc-modal-foot { display: flex; gap: .6rem; padding: 1rem 1.5rem; border-top: 1px solid #e5e7eb; }
.cc-modal-foot .cc-btn { flex: 1; }

.cc-cat { border-top: 1px solid #e5e7eb; padding: .9rem 0; }
.cc-cat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cc-cat-toggle {
  background: none; border: 0; cursor: pointer; font: inherit; font-weight: 700; color: #111827;
  display: flex; align-items: center; gap: .55rem; padding: .15rem .25rem; margin-left: -.25rem; border-radius: 6px; text-align: left;
}
.cc-chevron { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; flex-shrink: 0; }
.cc-cat-toggle[aria-expanded="true"] .cc-chevron { transform: rotate(45deg); }
.cc-cat-desc { margin: .35rem 0 0 1.35rem; color: #4b5563; font-size: .9rem; }
.cc-always { color: #2563eb; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.cc-cat-list { margin: .75rem 0 0 1.35rem; overflow-x: auto; }
.cc-none { margin: 0; color: #6b7280; font-size: .85rem; }
.cc-cookie-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.cc-cookie-table th, .cc-cookie-table td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.cc-cookie-table th { color: #6b7280; font-weight: 600; }
.cc-cookie-table code { background: #f3f4f6; padding: .1rem .35rem; border-radius: 4px; font-size: .8rem; word-break: break-all; }

/* Toggle switch */
.cc-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cc-slider { position: absolute; inset: 0; background: #6b7280; border-radius: 999px; transition: background .15s; }
.cc-slider::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; }
.cc-switch input:checked + .cc-slider { background: var(--color-primary, #4B5563); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(20px); }
.cc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Held-back embeds */
.cc-embed-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .9rem; padding: 1.5rem; text-align: center; background: #f3f4f6; color: #374151;
}
.cc-embed-placeholder p { margin: 0; max-width: 420px; }

/* Footer links */
.cc-footer-links { margin-top: .5rem; font-size: .85rem; text-align: center; position: relative; z-index: 1; }
.cc-footer-links a { color: inherit; text-decoration: underline; }

@media (max-width: 640px) {
  .cc-pos-bottom .cc-banner { padding: 1rem; max-height: 75vh; overflow-y: auto; }
  .cc-banner-actions { width: 100%; }
  .cc-banner-actions .cc-btn { flex: 1 1 auto; }
  .cc-modal-foot { flex-direction: column; }
  .cc-modal-head, .cc-modal-body, .cc-modal-foot { padding-left: 1rem; padding-right: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cc-slider, .cc-slider::before, .cc-chevron { transition: none; }
}
