/* The blog: /blog and /blog/<slug> (redesign of 2026-11-26). Loaded only by views/blog.php and blog-post.php, after
   style.css, so it uses the website's own tokens: forest, sandal and cream, the serif, pill actions, white cards on cream.
   A list page in three parts (the newest article wide, the rest as cards, then the guides) and an article page set for
   reading: the text across the container's width, an "On this page" list beside it, and a calm end (a note, sharing, more). */

.blog-sr { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; white-space: nowrap; width: 1px; }
.blog-arrow { display: inline-block; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }

/* ---- Bands ---- */
.blog-hero { padding: 56px 0 52px; }
.blog-hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); margin-bottom: 10px; }
.page-hero .blog-hero-meta { color: rgba(255, 255, 255, 0.72); font-size: 0.98rem; margin-top: 14px; }

.post-hero { padding: 48px 0 56px; }
.post-hero.has-cover { padding-bottom: clamp(132px, 15vw, 210px); }
.post-hero h1 { font-size: clamp(2rem, 4.2vw, 3.15rem); line-height: 1.14; margin-bottom: 16px; max-width: 1040px; text-wrap: balance; }
.page-hero .post-standfirst { color: rgba(255, 255, 255, 0.88); font-size: clamp(1.08rem, 1.5vw, 1.24rem); line-height: 1.6; max-width: 900px; }
.page-hero .post-meta { color: rgba(255, 255, 255, 0.74); display: flex; flex-wrap: wrap; font-size: 0.98rem; gap: 4px 0; margin-top: 20px; max-width: none; }
.post-meta > span + span::before { color: rgba(255, 255, 255, 0.42); content: '·'; margin: 0 10px; }
.page-hero .breadcrumb > span[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
/* The website's breadcrumb is faint on the band for its small size (2.1:1 for "/", 3.9:1 for the current page, test of
   2026-11-26); on the blog it reads at 4.5:1 or more */
.blog-hero .breadcrumb, .post-hero .breadcrumb { color: rgba(255, 255, 255, 0.86); }
.blog-hero .breadcrumb-sep, .post-hero .breadcrumb-sep { color: rgba(255, 255, 255, 0.7); }

/* ---- Section headings: the website's serif with its forest-to-sandal rule ---- */
.blog-section-title { color: var(--gray-900); font-family: var(--font-serif); font-size: clamp(1.5rem, 2.4vw, 1.9rem); font-weight: 700; line-height: 1.2; }
.blog-section-title::after { background: linear-gradient(90deg, var(--secondary), var(--sandal)); border-radius: 2px; content: ''; display: block; height: 3px; margin-top: 10px; width: 56px; }
.blog-grid-head { align-items: flex-end; display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; margin: 0 0 24px; }
.blog-head-link { align-items: center; color: var(--secondary); display: inline-flex; font-weight: 700; gap: 6px; min-height: 44px; }
.blog-head-link:hover .blog-arrow { transform: translateX(4px); }

/* ---- The list ---- */
.blog-list { background: var(--off-white); padding: 48px 0 72px; }
.blog-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* A card: the picture shown whole (the covers carry their own titles, so nothing is cropped off), then date and reading time,
   the title and the excerpt. The title's link covers the card, so the whole card opens the article; it lifts because it is
   a link. */
.blog-card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(48, 43, 36, 0.06), 0 8px 24px rgba(48, 43, 36, 0.07);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.blog-card:hover { box-shadow: 0 2px 4px rgba(48, 43, 36, 0.06), 0 18px 40px rgba(48, 43, 36, 0.13); transform: translateY(-4px); }
.blog-card:focus-within { outline: 3px solid var(--secondary); outline-offset: 3px; }
.blog-card:focus-within .blog-card-title a { outline: none; }
.blog-card-media { aspect-ratio: 16 / 9; background: var(--gray-100); overflow: hidden; }
.blog-card-media img { display: block; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); width: 100%; }
.blog-card:hover .blog-card-media img { transform: scale(1.03); }
.blog-card-blank { align-items: center; background: linear-gradient(155deg, #0D3B13 0%, #1B5E20 55%, #0D2A12 100%); display: flex; font-size: 3rem; height: 100%; justify-content: center; }
.blog-card-body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 22px 24px 24px; }
.blog-card-meta { color: var(--gray-600); font-size: 0.92rem; }
.blog-card-title { color: var(--secondary-dark); font-family: var(--font-serif); font-size: 1.38rem; font-weight: 700; line-height: 1.25; text-wrap: balance; }
.blog-card-title a { color: inherit; }
.blog-card-title a::after { content: ''; inset: 0; position: absolute; z-index: 1; }
.blog-card-text { -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: var(--gray-700); display: -webkit-box; font-size: 1.02rem; line-height: 1.6; overflow: hidden; }
.blog-card-more { color: var(--secondary); font-size: 1rem; font-weight: 700; margin-top: auto; padding-top: 6px; }
.blog-card:hover .blog-arrow { transform: translateX(4px); }

/* The newest article: picture and words side by side, larger, at the top of the first page */
.blog-card.is-featured { align-items: center; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); margin-bottom: 56px; }
/* The picture fills its column at the card's height; covers carry their titles at the top, so any trim comes off the bottom */
/* The whole cover, never trimmed: the covers are cards with their title and points on them (2026-11-28) */
.blog-card.is-featured .blog-card-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
.blog-card.is-featured .blog-card-media img { object-position: center; }
.blog-card.is-featured .blog-card-body { gap: 14px; padding: clamp(24px, 3.4vw, 44px); }
.blog-card.is-featured .blog-card-title { font-size: clamp(1.6rem, 2.5vw, 2.25rem); line-height: 1.18; }
.blog-card.is-featured .blog-card-text { -webkit-line-clamp: 5; font-size: 1.1rem; }
.blog-card.is-featured .blog-card-more { align-self: flex-start; background: var(--secondary); border-radius: var(--radius-full, 9999px); color: var(--white); margin-top: 8px; padding: 12px 22px; }

