/* mail.slop.graphics. Same language as the site: white and greys, no lines,
   no outlines, separation by fill and space, every control 36px. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Schibsted Grotesk";
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/schibsted-grotesk-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --page: #ffffff;
  --fill: #f1f1f1;
  --fill-strong: #e4e4e4;
  --ink: #111111;
  --ink-2: #5e5e5e;
  --placeholder: #686868;
  --frost-fill: rgba(236, 236, 236, 0.72);
  --frost-blur: blur(22px) saturate(1.5);
  --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px -2px rgba(0, 0, 0, 0.1);
  --shadow-float: 0 2px 6px rgba(0, 0, 0, 0.05), 0 18px 44px -14px rgba(0, 0, 0, 0.22);
  --focus: 0 0 0 3px rgba(0, 0, 0, 0.16);
  --control: 36px;
  --spring: cubic-bezier(0.3, 1.45, 0.45, 1);
  --out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-reduced-transparency: reduce) {
  :root {
    --frost-fill: #ececec;
    --frost-blur: none;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
  border: 0;
  margin: 0;
  outline: 0;
}

button {
  touch-action: manipulation;
}

:focus-visible {
  box-shadow: var(--focus);
}

.button {
  height: var(--control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--fill);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  flex: none;
  transition: transform 0.12s var(--out), background-color 0.15s var(--out);
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button:active,
.row:active {
  transform: scale(0.97);
}

.button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .button:hover {
    background: var(--fill-strong);
  }
  .button.primary:hover {
    background: #303030;
  }
}

.field {
  height: var(--control);
  width: 100%;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 16px;
  letter-spacing: -0.01em;
  transition: box-shadow 0.2s var(--out);
}

.field:focus,
.body-field:focus {
  box-shadow: var(--focus);
}

.field::placeholder,
.body-field::placeholder {
  color: var(--placeholder);
}

.frost {
  background: var(--frost-fill);
  -webkit-backdrop-filter: var(--frost-blur);
  backdrop-filter: var(--frost-blur);
}

/* ── The door ─────────────────────────────────────────────── */

.door {
  display: grid;
  grid-template-rows: none;
  place-content: center;
  gap: 10px;
}

.door form {
  display: flex;
  gap: 8px;
  width: min(340px, calc(100vw - 32px));
}

.door-note {
  min-height: 21px;
  color: var(--ink-2);
  text-align: center;
}

/* ── Top ──────────────────────────────────────────────────── */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--control);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark span {
  font-weight: 500;
  color: var(--ink-2);
}

.wordmark i {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--ink);
  display: grid;
  place-items: center;
}

.wordmark i::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

/* Which mail is shown: one track, the chosen one lifted. */
.views {
  margin: 0 20px 12px;
  height: var(--control);
  padding: 3px;
  display: flex;
  width: fit-content;
  max-width: calc(100% - 40px);
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: 999px;
  background: var(--fill);
}

.views button {
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s var(--out), color 0.15s var(--out);
}

.views button:active {
  transform: scale(0.97);
}

.views button[aria-pressed="true"] {
  background: var(--page);
  color: var(--ink);
  box-shadow: var(--shadow-lift);
}

.views small {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── List and reader ──────────────────────────────────────── */

.mail {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  padding: 0 12px 12px;
}

.list,
.reader {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.list {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 0 0 24px;
}

.row {
  width: 100%;
  display: grid;
  gap: 1px;
  padding: 10px 12px;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s var(--out), background-color 0.15s var(--out);
}

.row[aria-current="true"] {
  background: var(--fill);
}

@media (hover: hover) and (pointer: fine) {
  .row:hover {
    background: var(--fill);
  }
}

.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.row-who,
.row-subject,
.row-snippet {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-who {
  font-weight: 500;
}

.row-when {
  flex: none;
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.row-snippet,
.row-tag {
  color: var(--ink-2);
  font-size: 13px;
}

.row.unread .row-who,
.row.unread .row-subject {
  font-weight: 700;
}

.empty {
  padding: 40px 12px;
  color: var(--ink-2);
}

.reader {
  border-radius: 22px;
  background: var(--fill);
  padding: 28px clamp(16px, 3vw, 40px) 32px;
}

.reader-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.reader-head h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-right: auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reader .button {
  background: var(--page);
}

.reader .button.primary {
  background: var(--ink);
}

.back {
  display: none;
}

.message {
  background: var(--page);
  border-radius: 16px;
  padding: 18px 20px 20px;
  margin-bottom: 8px;
}

.message-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 16px;
  margin-bottom: 12px;
}

.message-who b {
  font-weight: 600;
}

.message-who span,
.message-when,
.message-warn {
  color: var(--ink-2);
  font-size: 13px;
}

.message-warn {
  margin-bottom: 10px;
}

.message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 76ch;
}

.message-frame {
  display: block;
  width: 100%;
  min-height: 420px;
  height: 60vh;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

.message-tools,
.files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.message .button {
  background: var(--fill);
}

/* ── Writing ──────────────────────────────────────────────── */

.compose {
  background: var(--page);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 8px;
  max-width: 720px;
}

.compose .views {
  margin: 0;
  max-width: 100%;
}

.body-field {
  width: 100%;
  min-height: 220px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--fill);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
  transition: box-shadow 0.2s var(--out);
}

.compose-foot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compose-note {
  color: var(--ink-2);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  transform: translateX(-50%);
  height: var(--control);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-float);
  font-weight: 500;
  animation: rise 0.6s var(--spring);
}

.toast[hidden] {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
}

/* ── Phone: the list, or one conversation ─────────────────── */

@media (max-width: 820px) {
  .mail {
    grid-template-columns: minmax(0, 1fr);
  }
  .mail .reader {
    display: none;
  }
  .mail.reading .list {
    display: none;
  }
  .mail.reading .reader {
    display: block;
  }
  .back {
    display: inline-flex;
  }
  .reader {
    padding: 16px 12px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
