/* OVG Reaction Widget */

.ovg-reaction-widget {
  margin: 2rem 0;
}

/* Card ------------------------------------------------------------------- */

.ovg-card {
  display: flex;
  border: 1px solid #eadfd7;
  border-radius: 14px;
  background: #fffdfb;
  overflow: hidden;
}

.ovg-card-accent {
  flex: 0 0 4px;
  background: #57116f;
}

.ovg-card-body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1.5rem 1.5rem 1.25rem;
}

/* Wraps to a single column on its own once there is not enough room, so the
   layout does not depend on the breakpoint alone. */
.ovg-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
}

.ovg-card-copy {
  flex: 1 1 17rem;
  min-width: 0;
}

.ovg-reaction-title {
  margin: 0 0 0.35rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.45rem;
  line-height: 1.25;
  font-weight: 700;
  color: #19171b;
}

.ovg-reaction-label {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #777;
}

/* Buttons ---------------------------------------------------------------- */

.ovg-reaction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 0 1 auto;
}

.ovg-reaction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 7.5rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid #57116f;
  border-radius: 12px;
  background: transparent;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 700;
  line-height: 1.25;
  color: #57116f;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
  min-height: 46px;
}

/* Icon sits a step above the label. Scales with the button's font-size. */
.ovg-reaction-icon {
  font-size: 1.3em;
  line-height: 1;
}

.ovg-reaction-button:hover:not(:disabled) {
  background: #f4ecf8;
  transform: translateY(-1px);
}

.ovg-reaction-button:focus-visible {
  outline: 2px solid #57116f;
  outline-offset: 3px;
}

/* After reacting: the chosen button fills in, the other one recedes */
.ovg-reaction-button--selected {
  background: #57116f;
  color: #fff;
}

.ovg-reaction-button:disabled {
  cursor: default;
}

.ovg-reaction-button:disabled:not(.ovg-reaction-button--selected) {
  opacity: 0.35;
}

@media (prefers-reduced-motion: reduce) {
  .ovg-reaction-button {
    transition: none;
  }

  .ovg-reaction-button:hover:not(:disabled) {
    transform: none;
  }
}

/* Inline form ------------------------------------------------------------ */

.ovg-reaction-form[hidden] {
  display: none;
}

.ovg-reaction-form {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 360px;
}

.ovg-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ovg-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.ovg-field input {
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s;
}

.ovg-field input:focus {
  outline: none;
  border-color: #57116f;
  box-shadow: 0 0 0 3px rgba(87, 17, 111, 0.15);
}

.ovg-field-error {
  font-size: 0.8rem;
  color: #b91c1c;
  min-height: 1em;
  margin: 0;
}

.ovg-submit-button {
  align-self: flex-start;
  padding: 0.7rem 1.5rem;
  background: #57116f;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 46px;
  transition: background 0.15s;
}

.ovg-submit-button:hover:not(:disabled) {
  background: #45095a;
}

.ovg-submit-button:focus-visible {
  outline: 2px solid #1f2937;
  outline-offset: 3px;
}

.ovg-submit-button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Confirmation / error message ------------------------------------------- */

.ovg-reaction-message {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: #374151;
  min-height: 1.25em;
}

.ovg-reaction-message:empty {
  min-height: 0;
  margin: 0;
}

/* Dark mode -------------------------------------------------------------- */

[data-theme="dark"] .ovg-card {
  border-color: #2d3238;
  background: #16191d;
}

[data-theme="dark"] .ovg-card-accent {
  background: #8b4fa8;
}

[data-theme="dark"] .ovg-reaction-title {
  color: #f3f4f6;
}

[data-theme="dark"] .ovg-reaction-label {
  color: #9ca3af;
}

[data-theme="dark"] .ovg-reaction-button {
  border-color: #c9a3dd;
  color: #d9bce8;
}

[data-theme="dark"] .ovg-reaction-button:hover:not(:disabled) {
  background: rgba(201, 163, 221, 0.14);
}

[data-theme="dark"] .ovg-reaction-button--selected {
  background: #8b4fa8;
  border-color: #8b4fa8;
  color: #fff;
}

[data-theme="dark"] .ovg-reaction-button:focus-visible,
[data-theme="dark"] .ovg-submit-button:focus-visible {
  outline-color: #f9fafb;
}

[data-theme="dark"] .ovg-field label {
  color: #d1d5db;
}

[data-theme="dark"] .ovg-field input {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

[data-theme="dark"] .ovg-field input:focus {
  border-color: #8b4fa8;
  box-shadow: 0 0 0 3px rgba(139, 79, 168, 0.25);
}

[data-theme="dark"] .ovg-field-error {
  color: #f87171;
}

[data-theme="dark"] .ovg-reaction-message {
  color: #d1d5db;
}

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

@media (max-width: 600px) {
  .ovg-card-body {
    padding: 1.25rem 1.1rem 1rem;
  }

  .ovg-reaction-title {
    font-size: 1.3rem;
  }

  .ovg-reaction-buttons {
    width: 100%;
  }

  .ovg-reaction-button {
    flex: 1 1 8.5rem;
  }

  .ovg-reaction-form,
  .ovg-field input,
  .ovg-submit-button {
    max-width: 100%;
    width: 100%;
  }
}
