/* artblibs blog kit: blog.css
 * Structure only. Every colour, font and radius comes from the --blog-* variables below.
 * Per site: edit ONLY part 1 (map each variable to the site's own CSS variables) and add brand touches in part 3.
 * Part 2 is shared by all sites; leave it alone so fixes can be copied across.
 * The neutral fallbacks in part 1 are there so nothing breaks; never ship them, map every line.
 */

/* ---- 1. BRAND MAP: FunHaus (cream, red, navy, butter; Shrikhand headings + DM Sans) ---------------------- */
:root{
  --blog-surface:#fff;            /* white cards on cream, like the site's .card */
  --blog-ink:var(--ink);
  --blog-muted:rgba(43,43,43,.72);
  --blog-title:var(--navy);
  --blog-accent:var(--red);
  --blog-line:var(--navy);
  --blog-soft:var(--cream2);
  --blog-head-font:var(--disp);
  --blog-body-font:var(--sans);
  --blog-head-weight:400;
  --blog-radius:22px;
  --blog-img-radius:22px;
  --blog-max:var(--max);
  --blog-prose:680px;             /* article text column */
}

/* ---- 2. STRUCTURE (shared, do not edit per site) ---------------------------------------------------------- */
[data-blog][hidden],[data-blog-nav][hidden],[data-blog-item][hidden],.blog-more-wrap[hidden]{display:none!important}

/* cards (home "From the blog", /blog/ grid, "More articles") */
.blog-grid{display:grid;grid-template-columns:1fr;gap:24px;margin:0;padding:0}
.blog-card,.blog-feature{margin:0;min-width:0}
.blog-card-link{display:flex;flex-direction:column;height:100%;color:inherit;text-decoration:none;background:var(--blog-surface);border:1px solid var(--blog-line);border-radius:var(--blog-radius);overflow:hidden;transition:transform .25s,box-shadow .25s}
.blog-card-link:hover{transform:translateY(-3px);box-shadow:0 12px 28px rgba(0,0,0,.08)}
.blog-card-link:focus-visible{outline:3px solid var(--blog-accent);outline-offset:3px}
.blog-thumb{display:block;aspect-ratio:16/9;overflow:hidden;background:var(--blog-soft)}
.blog-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.blog-card-body{display:flex;flex-direction:column;gap:.45rem;padding:1.15rem 1.2rem 1.3rem;flex:1;text-align:left}
.blog-cat{font:600 .72rem/1.3 var(--blog-body-font);letter-spacing:.16em;text-transform:uppercase;color:var(--blog-accent)}
.blog-card-title{font-family:var(--blog-head-font);font-weight:var(--blog-head-weight);font-size:1.45rem;line-height:1.15;color:var(--blog-title);margin:0;overflow-wrap:break-word}
.blog-excerpt{display:block;color:var(--blog-ink);font:400 .97rem/1.55 var(--blog-body-font)}
.blog-meta{display:block;margin-top:auto;padding-top:.35rem;color:var(--blog-muted);font:400 .85rem/1.4 var(--blog-body-font)}
.no-img .blog-card-body{padding-top:1.5rem}

/* /blog/: newest post large */
.blog-index{display:grid;gap:32px}
.blog-feature .blog-card-title{font-size:clamp(1.8rem,6vw,2.6rem)}
.blog-feature .blog-excerpt{font-size:1.05rem}
.blog-more-wrap{text-align:center;margin:8px 0 0}
.blog-empty{max-width:34em;margin:0 auto;text-align:center}

