/* Isolated community and popup layer; safe beside either article renderer. */

.sbla-community-front .sbla-community-form,
.sbcc-comments .comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.sbla-community-front .sbla-community-form > label,
.sbcc-comments .comment-form > p {
  margin: 0;
}

.sbcc-comments .comment-form :where(.comment-form-comment, .comment-form-author) {
  display: grid;
  gap: 0.4rem;
}

.sbla-community-front .sbla-community-form label,
.sbcc-comments .comment-form label {
  display: grid;
  gap: 0.4rem;
  color: #253b62;
  font-size: 0.82rem;
  font-weight: 800;
}

.sbla-community-front .sbla-community-form label span,
.sbcc-comments .comment-form label span {
  color: #667085;
  font-size: 0.72rem;
  font-weight: 600;
}

.sbla-community-front .sbla-community-form :where(input[type="text"], textarea),
.sbcc-comments .comment-form :where(input[type="text"], textarea) {
  box-sizing: border-box;
  width: 100%;
  min-height: 3.1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #c8d2e2;
  border-radius: 0.85rem;
  background: #fff;
  color: #2f3950;
  font: inherit;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(23, 36, 61, 0.04);
}

.sbla-community-front .sbla-community-form textarea,
.sbcc-comments .comment-form textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.sbla-community-front .sbla-community-form :where(input, textarea):focus,
.sbcc-comments .comment-form :where(input, textarea):focus {
  outline: 3px solid rgba(244, 207, 120, 0.6);
  outline-offset: 2px;
  border-color: #607096;
}

.sbla-community-front .sbla-community-form .sbla-honeypot,
.sbla-community-front .sbla-community-form [name="website"] {
  display: none !important;
}

.sbla-community-front .sbla-community-form button[type="submit"],
.sbcc-comments .comment-form .sbcc-comment-submit {
  align-self: flex-start;
  min-height: 3.2rem;
  margin: 0;
  padding: 0.8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: #17243d;
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(23, 36, 61, 0.18);
}

.sbla-community-front .sbla-community-form button[type="submit"]:hover,
.sbcc-comments .comment-form .sbcc-comment-submit:hover {
  background: #253b62;
  transform: translateY(-1px);
}

.sbla-community-front .sbla-community-form small,
.sbcc-comment-privacy {
  color: #667085;
  font-size: 0.7rem;
  line-height: 1.5;
}

.sbla-community-front .sbla-community-form.is-sbcc-enhanced > label:has(textarea) { order: 1; }
.sbla-community-front .sbla-community-form.is-sbcc-enhanced > label:has(input[name="author"]) { order: 2; }
.sbla-community-front .sbla-community-form.is-sbcc-enhanced > button { order: 3; }
.sbla-community-front .sbla-community-form.is-sbcc-enhanced > small { order: 4; }

.sbcc-comments {
  max-width: 47.5rem;
  padding-top: 1rem;
}

.sbcc-comments__welcome {
  margin-bottom: 1.5rem;
  padding: clamp(1.2rem, 3vw, 1.8rem);
  border: 1px solid #d8ddea;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, #f4f0fb, #fffaf2);
}

.sbcc-comments__welcome h2 {
  margin: 0;
  color: #17243d;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  line-height: 1.08;
}

.sbcc-comments__welcome > p:last-child,
.sbcc-comment-prompt {
  margin: 0.65rem 0 0;
  color: #667085;
  font-size: 0.84rem;
}

.sbcc-comments__eyebrow {
  margin: 0 0 0.45rem !important;
  color: #604d8b !important;
  font-size: 0.68rem !important;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sbcc-comments__count,
.sbcc-comments .comment-reply-title {
  margin: 1.5rem 0 0.65rem;
  color: #17243d;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.4rem;
}

.sbcc-comments .comment-form {
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid #d8ddea;
  border-radius: 1.2rem;
  background: #fff;
  box-shadow: 0 12px 34px rgba(23, 36, 61, 0.07);
}

body.has-sbcc-popup .sbcc-mobile-cta { display: none !important; }

.sbcc-popup[hidden] {
  display: none !important;
}

.sbcc-popup {
  position: fixed;
  right: 1rem;
  right: max(1rem, env(safe-area-inset-right));
  bottom: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 990;
  width: min(calc(100vw - 2rem), 29rem);
  box-sizing: border-box;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}

.sbcc-popup *,
.sbcc-popup *::before,
.sbcc-popup *::after {
  box-sizing: border-box;
}

.sbcc-popup__panel {
  position: relative;
  width: 100%;
  max-height: min(82vh, 40rem);
  overflow: auto;
  padding: clamp(1.3rem, 4vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.5rem;
  background: radial-gradient(circle at 85% 8%, rgba(244, 207, 120, 0.18), transparent 10rem), linear-gradient(145deg, #17243d, #253b62);
  color: #fff;
  text-align: left;
  box-shadow: 0 24px 70px rgba(3, 10, 24, 0.38);
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
}

.sbcc-popup.is-open .sbcc-popup__panel {
  opacity: 1;
  transform: none;
}

.sbcc-popup__close {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.sbcc-popup__close:hover { background: rgba(255, 255, 255, 0.15); }

.sbcc-popup__moon {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 1rem;
  border-radius: 1rem;
  background: #f4cf78;
  color: #17243d;
  font-size: 1.75rem;
}

.sbcc-popup__eyebrow {
  margin: 0 3rem 0.45rem 0;
  color: #ffe7a7;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sbcc-popup h2 {
  margin: 0;
  color: #fff;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: clamp(1.9rem, 7vw, 2.7rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.sbcc-popup h2 + p {
  margin: 0.8rem 0 1.15rem;
  color: #d1dced;
  font-size: 0.88rem;
  line-height: 1.6;
}

.sbcc-popup__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.25rem;
  width: 100%;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: #f4cf78;
  color: #17243d !important;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  box-shadow: 0 14px 34px rgba(2, 8, 20, 0.25);
}

.sbcc-popup__button:hover { background: #ffe7a7; }

.sbcc-popup small {
  display: block;
  margin-top: 0.7rem;
  color: #aebdd4;
  font-size: 0.66rem;
  line-height: 1.45;
  text-align: center;
}

.sbcc-popup :where(a, button):focus-visible {
  outline: 3px solid #f4cf78;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .sbcc-popup {
    right: 0.65rem;
    right: max(0.65rem, env(safe-area-inset-right));
    bottom: 0.65rem;
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    left: 0.65rem;
    left: max(0.65rem, env(safe-area-inset-left));
    width: auto;
  }
  .sbcc-popup__panel { border-radius: 1.35rem; }
  .sbcc-popup__moon { width: 2.8rem; height: 2.8rem; font-size: 1.45rem; }
  .sbla-community-front .sbla-community-form button[type="submit"],
  .sbcc-comments .comment-form .sbcc-comment-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sbcc-popup__panel,
  .sbla-community-front .sbla-community-form button[type="submit"],
  .sbcc-comments .comment-form .sbcc-comment-submit { transition: none !important; }
}

@media print {
  .sbcc-popup,
  .sbla-community-front .sbla-community-form,
  .sbcc-comments .comment-respond { display: none !important; }
}
