/* Story pages: the sign-in screen and the timeline. Tokens and fonts come from site.css. */

.story .top {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.address-chip {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.story a.lang {
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}

.signout {
  min-height: 2.25rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-soft);
  font: 500 0.8125rem/1 var(--sans);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}

.signout:hover {
  color: var(--varnish);
}

/* ---------- Sign-in ---------- */

.signin {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(3rem, 10vw, 7rem) var(--gutter);
}

.signin h1 {
  margin-top: 1rem;
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-style: italic;
}

.signin-lead {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

/* The message to send, large enough to read off one screen and type on another. */
.signin-code {
  margin-top: 1.5rem;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  /* A code is read off one screen and typed on another: the sans keeps letters and digits apart. */
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.6rem, 5.5vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--varnish);
  user-select: all;
}

.signin-button {
  display: inline-grid;
  place-items: center;
  margin-top: 1.5rem;
  text-decoration: none;
}

.signin-note {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.signin-warning {
  margin-top: 0.75rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--varnish);
  border-radius: 0;
}

/* ---------- Story head ---------- */

.story-head {
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) clamp(2rem, 5vw, 4rem);
}

.story-title {
  margin-top: 0.75rem;
  font-size: clamp(3.5rem, 13vw, 11rem);
  font-style: italic;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--varnish);
  overflow-wrap: anywhere;
}

.story-now {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.story-now span {
  margin-right: 0.6rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  vertical-align: 0.35em;
}

.story-how {
  max-width: 34rem;
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ---------- Days ---------- */

.days {
  margin: 0;
  padding: 0 var(--gutter) clamp(4rem, 8vw, 7rem);
}

/* One string per day: the date and its stamp hang on the left, the moments on the right. */
.day {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: 1.5rem clamp(1.5rem, 5vw, 5rem);
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-top: 1px solid var(--string);
}

.day-head {
  position: sticky;
  top: 1.5rem;
  align-self: start;
}

.day-head h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  line-height: 1.1;
}

.day-stamp {
  margin-top: 0.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.2;
  color: var(--varnish);
}

.day-empty,
.day-start {
  grid-template-columns: minmax(0, 1fr);
}

.day-empty p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--ink-soft);
}

.day-start .day-head {
  position: static;
}

.day-groups {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  min-width: 0;
}

.group {
  max-width: 46rem;
}

.group-items {
  display: grid;
  gap: 0.5rem;
}

/* Several photos sent together sit side by side, cropped square. */
.group-2 .group-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.group-3 .group-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.group-2 .moment-media,
.group-3 .moment-media {
  aspect-ratio: 1;
  object-fit: cover;
  height: 100%;
}

.moment-link {
  display: block;
}

.moment-media {
  display: block;
  width: 100%;
  max-height: 85vh;
  border-radius: 0.9rem;
  background: var(--paper-deep);
  object-fit: contain;
}

/* The size of a photo is not known until it loads; this keeps the page from collapsing meanwhile. */
.group-1 .moment-media {
  width: auto;
  max-width: 100%;
  min-height: 8rem;
}

.group figcaption {
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}

/* ---------- Older pages ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 0 var(--gutter) clamp(3rem, 7vw, 6rem);
}

.pager-older {
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  text-decoration: none;
}

/* ---------- Adding older photos ---------- */

[hidden] {
  display: none !important;
}

.add {
  max-width: 52rem;
  padding: clamp(2.5rem, 7vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7rem);
}

.add h1 {
  margin-top: 0.75rem;
  font-size: clamp(2.2rem, 6vw, 4rem);
}

.add-lead {
  max-width: 38rem;
  margin: 1.25rem 0 2rem;
  font-size: 1.125rem;
  color: var(--ink-soft);
}

.add-choose {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.add-choose:focus-within {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.add-undated {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--varnish);
  background: color-mix(in srgb, var(--varnish) 9%, transparent);
}

.add-undated p + p {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.add-undated input,
.add-when {
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: var(--ink);
  font: 400 1rem/1 var(--sans);
}

.add-apply,
.add-remove {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: 500 0.9375rem/1 var(--sans);
  cursor: pointer;
}

.add-remove {
  border: 0;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.add-list {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.add-row {
  position: relative;
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.9rem 0 1.1rem;
  border-top: 1px solid var(--string);
}

.add-pic {
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  overflow: hidden;
  border-radius: 0.6rem;
  background: var(--paper-deep);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.add-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.add-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
  min-width: 0;
}

.add-name {
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.add-when {
  width: 100%;
  min-width: 0;
  max-width: 16rem;
}

.add-status {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.add-row[data-state='done'] .add-status {
  color: var(--varnish);
  font-weight: 600;
}

.add-row[data-state='failed'] .add-status,
.add-row[data-state='refused'] .add-status {
  color: var(--varnish);
}

.add-row[data-state='done'] .add-remove,
.add-row[data-state='duplicate'] .add-remove,
.add-row[data-state='uploading'] .add-remove,
.add-row[data-state='preparing'] .add-remove {
  visibility: hidden;
}

.add-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.35rem;
  height: 3px;
  border-radius: 2px;
  background: transparent;
}

.add-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--varnish);
  transition: width 0.2s linear;
}

.add-summary {
  margin-top: 1.5rem;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.add-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 52rem) {
  .day {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .day-head {
    position: static;
  }

  .address-chip {
    display: none;
  }
}

@media (max-width: 36rem) {
  /* On a phone the date field needs the whole width, so "Remove" sits under it. */
  .add-row {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    align-items: start;
  }

  .add-remove {
    grid-column: 2;
    justify-self: start;
    min-height: 2.25rem;
    padding: 0;
  }
}
