/* Bidragssidene (/bidra, /mine-bidrag). Bygger på user.css-idiomet. */

[data-contrib-form] h2 {
  margin: 1.5rem 0 0.25rem;
  font-size: 1.1rem;
}

.contrib-help {
  margin: 0.25rem 0 0.75rem;
  color: var(--text-muted, #666);
  font-size: 0.9rem;
}

.contrib-kind {
  border: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  gap: 1.25rem;
}

.contrib-target label,
.contrib-context,
.contrib-comment,
.contrib-credit label[data-credit-name-row] {
  display: block;
  margin: 0.5rem 0;
}

.contrib-target label span,
.contrib-context span,
.contrib-comment span,
[data-credit-name-row] span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted, #666);
  margin-bottom: 0.15rem;
}

.contrib-target input,
.contrib-comment textarea,
.contrib-context select,
[data-credit-name-row] input,
.contrib-freetext input {
  width: 100%;
  max-width: 32rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
}

.contrib-freetext {
  margin: 0.5rem 0;
}

.contrib-freetext summary {
  cursor: pointer;
  color: var(--text-muted, #666);
}

.contrib-ref {
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  padding: 0.6rem;
  margin: 0.5rem 0;
}

.contrib-ref-main {
  display: flex;
  gap: 0.4rem;
}

.contrib-ref-main input[data-ref-raw] {
  flex: 1;
  min-width: 8rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
}

.contrib-ref-main select {
  padding: 0.3rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: inherit;
}

.contrib-ref-remove {
  border: none;
  background: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted, #888);
  padding: 0 0.35rem;
}

.contrib-ref-where {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}

.contrib-ref-where input {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: inherit;
  font-size: 0.85rem;
}

.contrib-ref-where input[data-ref-page] {
  width: 5.5rem;
}

.contrib-ref-where input[data-ref-section] {
  flex: 1;
  min-width: 8rem;
}

.contrib-ref-where input[data-ref-quote] {
  flex: 2;
  min-width: 10rem;
}

.contrib-ref-preview {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted, #555);
}

.contrib-preview-unparsed {
  font-style: italic;
}

.contrib-add-ref,
.contrib-submit,
[data-respond-send],
.contrib-login-cta {
  display: inline-block;
  margin: 0.5rem 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border, #bbb);
  border-radius: 8px;
  background: var(--bg-raised, #f4f4f4);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.contrib-submit {
  font-weight: 600;
}

.contrib-status {
  margin-top: 0.75rem;
  font-weight: 600;
}

.contrib-status-error {
  color: var(--danger, #b3261e);
}

.contrib-review-note {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
}

.contrib-respond {
  margin-top: 0.5rem;
}

.contrib-respond textarea {
  width: 100%;
  max-width: 32rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border, #ccc);
  border-radius: 6px;
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
}

/* Statusbadges. reading.css (som eier .version-badge) lastes ikke på
   brukersidene, så basen gjentas her for kortene. */
.contrib-card .version-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.badge-pending {
  background: #e8eaf6;
  color: #3949ab;
}

.badge-needs_info {
  background: #fff3e0;
  color: #b26a00;
}

.badge-approved {
  background: #e6f4ea;
  color: #1e7e34;
}

.badge-rejected {
  background: #fdecea;
  color: #b3261e;
}

@media (prefers-color-scheme: dark) {
  .badge-pending { background: #26305c; color: #aab6f7; }
  .badge-needs_info { background: #4a3410; color: #f0b45c; }
  .badge-approved { background: #143d20; color: #7fd39a; }
  .badge-rejected { background: #4a1512; color: #f2938c; }
}