.blog-pager { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 44px; }
.blog-pager a, .blog-pager span { align-items: center; border-radius: var(--radius-full, 9999px); color: var(--gray-700); display: inline-flex; font-weight: 700; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 16px; }
.blog-pager a { background: var(--white); box-shadow: inset 0 0 0 1px var(--gray-200); }
.blog-pager a:hover { box-shadow: inset 0 0 0 1px var(--secondary); color: var(--secondary); }
.blog-pager span[aria-current] { background: var(--secondary); color: var(--white); }
.blog-empty { background: var(--white); border-radius: 20px; margin: 0 auto; max-width: 640px; padding: 48px 32px; text-align: center; }
.blog-empty > span { display: block; font-size: 2.6rem; margin-bottom: 8px; }
.blog-empty .blog-section-title::after { margin-left: auto; margin-right: auto; }
.blog-empty p { color: var(--gray-700); font-size: 1.05rem; margin-top: 14px; }

/* ---- The guides, at the end of both pages ---- */
.blog-guides { background: var(--cream); border-top: 1px solid var(--gray-200); padding: 64px 0 80px; }
.blog-guides-head p { color: var(--gray-700); font-size: 1.05rem; margin-top: 12px; max-width: 60ch; }
.blog-guide-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); list-style: none; margin: 28px 0 0; padding: 0; }
.blog-guide {
  align-items: center;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(48, 43, 36, 0.06), 0 6px 18px rgba(48, 43, 36, 0.06);
  display: flex;
  gap: 14px;
  height: 100%;
  min-height: 76px;
  padding: 14px 18px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.blog-guide:hover { box-shadow: 0 2px 4px rgba(48, 43, 36, 0.06), 0 14px 30px rgba(48, 43, 36, 0.12); transform: translateY(-2px); }
.blog-guide:hover .blog-arrow { transform: translateX(4px); }
.blog-guide-ico { align-items: center; background: var(--sandal-cream); border-radius: 12px; display: flex; flex: none; font-size: 1.3rem; height: 46px; justify-content: center; width: 46px; }
.blog-guide-text { min-width: 0; }
.blog-guide-text strong { color: var(--secondary-dark); display: block; font-size: 1.08rem; line-height: 1.3; }
.blog-guide-text small { color: var(--gray-600); display: block; font-size: 0.95rem; line-height: 1.4; margin-top: 2px; }
.blog-guide .blog-arrow { color: var(--sandal-dark); flex: none; margin-left: auto; }

/* ---- The article ---- */
.post-main { background: var(--off-white); padding-bottom: 72px; }
.post-hero:not(.has-cover) + .post-main { padding-top: 48px; }
.post-cover { background: var(--white); border-radius: 20px; box-shadow: 0 4px 12px rgba(13, 59, 19, 0.08), 0 28px 64px rgba(13, 59, 19, 0.22); margin: calc(-1 * clamp(100px, 12vw, 172px)) auto 44px; overflow: hidden; position: relative; z-index: 2; }
/* Shown whole. A wide cover (about 1.8:1, like every cover so far) fills the width; a square or tall one would push the text
   two screens down, so it stops at 700px and sits centred on a sandal-cream mat */
.post-cover img { background: var(--sandal-cream); display: block; height: auto; max-height: 700px; object-fit: contain; width: 100%; }
/* The cover's caption (2026-11-27): a quiet line on the card's white, under the picture */
.post-cover figcaption { color: var(--gray-600); font-size: 0.95rem; line-height: 1.5; padding: 12px 22px 14px; }

/* The article takes the container's full width (owner's request of 2026-11-26: wider), the contents list beside it */
.post-layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
.post-layout:not(.has-toc) { grid-template-columns: minmax(0, 960px); justify-content: center; }
@media (min-width: 1100px) {
  .post-layout.has-toc { grid-template-columns: minmax(0, 1fr) 280px; }
  .post-toc-fold { display: none; }
}
@media (max-width: 1099px) { .post-aside { display: none; } }

/* The page: white paper on cream */
.post-article { background: var(--white); border-radius: 20px; box-shadow: 0 1px 2px rgba(48, 43, 36, 0.05), 0 8px 28px rgba(48, 43, 36, 0.06); min-width: 0; padding: clamp(24px, 5vw, 56px); }

.post-body { color: var(--gray-800); font-size: 1.25rem; line-height: 1.78; overflow-wrap: break-word; }
.post-body > :first-child { margin-top: 0; }
.post-body p { margin: 0 0 1.05em; }
.post-body h2, .post-body h3, .post-body h4 { color: var(--gray-900); font-family: var(--font-serif); scroll-margin-top: 104px; text-wrap: balance; }
.post-body h2 { color: var(--secondary-dark); font-size: clamp(1.55rem, 2.6vw, 1.95rem); font-weight: 700; line-height: 1.22; margin: 1.9em 0 0.55em; }
.post-body h3 { font-size: clamp(1.3rem, 2vw, 1.5rem); font-weight: 700; line-height: 1.28; margin: 1.6em 0 0.45em; }
.post-body h4 { font-size: 1.22rem; font-weight: 700; line-height: 1.35; margin: 1.4em 0 0.35em; }
.post-body h2 + h3, .post-body h3 + h4 { margin-top: 0.6em; }
.post-body a { color: var(--secondary); text-decoration: underline; text-decoration-color: rgba(27, 94, 32, 0.35); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body strong, .post-body b { color: var(--gray-900); }
.post-body ul, .post-body ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin: 0.4em 0; padding-left: 0.25em; }
.post-body li::marker { color: var(--sandal-dark); font-weight: 700; }
.post-body img { border-radius: 14px; display: block; height: auto; margin: 1.5em auto; max-width: 100%; }
.post-body figure { margin: 1.6em 0; }
.post-body figcaption { color: var(--gray-600); font-size: 0.95rem; margin-top: 8px; text-align: center; }
.post-body blockquote { background: var(--sandal-cream); border-radius: 16px; color: var(--gray-800); font-style: italic; margin: 1.6em 0; padding: 22px 26px 22px 58px; position: relative; }
.post-body blockquote::before { color: var(--sandal); content: '\201C'; font-family: var(--font-serif); font-size: 3.6rem; font-style: normal; left: 18px; line-height: 1; position: absolute; top: 10px; }
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body hr { background: var(--gray-200); border: 0; height: 1px; margin: 2.4em 0; }
/* Tables from the editor: one look whatever borders were typed, a header row in forest tint, and sideways scrolling on a phone */
.post-table { border: 1px solid var(--gray-200); border-radius: 14px; margin: 1.6em 0; overflow-x: auto; }
.post-body table { border-collapse: collapse; font-size: 1.04rem; line-height: 1.5; margin: 0; min-width: 100%; }
/* A table of four or more columns keeps readable columns on a phone and scrolls sideways in its box, instead of squeezing
   each column to a few words a line (the scheduled posts of 2026-11-27 use comparison tables). */
.post-body table:has(tr > :nth-child(4)) { min-width: 620px; }
.post-body table:has(tr > :nth-child(5)) { min-width: 760px; }
.post-body table, .post-body th, .post-body td, .post-body tr, .post-body colgroup, .post-body col { border: 0 !important; height: auto !important; }
.post-body th, .post-body td { border-bottom: 1px solid var(--gray-100) !important; padding: 12px 16px; text-align: left; vertical-align: top; }
.post-body tr:last-child > td { border-bottom: 0 !important; }
/* Row colours go on the row, not the cells: cells sized in fractions by the editor (50.0575%) left a hairline between them */
.post-body thead tr, .post-body table:not(:has(thead)) tr:first-child { background: rgba(27, 94, 32, 0.07); }
.post-body thead th, .post-body table:not(:has(thead)) tr:first-child > td { color: var(--secondary-dark); font-weight: 700; }
.post-body tbody tr:nth-child(even) { background: var(--gray-50); }
.post-body table:not(:has(thead)) tbody tr:first-child { background: rgba(27, 94, 32, 0.07); }
.post-body table p { margin: 0; }
/* Sizes typed in the editor (a header cell at 18pt) give way to the page's own scale, so text and tables keep one rhythm */
.post-body :is(p, li, td, th, blockquote, h2, h3, h4) [style*="font-size"] { font-size: inherit !important; }
/* …and a size typed on a heading itself gives way to the heading's own */
.post-body h2[style*="font-size"] { font-size: clamp(1.55rem, 2.6vw, 1.95rem) !important; }
.post-body h3[style*="font-size"] { font-size: clamp(1.3rem, 2vw, 1.5rem) !important; }
.post-body h4[style*="font-size"] { font-size: 1.22rem !important; }

/* "On this page": beside the text on wide screens, folded above it on narrower ones */
.post-aside { min-width: 0; }
.post-aside-inner { max-height: calc(100vh - 120px); overflow-y: auto; padding: 8px 0 8px 4px; position: sticky; scrollbar-width: thin; top: 104px; }
.post-aside-title { color: var(--gray-900); font-family: var(--font-serif); font-size: 1rem; font-weight: 700; margin: 0 0 10px; }
.post-toc-list { display: grid; gap: 2px; list-style: none; margin: 0 0 30px; padding: 0; }
.post-toc-list a { border-radius: 10px; color: var(--gray-700); display: block; font-size: 1rem; line-height: 1.4; padding: 8px 12px; transition: background-color 0.2s, color 0.2s; }
.post-toc-list a:hover { background: rgba(27, 94, 32, 0.07); color: var(--secondary-dark); }
.post-toc-fold { background: var(--sandal-cream); border-radius: 14px; margin: 0 0 30px; }
.post-toc-fold summary { align-items: center; cursor: pointer; display: flex; font-size: 1.05rem; font-weight: 700; gap: 12px; justify-content: space-between; list-style: none; min-height: 52px; padding: 12px 18px; }
.post-toc-fold summary::-webkit-details-marker { display: none; }
.post-toc-fold summary::after { -webkit-mask: var(--post-chevron) center / contain no-repeat; mask: var(--post-chevron) center / contain no-repeat; background: var(--sandal-dark); content: ''; flex: none; height: 16px; transition: transform 0.25s; width: 16px; }
.post-toc-fold[open] summary::after { transform: rotate(180deg); }
.post-toc-fold { --post-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.post-toc-count { color: var(--gray-600); font-size: 0.92rem; font-weight: 400; margin-left: auto; }
.post-toc-fold .post-toc-list { border-top: 1px solid var(--sandal-light); margin: 0; padding: 8px 8px 12px; }

/* A post held for review (blog_review_hold()): one calm line before the text, pointing to the reviewed guide */
.post-review-note { background: #FFF6E5; border: 1px solid #EBD3A2; border-radius: 14px; color: var(--gray-800); font-size: 1.02rem; line-height: 1.6; margin: 0 0 28px; padding: 16px 20px; }
.post-review-note strong { color: var(--gray-900); }
.post-review-note a { color: var(--secondary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* The end of the article: a note on acting on it, sharing, and the way back */
.post-note { background: var(--sandal-cream); border-radius: 16px; margin-top: 2.6em; padding: 22px 24px; }
.post-note h2 { color: var(--gray-900); font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700; margin: 0 0 6px; }
.post-note p { color: var(--gray-700); font-size: 1.02rem; line-height: 1.6; }
.post-end { align-items: flex-end; border-top: 1px solid var(--gray-100); display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; margin-top: 32px; padding-top: 26px; }
.post-share h2 { color: var(--gray-900); font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; }
.post-share-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.post-share-list a { align-items: center; background: var(--gray-100); border-radius: var(--radius-full, 9999px); color: var(--gray-800); display: inline-flex; font-size: 0.98rem; font-weight: 700; min-height: 44px; padding: 0 18px; transition: background-color 0.2s, color 0.2s; }
.post-share-list a:hover { background: var(--gray-200); }
.post-share-list li:first-child a { background: var(--secondary); color: var(--white); }
.post-share-list li:first-child a:hover { background: var(--secondary-dark); }
.post-share-list.is-compact { display: grid; gap: 6px; }
.post-share-list.is-compact a { min-height: 40px; width: 100%; }
.post-back { align-items: center; border-radius: var(--radius-full, 9999px); box-shadow: inset 0 0 0 1.5px var(--secondary); color: var(--secondary); display: inline-flex; font-weight: 700; gap: 8px; min-height: 44px; padding: 0 22px; transition: background-color 0.2s, color 0.2s; }
.post-back:hover { background: var(--secondary); color: var(--white); }
.post-more { background: var(--off-white); padding: 8px 0 72px; }

/* ---- Narrower ---- */
@media (max-width: 900px) {
  .blog-card.is-featured { grid-template-columns: minmax(0, 1fr); margin-bottom: 44px; }
  .blog-card.is-featured .blog-card-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
}
@media (max-width: 768px) {
  .blog-hero { padding: 40px 0 36px; }
  .post-hero { padding: 36px 0 40px; }
  .post-hero.has-cover { padding-bottom: 96px; }
  .post-cover { border-radius: 16px; margin-top: -72px; margin-bottom: 28px; }
  .blog-list { padding: 32px 0 56px; }
  .post-article { border-radius: 16px; padding: 22px 18px 26px; }
  .post-body { font-size: 1.1rem; line-height: 1.72; }
  .post-body th, .post-body td { padding: 10px 12px; }
  .post-end { align-items: stretch; flex-direction: column; }
  .post-back { justify-content: center; }
  .blog-guides { padding: 48px 0 56px; }
  .page-hero .breadcrumb > span[aria-current] { max-width: 24ch; }
  .page-hero .post-meta { gap: 4px 16px; }
  .post-meta > span + span::before { content: none; }       /* a wrapped line would start with a dot */
}

/* Printing an article (farmers print guides): the words only, dark on white. Browsers leave the band's green out, which
   printed its white title on white paper. */
@media print {
  .post-aside, .post-toc-fold, .post-end, .post-more, .blog-guides, .blog-pager, .blog-hero-meta { display: none !important; }
  .page-hero.blog-hero, .page-hero.post-hero { background: none !important; padding: 0 0 12px !important; }
  .page-hero.blog-hero::before, .page-hero.post-hero::before, .page-hero.blog-hero::after, .page-hero.post-hero::after { display: none !important; }
  .page-hero.blog-hero *, .page-hero.post-hero * { color: #000 !important; text-shadow: none !important; }
  .post-main, .blog-list { background: none; padding: 0; }
  .post-cover { box-shadow: none; margin: 0 0 16px; }
  .post-layout, .post-layout.has-toc { display: block; }
  .post-article { box-shadow: none; padding: 0; }
  .post-note { border: 1px solid #999; }
  .blog-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-card, .blog-card-media img, .blog-guide, .blog-arrow, .post-toc-fold summary::after { transition: none; }
  .blog-card:hover, .blog-guide:hover, .blog-card:hover .blog-card-media img { transform: none; }
}
