/* WM Static Consent v0.2.0 */

:root {
  --wm-consent-bg: #fff;
  --wm-consent-text: #111;
  --wm-consent-border: #d7d7d7;
  --wm-consent-accent: #111;
  --wm-consent-radius: 12px;
  --wm-consent-shadow: 0 10px 30px rgba(0,0,0,.15);
  --wm-consent-z-banner: 9999;
  --wm-consent-z-modal: 10000;
}

/* ── Root ── */
#wm-static-consent-root { display: contents; }

/* ── Banner ── */
.wm-consent-banner {
  position: fixed;
  inset: auto 1rem 1.25rem 1rem;
  z-index: var(--wm-consent-z-banner);
}

.wm-consent-panel,
.wm-consent-dialog {
  background: var(--wm-consent-bg);
  color: var(--wm-consent-text);
  border: 1px solid var(--wm-consent-border);
  border-radius: var(--wm-consent-radius);
  box-shadow: var(--wm-consent-shadow);
  padding: 1.25rem;
}

.wm-consent-panel {
  max-width: 780px;
  margin: 0 auto;
}

.wm-consent-panel h2,
.wm-consent-dialog h2 {
  margin: 0 0 .5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.wm-consent-panel p {
  margin: 0 0 .75rem;
  font-size: .9rem;
  line-height: 1.5;
}

.wm-consent-panel a,
.wm-consent-dialog a {
  color: inherit;
  text-decoration: underline;
}

/* ── Actions ── */
.wm-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
}

.wm-consent-actions button,
.wm-consent-settings-btn {
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--wm-consent-accent);
  background: transparent;
  color: var(--wm-consent-text);
  padding: .6rem 1rem;
  font-size: .875rem;
  font-family: inherit;
  line-height: 1;
}

.wm-consent-actions button:first-child {
  background: var(--wm-consent-accent);
  color: var(--wm-consent-bg);
}

.wm-consent-actions button:focus-visible,
.wm-consent-settings-btn:focus-visible,
.wm-consent-category input:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

/* ── Modal ── */
.wm-consent-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: var(--wm-consent-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* display:flex overrides the UA [hidden]{display:none} — restore it */
.wm-consent-modal[hidden] { display: none; }

.wm-consent-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Categories ── */
.wm-consent-categories {
  display: grid;
  gap: .625rem;
  margin: 1rem 0;
}

.wm-consent-category {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid var(--wm-consent-border);
  border-radius: 10px;
  padding: .75rem;
}

.wm-consent-category-text {
  display: grid;
  gap: .2rem;
}

.wm-consent-category-text strong { font-size: .9rem; }
.wm-consent-category-text small  { font-size: .8rem; color: #555; }

.wm-consent-category input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--wm-consent-accent);
  flex-shrink: 0;
  margin-top: .15rem;
  cursor: pointer;
}

.wm-consent-category input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: .6;
}

/* ── Footer settings link ── */
a.wm-consent-footer-link {
  color: inherit;
  opacity: .7;
  text-decoration: underline;
  cursor: pointer;
}

a.wm-consent-footer-link:hover,
a.wm-consent-footer-link:focus-visible {
  opacity: 1;
}

a.wm-consent-footer-link:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .wm-consent-banner { inset: auto .75rem .75rem .75rem; }
  .wm-consent-actions { flex-direction: column; }
  .wm-consent-actions button { width: 100%; text-align: center; }
}

/* ── Embed placeholder ── */
.wm-embed-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 1px solid var(--wm-consent-border);
  border-radius: var(--wm-consent-radius);
  min-height: 120px;
  padding: 1.25rem;
  box-sizing: border-box;
}

.wm-embed-placeholder p {
  margin: 0;
  font-size: .875rem;
  color: #555;
  text-align: center;
  max-width: 320px;
}

/* ── Blocking overlay ── */
.wm-consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 9998;
}
