/* ==========================================================
   Diary notebook page
   ========================================================== */

#page.diary-page-wrap #article-container {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.diary-page {
  --diary-paper: #fbf6ea;
  --diary-ink: #3d3a33;
  --diary-muted: #7a6f5f;
  --diary-line: rgba(86, 122, 145, 0.16);
  --diary-margin: rgba(190, 86, 76, 0.38);
  --diary-accent: #a9553f;
  --diary-green: #3f5c52;
  --diary-shadow: 0 18px 45px rgba(62, 48, 32, 0.16);
  width: 100%;
  margin: 0 auto;
  color: var(--diary-ink);
  font-family: "KaiTi", "STKaiti", "楷体", "Noto Serif SC", "Songti SC", serif;
}

.diary-page a {
  text-decoration: none;
}

.diary-book {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}

/* metal rings along the top */
.diary-rings {
  position: relative;
  z-index: 3;
  height: 26px;
  margin: 0 22px -13px;
  background-image: radial-gradient(circle at 13px 13px, #c8b99d 0 6px, #8d7c61 6.5px 8px, transparent 8.5px);
  background-size: 30px 26px;
  background-repeat: repeat-x;
  filter: drop-shadow(0 2px 2px rgba(60, 45, 30, 0.18));
}

/* book cover */
.diary-cover {
  position: relative;
  border-radius: 16px 16px 8px 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 7px),
    linear-gradient(135deg, #527367 0%, #3d5c51 55%, #2f4a41 100%);
  box-shadow: 0 24px 55px rgba(38, 55, 47, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: #f7f1e2;
  padding: 46px 52px 40px 76px;
}

.diary-cover::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 0;
  bottom: 0;
  width: 12px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 22px),
    rgba(0, 0, 0, 0.12);
  border-radius: 6px;
}

.diary-cover::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  pointer-events: none;
}

.diary-cover-inner {
  position: relative;
  z-index: 2;
}

.diary-cover-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: rgba(247, 241, 226, 0.72);
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0.42em;
}

