/* localmedic: a first aid topic's page (single-fa_topic.php) and a news post's page
   (single.php). Only their layout lives here. Buttons, tiles, chips, cards, bands, shapes,
   steps, folds and the "Not sure?" panel are the shared set in lm-ui.css. */

.lm-single{color:var(--lm-ink); padding-bottom:72px; overflow-x:clip;}
.lm-single h2,.lm-single h3{font-family:var(--lm-font-head); color:var(--lm-heading);}
.lm-single__section{margin-top:72px;}
.lm-single__narrow{max-width:860px;}
.lm-single__intro{color:var(--lm-muted); max-width:68ch; margin:-8px 0 22px!important;}
.lm-single__after{margin:20px 0 0!important;}

/* Reading text */
.lm-single__prose{min-width:0;}
.lm-single__prose > *{max-width:70ch;}
.lm-single__prose p,.lm-single__prose ul,.lm-single__prose ol{margin:0 0 16px;}
.lm-single__prose h2{font-size:clamp(26px,22px + 1vw,32px); line-height:1.2; margin:36px 0 12px!important;}
.lm-single__prose h3{font-size:22px; line-height:1.25; margin:28px 0 10px!important;}
.lm-single__prose > h2:first-child,.lm-single__prose > .lm-h2:first-child{margin-top:0!important;}
.lm-single__prose a{color:var(--lm-ink); text-decoration:underline; text-underline-offset:3px;}
.lm-single__prose a:hover{color:var(--lm-heading); text-decoration-thickness:2px;}
.lm-single__prose img{max-width:100%; height:auto; border-radius:var(--lm-r);}

/* Text beside "On this page" */
.lm-single__layout{display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:32px 56px; align-items:start; margin-top:56px;}
.lm-single__layout:has(> :only-child){grid-template-columns:1fr;}
.lm-single__side{position:sticky; top:24px;}
.lm-single__side .lm-card__title{font-size:20px; margin:0!important;}
.lm-single__toc{list-style:none!important; margin:0!important; padding:0!important; display:flex; flex-direction:column; gap:4px;}
.lm-single__toc li{margin:0!important;}
.lm-single__toc li::before{content:none!important;}
.lm-single__toc a{display:inline-flex; min-height:36px; align-items:center;}

/* ---------- First aid topic ---------- */
.lm-topic-key{display:flex; gap:16px; align-items:flex-start; background:var(--lm-blush); border-radius:var(--lm-r); padding:22px 24px; margin-top:-28px; position:relative; z-index:2;}
.lm-topic-key__text{font-size:18px; line-height:1.5;}
.lm-topic-key__text p{margin:0 0 8px;}
.lm-topic-key__text p:last-child{margin:0;}

.lm-topic-how{margin-top:72px; scroll-margin-top:24px;}
.lm-topic-how__inner{max-width:860px;}
.lm-topic-steps{grid-template-columns:1fr!important;}
.lm-topic-steps p{color:var(--lm-text-soft);}
.lm-topic-tip{margin-top:10px!important; background:var(--lm-cream); border-radius:var(--lm-r-sm); padding:10px 14px; font-size:15px!important; color:var(--lm-ink)!important;}

.lm-topic-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr)); gap:16px;}
.lm-topic-grid > li{margin:0!important;}
.lm-topic-grid > li::before{content:none!important;}
.lm-topic-grid .lm-card__title{font-size:20px; margin:0!important;}
.lm-topic-grid .lm-card p{color:var(--lm-ink);}

/* Course cards: the coloured top, then the name; the whole card is the link. */
.lm-topic-course{padding:0; overflow:hidden; position:relative;}
.lm-topic-course > :not(.lm-topic-course__top){padding:0 20px;}
.lm-topic-course__top{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px 20px; border-radius:0; margin-bottom:4px;}
.lm-topic-course__top .lm-chips{justify-content:flex-end;}
.lm-topic-course__link{color:inherit!important; text-decoration:none!important;}
.lm-topic-course__link::after{content:""; position:absolute; inset:0; border-radius:inherit;}
.lm-topic-course:hover{border-color:var(--lm-heading);}
.lm-topic-course:focus-within{outline:3px solid var(--lm-heading); outline-offset:2px;}
.lm-topic-course__link:focus{outline:none;}
.lm-topic-course__full{color:var(--lm-muted)!important; font-size:14px;}
.lm-topic-course__note{font-size:15px;}
.lm-topic-course__more{margin-top:auto!important; padding-top:8px!important; padding-bottom:20px!important; font-weight:700; text-decoration:underline; text-underline-offset:3px;}

.lm-topic-rel{flex-direction:row!important; align-items:center; gap:14px; height:100%; text-decoration:none!important; color:var(--lm-heading)!important;}
.lm-topic-rel__title{font-family:var(--lm-font-head); font-weight:700; font-size:17px; line-height:1.3;}
.lm-topic-rel:hover{border-color:var(--lm-heading);}
.lm-topic-rel:hover .lm-topic-rel__title{text-decoration:underline;}

/* ---------- News post ---------- */
.lm-news{
  --c-ink:var(--lm-ink); --c-muted:var(--lm-muted); --c-border:var(--lm-line);
  --c-magenta:var(--lm-magenta); --c-heading:var(--lm-heading);
}
.lm-news__meta{margin-top:32px!important;}
.lm-news__photo{margin:28px 0 0; border-radius:var(--lm-r-lg); overflow:hidden; background:var(--lm-cream);}
.lm-news__photo img{display:block; width:100%; height:auto; max-height:520px; object-fit:cover;}
.lm-news__body{margin-top:32px;}
.lm-news .lm-post-card{border-color:var(--lm-line); border-radius:var(--lm-r);}
.lm-news .lm-post-card__title{font-size:21px; line-height:1.2; margin:0;}
.lm-news .lm-post-card__img{overflow:hidden;}
.lm-news .lm-post-card__img img{aspect-ratio:16/9; height:auto; object-fit:cover;}
.lm-news .lm-post-link{color:var(--lm-heading)!important; text-decoration:none!important;}
.lm-news .lm-post-link:hover{text-decoration:underline!important;}

@media (max-width:900px){
  .lm-single__layout{grid-template-columns:1fr; margin-top:40px;}
  .lm-single__side{position:static; order:-1;}
  .lm-single__section,.lm-topic-how{margin-top:56px;}
}
@media (max-width:640px){
  .lm-topic-key{flex-direction:column; margin-top:-20px;}
}
