/* philchan.day · post pages only. Editorial template + Dawn Card slide-in.
   Loaded after site.css + pages.css. Everything reads fine without JS; post.js only adds
   the reading-progress bar and the slide-in. */

.page--post { --measure: 40rem; --wide: min(64rem, calc(100vw - 2 * var(--pad))); }

/* ───── title / dek ───── */
.post { padding: clamp(36px, 7vw, 88px) var(--pad) 24px; }
.post__h { max-width: 46rem; margin: 0 auto clamp(36px, 5vw, 56px); }
.post__h .label { display: flex; flex-wrap: wrap; gap: .3em .9em; }
.post__h .label a { margin: 0; text-decoration: none; }
.post__h .label a:hover { color: var(--true-ink); }
.page--post .post h1 {
  margin: .45em 0 0; font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.35rem, 5.6vw, 4.1rem); line-height: 1.04; letter-spacing: -.022em; text-wrap: balance;
}
.post__dek { margin-top: .75em; font-family: var(--serif); font-size: clamp(1.18rem, 2.1vw, 1.42rem); line-height: 1.38; color: var(--ink-2); max-width: 38em; text-wrap: pretty; }
.page--post .post__d { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .2em; margin-top: 1.6rem; font: 500 12px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.post__h::after { content: ""; display: block; width: 56px; height: 2px; margin-top: 26px; background: var(--sun); }
.page--post .post__img { width: var(--wide); max-width: none; margin: 0 auto clamp(36px, 5vw, 56px); border-radius: 4px; }

/* ───── the column ───── */
.page--post .prose {
  max-width: var(--measure); margin: 0 auto; display: flow-root;
  font-size: 1.15rem; line-height: 1.72; color: var(--ink); overflow-wrap: break-word; hyphens: manual;
}
.page--post .prose p, .page--post .prose ul, .page--post .prose ol, .page--post .prose pre, .page--post .prose table { margin: 0 0 1.3em; }
.prose p, .prose li { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose ul { list-style: disc; } .prose li { margin-bottom: .45em; } .prose li::marker { color: var(--amber); }
.prose li > ul, .prose li > ol { margin: .45em 0 0; }
.prose a { color: var(--true-ink); text-decoration: underline 1px; text-decoration-color: rgba(180, 47, 24, .4); text-underline-offset: .2em; }
.prose a:hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; }
.prose strong, .prose b { font-weight: 600; }
.prose .tc { text-align: center; }
.prose sup { line-height: 0; }
.prose code { font: .88em var(--mono); background: rgba(18, 18, 18, .05); padding: .1em .3em; border-radius: 3px; }

.page--post .prose h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.55rem, 3vw, 1.95rem); line-height: 1.18; letter-spacing: -.012em; margin: 2em 0 .6em; }
.prose h3 { font-size: 1.24rem; line-height: 1.3; letter-spacing: -.015em; margin: 1.9em 0 .5em; }
.prose h4, .prose h5 { font: 500 .8rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); margin: 2em 0 .7em; }
.prose h2 + h3 { margin-top: .8em; }

/* opening: drop cap on a full first paragraph, lead on a short first line */
.prose .lead { font-family: var(--serif); font-size: clamp(1.4rem, 2.6vw, 1.7rem); line-height: 1.32; letter-spacing: -.01em; }
.prose .dropcap::first-letter {
  float: left; font-family: var(--serif); font-weight: 500; font-size: 4.25em; line-height: .8;
  margin: .06em .09em 0 -.02em; color: var(--ink);
}
@supports (initial-letter: 3) {
  .prose .dropcap::first-letter { float: none; initial-letter: 3; font-size: 1em; line-height: 1; margin: 0 .12em 0 0; }
}

/* separators */
.prose hr { border: 0; width: 48px; height: 2px; margin: 2.6em auto; background: var(--sun); }

/* quotes */
.page--post .prose blockquote {
  margin: 1.8em 0; padding: .1em 0 .1em 1.25em; border-left: 2px solid var(--sun);
  font-family: var(--serif); font-size: 1.32rem; line-height: 1.45; letter-spacing: -.005em; color: var(--ink);
}
.page--post .prose blockquote p { margin: 0 0 .6em; }
.page--post .prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite, .prose blockquote .cite, .prose .wp-block-quote cite {
  display: block; margin-top: .9em; font: 500 .74rem/1.3 var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--amber);
}
.prose blockquote .cite::before, .prose blockquote cite::before { content: "— "; }
.prose blockquote .cite strong { font-weight: 500; }
.prose .wp-block-pullquote { margin: 2.4em auto; padding: 1.3em 0; border-block: 2px solid var(--sun); text-align: center; }
.page--post .prose .wp-block-pullquote blockquote { margin: 0; padding: 0; border: 0; font-size: clamp(1.5rem, 3vw, 1.95rem); line-height: 1.28; letter-spacing: -.015em; text-wrap: balance; }
.prose .intro { margin: 0 0 2em; font-family: var(--serif); font-size: 1.28rem; line-height: 1.45; color: var(--ink-2); }
.prose .intro p { margin: 0 0 .4em; }
.prose .intro strong { display: block; font: 500 .74rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }
.prose pre { white-space: pre-wrap; overflow-x: auto; }
.prose pre.wp-block-preformatted { margin: 1.8em 0; padding: .1em 0 .1em 1.25em; border-left: 2px solid var(--sun); font: 500 1.28rem/1.45 var(--serif); }
.prose .highlight, .prose mark { background: linear-gradient(transparent 52%, var(--glow) 52%); color: inherit; padding: 0 .08em; }

