:root {
  --diary-primary: #d31745;
  --diary-ink: #171716;
  --diary-muted: #626871;
  --diary-line: #d5d9dc;
  --diary-paper: #fff;
  --diary-height: min(780px, calc(100svh - 28px));
}

.diary-main {
  min-height: 100svh;
  padding: 14px 0;
}

.diary-spread {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(calc(100vw - 20px), 1280px);
  height: var(--diary-height);
  margin-inline: auto;
  overflow: hidden;
  background: var(--diary-paper);
  box-shadow: 0 18px 40px rgb(22 22 22 / 16%), 0 2px 8px rgb(22 22 22 / 10%);
}

.diary-spread::after {
  content: "";
  position: absolute;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 24px;
  pointer-events: none;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgb(29 36 42 / 9%), rgb(29 36 42 / 3%), transparent);
}

.diary-cover,
.diary-reader {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--diary-paper);
}

.diary-cover {
  display: grid;
  grid-template-rows: 86px 30px minmax(0, 1fr) 22px;
  padding: 0 24px 12px;
  overflow: hidden;
}

.diary-cover__content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 72px;
  gap: 12px;
  min-height: 0;
  padding: 18px 0 12px;
}

.diary-cover__headline > p:first-child,
.diary-reader__header > div:first-child > p {
  margin: 0;
  color: var(--diary-primary);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.diary-cover__accessible-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.diary-cover__footer {
  align-self: end;
  margin: 0;
  color: #737a81;
  font-size: 0.46rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.diary-cover__footer span {
  margin-inline: 5px;
}

.diary-reader {
  border-left: 1px solid var(--diary-line);
  background: #f5f6f7;
}

.diary-reader__scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--diary-primary) #e3e6e8;
  scrollbar-width: thin;
}

.diary-reader__scroll::-webkit-scrollbar {
  width: 7px;
}

.diary-reader__scroll::-webkit-scrollbar-track {
  background: #e3e6e8;
}

.diary-reader__scroll::-webkit-scrollbar-thumb {
  background: var(--diary-primary);
}

.diary-reader__header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  padding: 24px 30px 19px;
  border-bottom: 1px solid var(--diary-line);
  background: rgb(255 255 255 / 97%);
}

.diary-reader__header h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.diary-reader__tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.diary-reader__tools span {
  color: #727980;
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.diary-reader__tools button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #c9cdd1;
  border-radius: 4px;
  background: #fff;
  color: #2c3034;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.diary-reader__tools button:hover,
.diary-reader__tools button:focus-visible {
  border-color: var(--diary-primary);
  color: var(--diary-primary);
}

.diary-feature,
.diary-secondary,
.diary-feed {
  min-width: 0;
}

.diary-feature {
  min-height: 0;
}

.diary-secondary[hidden] {
  display: none;
}

.diary-cover__stories {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 162px;
  gap: 16px;
  min-height: 0;
}

.diary-cover__stories:not(.has-secondary),
.diary-cover__stories.is-empty {
  grid-template-columns: minmax(0, 1fr);
}

.diary-cover__stories.is-empty .diary-feature {
  grid-column: 1 / -1;
}

.diary-cover-lead {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.diary-cover-lead__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: start;
}

.diary-cover-lead__copy {
  min-width: 0;
}

.diary-cover-story__category {
  margin: 0 0 4px;
  color: var(--diary-primary);
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

.diary-cover-lead h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 0.96;
}

.diary-cover-story__byline {
  margin: 8px 0 0;
  color: #60676e;
  font-size: 0.58rem;
  font-weight: 800;
}

.diary-cover-story__save {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--diary-primary);
  cursor: pointer;
}

.diary-cover-story__save svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.diary-cover-lead__image,
.diary-cover-secondary__image {
  display: block;
  min-height: 0;
  overflow: hidden;
  background: #d9dcde;
}

.diary-cover-lead__image img,
.diary-cover-secondary__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.diary-cover-secondary {
  display: grid;
  grid-template-rows: 116px minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
  padding-left: 14px;
  overflow: hidden;
  border-left: 1px solid var(--diary-line);
}

.diary-cover-secondary__copy {
  min-height: 0;
  overflow: hidden;
}

.diary-cover-secondary__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 4px;
  align-items: center;
}

.diary-cover-secondary__meta .diary-cover-story__category {
  margin-bottom: 0;
}

