/* ========================================================================== 
   Journal navigation, feed and reading shell
   ========================================================================== */

/* Prominent Journal entry on the academic homepage. */
.masthead__menu-item--journal > a {
  margin: 0.22rem 0.72rem 0.22rem 0.15rem !important;
  padding: 0.38rem 0.86rem !important;
  border-radius: 999px;
  background: linear-gradient(135deg, #8f6874 0%, #66577f 100%);
  box-shadow: 0 5px 16px rgba(102, 87, 127, 0.2);
  color: #fff !important;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.greedy-nav .visible-links .masthead__menu-item--journal > a::before {
  display: none;
}

.masthead__menu-item--journal > a:hover,
.masthead__menu-item--journal > a:focus {
  color: #fff !important;
  opacity: 0.94;
  transform: translateY(-1px);
  box-shadow: 0 8px 21px rgba(102, 87, 127, 0.28);
}

/* Homepage floating shortcut. */
.homepage-journal-fab {
  position: fixed;
  right: 1.45rem;
  bottom: 1.45rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.68rem;
  padding: 0.72rem 1rem 0.72rem 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(143, 104, 116, 0.97), rgba(91, 81, 124, 0.97));
  box-shadow: 0 12px 34px rgba(61, 48, 73, 0.26);
  color: #fff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  text-decoration: none !important;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.homepage-journal-fab:hover,
.homepage-journal-fab:focus {
  color: #fff !important;
  text-decoration: none !important;
  transform: translateY(-3px);
  box-shadow: 0 17px 42px rgba(61, 48, 73, 0.34);
}

.homepage-journal-fab__icon {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.17);
  font-size: 1.08rem;
}

.homepage-journal-fab__text {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.homepage-journal-fab__text strong {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.03em;
}

.homepage-journal-fab__text small {
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Independent Journal shell: no academic sidebar and no wide academic nav. */
body.journal-shell {
  overflow-x: hidden;
  background: #f6f6f6;
  color: #252525;
}

.journal-shell .sidebar {
  display: none !important;
}

.journal-shell .masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.025);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.masthead--journal .masthead__inner-wrap {
  max-width: 1440px;
  padding-top: 0;
  padding-bottom: 0;
}

.masthead--journal .masthead__menu {
  display: block;
  width: 100%;
}

.journal-masthead {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.journal-masthead__brand {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 0.48rem;
  overflow: hidden;
  color: #1f1f1f !important;
  font-size: 0.94rem;
  font-weight: 760;
  letter-spacing: 0.015em;
  text-decoration: none !important;
  white-space: nowrap;
}

.journal-masthead__brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-masthead__brand-divider {
  color: #b0b0b0;
  font-weight: 400;
}

.journal-masthead__brand-section {
  color: #ff3154;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  font-style: italic;
  font-weight: 700;
}

.journal-masthead__actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.18rem;
  padding: 0.24rem;
  border: 1px solid #ebebeb;
  border-radius: 999px;
  background: #f4f4f4;
}

.journal-masthead__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.82rem;
  border-radius: 999px;
  color: #606060 !important;
  font-size: 0.76rem;
  font-weight: 680;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
}

.journal-masthead__actions a:hover,
.journal-masthead__actions a:focus {
  color: #1f1f1f !important;
}

.journal-masthead__actions a.is-active {
  background: #202020;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
  color: #fff !important;
}

.journal-shell #main.journal-shell__main {
  width: auto;
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem 1.75rem 5rem;
  animation: none;
}

.journal-shell .page--journal {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.journal-shell .page--journal .page__inner-wrap,
.journal-shell .page--journal .page__content {
  float: none !important;
  width: 100% !important;
  margin: 0 !important;
}

.journal-shell .page__content h1::before,
.journal-shell .page__content .anchor::before {
  display: none;
}

.journal-shell .page__content h1 {
  padding-bottom: 0;
  border-bottom: 0;
}

/* Compact feed header. */
.journal-feed-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
  margin-bottom: 1.4rem;
  padding: clamp(1.6rem, 3.5vw, 2.8rem);
  overflow: hidden;
  border: 1px solid #e9e9e9;
  border-radius: 22px;
  background:
    radial-gradient(circle at 93% 10%, rgba(255, 49, 84, 0.12), transparent 29%),
    radial-gradient(circle at 72% 110%, rgba(255, 190, 92, 0.18), transparent 32%),
    #fff;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.04);
}

.journal-feed-hero__copy {
  min-width: 0;
  max-width: 760px;
}

