/* Blog — 縹色 hanada, indigo (5.8:1 on the paper) */
:root { --page-color: #3b5b9c; }

/* --- The post list, set like a table of contents (目次) ------------------ */
.post-list {
  border-top: 2px solid var(--page-color);
  max-width: 64rem;
  margin-left: clamp(0px, 9vw, 150px);
}

.post-item {
  display: grid;
  grid-template-columns: 7.5rem 6.2rem minmax(0, 1fr) auto;
  grid-template-areas: "thumb meta content time";
  gap: clamp(16px, 2.6vw, 36px);
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.post-item.no-thumb { grid-template-columns: 6.2rem minmax(0, 1fr) auto; grid-template-areas: "meta content time"; }
.post-item:hover .post-title, .post-item:focus-visible .post-title { color: var(--page-color); }

.post-thumb { grid-area: thumb; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-deep); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-meta { grid-area: meta; display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.post-date { font-family: var(--font-mincho); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.post-category-tag { font-size: 12px; font-weight: 500; letter-spacing: 0.02em; }   /* colour set per category by blog.js */

.post-content { grid-area: content; display: flex; flex-direction: column; gap: 4px; }
.post-title { font-size: 1.2rem; line-height: 1.5; }
.post-desc { font-size: 14px; line-height: 1.9; max-width: var(--measure); }
.post-time { grid-area: time; font-size: 12px; color: var(--muted); white-space: nowrap; padding-top: 5px; }

.post-loading { padding: 22px 0; font-size: 13px; color: var(--muted); }

/* --- Reading a post: a sheet of paper over the page ----------------------- */
.post-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  justify-content: center;
  padding: 0 16px;
}
.post-modal.open { display: flex; }
.post-modal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--ink) 45%, transparent); }

.post-modal-content {
  position: relative;
  background: var(--paper);
  width: 100%;
  max-width: 44rem;
  height: 100%;
  overflow-y: auto;
  padding: clamp(48px, 8vh, 88px) clamp(24px, 6vw, 72px) 96px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.post-modal-image { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-bottom: 32px; }

.post-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  font: 500 13px var(--font-gothic);
  color: var(--ink);
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ink);
  padding: 2px 0;
  cursor: pointer;
  font-size: 0;                 /* hide the × glyph; show a word instead */
}
.post-modal-close::before { content: "Close"; font-size: 13px; }

.post-modal-header { border-bottom: 1px solid var(--ink); padding-bottom: 20px; margin-bottom: 32px; }
.post-modal-meta { display: flex; gap: 16px; align-items: baseline; margin-bottom: 10px; }
.post-modal-category { font-size: 12px; font-weight: 500; }
.post-modal-date { font-family: var(--font-mincho); font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.post-modal-title { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.45; }

.post-modal-body { font-size: 15px; line-height: 2; color: var(--ink); }
.post-modal-body h1, .post-modal-body h2, .post-modal-body h3 { margin: 36px 0 12px; line-height: 1.5; }
.post-modal-body p { margin-bottom: 1.2em; color: var(--ink); }
.post-modal-body ul, .post-modal-body ol { margin: 0 0 1.2em 1.4em; }
.post-modal-body code { font-size: 0.92em; background: var(--paper-deep); padding: 1px 5px; }
.post-modal-body pre { background: var(--paper-deep); padding: 16px 18px; overflow-x: auto; margin-bottom: 1.2em; border-left: 2px solid var(--page-color); }
.post-modal-body pre code { background: none; padding: 0; }
.post-modal-body a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 0.3em; }
.post-modal-body a:hover { color: var(--page-color); text-decoration-color: currentColor; }
.post-modal-body img { max-width: 100%; margin: 20px 0; }
.post-modal-body blockquote { border-left: 1px solid var(--ink); padding-left: 18px; color: var(--ink-soft); margin-bottom: 1.2em; }

@media (max-width: 899px) {
  .post-list { margin-left: 0; }
  .post-item { grid-template-columns: 5.5rem minmax(0, 1fr); grid-template-areas: "thumb content" "meta content" "time content"; gap: 4px 16px; }
  .post-item.no-thumb { grid-template-columns: minmax(0, 1fr); grid-template-areas: "meta" "content" "time"; }
  .post-meta { flex-direction: column; }
  .post-modal { padding: 0; }
}