/* a post */
.post{padding:2rem 0 3rem}
.post-head,.post-body,.post-cta{max-width:var(--blog-prose);margin-left:auto;margin-right:auto}
.post-crumbs{list-style:none;display:flex;flex-wrap:wrap;gap:.2rem .5rem;margin:0 0 1.2rem;padding:0;font:400 .85rem/1.4 var(--blog-body-font);color:var(--blog-muted)}
.post-crumbs li+li::before{content:"/";margin-right:.5rem;opacity:.6}
.post-crumbs a{color:inherit}
.post-title{font-family:var(--blog-head-font);font-weight:var(--blog-head-weight);font-size:clamp(2.2rem,8vw,3.6rem);line-height:1.08;color:var(--blog-title);margin:.4rem 0 .8rem;overflow-wrap:break-word}
.post-dek{font-size:1.15rem;line-height:1.55;margin:0 0 1rem}
.post-meta{display:flex;flex-wrap:wrap;gap:.2rem 0;color:var(--blog-muted);font:400 .9rem/1.5 var(--blog-body-font);margin:0 0 1.6rem}
.post-meta>span:empty{display:none}
.post-meta>span:not(:empty)~span:not(:empty)::before{content:"\00B7";margin:0 .55rem}
.post-hero{max-width:var(--blog-max);margin:0 auto 2.2rem}
.post-hero img{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:var(--blog-img-radius);background:var(--blog-soft)}
.post-hero figcaption,.post-body figcaption{font-size:.85rem;color:var(--blog-muted);margin-top:.5rem;text-align:center}
.post-body{font-size:1.06rem;line-height:1.75;color:var(--blog-ink);overflow-wrap:break-word}
.post-body>*{margin-top:0;margin-bottom:1.15em}
.post-body h2{font-family:var(--blog-head-font);font-weight:var(--blog-head-weight);font-size:clamp(1.6rem,5.5vw,2.1rem);line-height:1.15;color:var(--blog-title);margin:2.2em 0 .6em}
.post-body h3{font-family:var(--blog-head-font);font-weight:var(--blog-head-weight);font-size:1.35rem;line-height:1.2;color:var(--blog-title);margin:1.8em 0 .5em}
.post-body a{color:var(--blog-accent);text-underline-offset:.18em}
.post-body ul,.post-body ol{padding-left:1.3em}
.post-body li{margin:.35em 0}
.post-body img{display:block;max-width:100%;height:auto;border-radius:var(--blog-img-radius)}
.post-body figure{margin:2em 0}
.post-body blockquote{margin:1.8em 0;padding:1.1em 1.3em;background:var(--blog-soft);border-left:3px solid var(--blog-accent);border-radius:0 var(--blog-radius) var(--blog-radius) 0;font-family:var(--blog-head-font);font-size:1.3rem;line-height:1.45}
.post-body blockquote p:last-child{margin-bottom:0}
.post-body table{width:100%;border-collapse:collapse;font-size:.95rem;display:block;overflow-x:auto}
.post-body th,.post-body td{padding:.55em .7em;border-bottom:1px solid var(--blog-line);text-align:left;vertical-align:top}
.post-body hr{border:0;border-top:1px solid var(--blog-line);margin:2.4em 0}
.post-cta{margin-top:2.6rem;margin-bottom:0;padding:1.5rem 1.4rem;background:var(--blog-soft);border:1px solid var(--blog-line);border-radius:var(--blog-radius);text-align:center}
.post-cta-title{font-family:var(--blog-head-font);font-weight:var(--blog-head-weight);font-size:1.5rem;line-height:1.2;color:var(--blog-title);margin:0 0 .4rem}
.post-cta p{margin:0 0 1rem}
.post-cta p:last-child{margin-bottom:0}
.blog-related{padding:3rem 0}
.blog-related .blog-related-title{font-family:var(--blog-head-font);font-weight:var(--blog-head-weight);color:var(--blog-title);text-align:center;margin:0 0 1.6rem}

@media (min-width:640px){
  .blog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .post-cta{padding:2rem 2.2rem}
}
/* two columns: a last card on its own row spans the width, picture beside the text */
@media (min-width:640px) and (max-width:959px){
  .blog-grid>.blog-card:last-child:nth-child(odd){grid-column:1/-1}
  .blog-grid>.blog-card:last-child:nth-child(odd) .blog-card-link{flex-direction:row}
  .blog-grid>.blog-card:last-child:nth-child(odd) .blog-thumb{flex:1;aspect-ratio:auto;min-height:220px}
  .blog-grid>.blog-card:last-child:nth-child(odd) .blog-card-body{flex:1;justify-content:center}
}
@media (min-width:960px){
  .blog-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .blog-feature .blog-card-link{flex-direction:row;align-items:stretch}
  .blog-feature .blog-thumb{flex:1.35;aspect-ratio:auto;min-height:360px}
  .blog-feature .blog-card-body{flex:1;justify-content:center;padding:2rem 2.2rem}
  .blog-feature .blog-meta{margin-top:.6rem}
}
@media (prefers-reduced-motion:reduce){
  .blog-card-link{transition:none}
  .blog-card-link:hover{transform:none}
}

/* ---- 3. BRAND LAYER (per site: motifs, section backgrounds, special touches) ------------------------------ */
/* Sections: cream and pale cream, alternating with the neighbours. Each blog section opens with an awning:
   red stripes that hang down with round, scalloped tips (the light stripes match the section above). */
