/*
 * Project-specific ActiveAdmin styles.
 *
 * ActiveAdmin 4 ships a Tailwind build (served by the activeadmin_assets gem)
 * whose preflight reset strips default heading, list and link styling, so the
 * raw HTML rendered by the User Guide pages needs explicit rules. Colors are
 * defined for both the light theme and ActiveAdmin's `.dark` theme.
 */

.user-guide {
  max-width: 960px;
}

.user-guide .guide-section {
  margin-bottom: 2.5rem;
}

.user-guide .guide-title {
  color: #111827;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.user-guide .guide-text {
  color: #374151;
  font-size: 1rem;
  line-height: 1.5rem;
  margin: 0 0 0.75rem;
}

.user-guide .guide-steps,
.user-guide .guide-list {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.5rem;
  margin: 0.25rem 0 0;
  padding-left: 1.5rem;
}

.user-guide .guide-steps {
  list-style: decimal;
}

.user-guide .guide-list {
  list-style: disc;
}

.user-guide li {
  margin: 0.25rem 0;
}

.user-guide .guide-subtitle {
  color: #111827;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.user-guide .guide-fields {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  display: grid;
  font-size: 0.95rem;
  grid-template-columns: minmax(160px, 240px) 1fr;
  margin: 0.5rem 0 0.75rem;
  overflow: hidden;
}

.user-guide .guide-fields dt,
.user-guide .guide-fields dd {
  border-top: 1px solid #e5e7eb;
  margin: 0;
  padding: 0.6rem 0.9rem;
}

.user-guide .guide-fields dt:first-of-type,
.user-guide .guide-fields dd:first-of-type {
  border-top: 0;
}

.user-guide .guide-fields dt {
  background: #f9fafb;
  color: #111827;
  font-weight: 600;
}

.user-guide .guide-fields dd {
  color: #374151;
  line-height: 1.5rem;
}

@media (max-width: 640px) {
  .user-guide .guide-fields {
    grid-template-columns: 1fr;
  }

  .user-guide .guide-fields dd {
    border-top: 0;
  }
}

.user-guide strong {
  font-weight: 600;
}

.user-guide .guide-link {
  color: #2563eb;
  text-decoration: none;
}

.user-guide .guide-link:hover {
  text-decoration: underline;
}

.user-guide .guide-screenshot {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 0.9rem;
  margin: 1rem 0 0;
  overflow: hidden;
}

.user-guide .guide-screenshot img {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.user-guide .guide-screenshot figcaption {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  margin: 0;
  padding: 0.6rem 1rem;
}

.user-guide .guide-nav {
  border-top: 1px solid #e5e7eb;
  font-size: 0.95rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

/* Comments block at the bottom of every guide page */
.user-guide .guide-comment-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.user-guide .guide-comment {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
}

.user-guide .guide-comment-meta {
  align-items: center;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.85rem;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.user-guide .guide-comment-author {
  color: #111827;
  font-weight: 600;
}

.user-guide .guide-comment-delete-form {
  display: inline;
  margin-left: auto;
}

.user-guide .guide-comment-delete {
  background: none;
  border: 0;
  color: #b91c1c;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
  text-decoration: underline;
}

.user-guide .guide-comment-body {
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.5rem;
  overflow-wrap: anywhere;
}

.user-guide .guide-comment-body p {
  margin: 0 0 0.5rem;
}

.user-guide .guide-comment-body p:last-child {
  margin-bottom: 0;
}

.user-guide .guide-comment-empty {
  color: #6b7280;
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

.user-guide .guide-comment-form label {
  color: #111827;
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.user-guide .guide-comment-form textarea {
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
  display: block;
  font: inherit;
  margin-bottom: 0.75rem;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  width: 100%;
}

.user-guide .guide-comment-form textarea:focus {
  border-color: #2563eb;
  outline: 2px solid rgba(37, 99, 235, 0.25);
}

.user-guide .guide-comment-submit {
  background: #2563eb;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
}

.user-guide .guide-comment-submit:hover {
  background: #1d4ed8;
}

/* Dark theme (ActiveAdmin toggles the `dark` class on <html>) */
.dark .user-guide .guide-title,
.dark .user-guide .guide-subtitle {
  color: #f3f4f6;
}

.dark .user-guide .guide-fields,
.dark .user-guide .guide-fields dt,
.dark .user-guide .guide-fields dd {
  border-color: #374151;
}

.dark .user-guide .guide-fields dt {
  background: #111827;
  color: #f3f4f6;
}

.dark .user-guide .guide-fields dd {
  color: #d1d5db;
}

.dark .user-guide .guide-text,
.dark .user-guide .guide-steps,
.dark .user-guide .guide-list {
  color: #d1d5db;
}

.dark .user-guide .guide-link {
  color: #60a5fa;
}

.dark .user-guide .guide-screenshot {
  border-color: #374151;
  color: #9ca3af;
}

.dark .user-guide .guide-screenshot figcaption {
  background: #111827;
  border-top-color: #374151;
}

.dark .user-guide .guide-nav {
  border-top-color: #374151;
}

.dark .user-guide .guide-comment {
  border-color: #374151;
}

.dark .user-guide .guide-comment-author,
.dark .user-guide .guide-comment-form label {
  color: #f3f4f6;
}

.dark .user-guide .guide-comment-meta,
.dark .user-guide .guide-comment-empty {
  color: #9ca3af;
}

.dark .user-guide .guide-comment-body {
  color: #d1d5db;
}

.dark .user-guide .guide-comment-delete {
  color: #f87171;
}

.dark .user-guide .guide-comment-form textarea {
  background: #111827;
  border-color: #4b5563;
  color: #f3f4f6;
}