.diary-cover-title {
  margin: 0 0 10px;
  color: #fbf4e3;
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.diary-cover-sub {
  max-width: 520px;
  margin: 0;
  color: rgba(247, 241, 226, 0.82);
  font-size: 15px;
  line-height: 1.9;
}

.diary-cover-rule {
  width: 86px;
  height: 3px;
  margin-top: 22px;
  border-radius: 2px;
  background: linear-gradient(90deg, #d9b77a, rgba(217, 183, 122, 0));
}

/* ribbon bookmark */
.diary-ribbon {
  position: absolute;
  top: -8px;
  right: 58px;
  z-index: 4;
  width: 20px;
  height: 86px;
  background: linear-gradient(180deg, #b05643, #8d3f30);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.diary-ribbon::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 0;
  border-right: 10px solid #8d3f30;
  border-bottom: 12px solid transparent;
  border-left: 10px solid #8d3f30;
}

/* paper pages */
.diary-sheet {
  position: relative;
  z-index: 2;
  margin: -6px 14px 0;
  padding: 40px 42px 46px;
  border: 1px solid rgba(120, 100, 70, 0.14);
  border-top: 0;
  border-radius: 4px 4px 16px 16px;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.75), transparent 38%),
    linear-gradient(180deg, #fdfaf2, #f7f0e0);
  box-shadow: var(--diary-shadow);
}

.diary-sheet::before {
  content: "";
  position: absolute;
  top: 0;
  right: 42px;
  left: 42px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(120, 100, 70, 0.25) 0 6px, transparent 6px 12px);
}

/* intro */
.diary-intro {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px dashed rgba(120, 100, 70, 0.24);
}

.diary-quote {
  color: rgba(169, 85, 63, 0.55);
  font-family: "Georgia", serif;
  font-size: 44px;
  line-height: 0.8;
}

.diary-intro p {
  margin: 4px 0 0;
  color: #6b6153;
  font-size: 15px;
  line-height: 1.9;
}

.diary-count {
  margin: 0 0 18px;
  color: #8a7c68;
  font-size: 13px;
  letter-spacing: 0.12em;
}

/* entries */
.diary-list {
  display: grid;
  gap: 22px;
}

.diary-entry {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.diary-date {
  flex: 0 0 72px;
  padding-top: 18px;
  color: #fff;
  text-align: center;
}

.diary-date-day {
  display: block;
  padding: 6px 0 2px;
  border-radius: 4px 4px 0 0;
  background: var(--diary-accent);
  box-shadow: 0 4px 10px rgba(169, 85, 63, 0.2);
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.diary-date-month {
  display: block;
  padding: 5px 0 7px;
  border-radius: 0 0 4px 4px;
  background: #7d4032;
  font-family: "Georgia", serif;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.diary-entry-paper {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 22px 26px 24px 54px;
  border: 1px solid rgba(120, 100, 70, 0.14);
  border-radius: 6px;
  background-color: #fffdf7;
  background-image:
    linear-gradient(90deg, transparent 0 38px, var(--diary-margin) 38px 39px, transparent 39px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--diary-line) 31px 32px);
  background-size: 100% 100%, 100% 32px;
  box-shadow: 0 10px 24px rgba(72, 55, 36, 0.09);
  transform: rotate(-0.22deg);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.diary-entry:nth-child(even) .diary-entry-paper {
  transform: rotate(0.22deg);
}

.diary-entry-paper:hover {
  transform: translateY(-2px) rotate(0);
  box-shadow: 0 16px 32px rgba(72, 55, 36, 0.14);
}

/* washi tape */
.diary-entry-tape {
  position: absolute;
  top: -9px;
  left: 42px;
  z-index: 2;
  width: 74px;
  height: 19px;
  border-right: 1px dashed rgba(255, 255, 255, 0.5);
  border-left: 1px dashed rgba(255, 255, 255, 0.5);
  background: rgba(214, 190, 132, 0.52);
  box-shadow: 0 2px 4px rgba(90, 70, 40, 0.1);
  transform: rotate(-2.5deg);
}

.diary-entry-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.diary-entry-title a {
  color: #3d3a33;
  background-image: linear-gradient(90deg, rgba(169, 85, 63, 0.45), rgba(169, 85, 63, 0.45));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: color 0.2s ease;
}

.diary-entry-title a:hover {
  color: var(--diary-accent);
}

.diary-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  color: #8a7c68;
  font-size: 12px;
}

.diary-entry-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.diary-tag {
  padding: 1px 8px;
  border: 1px solid rgba(169, 85, 63, 0.28);
  border-radius: 999px;
  background: rgba(169, 85, 63, 0.04);
  color: #9a5a45;
  font-size: 11px;
}

.diary-tag:hover {
  background: rgba(169, 85, 63, 0.1);
}

.diary-entry-excerpt {
  margin: 4px 0 10px;
  color: #5f574a;
  font-size: 14px;
  line-height: 2.05;
  text-indent: 2em;
}

.diary-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--diary-accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.diary-readmore .diary-arrow {
  transition: transform 0.2s ease;
}

.diary-readmore:hover .diary-arrow {
  transform: translateX(4px);
}

.diary-end {
  margin-top: 30px;
  color: #a1927c;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-align: center;
}

.diary-empty {
  padding: 40px 0;
  color: #8a7c68;
  font-size: 15px;
  text-align: center;
}

/* responsive */
@media screen and (max-width: 768px) {
  #page.diary-page-wrap #article-container {
    padding: 0 8px;
  }

  .diary-rings {
    margin: 0 10px -13px;
  }

  .diary-cover {
    padding: 34px 24px 30px 54px;
  }

  .diary-cover::before {
    left: 14px;
    width: 8px;
  }

  .diary-cover-title {
    font-size: 30px;
  }

  .diary-cover-sub {
    font-size: 14px;
  }

  .diary-ribbon {
    right: 30px;
    height: 66px;
  }

  .diary-sheet {
    margin: -4px 0 0;
    padding: 26px 16px 32px;
  }

  .diary-sheet::before {
    right: 16px;
    left: 16px;
  }

  .diary-entry {
    flex-direction: column;
    gap: 10px;
  }

  .diary-date {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding-top: 0;
    text-align: left;
  }

  .diary-date-day {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 20px;
  }

  .diary-date-month {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
  }

  .diary-entry-paper {
    padding: 20px 16px 20px 40px;
  }

  .diary-entry-tape {
    left: 26px;
  }

  .diary-entry-title {
    font-size: 18px;
  }

  .diary-entry-excerpt {
    font-size: 13.5px;
  }
}
