/* Postings
 * -------------------------------------------------------------------------- */

.posting {
  position: relative;
}

.posting__body {
  position: relative;
  display: grid;
  grid-template-columns: calc(2.25em + 1rem) calc(100% - 2.25em - 2rem);
  min-height: 5rem;
  margin: 0 auto;
  padding: 0.25em 0 0.25em 0.75rem;
  grid-template-areas:
    "avatar content"
    ". note";

  @media (min-width: 60em) {
    padding: 0.5em 1rem;
  }
}

.posting__body--with-action {
  grid-template-columns: calc(2.25em + 1rem) calc(100% - 2.25em - 5rem) 2rem;
  grid-template-areas:
  "avatar content action";
}


.posting--clearance .posting__body {
  grid-template-columns: 100%;
  grid-template-rows: auto;
  grid-template-areas:
    "content"
    "footer"
    "actions";

  @media (min-width: 40em) {
    grid-template-columns: min-content 1fr;
    grid-template-areas:
      "actions content"
      "footer footer";
  }

  &:hover { background: none !important; }
}

.posting--announcement {
  background: #ffe;
}

.posting--bulk-reply {
  --sheet-padding: 0.2em 0.7em !important;
  border-radius: 1em;
  margin-top: var(--half-space) !important;
  margin-bottom: var(--half-space) !important;
}

.posting--bulk-reply__header {
  margin: var(--half-space);
}

.posting__column {
  display: flex;
  align-items: center;
  justify-content: center;
}

.posting__link {
  justify-content: stretch;
  text-decoration: none;
  outline: none;
}

/* Account purpose / unread dots */
.posting__status {
  position: absolute;
  display: block;
  top: 2.5rem;
  left: 0.2rem;

  &::before {
    display: none;
    content: ' ';
    position: absolute;
    width: 0.5em;
    height: 0.5em;
    background: url("/assets/icons/unread-355d2617.svg") center / 100% no-repeat;
  }

  .has-work-and-home &::before { display: block; }
}

.posting__status::before {
  filter: var(--colorize-border);
}

.posting__avatar {
  position: relative;
  padding: 0.4rem 0.5rem 0;
  align-self: flex-start;

  @media (min-width: 40em) { padding-top: 0; }

  .clearance & { padding: 0 0.4rem 0 0; }
}

.posting__avatar--bundled {
  min-width: 2.8em;
}

.posting__menu {
  padding: 0 0 0 0.3rem;
}

.posting__type {
  position: absolute;
  top: 0;
  right: 0.2em;
}

.posting__type-icon {
  width: 1em;
  height: 1em;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100%;
  z-index: 2;
}

.posting__type-icon--announcement { background-image: url("/assets/icons/bugs/announcement-bug-2fe58e78.svg"); }
.posting__type-icon--file { background-image: url("/assets/icons/bugs/file-bug-09940fc0.svg"); }
.posting__type-icon--involvement { background-image: url("/assets/icons/bugs/involvement-bug-6624053b.svg"); }
.posting__type-icon--request { background-image: url("/assets/icons/bugs/request-bug-0838f2e5.svg"); }
.posting__type-icon--cancelled { background-image: url("/assets/icons/bugs/cancelled-bug-c6a3ff3b.svg"); }

.posting__content {
  justify-content: flex-start;
  width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
  padding: 0.3rem 1em 0.3rem 0;

  @media (min-width: 60em) {
    padding: 0;
    line-height: 1.2;
  }

  .posting--clearance & { margin-right: 1rem; }
}

.posting__headline {
  display: flex;
  align-items: center;
  margin: 0 0 -1px;
  padding-bottom: 0.1rem;
  overflow: hidden;

  @media (min-width: 60em) {
    max-width: calc(100% - 7rem);
  }

  .clearance & { max-width: 100%; }
}

.posting__title {
  font-weight: normal;
  line-height: 1.3;
  flex-shrink: 0;
  word-break: break-word;

  @media (min-width: 40em) {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.posting__contacts {
  display: inline-flex;
  flex-grow: 0;
  flex-shrink: 1;
  order: 2;
  z-index: 0;
}

.posting__draft-badge {
  width: 2.25em;
  height: 2.25em;
  background: var(--color-bg--main) repeating-linear-gradient(var(--color-bg--surface), var(--color-bg--surface) 2px, var(--color-bg--surface-glint) 2px, var(--color-bg--surface-glint) 4px);
  border-radius: 100%;
  line-height: 2;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  transform: rotate(-45deg);
  @media (max-width: 39.95em) { margin-top: -0.4rem; }
}

.posting__draft-label { font-size: 0.5em; }

.posting__byline {
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 1px 0;

  @media (min-width: 40em) {
    max-width: calc(100% - 7rem);
  }
}

.posting__summary:not(:empty):not(.posting__summary--comment)::before {
  content: '– ';
}

.posting__summary--comment,
.posting__summary--access_notice {
  padding: 0 0.5em;
  background-color: var(--color-bg--secondary);
  background: linear-gradient(135deg, var(--color-bg--secondary) 0%, var(--color-bg--secondary-glint) 100%);
  border-radius: 0 1em 1em 1em;

  &:not(:empty)::before { display: none; }
}

.posting__summary--shadowed {
  background-color: var(--color-bg--collection);
  background: linear-gradient(135deg, var(--color-bg--collection) 0%, var(--color-bg--collection-glint) 100%);
}

.posting__time {
  font-size: var(--font-size-x-small);
  color: var(--color-txt--subtle);
  justify-content: flex-end;
  white-space: nowrap;
}

.posting__note {
  margin-top: 0.2rem;
  grid-area: note;
  justify-content: flex-start;

  .entry__anchor {
    top: -8.5em;
  }
}

.posting__shared {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 11rem);
  padding: 0;

  @media (max-width: 39.95em) {
    max-width: calc(100% - 4rem);
  }
}

.posting__published {
  .posting__content { padding-bottom: 0; }

  @media (max-width: 39.95em) {
    padding: 0 0.8rem 0 0.4rem;
  }
}

.posting__account-purpose {
  order: 2;
  margin-left: 0.2em;
}

.posting__detail--bundled {
  &:not(:only-child):not(:last-child) {
    flex-shrink: 0;
  }
}

.posting__detail-separator {
  margin-left: 0.25em;
  margin-right: 0.25em;
}

.inbox--sent {
  .posting__summary:not(:empty):not(.posting__summary--comment)::before {
    content: '';
  }
}