.journal-feed-hero__eyebrow {
  margin: 0 0 0.65rem !important;
  color: #ff3154;
  font-size: 0.7rem !important;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.page__content .journal-feed-hero h1 {
  margin: 0;
  color: #202020;
  font-size: clamp(1.9rem, 4.1vw, 3.45rem);
  font-weight: 780;
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.journal-feed-hero__intro {
  max-width: 660px;
  margin: 1rem 0 0 !important;
  color: #747474;
  font-size: 0.96rem !important;
  line-height: 1.8;
}

.journal-feed-hero__count {
  display: flex;
  min-width: 112px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.05rem 1.1rem;
  border: 1px solid rgba(255, 49, 84, 0.13);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(255, 49, 84, 0.07);
}

.journal-feed-hero__count strong {
  color: #ff3154;
  font-size: 2rem;
  line-height: 1;
}

.journal-feed-hero__count span {
  margin-top: 0.42rem;
  color: #8a8a8a;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.journal-feed-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0.3rem 0.15rem;
}

.journal-feed-toolbar__title {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  color: #282828;
  font-size: 0.92rem;
}

.journal-feed-toolbar__dot {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #ff3154;
  box-shadow: 0 0 0 4px rgba(255, 49, 84, 0.1);
}

.journal-feed-toolbar__hint {
  color: #979797;
  font-size: 0.72rem;
}

/* Image-first masonry feed inspired by social photo notes. */
.journal-list {
  column-width: 270px;
  column-gap: 1.1rem;
}

.journal-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 1.1rem;
  overflow: hidden;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  border: 1px solid #ececec;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.035);
  vertical-align: top;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.journal-card:hover {
  transform: translateY(-3px);
  border-color: #dedede;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.09);
}

.page__content a.journal-card__cover {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  border: 0 !important;
  background: linear-gradient(145deg, #f3e7e9, #ececf3);
  text-decoration: none !important;
}

.journal-card:nth-child(5n + 1) .journal-card__cover {
  aspect-ratio: 4 / 5;
}

.journal-card:nth-child(5n + 2) .journal-card__cover {
  aspect-ratio: 1 / 1;
}

.journal-card:nth-child(5n + 3) .journal-card__cover {
  aspect-ratio: 3 / 4;
}

.journal-card:nth-child(5n + 4) .journal-card__cover {
  aspect-ratio: 5 / 6;
}

.journal-card:nth-child(5n) .journal-card__cover {
  aspect-ratio: 4 / 5;
}

.journal-card__cover img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.journal-card:hover .journal-card__cover img {
  transform: scale(1.035);
}

.journal-card__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(2.6rem, 7vw, 5rem);
  background: linear-gradient(145deg, #c9a9b5, #7e748e);
}

.journal-card__image-shade {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.28), transparent);
}

.journal-card__date-badge {
  position: absolute;
  right: 0.72rem;
  bottom: 0.68rem;
  z-index: 1;
  padding: 0.28rem 0.52rem;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.36);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.journal-card__body {
  padding: 0.9rem 0.92rem 0.88rem;
}

.page__content .journal-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 760;
  line-height: 1.45;
  letter-spacing: -0.015em;
}

.page__content .journal-card__title a {
  display: -webkit-box;
  overflow: hidden;
  color: #262626;
  text-decoration: none !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.page__content .journal-card__title a:hover {
  color: #ff3154;
}

.journal-card__excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0.52rem 0 0 !important;
  color: #747474;
  font-size: 0.78rem !important;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.journal-card__footer {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.76rem;
  padding-top: 0.7rem;
  border-top: 1px solid #f0f0f0;
}

.journal-card__place {
  min-width: 0;
  overflow: hidden;
  color: #999;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-tags {
  display: flex;
  min-width: 0;
  flex: 0 1 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.28rem;
  overflow: hidden;
}

.journal-tags span {
  flex: 0 0 auto;
  padding: 0.18rem 0.42rem;
  border-radius: 999px;
  background: #fff1f3;
  color: #e84a63;
  font-size: 0.6rem;
  line-height: 1.2;
  white-space: nowrap;
}

.journal-empty {
  padding: 3rem 1.5rem;
  border: 1px dashed #dcdcdc;
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.journal-empty > span {
  display: block;
  margin-bottom: 0.5rem;
  color: #aaa;
  font-size: 2.2rem;
}

.page__content .journal-empty h2 {
  margin: 0.4rem 0;
  color: #444;
  font-size: 1.25rem;
}

.journal-empty p {
  margin: 0 !important;
  color: #777;
}

/* Individual Journal entry: spacious reading card without the academic sidebar. */
.journal-shell--entry #main.journal-shell__main {
  max-width: 1040px;
  padding-top: 2.2rem;
}

.journal-shell--entry .diary-entry {
  box-sizing: border-box;
  width: min(100%, 940px);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3.35rem);
  border: 1px solid #e9e9e9;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 42px rgba(0, 0, 0, 0.055);
}