.blog-home,.blog-list,.blog-related{position:relative}
.blog-home::before,.blog-list::before,.blog-related::before{content:"";position:absolute;left:0;right:0;top:0;height:29px;pointer-events:none;background:radial-gradient(circle at 11px 18px,var(--red) 11px,transparent 11.5px) 0 0/44px 29px repeat-x,repeating-linear-gradient(90deg,var(--red) 0 22px,var(--awn,var(--cream)) 22px 44px) 0 0/44px 18px repeat-x}
.blog-home{--awn:var(--cream2);background:var(--cream);text-align:center;padding-top:5.5rem}
.blog-list,.blog-related{--awn:var(--cream);background:var(--cream2)}
.blog-home h2{font-size:clamp(1.9rem,7vw,3.1rem);max-width:15em;margin:0 auto .5em}
.blog-home .blog-grid,.blog-related .blog-grid{margin-top:2rem;text-align:left}
.blog-home-all{margin:2.6rem 0 0}
.blog-intro{text-align:center;padding:3.5rem 0 2.6rem}
.blog-intro h1{font-size:clamp(2.1rem,8vw,3.6rem);color:var(--red);max-width:14em;margin:0 auto .3em}
.blog-lede{max-width:32em;margin:0 auto;font-size:1.1rem;text-wrap:balance}
.blog-empty{font-size:1.08rem}
.blog-empty .btn{margin-top:.6rem}
.blog-intro:last-child{padding-bottom:5.5rem}
.blog-list{padding:4.5rem 0 5rem}
.blog-related{padding:5rem 0 4.5rem}
.blog-related .blog-related-title{font-size:clamp(1.9rem,7vw,2.6rem);margin-bottom:0}

/* Cards: like the site's .card, a navy outline with a solid navy shadow and a small tilt on hover */
.blog-card-link{position:relative;border-width:3px;box-shadow:0 6px 0 var(--navy);transition:transform .2s}
.blog-card-link:hover{transform:translateY(-3px) rotate(-.6deg);box-shadow:0 6px 0 var(--navy)}
.blog-card-link:focus-visible{outline-color:var(--navy)}
.blog-thumb{background:var(--stripe);background-size:22px 100%;border-bottom:3px solid var(--navy)}
.no-img .blog-card-link::before{content:"";flex:none;height:10px;background:repeating-linear-gradient(90deg,var(--red) 0 18px,var(--cream) 18px 36px)}
.blog-cat{font-weight:700;color:var(--red)}
.blog-card-title{line-height:1.2}
.blog-card-link:hover .blog-card-title{color:var(--red)}
.blog-feature .blog-cat{align-self:flex-start;background:var(--butter);color:var(--navy);border:2px solid var(--navy);border-radius:999px;padding:.4rem .8rem;letter-spacing:.12em}
@media (min-width:960px){
  .blog-feature .blog-thumb{border-bottom:0;border-right:3px solid var(--navy)}
}

/* A post: red Shrikhand title, a striped rule, the hero framed like the home hero card */
.post{padding:2.4rem 0 3.5rem}
.post-cat{margin:0}
.post-title{color:var(--red)}
.post-head .rule{margin:0 0 1.8rem}
.post-hero{position:relative;padding-top:9px}
.post-hero::before{content:"";position:absolute;left:28px;right:28px;top:0;height:9px;border-radius:9px 9px 0 0;background:var(--stripe);background-size:22px 100%}
.post-hero img{border:3px solid var(--navy);box-shadow:0 8px 0 var(--navy);background:var(--stripe);background-size:22px 100%}
.post-body h3{font-family:var(--sans);font-weight:700;font-size:1.2rem;letter-spacing:.01em;color:var(--red)}
.post-body li::marker{color:var(--red)}
.post-body a:hover{color:var(--red2)}
.post-body blockquote{border-left:6px solid var(--red);background:#fff;color:var(--red);font-size:1.35rem}
.post-body hr{width:96px;height:10px;border:0;border-radius:6px;margin:2.6em auto;background:var(--stripe);background-size:22px 100%}
.post-body th{color:var(--navy);border-bottom-width:3px}
.post-body td{border-bottom-color:rgba(31,58,95,.25)}

/* The Starter Guide box: a small navy stage, like the Free Guide section, with the striped book */
.post-cta{position:relative;overflow:hidden;background:var(--navy);color:var(--cream);border:3px solid var(--navy);box-shadow:0 6px 0 var(--red2);padding-top:2.4rem}
.post-cta::before{content:"";position:absolute;left:0;right:0;top:0;height:10px;background:repeating-linear-gradient(90deg,var(--red) 0 18px,var(--cream) 18px 36px)}
.post-cta-title{color:var(--butter)}
.post-cta a:focus-visible{outline-color:var(--butter)}
.post-cta-book{display:block;width:min(260px,72%);height:auto;aspect-ratio:16/9;object-fit:cover;margin:.4rem auto 1.4rem;border:4px solid var(--cream);border-radius:6px 14px 14px 6px;box-shadow:-8px 0 0 var(--red),0 10px 0 rgba(0,0,0,.3);rotate:-2deg}

/* Nav: the Blog link makes six items; keep each on one line and the bar on one row */
@media (min-width:900px){.nav a{white-space:nowrap}}
.nav a[aria-current="page"]{color:var(--butter)}

@media (prefers-reduced-motion:reduce){
  .blog-card-link:hover{transform:none}
  .post-cta-book{rotate:none}
}
