/* Redesign, journal workstream.
   Tokens, the layout system and the type atoms live in redesign.css; this file is the
   only stylesheet the journal pages own. See docs/redesign-workstreams.md. */

/* ---------- 7 · Journal / 21 · Journal, time set ---------- */

.rd-journal { background: var(--rd-bone); }

.rd-journal__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--rd-space-2xs) var(--rd-space-m);
}
.rd-journal__lede {
  font-family: var(--rd-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.15;
  color: var(--rd-ink);
}
/* The journal's two underlined links are set at .16em in the design, not the .2em the
   shared atom uses, so that head and row hold one line at 375 wide. */
.rd-journal .rd-link { letter-spacing: 0.16em; }
.rd-journal__how {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
}

/* The app styles form controls with `#frontend [type='text']` / `#frontend select`
   (application.tailwind.css, specificity 1,0,1), so a page block has to name the
   wrapper as well to win the shape: otherwise the controls keep Tailwind's rounded
   box, shadow and Encode Sans.
   The writing page itself: white paper, lifted off the bone field. */
#frontend .rd-journal__page {
  display: block;
  width: 100%;
  min-height: 230px;
  margin-top: var(--rd-space-m);
  padding: var(--rd-space-l) var(--rd-space-m);
  border: 0;
  border-radius: 0;
  background: var(--rd-journal-page);
  box-shadow: 0 14px 30px -22px rgba(80, 55, 35, 0.5);
  font-family: var(--rd-sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.45;
  color: var(--rd-ink);
  resize: none;
}
.rd-journal__page:focus { outline: 1px solid var(--rd-accent-underline); outline-offset: 0; }
/* The existing date picker, kept as it is and only dressed for the field: hairline
   numerals under the date and the three time selects, no boxed inputs. */
.rd-journal__when { margin-top: var(--rd-space-l); }
.rd-journal__when-label { margin-bottom: var(--rd-space-xs); }
#frontend .rd-journal__when .datepicker-input,
#frontend .rd-journal__when select {
  border: 0;
  border-bottom: 1px solid rgba(51, 45, 43, 0.28);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--rd-sans);
  font-weight: 200;
  font-size: 22px;
  line-height: 1.2;
  color: var(--rd-ink);
}
/* the component's own calendar glyph, tinted to the field rather than Tailwind's slate */
.rd-journal__when svg {
  width: 18px;
  height: 18px;
  color: var(--rd-ink-muted);
  opacity: 0.7;
}
#frontend .rd-journal__when .datepicker-input { padding: var(--rd-space-xs) 0 var(--rd-space-2xs) var(--rd-space-xl); }
#frontend .rd-journal__when select { padding: var(--rd-space-xs) 0 var(--rd-space-2xs); }
#frontend .rd-journal__when select:focus,
#frontend .rd-journal__when .datepicker-input:focus { outline: none; border-bottom-color: var(--rd-ink); }

.rd-journal__note {
  margin-top: var(--rd-space-s);
  font-family: var(--rd-serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.25;
  color: var(--rd-ink-muted);
}

.rd-journal__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--rd-space-s) var(--rd-space-xs);
  margin-top: var(--rd-space-l);
}
.rd-journal__set-time { flex: none; white-space: nowrap; }

/* the journal's submit is the design's 44-high pill, not .rd-pill's 50 */
.rd-journal__submit {
  margin-left: auto;
  height: 44px;
  padding: 0 22px;
  font-size: 11.5px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}
.rd-journal__submit:disabled {
  background: var(--rd-ink);
  color: var(--rd-bone);
  opacity: 0.4;
  cursor: default;
}

/* My OM Journals */
.rd-journal__mine { margin-top: var(--rd-space-2xl); }
.rd-journal__mine-title {
  font-family: var(--rd-sans);
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  line-height: 1.3;
}

/* a turbo-frame is inline until told otherwise */
.rd-journal__list { display: block; margin-top: var(--rd-space-l); }

/* The list's footer comes from shared/_load_more: either "Showing all items" once
   the list is complete, or the Load More button, re-dressed as an outline pill. */
.rd-journal__pagination { margin-top: var(--rd-space-l); }
.rd-journal__pagination > div {
  font-family: var(--rd-serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.2;
  color: var(--rd-ink-muted);
}
.rd-journal__pagination .btn-primary {
  width: auto;
  height: 44px;
  padding-inline: var(--rd-space-l);
  border: 0;
  border-radius: 30px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rd-accent);
  color: var(--rd-accent);
  font-family: var(--rd-sans);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.rd-journal__entry + .rd-journal__entry { margin-top: var(--rd-space-l); }
.rd-journal__entry-date {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rd-accent);
}
.rd-journal__entry-text {
  display: block;
  margin-top: var(--rd-space-2xs);
  font-family: var(--rd-serif);
  font-size: 18.5px;
  line-height: 1.28;
  color: var(--rd-ink-reading);
  text-decoration: none;
}
.rd-journal__entry-text:hover { color: var(--rd-ink); }

/* ---------- 8 · How to journal ---------- */

/* The journal dimmed behind the sheet, as the render reads: the field shows in a
   band at the top and the sheet covers the rest, down to the tab bar. */
.rd-journal-tips {
  background: linear-gradient(rgba(51, 45, 43, 0.34), rgba(51, 45, 43, 0.34)), var(--rd-bone);
  padding-inline: 0;
  padding-top: var(--rd-space-l);
}
.rd-journal-tips__sheet {
  padding: var(--rd-space-2xl) var(--rd-space-xl) var(--rd-space-2xl);
  border-radius: 26px 26px 0 0;
  background: var(--rd-sheet);
}
.rd-journal-tips__title {
  font-family: var(--rd-serif);
  font-weight: 500;
  font-size: 33px;
  line-height: 1.05;
  text-wrap: balance;
}
.rd-journal-tips__body {
  margin-top: var(--rd-space-m);
  font-family: var(--rd-serif);
  font-size: 18.5px;
  line-height: 1.32;
  color: var(--rd-ink-reading);
  text-wrap: pretty;
}
.rd-journal-tips__back { display: inline-block; margin-top: var(--rd-space-l); }

/* ---------- A single journal entry ----------
   No screen in the hand-off: it is the list's row, opened. Same date treatment as the row,
   the entry set as a reading page, and the app's quiet outline pill to go back. */
/* the same reading treatment as a story page: full gutter width, not the short measure */
.rd-journal-entry__body {
  margin-top: var(--rd-space-s);
}
.rd-journal-entry__body p {
  margin-bottom: var(--rd-space-s);
  font-family: var(--rd-serif);
  font-size: 19.5px;
  line-height: 1.34;
  color: var(--rd-ink-reading);
  text-wrap: pretty;
}
.rd-journal-entry__body p:last-child {
  margin-bottom: 0;
}
.rd-journal-entry__meta {
  margin-top: var(--rd-space-l);
  font-family: var(--rd-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rd-ink-muted);
}
.rd-journal-entry__actions {
  margin-top: var(--rd-space-xl);
}