.journal-shell--entry .diary-entry__back,
.journal-shell--entry .diary-entry__header,
.journal-shell--entry .diary-entry__content,
.journal-shell--entry .diary-entry__footer {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.journal-shell--entry .page__content a.diary-entry__back {
  margin-bottom: 1.7rem;
  color: #777;
  font-size: 0.78rem;
}

.journal-shell--entry .page__content .diary-entry__header h1 {
  color: #222;
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 1.18;
}

.journal-shell--entry .diary-entry__subtitle {
  color: #737373;
}

.journal-shell--entry .diary-entry__cover {
  margin: 0 0 2.4rem;
}

.journal-shell--entry .page__content .diary-entry__cover a {
  border-radius: 18px;
  box-shadow: none;
}

.journal-shell--entry .diary-entry__cover img {
  max-height: 680px;
  object-fit: cover;
}

.journal-shell--entry .diary-entry__content {
  color: #393939;
  font-size: 1.02rem;
  line-height: 2.05;
}

.journal-shell--entry .diary-entry__content img {
  border-radius: 15px;
}

.journal-shell--entry .diary-entry__footer {
  color: #999;
}

.journal-shell--entry .page__content .diary-entry__footer a {
  color: #ff3154;
}

@media (max-width: 1080px) {
  .journal-list {
    column-width: 245px;
    column-gap: 0.95rem;
  }
}

@media (max-width: 760px) {
  .masthead--journal .masthead__inner-wrap {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .journal-masthead {
    min-height: 58px;
    gap: 0.7rem;
  }

  .journal-masthead__brand {
    font-size: 0.82rem;
  }

  .journal-masthead__actions a {
    padding: 0.42rem 0.64rem;
    font-size: 0.68rem;
  }

  .journal-shell #main.journal-shell__main {
    padding: 1rem 0.82rem 3.5rem;
  }

  .journal-feed-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 1.35rem;
    border-radius: 18px;
  }

  .page__content .journal-feed-hero h1 {
    font-size: clamp(1.55rem, 7vw, 2.35rem);
  }

  .journal-feed-hero__intro {
    margin-top: 0.65rem !important;
    font-size: 0.78rem !important;
    line-height: 1.65;
  }

  .journal-feed-hero__count {
    min-width: 76px;
    padding: 0.75rem 0.62rem;
    border-radius: 14px;
  }

  .journal-feed-hero__count strong {
    font-size: 1.5rem;
  }

  .journal-feed-toolbar__hint {
    display: none;
  }

  .journal-list {
    column-count: 2;
    column-width: auto;
    column-gap: 0.72rem;
  }

  .journal-card {
    margin-bottom: 0.72rem;
    border-radius: 13px;
  }

  .journal-card__body {
    padding: 0.68rem 0.68rem 0.7rem;
  }

  .page__content .journal-card__title {
    font-size: 0.85rem;
    line-height: 1.42;
  }

  .journal-card__excerpt {
    margin-top: 0.38rem !important;
    font-size: 0.68rem !important;
    line-height: 1.55;
    -webkit-line-clamp: 2;
  }

  .journal-card__footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.42rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
  }

  .journal-tags {
    width: 100%;
    justify-content: flex-start;
  }

  .journal-card__date-badge {
    right: 0.5rem;
    bottom: 0.48rem;
    font-size: 0.57rem;
  }

  .journal-shell--entry #main.journal-shell__main {
    padding: 0.8rem 0.65rem 2.5rem;
  }

  .journal-shell--entry .diary-entry {
    padding: 1.1rem 1rem 1.7rem;
    border-radius: 18px;
  }

  .journal-shell--entry .diary-entry__cover {
    margin-right: -0.2rem;
    margin-left: -0.2rem;
  }

  .journal-shell--entry .diary-entry__content {
    font-size: 0.96rem;
    line-height: 1.95;
  }

  .homepage-journal-fab {
    right: 0.85rem;
    bottom: 0.85rem;
    gap: 0.48rem;
    padding: 0.58rem 0.78rem 0.58rem 0.62rem;
  }

  .homepage-journal-fab__icon {
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.96rem;
  }
}

@media (max-width: 430px) {
  .journal-masthead__brand-name,
  .journal-masthead__brand-divider {
    display: none;
  }

  .journal-masthead__brand-section {
    font-size: 1rem;
  }

  .journal-feed-hero {
    grid-template-columns: 1fr;
  }

  .journal-feed-hero__count {
    width: max-content;
    min-width: 0;
    flex-direction: row;
    gap: 0.38rem;
    padding: 0.46rem 0.72rem;
  }

  .journal-feed-hero__count strong {
    font-size: 1rem;
  }

  .journal-feed-hero__count span {
    margin-top: 0;
  }

  .journal-card__excerpt {
    display: none;
  }
}

@media (max-width: 340px) {
  .journal-list {
    column-count: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .masthead__menu-item--journal > a,
  .homepage-journal-fab,
  .journal-card,
  .journal-card__cover img {
    transition: none;
  }
}
