/*
 * Styles for everything to do with posts from claimed pages, and the few extra pieces on the
 * account page: /updates/ and /updates/<slug>/ (drawn by api/updates.ts), /submit/, the
 * "Claimed" badge and the "From <name>" list that js/entity.js adds to directory pages.
 *
 * Kept out of app/globals.css so that it can be loaded only where it is needed. It uses the
 * variables that file defines (--ink, --accent, --rule, --sans, --serif, --mono and so on);
 * the second value in each var() is the same colour or font, for a page that loads without them.
 */

/* ---------- a post ---------- */

.ugc__kicker {
  margin: 0 0 0.75rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #1f3be8);
}

.ugc__kicker a {
  color: inherit;
  text-decoration: none;
}

.ugc__kicker a:hover {
  text-decoration: underline;
}

.ugc__title {
  margin-bottom: 0.75rem;
}

.ugc__by {
  margin: 0 0 1.25rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted, #6a6b72);
}

.ugc__by a {
  color: var(--ink, #101114);
  font-weight: 600;
}

/* The notice has to be seen: a full-width box with a heavy cobalt edge, above the text. */
.ugc__notice {
  margin: 0 0 1.5rem;
  padding: 0.9rem 1.1rem;
  background: var(--accent-tint, #eef1fe);
  border-left: 4px solid var(--accent, #1f3be8);
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink, #101114);
}

.ugc__notice strong {
  font-weight: 700;
}

.ugc__figure {
  margin: 0 0 1.5rem;
}

.ugc__figure img {
  display: block;
  width: 100%;
  max-height: 32rem;
  object-fit: contain;
  background: var(--shade, #f3f2ed);
  border: 1px solid var(--rule, #e3e1da);
}

.ugc__figure figcaption {
  margin-top: 0.4rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  color: var(--muted, #6a6b72);
}

.ugc__body {
  font-family: var(--serif, Georgia, serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink, #101114);
  overflow-wrap: anywhere;
}

.ugc__body p {
  margin: 0 0 1.15em;
}

.ugc__body a,
.ugc__link a {
  color: var(--accent, #1f3be8);
}

.ugc__link {
  margin: 1.5rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rule, #e3e1da);
  background: var(--card, #fff);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.ugc__foot {
  margin-top: 2.5rem;
  padding-top: 0.9rem;
  border-top: 2px solid var(--ink, #101114);
  font-size: 0.875rem;
  color: var(--ink-soft, #3a3b42);
}

.ugc__foot p {
  margin: 0 0 0.4rem;
}

/* ---------- the list at /updates/ ---------- */

.ugc-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 2px solid var(--ink, #101114);
}

.ugc-list__item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule, #e3e1da);
}

.ugc-list__title {
  margin: 0 0 0.4rem;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.ugc-list__title a {
  text-decoration: none;
}

.ugc-list__title a:hover {
  text-decoration: underline;
}

.ugc-list__item .ugc__by {
  margin-bottom: 0.5rem;
}

.ugc-list__excerpt {
  margin: 0;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--ink-soft, #3a3b42);
  overflow-wrap: anywhere;
}

.ugc-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 0;
  font-weight: 700;
}

.ugc-list__cta {
  margin: 2rem 0 0;
  padding: 1rem 1.1rem;
  background: var(--shade, #f3f2ed);
  font-size: 0.9375rem;
}

.ugc-list__cta a {
  font-weight: 700;
  color: var(--accent, #1f3be8);
}

/* ---------- /submit/ ---------- */

.submit {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
  max-width: 68rem;
  margin-inline: auto;
}

@media (min-width: 60rem) {
  .submit {
    grid-template-columns: minmax(0, 1fr) 21rem;
    align-items: start;
  }
}

.submit__help {
  padding: 1.25rem 1.35rem;
  background: var(--card, #fff);
  border: 1px solid var(--rule, #e3e1da);
  border-top: 3px solid var(--accent, #1f3be8);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.submit__help h2 {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.submit__help h3 {
  margin: 1.1rem 0 0.4rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #6a6b72);
}

.submit__help ul {
  margin: 0;
  padding-left: 1.1rem;
}

.submit__help li + li {
  margin-top: 0.4rem;
}

.submit__help p {
  margin: 1.1rem 0 0;
}

.submit__gate {
  padding: 1.25rem 1.35rem;
  background: var(--card, #fff);
  border: 1px solid var(--rule, #e3e1da);
  font-family: var(--serif, Georgia, serif);
  font-size: 1.0625rem;
  line-height: 1.45;
}

.submit__gate .btn,
.submit__gate .small,
.submit__gate .auth__note {
  font-family: var(--sans, system-ui, sans-serif);
}

.submit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0;
}

.submit__form {
  display: grid;
  gap: 1.1rem;
}

.submit__from {
  margin: 0;
  color: var(--ink-soft, #3a3b42);
}

.submit__field {
  display: grid;
  gap: 0.35rem;
}

.submit__field label,
.submit__label {
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
}

.submit__field .upload label {
  font-weight: 700;
}

.submit__field input[type='text'],
.submit__field input[type='url'],
.submit__field select,
.submit__field textarea {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--ink, #101114);
  border-radius: 0;
  background: #fff;
  color: var(--ink, #101114);
}

.submit__field input[type='text'] {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
}

.submit__field textarea {
  min-height: 16rem;
  resize: vertical;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.0625rem;
  line-height: 1.5;
}

.submit__count {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--muted, #6a6b72);
}

.submit__count--short {
  color: #8f1d1d;
}

.submit__preview {
  display: block;
  max-width: 16rem;
  max-height: 10rem;
  object-fit: contain;
  background: var(--shade, #f3f2ed);
  border: 1px solid var(--rule, #e3e1da);
}

.submit__preview[hidden],
.submit [hidden] {
  display: none;
}

.submit__send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.submit__publish {
  min-width: 10rem;
  font-size: 1.0625rem;
}

.submit__publish[disabled] {
  opacity: 0.6;
  cursor: default;
}

.submit__error:empty {
  display: none;
}

.submit__done {
  padding: 1.25rem 1.35rem;
  background: var(--accent-tint, #eef1fe);
  border-left: 4px solid var(--accent, #1f3be8);
}

.submit__done h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.submit__done p {
  margin: 0 0 0.5rem;
  overflow-wrap: anywhere;
}

.submit__previous .account__actions {
  flex-wrap: wrap;
  align-items: center;
}

/* ---------- account page: password reset and the posts lists ---------- */

.auth__switch--forgot {
  margin-top: 0.6rem;
}

.account__write p {
  color: var(--ink-soft, #3a3b42);
}

.account__post {
  flex: 1 1 18rem;
  min-width: 0;
}

.account__post details,
.account__recent {
  margin-top: 0.5rem;
}

.account__post summary,
.account__recent summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent, #1f3be8);
}

.account__posttext {
  margin: 0.5rem 0 0;
  padding: 0.75rem 0.9rem;
  background: var(--shade, #f3f2ed);
  font-family: var(--serif, Georgia, serif);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.account__posts .account__actions {
  flex-wrap: wrap;
}

/* ---------- on directory pages (js/entity.js) ---------- */

.claimed-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  color: #fff;
  background: var(--accent, #1f3be8);
  vertical-align: middle;
}

.claimed-badge::before {
  content: '✓';
  margin-right: 0.3rem;
}

.entity-posts {
  margin: 2rem 0;
}

.entity-posts__title {
  padding-top: 0.7rem;
  border-top: 2px solid var(--ink, #101114);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.entity-posts__note {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted, #6a6b72);
}

.entity-posts__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.entity-posts__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--rule, #e3e1da);
  font-weight: 600;
}

.entity-posts__list time {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--muted, #6a6b72);
  white-space: nowrap;
}