/* media */
.page--post .prose img { height: auto; max-width: 100%; border-radius: 3px; }
.prose figure, .prose .wp-caption, .prose .fig { margin: 2em auto; max-width: 100%; width: auto !important; text-align: center; }
.prose figure img, .prose .fig img { display: inline-block; vertical-align: top; }
.prose figure > a, .prose .fig > a { display: inline-block; }
.page--post .prose figcaption, .prose .wp-caption-text, .prose .wp-element-caption {
  margin: .7em auto 0; max-width: 34rem; font-size: .86rem; line-height: 1.45; color: var(--ink-3); text-align: center; text-wrap: pretty;
}
.prose .aligncenter { margin-inline: auto; text-align: center; }
.prose img.aligncenter { display: block; }
@media (min-width: 700px) {
  .prose .alignleft { float: left; max-width: 46%; margin: .35em 1.6em 1em 0; }
  .prose .alignright { float: right; max-width: 46%; margin: .35em 0 1em 1.6em; }
  .prose figure.alignleft, .prose figure.alignright { text-align: left; }
}
.prose h2, .prose h3, .prose hr, .prose blockquote, .prose .wp-block-pullquote, .prose .bleed { clear: both; }
.prose .bleed, .prose .alignwide { width: var(--wide) !important; max-width: none; margin-left: 50%; translate: -50% 0; }
.prose .alignfull { width: 100vw !important; max-width: none; margin-left: 50%; translate: -50% 0; }
.prose .bleed img, .prose .alignwide img, .prose .alignfull img { width: 100%; }
.prose .alignfull img { border-radius: 0; }

.page--post .prose iframe, .page--post .prose video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 4px; background: rgba(18, 18, 18, .06); }
.prose .embed, .prose .wp-block-embed { margin: 2em 0; }
.prose .wp-block-embed__wrapper { position: static; }
.prose .wp-video { width: 100% !important; }
.prose iframe[src*="spotify"] { aspect-ratio: auto; height: 232px; }

.page--post .prose .gallery, .page--post .prose .wp-block-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 2em 0; padding: 0; list-style: none;
}
.prose .gallery br { display: none; }
.prose .gallery-item, .prose .wp-block-gallery figure { margin: 0; }
.prose .gallery img, .prose .wp-block-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.prose .gallery-icon a { display: block; }

.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .95rem; }
.prose td, .prose th { padding: .5em .8em; border-bottom: 1px solid var(--rule-warm); vertical-align: top; text-align: left; }

.prose .gone { padding: .8em 1em; border: 1px dashed var(--rule-warm); border-radius: 6px; font: 500 .74rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* old table-of-contents plugin */
.prose #ez-toc-container { margin: 0 0 2.2em; padding: 18px 22px 8px; border: 1px solid var(--rule-warm); border-radius: 8px; background: rgba(255, 255, 255, .5); font-size: .98rem; line-height: 1.45; }
.prose .ez-toc-title { margin: 0 0 .6em; font: 500 .74rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }
.prose #ez-toc-container ul { list-style: none; padding-left: 0; margin: 0; }
.prose #ez-toc-container ul ul { padding-left: 1.1em; margin-top: .3em; }
.prose #ez-toc-container li { margin-bottom: .55em; }
.prose #ez-toc-container a { color: var(--ink); text-decoration: none; }
.prose #ez-toc-container a:hover { color: var(--true-ink); text-decoration: underline; }

/* end of article */
.post .credit { max-width: var(--measure); margin: 1.5em auto 0; }
.post__end { display: flex; justify-content: center; margin: 2.8em auto 0; color: var(--ink); }
.post__end .mark { width: 12px; height: 16px; fill: currentColor; }

/* ───── after the article ───── */
.post__after { max-width: calc(var(--measure) + 2 * var(--pad)); }
.post__after .sub { margin-top: 32px; }
.keep { margin: 56px 0 8px; }
.page--post .keep h2.label { margin: 0 0 16px; font: 500 12px/1.2 var(--mono); letter-spacing: .08em; }
.rcs { display: grid; gap: 12px; }
.rc a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px 20px;
  border: 1px solid var(--rule-warm); border-radius: 8px; background: rgba(255, 255, 255, .55);
  color: var(--ink); text-decoration: none; transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}
