/* The community page (views/community.templ, community.js) on Daybook's tokens, one idea a section, its heads centred:
   the moments on a row of pills over a phone whose lock screen gets their emails; one member's year and the email
   a milestone sends; the three members to write to; then the page kit's cards. The heading and the field are the
   feature pages' kit (feature.css). The studio's colour is lagoon, the field of the studios' page. Inter Tight only; type
   keeps a 15px floor; every word sits on a ground, a card or a scrim; no drawing moves. */

.cm-page p {
  margin: 0;
}
.cm-icon {
  display: block;
  width: 20px;
  height: 20px;
}
.cm-av {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--db-field);
  color: var(--db-field-ink);
  font: 600 15px/1 var(--font-db);
}

/* ---------------------------------------------------------------- the sections' heads: centred, the heading over its
   one line; the page kit's cards follow suit */
.cm-head,
.cm-page .pg-cards > h2 {
  display: grid;
  justify-items: center;
  gap: var(--spacing-db-card);
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}
.cm-head p {
  max-width: 34em;
  text-wrap: balance;
}

/* ---------------------------------------------------------------- their phone
   One column: the moments on a row of pills, the line saying when the one picked goes out (two lines' height, three on
   a phone, so nothing under it moves), then the phone */
.cm-try {
  padding-bottom: var(--spacing-db-section);
}
.cm-wall {
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(760px, 100%);
  margin: 0 auto;
}
.cm-moments {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.cm-moment {
  flex: none;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-db-full);
  background: var(--db-card);
  color: var(--db-fg);
  cursor: pointer;
  font: 500 15px/1 var(--font-db);
  white-space: nowrap;
  transition: background-color var(--duration-db-fast) var(--ease-db), color var(--duration-db-fast) var(--ease-db);
}
.cm-moment:hover {
  background: var(--db-card-2);
}
.cm-moment[aria-checked="true"] {
  background: var(--db-selected);
  color: var(--db-on-selected);
}
:is(.cm-moment, .cm-q__send):focus-visible {
  outline: 2px solid var(--db-focus);
  outline-offset: 2px;
}
.cm-says {
  display: grid;
  align-items: center;
  max-width: 34em;
  height: calc(1.45em * 2);
  margin-bottom: 12px !important;
  color: var(--db-fg-3);
  font: 400 15px/1.45 var(--font-db);
  text-align: center;
  text-wrap: balance;
}

/* the phone: a black frame, its lock screen the studio's photo under a scrim, the status bar, the day and the time,
   the emails stacked under them */
