/*
 * The blog article template.
 *
 * Every post - 2021 prose, 2025 course posts, the 2026 designed guides -
 * renders through this one stylesheet. Per-post <style> blocks are removed
 * at render (PE_Post_Html), so there is nothing to fight. Hand-written,
 * tokens only.
 *
 * Designed articles carry markup we cannot know the classes of, so their
 * components are recognised by what they contain: a block that holds a
 * bulk-buy or course link is a call-to-action card; a link standing on its
 * own inside a block is a button; details/summary is an FAQ.
 */

/* ---- hero -------------------------------------------------------------- */

.pe-posthero{background:var(--pe-blue-900);color:var(--pe-surface);padding:56px 0 48px;position:relative;overflow:hidden}
.pe-posthero--image{background-size:cover;background-position:center}
.pe-posthero--image::before{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(15,27,51,.70),rgba(15,27,51,.82))}
.pe-posthero__inner{position:relative;max-width:min(78ch,100%);margin-inline:auto}
.pe-posthero__eyebrow{margin:0 0 14px;font-size:12.5px;letter-spacing:.14em;text-transform:uppercase;color:var(--pe-on-dark-soft);font-weight:600}
.pe-posthero__title{margin:0;font-family:var(--pe-font-display);font-size:clamp(1.9rem,4vw,2.9rem);line-height:1.15;color:var(--pe-surface)}
.pe-posthero__standfirst{margin:18px 0 0;font-size:18px;line-height:1.55;color:var(--pe-on-dark-soft);max-width:64ch}
.pe-posthero__meta{margin:22px 0 0;display:flex;flex-wrap:wrap;gap:10px;font-size:13.5px;color:var(--pe-on-dark-soft)}

/* ---- the article column ------------------------------------------------ */

.pe-post .pe-post__content{max-width:min(78ch,100%);margin-inline:auto}
.pe-post-html{font-size:17px;line-height:1.7;color:var(--pe-ink)}
.pe-post-html>*:first-child{margin-top:0}
.pe-post-html h2{font-family:var(--pe-font-display);font-size:clamp(1.45rem,2.6vw,1.85rem);line-height:1.25;margin:44px 0 14px;color:var(--pe-ink)}
.pe-post-html h3{font-size:1.2rem;line-height:1.3;margin:32px 0 10px;color:var(--pe-ink)}
.pe-post-html h4{font-size:1.05rem;margin:24px 0 8px}
.pe-post-html p{margin:0 0 18px}
.pe-post-html a{color:var(--pe-blue-dark);text-decoration:underline;text-underline-offset:3px}
.pe-post-html a:hover{color:var(--pe-blue)}
.pe-post-html ul,.pe-post-html ol{margin:0 0 20px;padding-left:1.4em}
.pe-post-html li{margin:0 0 8px}
.pe-post-html img{max-width:100%;height:auto;border-radius:12px}
.pe-post-html blockquote{margin:24px 0;padding:16px 22px;border-left:4px solid var(--pe-blue-line);background:var(--pe-surface);border-radius:0 10px 10px 0}
.pe-post-html table{width:100%;border-collapse:collapse;margin:0 0 24px;font-size:15px}
.pe-post-html th,.pe-post-html td{padding:10px 12px;border:1px solid var(--pe-rule);text-align:left;vertical-align:top}
.pe-post-html th{background:var(--pe-surface)}
.pe-post-html hr{border:0;border-top:1px solid var(--pe-rule);margin:36px 0}

/* A short bold line followed by a paragraph - the FAQ pattern in prose posts. */
.pe-post-html p>strong:only-child{display:block;margin-top:24px;color:var(--pe-ink)}

/* ---- designed-article components, recognised by content ---------------- */

/* Any block that carries a bulk-buy or course-enrolment link is a call to action. */
.pe-post-html.is-designed :is(div,section,aside):has(> a[href*="bulk-buy"]),
.pe-post-html.is-designed :is(div,section,aside):has(> a[href*="/courses/"]),
.pe-post-html.is-designed :is(div,section,aside):has(> p > a[href*="bulk-buy"]){
	background:var(--pe-surface);border:1px solid var(--pe-rule);border-left:4px solid var(--pe-blue);border-radius:14px;padding:22px 24px;margin:28px 0}

/* A link that stands on its own inside a block is a button, not prose. */
.pe-post-html.is-designed :is(div,section,aside,li)>a[href*="bulk-buy"],
.pe-post-html.is-designed :is(div,section,aside,li)>a[href*="/courses/"],
.pe-post-html.is-designed :is(div,section,aside)>a[href*="/online-courses/"],
.pe-post-html.is-designed :is(div,section,aside)>a[href*="courses-for-"]{
	display:inline-flex;align-items:center;gap:6px;padding:10px 16px;margin:6px 8px 6px 0;border-radius:999px;background:var(--pe-blue-900);color:var(--pe-surface);text-decoration:none;font-weight:600;font-size:14.5px;line-height:1.2}
.pe-post-html.is-designed :is(div,section,aside,li)>a[href*="bulk-buy"]:hover,
.pe-post-html.is-designed :is(div,section,aside,li)>a[href*="/courses/"]:hover{background:var(--pe-blue-dark);color:var(--pe-surface)}
.pe-post-html.is-designed :is(div,section,aside)>a[href*="bulk-buy"]{background:var(--pe-blue)}

/* Lists of enrolment links become a tidy course list. */
.pe-post-html.is-designed ul:has(> li > a[href*="/courses/"]){list-style:none;padding:0;margin:14px 0 6px;display:grid;gap:8px}
.pe-post-html.is-designed ul:has(> li > a[href*="/courses/"]) li{margin:0;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;background:var(--pe-surface);border:1px solid var(--pe-rule);border-radius:10px}

/* Stat figures (a bold number followed by a label). */
.pe-post-html.is-designed :is(div,section)>b,
.pe-post-html.is-designed :is(div,section)>strong{font-family:var(--pe-font-display);font-size:1.5rem;color:var(--pe-blue-900);margin-right:6px}

/* Course badge images sit small and centred, never full width. */
.pe-post-html.is-designed img[src*="cpdmember"],.pe-post-html.is-designed img[alt*="CPD"]{max-width:140px;height:auto;display:block;margin:6px 0 10px;border-radius:0}

/* FAQs as native disclosure widgets. */
.pe-post-html details{border:1px solid var(--pe-rule);border-radius:12px;padding:0 18px;margin:0 0 10px;background:var(--pe-surface)}
.pe-post-html summary{cursor:pointer;padding:14px 0;font-weight:600;color:var(--pe-ink);list-style:none;display:flex;justify-content:space-between;gap:12px}
.pe-post-html summary::-webkit-details-marker{display:none}
.pe-post-html summary::after{content:"+";color:var(--pe-blue);font-weight:400;font-size:1.3em;line-height:1}
.pe-post-html details[open] summary::after{content:"–"}
.pe-post-html details>*:not(summary){padding-bottom:14px}
.pe-post-html summary h3,.pe-post-html summary h2{margin:0;font-size:1rem}

/* Warning/notice callouts, recognised by the ⚠ they start with. */
.pe-post-html.is-designed :is(p,div):has(> a[href*="bulk-buy"]):first-child{margin-top:8px}

/* ---- small screens ------------------------------------------------------ */

@media (max-width:640px){
	.pe-posthero{padding:40px 0 34px}
	.pe-post-html{font-size:16px}
	.pe-post-html.is-designed :is(div,section,aside):has(> a[href*="bulk-buy"]),
	.pe-post-html.is-designed :is(div,section,aside):has(> a[href*="/courses/"]){padding:18px 16px}
}
