/* Single note (blog article) — the reading page.
   Layout: breadcrumb, title and meta, the featured picture, the quick answer,
   then two columns on wide screens — the article, opening with its table of
   contents as a bordered box above the body, and beside it a sticky rail
   holding the inquiry form, the note search and the closest notes. Below
   1024px the rail stacks under the article.
   This sheet is enqueued site-wide (functions.php), so every rule is scoped to
   the classes this template alone renders: .single-post*, .post-toc* and
   .post-rail*. The shared layer (style.css, pages.css, tokens.css) keeps the
   palette, the spacing and the form field styling. */

/* Breadcrumb */
.breadcrumbs{
  max-width:var(--content-max);
  margin:0 auto;
  padding:24px var(--gutter) 0;
  font-size:14px;
  color:var(--color-muted);
}
.breadcrumbs a{color:var(--color-muted);text-decoration:none}
.breadcrumbs a:hover{color:var(--color-accent)}
.breadcrumbs__sep{margin:0 8px;color:var(--color-field-line)}
.breadcrumbs__current{color:var(--color-text)}

/* Header */
.single-post__header{padding:16px 0 8px}
.site-main--single .single-post{padding-bottom:var(--section-space)}
.single-post .entry__title{
  /* A note title is a sentence, not a slogan: it is set a step smaller than the
     site's display h1 and given a wider measure, so a long title holds three
     lines instead of five. */
  font-size:clamp(1.65rem,2.9vw,2.35rem);
  line-height:1.16;
  letter-spacing:-.02em;
  margin:0 0 12px;
  max-width:28ch;
  text-wrap:balance;
}
.entry__meta{
  margin:0 0 8px;
  font-size:14px;
  color:var(--color-muted);
}
.entry__meta a{color:var(--color-accent);text-decoration:none}
.entry__meta a:hover{text-decoration:underline}
.entry__meta-sep{margin:0 8px}

/* Featured picture */
.single-post__hero{
  margin:8px 0 24px;
  border-radius:var(--radius-lg);
  overflow:hidden;
  background:var(--color-pale);
}
.single-post__photo{display:block;width:100%;height:auto}

/* Quick answer */
.quick-answer{
  margin:0 0 32px;
  padding:20px 24px;
  background:var(--color-accent-pale);
  border-left:4px solid var(--color-accent);
  border-radius:0 var(--radius-md) var(--radius-md) 0;
  max-width:70ch;
}
.quick-answer__label{
  margin:0 0 6px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--color-accent);
}
.quick-answer__text{margin:0;font-size:17px;color:var(--color-heading)}

/* Layout: the article in the first column, the rail in the second.
   Below 1024px the two stack, the article first. */
.single-post__layout{display:block}
.single-post__main{min-width:0}
.post-rail{margin:36px 0 0}
@media (min-width:1024px){
  .single-post__layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(320px,340px);
    gap:48px;
    align-items:start;
  }
  .post-rail{
    margin:0;
    position:sticky;
    top:96px;
    /* The rail is taller than the window on a short screen (the inquiry form
       alone carries eight fields), and a sticky element that does not fit would
       leave its submit button out of reach, so the rail scrolls inside itself
       instead of being pinned whole. */
    max-height:calc(100vh - 120px);
    max-height:calc(100dvh - 120px);
    overflow-y:auto;
  }
}

/* The rail: the inquiry block, the note search and the related notes.
   The form and the search carry their own chrome; the related list is a plain
   list of titles with their dates. */
.post-rail__block{margin:0 0 28px}
.post-rail__block:last-child{margin-bottom:0}
.post-rail__block--search{
  padding:18px 20px;
  background:var(--color-pale);
  border:1px solid var(--color-line);
  border-radius:var(--radius-md);
}
/* The inquiry form posts back to this page and lands on #contact, which is this
   block, so a jump to it clears the fixed header. */
