/* oomoo -- the micro-moos page. This file is the page, same deal as css/media-log/medialog.css.
 *
 * Imports are the whole dependency list: tokens first so everything after can read --ink,
 * --line and --text, then the reset and faces, then the ambient chrome this page borrows
 * from home (the ruler, the theme toggle, the lightbox).
 *
 * The look is drawn after the small hand-made microblogs of the neo-web: one narrow
 * column, every post in a dashed box, the profile up top like a letterhead. Dashed rather
 * than solid on purpose -- the solid hairline is the site's voice for furniture, and these
 * cards are the one thing on the site that is ephemera, pinned up rather than built in.
 *
 * Mobile-first: what's outside a media query is the phone. */

@import url('../tokens.css');
@import url('../reset.css');
@import url('../utilities.css');
@import url('../home/fonts.css');
@import url('../home/ruler.css');
@import url('../home/theme-toggle.css');
@import url('../home/lightbox.css');

/* ------------------------------------------------------------------- Page */

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'National Park', system-ui, sans-serif;
  line-height: 1.55;
}

.page {
  max-width: 36rem; /* narrower than the media log: posts read best a sentence wide */
  margin: 0 auto;
  padding: 24px 14px 64px;
}

@media (min-width: 480px) {
  .page {
    padding-inline: 24px;
  }
}

@media (min-width: 768px) {
  .page {
    padding-left: 72px; /* stand off the ruler, like home */
  }
}

.label {
  text-transform: uppercase;
  font-family: 'National Park', system-ui, sans-serif;
}

a {
  color: inherit;
}

.back {
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
}

.back:hover {
  color: var(--accent);
}

/* ---------------------------------------------------------------- Profile */

/* The letterhead. Centered like the profiles this page is drawn after; the portrait is
   square in its hairline frame because everything on this site lives in a box. */

.profile {
  display: grid;
  justify-items: center;
  text-align: center;
  margin: 2rem 0 2.25rem;
}

.profile__pfp {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border: 1px solid var(--line);
  padding: 3px; /* a mat inside the frame, like the portrait on home */
}

.profile__name {
  margin-top: 0.9rem;
  font-family: 'Terminal Grotesque', 'National Park', sans-serif;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink);
}

.profile__bio {
  margin-top: 0.45rem;
  font-size: 0.85rem;
  color: var(--text);
}

.profile__stats {
  margin-top: 0.55rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.profile__stats a {
  text-decoration: none;
}

.profile__stats a:hover {
  color: var(--accent);
}

/* The active filter reads in the accent, like a tab with the light on. */
.profile__stats a[aria-current='true'] {
  color: var(--accent);
}

/* ------------------------------------------------------------------- Herd */

.herd {
  display: grid;
  gap: 0.9rem;
}

.moo {
  border: 1px dashed var(--line);
  padding: 0.9rem 1rem;
}

.moo__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.5rem;
}

.moo__pfp {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.moo__name {
  color: var(--ink);
  font-weight: 500;
}

.moo__handle {
  color: var(--dim);
  font-size: 0.8rem;
}

.moo__date {
  margin-left: auto;
  font: 500 10px/1 var(--chrome-face);
  letter-spacing: 0.14em;
  color: var(--dim);
}

.moo__body {
  font-size: 0.9rem;
}

.moo__body + .moo__body {
  margin-top: 0.5rem;
}

/* Attached image: framed, capped, never wider than the words. Click for the lightbox. */
.moo__imglink {
  display: inline-block;
  margin-top: 0.65rem;
  max-width: 100%;
}

.moo__img {
  display: block;
  max-width: 100%;
  max-height: 26rem;
  border: 1px solid var(--line);
}

.moo__foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

/* The heart. An outline until it's yours, and never anyone's name -- the count is as
   social as this site gets. */
.moo__like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--dim);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.moo__like:hover {
  color: var(--accent);
}

.moo__like--on {
  color: var(--accent);
}

.moo__like-heart {
  font-size: 1rem;
  line-height: 1;
}

.moo__like:disabled {
  opacity: 0.5;
  cursor: default;
}

.herd__empty {
  color: var(--dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

/* ------------------------------------------------------------------- Foot */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--accent);
}

/* ------------------------------------------------------------------ Admin
 *
 * Only ever rendered into the page for an admin session; for everyone else none of this
 * markup exists. Same voice as the media log's controls -- small labels, hairline dialogs.
 */

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  border: 1px dashed var(--accent);
  padding: 8px 12px;
  margin-bottom: 1.5rem;
  font-size: 10px;
}

.admin-bar button {
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
  padding: 2px 0;
}

.admin-bar button:hover {
  color: var(--accent);
}

/* The edit button hanging off each moo's foot. */
.moo__edit {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  cursor: pointer;
  padding: 0;
}

.moo__edit:hover {
  color: var(--accent);
}

.dlg {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--accent);
  padding: 18px;
  width: min(30rem, calc(100vw - 28px));
}

.dlg::backdrop {
  background: rgb(0 0 0 / 0.6);
}

.dlg__form {
  display: grid;
  gap: 10px;
}

.dlg__form h2 {
  font-size: 11px;
  color: var(--accent);
}

.dlg__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.dlg__input {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-family: 'National Park', system-ui, sans-serif;
  font-size: 12px;
  padding: 6px 8px;
}

.dlg__input:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

textarea.dlg__input {
  font-size: 0.9rem;
  resize: vertical;
}

.dlg__file {
  font-size: 10px;
  color: var(--dim);
}

.dlg__file input {
  font: inherit;
  color: inherit;
  max-width: 14rem;
}

.dlg__check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--dim);
}

.dlg__actions {
  justify-content: flex-end;
}

.dlg__actions button {
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  font: inherit;
  font-size: 10px;
  padding: 5px 12px;
  cursor: pointer;
}

.dlg__actions button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.dlg__actions button:disabled {
  opacity: 0.4;
  cursor: default;
}

.dlg__delete {
  margin-right: auto;
  color: var(--dim);
}

.dlg__error {
  font-family: 'National Park', system-ui, sans-serif;
  font-size: 10px;
  color: var(--accent);
}