.cm-phone {
  box-sizing: border-box;
  width: min(320px, 100%);
  aspect-ratio: 320 / 660;
  border: 10px solid var(--db-fg);
  border-radius: 50px;
  background: var(--db-fg);
  box-shadow: var(--shadow-db-float);
}
.cm-lock {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 40px;
  background: var(--db-card-2);
  color: var(--color-white);
  text-align: center;
}
.cm-lock::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 50%;
  width: 30%;
  height: 24px;
  border-radius: 20px;
  background: var(--color-black);
  translate: -50% 0;
}
.cm-lock__pic {
  position: absolute;
  inset: 0;
}
.cm-lock__pic > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cm-lock__pic::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(color-mix(in srgb, var(--color-black) 55%, transparent), color-mix(in srgb, var(--color-black) 20%, transparent) 45%, color-mix(in srgb, var(--color-black) 35%, transparent));
}
.cm-lock__status {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 4px 20px 0 28px;
  font: 600 15px/1 var(--font-db);
}
.cm-lock__status svg {
  width: 52px;
  height: 11px;
  fill: currentColor;
}
.cm-lock__day {
  position: relative;
  z-index: 2;
  margin-top: 18px !important;
  font: 500 15px/1.2 var(--font-db);
}
.cm-lock__time {
  position: relative;
  z-index: 2;
  font: 300 68px/1 var(--font-db);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
/* the emails, as a lock screen shows them: frosted cards, the newest with its words, the ones before with their
   subject; the newest drops in, the others settle under it */
.cm-notes {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  margin: 26px 10px 0;
  text-align: left;
}
.cm-note {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px 12px 12px 11px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--db-raised) 86%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  color: var(--db-fg);
}
.cm-note.is-older {
  align-items: center;
  padding-block: 9px;
}
.cm-notes.is-drop .cm-note:first-child {
  animation: cm-drop 0.5s var(--ease-db);
}
.cm-notes.is-drop .cm-note.is-older {
  animation: cm-settle 0.5s var(--ease-db);
}
@keyframes cm-drop {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.97);
  }
}
@keyframes cm-settle {
  from {
    transform: translateY(-40px);
  }
}
.cm-note__app {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--db-field);
  color: var(--db-field-ink);
}
.cm-note__in {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  font: 400 15px/1.3 var(--font-db);
}
.cm-note__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cm-note__top b {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cm-note__top span {
  flex: none;
  color: var(--db-fg-3);
}
.cm-note__s {
  font-weight: 500;
}
.cm-note.is-older .cm-note__s {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cm-note__b {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (max-width: 767px) {
  .cm-moments {
    gap: 6px;
  }
  .cm-moment {
    height: 40px;
    padding: 0 14px;
  }
  .cm-says {
    height: calc(1.45em * 3);
    margin-bottom: 4px !important;
  }
  .cm-phone {
    width: min(300px, 100%);
  }
  .cm-lock__time {
    font-size: 60px;
  }
}

/* ---------------------------------------------------------------- the milestones
   Maya's year: a row a month, a dot a day, the days she came in filled in the studio's colour, her milestones ringed,
   the one picked dark with its date on a chip, the milestones to pick under it; then the email it sent her. One column */
.cm-ms__grid {
  display: grid;
  gap: 16px;
  width: min(820px, 100%);
  margin: 48px auto 0;
}
.cm-yr {
  display: grid;
  gap: 26px;
  padding: 26px 28px;
  border-radius: 24px;
  background: var(--db-raised);
  box-shadow: 0 0 0 1px var(--db-edge), var(--shadow-db-float);
}
.cm-yr__top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cm-yr__who {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font: 400 15px/1.3 var(--font-db);
}
.cm-yr__who b {
  font: 600 17px/1.2 var(--font-db);
  letter-spacing: -0.01em;
}
.cm-yr__who span {
  color: var(--db-fg-3);
}
.cm-yr__n {
  flex: none;
  margin-left: auto;
  color: var(--db-field-text);
  font: 600 28px/1 var(--font-db);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.cm-yr__g {
  display: grid;
  grid-template-columns: 3.4em repeat(31, minmax(0, 1fr));
  align-items: center;
  gap: 12px 5px;
}
.cm-yr__m {
  color: var(--db-fg-3);
  font: 400 15px/1 var(--font-db);
  white-space: nowrap;
}
.cm-yr__g i {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--db-card-2);
}
.cm-yr__g i.is-off {
  visibility: hidden;
}
.cm-yr__g i.is-v {
  background: var(--db-field);
}
.cm-yr__g i.is-ms {
  box-shadow: 0 0 0 2px var(--db-raised), 0 0 0 4px var(--db-field-edge);
}
.cm-yr__g i.is-on {
  z-index: 1;
  background: var(--db-fg);
  box-shadow: 0 0 0 2px var(--db-raised), 0 0 0 4px var(--db-fg);
}
.cm-yr__flag {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  padding: 7px 12px;
  border-radius: var(--radius-db-full);
  background: var(--db-fg);
  color: var(--db-bg);
  font: 600 15px/1 var(--font-db);
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}
.cm-yr__flag--l {
  left: -6px;
  transform: none;
}
.cm-yr__flag--r {
  right: -6px;
  left: auto;
  transform: none;
}
.cm-yr__flag.is-below {
  top: calc(100% + 10px);
  bottom: auto;
}
.cm-yr__steps {
  justify-self: center;
}
/* the email a milestone sends: from, to and when, the subject, its words */
.cm-mail {
  display: grid;
  gap: 8px;
  padding: 20px 24px 22px;
  border-radius: 20px;
  background: var(--db-card);
  font: 400 15px/1.45 var(--font-db);
}
.cm-mail__hd {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--db-fg-3);
}
.cm-mail__hd b {
  margin-right: 0.35em;
  color: var(--db-fg);
  font-weight: 600;
}
.cm-mail__app {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--db-field);
  color: var(--db-field-ink);
}
.cm-mail__app .cm-icon {
  width: 18px;
  height: 18px;
}
.cm-mail__s {
  margin-top: 6px !important;
  font: 500 20px/1.25 var(--font-db);
  letter-spacing: -0.02em;
}
.cm-mail__b {
  max-width: 52ch;
  color: var(--db-fg-2);
}
@media (max-width: 767px) {
  .cm-ms__grid {
    margin-top: 32px;
  }
  .cm-yr {
    gap: 20px;
    padding: 18px 14px 18px;
    border-radius: 20px;
  }
  .cm-yr__top .cm-av {
    display: none;
  }
  .cm-yr__n {
    font-size: 22px;
  }
  .cm-yr__g {
    grid-template-columns: 2.5em repeat(31, minmax(0, 1fr));
    gap: 5px 2px;
  }
  .cm-yr__g i.is-ms {
    box-shadow: 0 0 0 1.5px var(--db-raised), 0 0 0 3px var(--db-field-edge);
  }
  .cm-yr__g i.is-on {
    box-shadow: 0 0 0 1.5px var(--db-raised), 0 0 0 3px var(--db-fg);
  }
  .cm-mail {
    padding: 16px 16px 18px;
  }
}

/* ---------------------------------------------------------------- who hasn't been in: three members, each in their
   circle's colour, how long it has been, Send a note */
.cm-quiet__box {
  box-sizing: border-box;
  width: min(560px, 100%);
  margin: 48px auto 0;
  padding: 8px 22px 10px;
  border-radius: 24px;
  background: var(--db-raised);
  box-shadow: 0 0 0 1px var(--db-edge), var(--shadow-db-float);
}
.cm-q__h {
  padding: 14px 0;
  border-bottom: 1px solid var(--db-edge);
  font: 600 17px/1.2 var(--font-db);
  letter-spacing: -0.02em;
}
.cm-q {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cm-q li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--db-edge);
}
.cm-q li:last-child {
  border-bottom: 0;
}
.cm-q__who {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font: 400 15px/1.3 var(--font-db);
}
.cm-q__who b {
  font-weight: 500;
}
.cm-q__who span {
  color: var(--db-fg-3);
}
.cm-q__send {
  flex: none;
}
.cm-q__send.is-sent {
  cursor: default;
  opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
  .cm-note {
    animation: none !important;
  }
  .cm-moment {
    transition: none !important;
  }
}