.post-rail__block--inquiry{scroll-margin-top:110px}
.post-rail__eyebrow{margin-bottom:10px;font-size:11px}
.post-rail__title{
  margin:0 0 10px;
  font-size:1.05rem;
  line-height:1.3;
  color:var(--color-heading);
}
.post-rail__text{
  margin:0 0 16px;
  font-size:14px;
  line-height:1.5;
  color:var(--color-muted);
}

/* The form, compacted for a narrow column: one field per row and a full-width
   submit. The form's own note and its feedback line stay visible. */
.post-rail .form{padding:20px}
.post-rail .fields{grid-template-columns:1fr;gap:14px}
.post-rail .field label{font-size:12.5px}
.post-rail .field input,.post-rail .field select,.post-rail .field textarea{
  min-height:44px;
  padding:10px 12px;
  font-size:14.5px;
}
.post-rail .field textarea{min-height:96px}
.post-rail .form__submit{margin-top:18px}
.post-rail .form__note{font-size:11.5px}
.post-rail .feedback{font-size:13px}

/* The rail's search: the block above owns the panel, so the shared component
   is stripped back to its fields and stacked. The variant class the template
   passes (notes-search--rail) is part of every selector here, so these rules
   hold wherever the component's own sheet sits in the cascade. */
.post-rail .notes-search--rail{padding:0;background:none;border:0}
.post-rail .notes-search--rail .notes-search__label{
  display:block;
  margin:0 0 8px;
  font-size:12.5px;
  font-weight:600;
  color:var(--color-navy);
}
.post-rail .notes-search--rail .notes-search__row{display:grid;gap:10px}
.post-rail .notes-search--rail .notes-search__input{min-height:44px;font-size:14.5px}
.post-rail .notes-search--rail .notes-search__submit{width:100%}
.post-rail .notes-search--rail .notes-search__note{margin:10px 0 0;font-size:11.5px;color:var(--color-muted)}

/* Related notes: a compact list, not cards. */
.post-rail__list{margin:0;padding:0;list-style:none}
.post-rail__item{padding:12px 0;border-top:1px solid var(--color-line)}
.post-rail__item:first-child{padding-top:0;border-top:0}
.post-rail__link{
  display:block;
  font-size:14.5px;
  font-weight:600;
  line-height:1.35;
  color:var(--color-text);
  text-decoration:none;
}
.post-rail__link:hover{color:var(--color-accent);text-decoration:underline}
.post-rail__date{display:block;margin-top:4px;font-size:12px;color:var(--color-muted)}

/* Table of contents */
.post-toc{
  margin:0 0 32px;
  padding:18px 20px;
  background:var(--color-pale);
  border:1px solid var(--color-line);
  border-radius:var(--radius-md);
}
.post-toc__label{
  margin:0 0 10px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--color-muted);
}
/* Numbered, because the site numbers its sections elsewhere (01 / ARTICLES) and
   because a seventeen-entry list reads faster with leading zeros than with
   bullets. */
.post-toc__list{margin:0;padding:0;list-style:none;counter-reset:toc;font-size:14.5px}
.post-toc__list li{
  display:grid;
  grid-template-columns:24px minmax(0,1fr);
  gap:0 8px;
  counter-increment:toc;
  margin:0 0 9px;
}
.post-toc__list li::before{
  content:counter(toc,decimal-leading-zero);
  padding-top:3px;
  font-size:11.5px;
  font-weight:700;
  font-variant-numeric:tabular-nums;
  color:var(--color-field-line);
}
.post-toc__list a{color:var(--color-text);text-decoration:none;line-height:1.4}
.post-toc__list a:hover{color:var(--color-accent);text-decoration:underline}
/* Two columns once the article column is wide enough for the list to read as
   one, so the box does not become a tall block above the body. */
@media (min-width:720px){
  .post-toc__list{columns:2;column-gap:32px}
  .post-toc__list li{break-inside:avoid}
}