.rc a:hover { border-color: var(--ink); background: #fff; }
.rc a:hover .rc__t { color: var(--true-ink); }
.rc time { font: 500 11.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--amber); }
.rc__t { font-family: var(--serif); font-size: 1.24rem; line-height: 1.22; letter-spacing: -.008em; text-wrap: balance; }
.rc__x { font-size: .9rem; line-height: 1.5; color: var(--ink-2); }
@media (min-width: 900px) {
  .keep { width: var(--wide); margin-left: 50%; translate: -50% 0; }
  .rcs { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
.page--post .pn { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--rule-warm); }
.page--post .pn a { text-decoration: none; line-height: 1.4; }
.page--post .pn a:hover { color: var(--true-ink); }

/* ───── reading progress (post.js) ───── */
.progress { position: fixed; z-index: 60; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun), var(--true)); transform-origin: 0 50%; transform: scaleX(0); }

/* ───── The Dawn Card slide-in (post.js injects it) ───── */
.dc {
  position: fixed; z-index: 55; right: 24px; bottom: 24px; width: 368px; max-width: calc(100vw - 32px);
  padding: 18px 20px 16px; border: 1px solid var(--rule-warm); border-radius: 12px;
  background: linear-gradient(180deg, var(--glow) 0, #FFF6E8 46%, #FFFBF4 100%);
  box-shadow: 0 1px 2px rgba(18, 18, 18, .06), 0 18px 48px -12px rgba(18, 18, 18, .28);
  color: var(--ink);
  opacity: 0; transform: translateY(28px); visibility: hidden;
  transition: opacity 320ms var(--ease), transform 420ms var(--ease), visibility 0s linear 420ms;
}
.dc.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity 320ms var(--ease), transform 420ms var(--ease), visibility 0s; }
.dc__lock { width: 158px; height: auto; margin: 2px 0 14px; }
.dc__x {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid rgba(18, 18, 18, .16); border-radius: 50%; background: rgba(255, 255, 255, .7); color: var(--ink); cursor: pointer;
}
.dc__x:hover { background: var(--ink); color: var(--dawn); border-color: var(--ink); }
.dc__x svg { width: 14px; height: 14px; }
.dc__row { display: grid; grid-template-columns: 62px 1fr; gap: 16px; align-items: center; }
.dc__card { width: 62px; height: auto; border-radius: 4px; transform: rotate(-4deg); box-shadow: 0 6px 16px -4px rgba(18, 18, 18, .3); }
.dc h2 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; line-height: 1.08; letter-spacing: -.012em; outline: none; }
.dc p { margin-top: 6px; font-size: .9rem; line-height: 1.4; color: var(--ink-2); }
.dc form { display: flex; gap: 8px; margin-top: 16px; }
.dc input { flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 14px; font: inherit; font-size: 16px; border: 1px solid var(--rule-warm); border-radius: 999px; background: #fff; color: var(--ink); }
.dc input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.dc .btn { min-height: 46px; padding: 0 18px; font-size: 15px; border-radius: 999px; white-space: nowrap; }
.dc__fine { font-size: .78rem !important; color: var(--ink-3) !important; margin-top: 8px !important; }

@media (max-width: 639px) {
  .dc {
    left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: 40vh; max-height: 40dvh; overflow-y: auto;
    padding: 12px 14px 12px; border-radius: 14px; transform: translateY(110%);
  }
  .dc__lock { width: 118px; margin: 4px 0 8px; }
  .dc__x { top: 8px; right: 8px; width: 40px; height: 40px; }
  .dc__row { grid-template-columns: 40px 1fr; gap: 12px; }
  .dc__card { width: 40px; }
  .dc h2 { font-size: 1.22rem; }
  .dc p { margin-top: 3px; font-size: .84rem; line-height: 1.35; }
  .dc form { margin-top: 10px; }
  .dc input, .dc .btn { height: 44px; min-height: 44px; }
  .dc .btn { padding: 0 14px; }
  .dc__fine { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .dc, .dc.is-open { transform: none; transition: opacity 1ms, visibility 0s; }
  .rc a { transition: none; }
}
@media print { .progress, .dc, .sub, .keep, .pn { display: none !important; } }

/* ───── refinements ───── */
/* header shares the column's left edge; the title may run a little wider on big screens */
.post__h { max-width: var(--measure); }
@media (min-width: 1000px) { .page--post .post h1 { margin-right: -8rem; } .post__dek { margin-right: -4rem; } }
.page--post .post__img { aspect-ratio: 16 / 9; object-fit: cover; height: auto; }
.page--post .prose > :first-child { margin-top: 0; }
.prose blockquote em, .prose .lead em, .rc__t em { padding-right: .06em; }   /* Newsreader italic is synthesized; give it room */
.post__after { padding-bottom: clamp(48px, 7vw, 88px); }
@media (max-width: 639px) {
  .page--post .prose { font-size: 1.08rem; line-height: 1.66; }
  .page--post .prose blockquote { font-size: 1.22rem; padding-left: 1em; }
  .prose .dropcap::first-letter { font-size: 3.6em; }
  .post__h::after { margin-top: 20px; }
}

.post__arch { margin-top: .7rem; font-family: var(--serif); font-style: italic; font-size: .98rem; line-height: 1.4; color: var(--ink-3); }
.post__arch a { color: var(--ink-2); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.post__arch a:hover { color: var(--ink); }
