/* Page: Blog post */

.post-shell{
  /* max-width: 980px; */
  width: 100%;
  margin: 0 auto;
}

.post-card{
  padding: 18px;
  border-radius: var(--r-lg);
}

.post-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.post-kicker{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.post-title{
  margin: 6px 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -0.02em;
}

.post-meta{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.post-dot{
  opacity: 0.6;
}

.post-readtime{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.post-back{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.post-back:hover{
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.post-tags{
  margin: 12px 0 14px;
}

/* Post hero — clean editorial opening */
.post-hero{
  padding: clamp(34px, 5.2vw, 64px) 0 clamp(18px, 3vw, 30px);
}

.post-hero-inner{
  max-width: 78ch;
  padding-top: 14px;
}

.post-back-minimal{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: clamp(16px, 2.2vw, 24px);
  color: var(--ink-muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 650;
  transition: color 140ms ease, transform 140ms ease;
}

.post-back-minimal:hover{
  color: var(--ink);
  transform: translateX(-2px);
}

.post-hero-title{
  width: min(100%, 24ch);
  max-width: 100%;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.05;
}

.post-title-toggle{
  appearance: none;
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.post-title-toggle:focus-visible{
  outline: 2px solid var(--accent-soft-border);
  outline-offset: 7px;
  border-radius: 8px;
}

.post-title-cue{
  display: inline-block;
  margin-left: .18em;
  color: var(--accent);
  font-size: .48em;
  opacity: 0;
  transform: translateY(-.12em);
  transition: opacity 180ms ease, transform 180ms ease;
}

.post-title-toggle:hover .post-title-cue,
.post-title-toggle:focus-visible .post-title-cue,
.post-title-toggle[aria-expanded="true"] .post-title-cue{
  opacity: .52;
}

.post-title-toggle[aria-expanded="true"] .post-title-cue{
  transform: translateY(-.12em) rotate(180deg);
}

.post-dek-wrap{
  max-width: 68ch;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    max-height 320ms ease,
    opacity 230ms ease,
    transform 260ms ease,
    margin-top 260ms ease;
}

.post-dek-wrap[data-open="true"]{
  max-height: 260px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 14px;
}

.post-dek{
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 1px solid color-mix(in oklab, var(--accent) 40%, transparent);
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.68;
}

.post-hero-meta{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: .92rem;
}

.post-hero-meta .post-readtime{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 760px){
  .post-hero-inner{ max-width: 100%; }
  .post-hero-title{ width: 100%; }
  .post-title-toggle{ width: 100%; }
  .post-back-minimal{ margin-bottom: 14px; }
  .post-dek{ padding-left: 11px; }
}

@media (max-width: 640px){
  .post-card{ padding: 14px; }
  .post-back{ width: 100%; justify-content: center; }
}

/* Article authorship / signature — footer editorial block */
.post-authors{
  width: min(72ch, 100%);
  margin: 34px auto 4px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.post-authors-card{
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, color-mix(in oklab, var(--surface-hover) 84%, transparent), color-mix(in oklab, var(--surface) 92%, transparent));
  box-shadow: 0 18px 46px color-mix(in oklab, var(--ink) 9%, transparent);
  overflow: hidden;
}

.post-authors-card::before{
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), color-mix(in oklab, var(--accent) 22%, transparent));
  opacity: 0.82;
}

.post-authors-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post-authors-label{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .72rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.post-authors-mark{
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-weight: 850;
}

.post-authors-list{
  display: grid;
  gap: 12px;
}

.post-author{
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-md);
  transition: transform 140ms ease, background 140ms ease;
}

.post-author[href]:hover{
  transform: translateY(-1px);
}

.post-author-avatar,
.post-author-avatar-fallback{
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  font-size: 1rem;
}

.post-author-text{
  display: grid;
  gap: 3px;
  min-width: 0;
}

.post-author-name{
  font-weight: 820;
  color: var(--ink);
  letter-spacing: -0.015em;
}

.post-author-meta{
  font-size: .88rem;
  color: var(--ink-muted);
}

.post-author-bio{
  margin: 2px 0 0;
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.55;
}

.post-author-link-hint{
  margin-top: 2px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 720;
}

@media (max-width:560px){
  .post-authors{
    margin-top: 28px;
  }
  .post-authors-card{
    padding: 15px;
  }
  .post-author{
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .post-author-avatar,
  .post-author-avatar-fallback{
    width: 40px;
    height: 40px;
  }
}

/* Post closure: author signature, subtle tags, and recommended readings */
.post-author.no-avatar{
  display: block;
  padding: 2px 0;
}

.post-author.no-avatar .post-author-text{
  gap: 4px;
}

.post-author.has-avatar{
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.post-author-avatar-fallback{
  display: none !important;
}

.post-article-tags{
  width: min(72ch, 100%);
  margin: 16px auto 0;
  padding-top: 12px;
  border-top: 1px solid color-mix(in oklab, var(--border) 72%, transparent);
}

.post-article-tags-label{
  margin-bottom: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: .72;
}

.post-article-tags-list{
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.post-article-tag{
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--border) 75%, transparent);
  background: color-mix(in oklab, var(--surface) 58%, transparent);
  color: var(--ink-muted);
  font-size: .78rem;
  font-weight: 620;
}

.post-related{
  width: min(72ch, 100%);
  margin: 28px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.post-related-head{
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.post-related-kicker{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .70rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.post-related-title{
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.post-related-list{
  display: grid;
  gap: 10px;
}

.post-related-card{
  display: grid;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: color-mix(in oklab, var(--surface-hover) 68%, transparent);
  color: inherit;
  text-decoration: none !important;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.post-related-card:hover{
  transform: translateY(-1px);
  border-color: var(--accent-soft-border);
  background: color-mix(in oklab, var(--accent-soft) 28%, var(--surface-hover));
}

.post-related-meta{
  color: var(--ink-muted);
  font-size: .78rem;
  font-weight: 650;
}

.post-related-card-title{
  color: var(--ink);
  font-weight: 780;
  letter-spacing: -.015em;
  line-height: 1.25;
}

.post-related-excerpt{
  color: var(--muted);
  font-size: .90rem;
  line-height: 1.45;
}

.post-related-link{
  margin-top: 3px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 720;
}

@media (max-width:560px){
  .post-author.has-avatar{
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .post-article-tags,
  .post-related{
    width: 100%;
  }
}

/* Dark-mode article surface refinement: avoid the heavy outer black frame */
html:not([data-theme="light"]) .post-card.glass,
html[data-theme="dark"] .post-card.glass{
  background: var(--surface-hover);
}

html:not([data-theme="light"]) .post-card,
html[data-theme="dark"] .post-card{
  padding: 0;
  overflow: hidden;
}

html:not([data-theme="light"]) .modal-cover,
html[data-theme="dark"] .modal-cover,
html:not([data-theme="light"]) .modal-article,
html[data-theme="dark"] .modal-article{
  background: transparent;
}

html:not([data-theme="light"]) .modal-cover,
html[data-theme="dark"] .modal-cover{
  border-bottom-color: color-mix(in oklab, var(--border) 70%, transparent);
}