.diary-cover-secondary__meta .diary-cover-story__save {
  width: 30px;
  height: 30px;
}

.diary-cover-secondary h3 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  line-height: 0.98;
}

.diary-cover__stories.is-empty .diary-empty,
.diary-feature .diary-loading {
  height: 100%;
  min-height: 0;
}

.diary-panorama {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-top: 2px solid var(--diary-primary);
  border-bottom: 1px solid #28282a;
  background: #202128;
}

.diary-panorama__slide {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  background: transparent;
  transition: opacity 240ms ease;
}

.diary-panorama__slide picture,
.diary-panorama__slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.diary-panorama__slide img {
  object-fit: contain;
  object-position: center;
}

.diary-panorama__slide.is-active {
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.diary-panorama__slide span {
  display: grid;
  place-items: center;
  align-self: stretch;
  padding-inline: 12px;
  background: #f5d812;
  color: #111;
  font-size: 0.53rem;
  font-weight: 900;
  text-transform: uppercase;
}

.diary-panorama__slide strong {
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1;
}

.diary-panorama__slide em {
  font-size: 0.48rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.diary-feed {
  display: grid;
  gap: 24px;
  padding: 24px 30px 34px;
}

.diary-card {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  min-width: 0;
  padding: 12px;
  border: 1px solid #aeb3b7;
  background: #fff;
  color: var(--diary-ink);
}

.diary-feature .diary-card {
  height: auto;
}

.diary-feature .diary-card__image {
  aspect-ratio: 2.25 / 1;
}

.diary-feature .diary-card__excerpt {
  min-height: 1.3em;
  -webkit-line-clamp: 1;
}

.diary-card__author {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 38px;
  gap: 9px;
  align-items: center;
  padding-bottom: 9px;
  border-bottom: 1px solid #c7cacc;
}

.diary-card__avatar,
.diary-card__avatar-fallback {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid #1f2123;
  border-radius: 50%;
  background: #e7e9ea;
  font-size: 0.68rem;
  font-weight: 900;
}

.diary-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.diary-card__author-copy {
  min-width: 0;
}

.diary-card__author-copy strong,
.diary-card__author-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary-card__author-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
}

.diary-card__author-copy span {
  margin-top: 2px;
  color: #686f76;
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
}

.diary-card__save,
.diary-card__share,
.diary-card__reaction {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #17191a;
  cursor: pointer;
}

.diary-card__save {
  width: 38px;
  height: 38px;
  justify-self: end;
}

.diary-card__save svg,
.diary-card__share svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.diary-card__save[aria-pressed="true"] {
  color: var(--diary-primary);
}

.diary-card__save[aria-pressed="true"] svg {
  fill: currentColor;
}

.diary-card h3 {
  margin: 10px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 0.98;
}

.diary-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #d9dcde;
}

.diary-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.diary-card__excerpt {
  display: -webkit-box;
  min-height: 2.6em;
  margin: 9px 0 10px;
  overflow: hidden;
  color: #4e555c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.78rem;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.diary-card__footer {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 6px;
  align-items: center;
  min-height: 38px;
  padding-top: 8px;
  border-top: 1px solid #c7cacc;
}

.diary-card__reaction {
  grid-template-columns: auto auto;
  gap: 4px;
  min-width: 36px;
  height: 32px;
  padding: 0 4px;
  font-size: 0.64rem;
  font-weight: 800;
}

.diary-card__reaction b {
  color: var(--diary-primary);
  font-size: 0.9rem;
}

.diary-card__reaction[aria-pressed="true"] {
  background: #f1f2f3;
}

.diary-card__share {
  width: 34px;
  height: 34px;
}

.diary-card__read {
  justify-self: end;
  font-size: 0.56rem;
  font-weight: 900;
  text-transform: uppercase;
}

.diary-card__read span {
  margin-left: 7px;
  font-size: 0.9rem;
}

.diary-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 34px;
  border: 1px solid #c7cacc;
  background: #f7f8f8;
  text-align: center;
}

.diary-empty__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 12px;
  border: 1px solid #aeb3b7;
  border-radius: 50%;
  background: #fff;
}

