/* Site-wide additions (owner via CT-1, 2026-11-20): post "On this page" contents and the floating application launcher. */

/* --- On this page (posts) --- */
.editorial-text > h2[id] { scroll-margin-top: 1.5rem; }
.post-toc { margin: 2rem 0 2.5rem; }
.post-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.post-toc li { counter-increment: toc; display: grid; grid-template-columns: 2.1rem 1fr; padding: .45rem 0; border-top: 1px solid var(--line); line-height: 1.35; }
.post-toc li::before { content: counter(toc, decimal-leading-zero); font: .72rem/1.9 var(--mono); color: var(--bright); }
.post-toc a { color: var(--bone); text-decoration-color: rgba(201, 174, 124, .45); text-underline-offset: .2em; }
.post-toc a:hover { text-decoration-color: var(--bright); }
.post-toc-fold { border: 1px solid var(--line); border-top: 2px solid var(--brass); background: var(--panel); padding: 0 1.1rem; }
.post-toc-fold summary { cursor: pointer; padding: .9rem 0; font: 500 .74rem/1.6 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--bright); }
.post-toc-fold[open] summary { border-bottom: 1px solid var(--line); }
.post-toc-fold ol { padding: .4rem 0 .9rem; }
.post-toc-fold li:first-child { border-top: 0; }
.post-toc-title { margin: 0 0 .6rem; font: 500 .71rem/1.6 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--bright); }
/* Wide layouts: the 780 px column leaves a right gutter; the same list sits there, always open, and stays in view while reading
   (float with a negative margin: no effect on the text flow). Browsers without ::details-content keep the collapsible version. */
@media (min-width: 1400px) {
  @supports selector(::details-content) {
    .post-toc { float: right; position: sticky; top: 2rem; width: 210px; margin: 0 -250px 0 0; font-size: .88rem; }
    .post-toc::before { content: "On this page"; display: block; margin: 0 0 .6rem; font: 500 .71rem/1.6 var(--mono); letter-spacing: .13em; text-transform: uppercase; color: var(--bright); }
    .post-toc-fold { border: 0; background: none; padding: 0; }
    .post-toc-fold summary { display: none; }
    .post-toc-fold::details-content { content-visibility: visible; display: block; }
    .post-toc-fold ol { padding: 0; max-height: calc(100vh - 2rem - 130px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 6px; }
    .post-toc-fold li:first-child { border-top: 1px solid var(--line); }
    .post-toc li { grid-template-columns: 1.8rem 1fr; padding: .4rem 0; }
  }
}

/* --- Floating launcher --- */
.apply-launcher { position: fixed; z-index: 40; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 58px; height: 58px; border-radius: 50%; border: 1px solid #d8c294; background: var(--brass); color: #12151c; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 10px 28px rgba(0, 0, 0, .45); transition: transform .15s ease, background-color .15s ease; }
.apply-launcher svg { width: 26px; height: 26px; }
.apply-launcher:hover { background: var(--bright); transform: translateY(-2px); }
.apply-launcher:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
.apply-launcher-tip { position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%); white-space: nowrap; pointer-events: none;
  padding: .5rem .8rem; background: var(--bone); color: #12151c; font: 500 .82rem/1.2 Inter, system-ui, sans-serif; border-radius: 3px;
  opacity: 0; transition: opacity .15s ease; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.apply-launcher:hover .apply-launcher-tip, .apply-launcher:focus-visible .apply-launcher-tip { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .apply-launcher, .apply-launcher-tip { transition: none; } .apply-launcher:hover { transform: none; } }
/* the footer's last line stays clear of the button */
.has-apply-launcher footer.colophon { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* --- Panel (modal <dialog>) --- */
html.apply-panel-open { overflow: hidden; }
.apply-panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(620px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh;
  padding: 0; border: 0; border-left: 1px solid #554a3b; background: var(--midnight); color: var(--bone); overflow: hidden; }
.apply-panel[open] { display: flex; flex-direction: column; }
.apply-panel::backdrop { background: rgba(5, 7, 11, .72); }
.apply-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex: none;
  padding: calc(14px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-right, 0px)) 14px 24px; border-bottom: 1px solid var(--line); }
.apply-panel-head h2 { margin: 0; font: 500 clamp(1.6rem, 3vw, 2.1rem)/1.05 var(--display); outline: none; }
.apply-panel-close { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #554a3b; background: transparent; color: var(--bone); cursor: pointer; font-size: 1.5rem; line-height: 1; }
.apply-panel-close:hover { border-color: var(--bright); }
.apply-panel-close:focus-visible { outline: 2px solid var(--bright); outline-offset: 3px; }
.apply-panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px calc(24px + env(safe-area-inset-right, 0px)) calc(28px + env(safe-area-inset-bottom, 0px)) 24px; }
.apply-panel-body .intake-progress { margin-top: 0; }
.apply-panel-body .intake-intro > p, .apply-panel-body > .apply-panel-form > p { max-width: none; }
.apply-panel-body .application { padding: clamp(18px, 3vw, 28px); margin-top: 1rem; }
.apply-panel-body .application h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.apply-panel-loading, .apply-panel-fallback { color: var(--mist); }
.apply-panel-fallback a { color: var(--bright); }
@media (max-width: 640px) { .apply-panel { width: 100vw; border-left: 0; } .apply-panel-head { padding-left: 18px; } .apply-panel-body { padding-left: 18px; padding-right: calc(18px + env(safe-area-inset-right, 0px)); } }