/* Body: section targets clear the fixed header when jumped to */
/* The reading column: 66ch rather than the site's 70ch, because a note here is
   read in long runs, and every section heading opens with a hairline — that rule
   is what tells the eye where one answer ends and the next begins. */
.single-post__body{max-width:66ch}
.single-post__body p{margin:0 0 18px;line-height:var(--leading-body);text-wrap:pretty}
/* The opening paragraph is the note's own summary line: set a step larger and
   quieter, so the page opens with a lead instead of starting flat. */
.single-post__body > p:first-of-type{
  font-size:19px;
  line-height:1.55;
  color:var(--color-muted);
}
.single-post__body h2{
  scroll-margin-top:110px;
  font-size:clamp(1.35rem,2.2vw,1.7rem);
  line-height:1.28;
  letter-spacing:-.01em;
  margin:48px 0 16px;
  padding-top:32px;
  border-top:1px solid var(--color-line);
  color:var(--color-heading);
  text-wrap:balance;
}
.single-post__body h3{
  scroll-margin-top:110px;
  font-size:1.1rem;
  line-height:1.35;
  letter-spacing:-.005em;
  margin:30px 0 10px;
  color:var(--color-heading);
}
/* The labels a note uses inside a section ("F-R — Real-Time Flow"). */
.single-post__body h4{
  margin:24px 0 8px;
  font-size:1rem;
  line-height:1.4;
  letter-spacing:.01em;
  color:var(--color-navy);
}
.single-post__body ul,.single-post__body ol{margin:0 0 20px;padding-left:20px;line-height:var(--leading-body)}
.single-post__body li{margin:0 0 8px;padding-left:2px}
.single-post__body li::marker{color:var(--color-accent)}
.single-post__body table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 24px;
  font-size:15px;
}
.single-post__body th,.single-post__body td{
  padding:10px 14px;
  border:1px solid var(--color-line);
  text-align:left;
  vertical-align:top;
}
.single-post__body th{background:var(--color-pale);color:var(--color-heading)}
.single-post__body .wp-block-table{margin:0 0 24px}

/* The pictures inside the note: the site's own field photographs, placed
   between sections by hober_note_figures() when the note carries no picture of
   its own. They run a little wider than the text measure so a photograph reads
   as a photograph rather than as an illustration in a column. */
.post-figure{
  margin:36px 0;
  max-width:84ch;
}
.post-figure__photo{
  display:block;
  width:100%;
  height:auto;
  border-radius:var(--radius-md);
  background:var(--color-pale);
}
.post-figure__caption{
  margin:10px 0 0;
  max-width:66ch;
  font-size:13.5px;
  line-height:1.5;
  color:var(--color-muted);
}

/* The chains a note writes as a line of their own — "Pressure Sensor → 4–20mA
   Signal → Solar Pump Inverter → Pump Speed Adjustment" — carry this class from
   hober_note_flows() in functions.php, because as ordinary prose they read as a
   sentence that lost its punctuation. */
.single-post__body .post-flow{
  margin:28px 0;
  padding:16px 20px;
  background:var(--color-pale);
  border:1px solid var(--color-line);
  border-left:4px solid var(--color-accent);
  border-radius:0 var(--radius-md) var(--radius-md) 0;
  font-size:15px;
  line-height:1.7;
  color:var(--color-navy);
  font-variant-numeric:tabular-nums;
}

/* Mid-article call to action */
.post-cta{
  margin:32px 0;
  padding:24px 28px;
  background:var(--color-navy);
  border-radius:var(--radius-md);
  color:#fff;
}
.post-cta .eyebrow{color:var(--color-sun)}
.post-cta__lead{
  margin:0 0 8px;
  font-size:1.15rem;
  font-weight:700;
  line-height:1.3;
}
.post-cta__text{margin:0 0 18px;color:#d7e2ee}
.post-cta__actions{display:flex;flex-wrap:wrap;gap:12px}