.diary-empty__icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: var(--diary-primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.diary-empty h2,
.diary-empty h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.diary-empty p {
  max-width: 32ch;
  margin: 8px 0 0;
  color: #646b72;
  font-size: 0.78rem;
  line-height: 1.45;
}

.diary-empty a {
  margin-top: 16px;
  color: var(--diary-primary);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.diary-feed > .diary-empty {
  min-height: 320px;
}

.diary-loading {
  display: grid;
  gap: 10px;
  height: 100%;
  min-height: 280px;
  padding: 12px;
  border: 1px solid #d3d6d8;
  background: #f7f8f8;
}

.diary-loading span {
  display: block;
  background: linear-gradient(90deg, #e3e5e6 25%, #f1f2f3 50%, #e3e5e6 75%);
  background-size: 200% 100%;
  animation: diary-loading 1.2s linear infinite;
}

.diary-loading span:first-child {
  height: 48px;
}

.diary-loading span:nth-child(2) {
  aspect-ratio: 16 / 9;
}

.diary-loading span:last-child {
  height: 50px;
}

@keyframes diary-loading {
  to { background-position: -200% 0; }
}

.diary-footer {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 18px 30px 22px;
  border-top: 1px solid var(--diary-line);
  color: #747b82;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
}

.diary-footer a {
  color: var(--diary-primary);
}

.diary-page .article-menu nav a.is-current {
  color: var(--diary-primary);
}

@media (max-width: 1299.98px) {
  .diary-main {
    min-height: 0;
    padding: 0 0 28px;
  }

  .diary-spread {
    display: block;
    width: min(100%, 792px);
    height: auto;
    overflow: visible;
  }

  .diary-spread::after {
    display: none;
  }

  .diary-cover {
    grid-template-rows: 106px 30px auto;
    height: auto;
    padding-bottom: 0;
    overflow: visible;
  }

  .diary-cover__content {
    grid-template-rows: auto auto 82px;
    padding: 30px 0 34px;
  }

  .diary-cover-lead {
    height: auto;
  }

  .diary-cover-lead__image {
    aspect-ratio: 16 / 10;
  }

  .diary-cover-secondary {
    grid-template-rows: 128px minmax(0, 1fr);
  }

  .diary-cover__footer {
    display: none;
  }

  .diary-feature .diary-card {
    height: auto;
  }

  .diary-reader {
    height: auto;
    border-left: 0;
  }

  .diary-reader__scroll {
    height: auto;
    overflow: visible;
  }

  .diary-reader__header {
    position: static;
  }
}

@media (max-width: 599.98px) {
  .diary-cover {
    grid-template-rows: 100px 30px auto;
    padding-inline: 16px;
  }

  .diary-cover__content {
    gap: 18px;
    grid-template-rows: auto auto 76px;
    padding: 24px 0 28px;
  }

  .diary-cover__stories {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .diary-cover-lead h2 {
    font-size: 1.65rem;
  }

  .diary-cover-secondary {
    grid-template-columns: 118px minmax(0, 1fr);
    grid-template-rows: 112px;
    gap: 12px;
    padding: 14px 0 0;
    border-top: 1px solid var(--diary-line);
    border-left: 0;
  }

  .diary-cover-secondary h3 {
    font-size: 1rem;
  }

  .diary-panorama__slide {
    padding: 0;
    background: transparent;
  }

  .diary-panorama__slide em {
    display: none;
  }

  .diary-panorama__slide strong {
    font-size: 0.88rem;
  }

  .diary-reader__header {
    align-items: center;
    padding: 22px 16px 16px;
  }

  .diary-reader__header h2 {
    font-size: 1.55rem;
  }

  .diary-reader__tools > span {
    display: none;
  }

  .diary-feed {
    gap: 28px;
    padding: 20px 16px 30px;
  }

  .diary-card {
    padding: 10px;
  }

  .diary-card h3 {
    font-size: 1.42rem;
  }

  .diary-card__excerpt {
    font-size: 0.76rem;
  }

  .diary-card__read {
    font-size: 0.5rem;
  }

  .diary-empty {
    min-height: 300px;
    padding: 26px 18px;
  }

  .diary-footer {
    flex-wrap: wrap;
    padding-inline: 16px;
  }
}

@media (max-width: 359.98px) {
  .diary-card__footer {
    grid-template-columns: auto auto auto 1fr;
  }

  .diary-card__read {
    max-width: 82px;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diary-loading span {
    animation: none;
  }
}
