/* EduCastle blog: the list of guides and each guide's page. Uses the site's colours and type from styles.css. */

.blog-hero { padding-bottom: clamp(80px, 9vw, 120px) }
.blog-kicker { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .9rem; padding: .38rem .9rem; border-radius: var(--r-pill);
  background: rgba(253, 202, 1, .16); color: var(--gold-light); font: 700 .74rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase }
.blog-hero h1 { max-width: 22ch; margin-inline: auto; text-wrap: balance }
.blog-meta { font: 700 .72rem/1.3 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 }

/* byline under the title */
.post-byline { display: inline-flex; align-items: center; gap: .8rem; margin-top: 1.4rem; padding: .5rem 1.1rem .5rem .5rem; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); text-align: left }
.post-byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold) }
.post-byline a { color: #fff; font: 700 1rem/1.2 var(--font-head); text-decoration: none }
.post-byline a:hover { color: var(--gold-light) }
.post-byline span { display: block; color: #b9c6f0; font-size: .86rem; margin-top: .15rem }

/* ---------- a guide ---------- */
.post-wrap { background: #fff; padding-top: clamp(28px, 4vw, 48px) }
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 4vw, 64px); align-items: start }
.post-article { min-width: 0; max-width: 760px }
.post-feature { margin: 0 0 2.2rem; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 10; background: var(--blue-mist) }
.post-feature img { width: 100%; height: 100%; object-fit: cover; display: block }

.post-body { font-size: clamp(1.03rem, 1.3vw, 1.12rem); line-height: 1.78; color: var(--ink) }
.post-body p { margin: 0 0 1.15em }
.post-intro > p:first-child { font-size: 1.15em; line-height: 1.7; color: var(--navy) }
.post-intro > p:first-child::first-letter { float: left; font: 800 3.4em/.82 var(--font-head); color: var(--gold-deep); margin: .08em .1em 0 0 }
.post-body a { color: var(--navy); font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px }
.post-body a:hover { background: var(--gold-mist) }
.post-body strong { color: var(--navy) }
.post-section { scroll-margin-top: calc(var(--header-h) + 20px); margin-top: 2.6rem }
.post-section > h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); margin: 0 0 .9rem; padding-top: 1.4rem; border-top: 1px solid var(--line); line-height: 1.22 }
.post-section h3 { font-size: clamp(1.12rem, 1.6vw, 1.28rem); margin: 1.8rem 0 .55rem; color: var(--navy) }
.post-section h3::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .5em; border-radius: 3px; background: var(--gold); vertical-align: .1em }

.post-list { margin: 0 0 1.3em; padding: 0; list-style: none; display: grid; gap: .55rem }
ul.post-list li { position: relative; padding-left: 1.85rem }
ul.post-list li::before { content: ""; position: absolute; left: .2rem; top: .62em; width: .62rem; height: .62rem; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-mist) }
ol.post-list { counter-reset: step }
ol.post-list li { position: relative; padding-left: 2.6rem; counter-increment: step; min-height: 1.9rem }
ol.post-list li::before { content: counter(step); position: absolute; left: 0; top: .1em; width: 1.85rem; height: 1.85rem; border-radius: 50%; background: var(--navy); color: #fff;
  font: 700 .9rem/1.85rem var(--font-head); text-align: center }

/* checklists: tick them off on the page */
.post-checklist { margin: .4rem 0 1.4em; padding: .6rem; list-style: none; display: grid; gap: .4rem; background: var(--blue-mist); border-radius: var(--r) }
.post-checklist label { display: flex; gap: .75rem; align-items: flex-start; padding: .65rem .85rem; background: #fff; border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--line); transition: border-color .15s, background .15s }
.post-checklist label:hover { border-color: var(--line-strong) }
.post-checklist input { appearance: none; -webkit-appearance: none; flex: none; width: 1.35rem; height: 1.35rem; margin: .18em 0 0; border: 2px solid var(--line-strong); border-radius: 6px; background: #fff; display: grid; place-items: center; cursor: pointer }
.post-checklist input:checked { background: var(--green); border-color: var(--green) }
.post-checklist input:checked::after { content: ""; width: .38rem; height: .7rem; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px) }
.post-checklist input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px }
.post-checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(31, 138, 76, .5) }

.post-figure { margin: 1.8rem 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); background: var(--blue-mist) }
.post-figure img { width: 100%; height: auto; display: block }

/* key takeaways, the visit box and the questions */
.post-takeaways { background: var(--gold-mist); border: 1px solid rgba(185, 143, 0, .25); border-radius: var(--r-lg); padding: .4rem clamp(1.2rem, 3vw, 2rem) 1rem }
.post-takeaways > h2 { border-top: 0; padding-top: 1rem }
.post-takeaways > h2::before { content: "★ "; color: var(--gold-deep) }
.post-takeaways ul.post-list li::before { background: var(--gold-deep); box-shadow: 0 0 0 4px #fff }
.post-visit { background: var(--navy); color: #d7def5; border-radius: var(--r-lg); padding: .4rem clamp(1.2rem, 3vw, 2rem) 1.2rem; position: relative; overflow: hidden }
.post-visit::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(253, 202, 1, .25), transparent 70%) }
.post-visit > h2 { color: #fff; border-top: 0; padding-top: 1rem }
.post-visit a { color: var(--gold-light) }
.post-visit a:hover { background: rgba(255, 255, 255, .08) }
.post-visit strong { color: #fff }
.post-visit .post-figure { box-shadow: none }
.post-faq > h2::after { content: ""; display: block; width: 56px; height: 4px; margin-top: .7rem; border-radius: 4px; background: var(--gold) }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-sm); margin: 0 0 .7rem; background: #fff; transition: box-shadow .2s, border-color .2s }
.faq-item[open] { box-shadow: var(--shadow-sm); border-color: var(--line-strong) }
.faq-item summary { cursor: pointer; list-style: none; padding: 1rem 3rem 1rem 1.2rem; font: 700 1.04rem/1.4 var(--font-head); color: var(--navy); position: relative }
.faq-item summary::-webkit-details-marker { display: none }
.faq-item summary::after { content: "+"; position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--gold-mist); color: var(--gold-deep); font: 700 1.2rem/1.7rem var(--font-head); text-align: center; transition: transform .2s }
.faq-item[open] summary::after { content: "–" }
.faq-a { padding: 0 1.2rem .4rem; color: var(--ink) }

/* about the author */
.post-author { display: flex; gap: 1.2rem; align-items: center; margin-top: 3rem; padding: 1.4rem; border-radius: var(--r-lg); background: var(--cream); border: 1px solid var(--line) }
.post-author img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); flex: none }
.post-author h2 { font-size: 1.25rem; margin: .25rem 0 .3rem }
.post-author h2 a { color: var(--navy); text-decoration: none }
.post-author p:last-child { margin: 0; color: var(--muted) }

/* side column: contents and a visit card, following the reader */
.post-side { position: sticky; top: calc(var(--header-h) + 18px); display: grid; gap: 1.1rem }
.post-toc { background: var(--blue-mist); border-radius: var(--r); padding: 1.2rem 1.2rem 1rem }
.post-toc ol { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .15rem; counter-reset: toc }
.post-toc li { counter-increment: toc }
.post-toc a { display: flex; gap: .55rem; padding: .42rem .55rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .92rem; line-height: 1.35 }
.post-toc a::before { content: counter(toc, decimal-leading-zero); font: 700 .74rem/1.6 var(--font-head); color: var(--muted); flex: none }
.post-toc a:hover { background: #fff }
.post-toc a.is-active { background: #fff; color: var(--navy); font-weight: 700; box-shadow: var(--shadow-xs) }
.post-toc a.is-active::before { color: var(--gold-deep) }
.post-side-cta { background: var(--navy); color: #c9d4f2; border-radius: var(--r); padding: 1.3rem; text-align: center }
.post-side-cta .blog-meta { color: var(--gold-light) }
.post-side-cta h3 { color: #fff; margin: .4rem 0 .4rem; font-size: 1.25rem }
.post-side-cta p { font-size: .92rem; margin: 0 0 1rem }
.post-side-cta .btn { width: 100%; justify-content: center }
.post-side-call { display: block; margin-top: .7rem; color: #b9c6f0; font-size: .88rem; text-decoration: none }
.post-side-call:hover { color: #fff }

/* ---------- cards: the blog page and "keep reading" ---------- */
.blog-list { background: #fff; padding-top: clamp(28px, 4vw, 52px) }
.blog-grid { display: grid; gap: clamp(18px, 2.4vw, 30px) }
.blog-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)) }
.blog-grid--lead { margin-bottom: clamp(18px, 2.4vw, 30px) }
.blog-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: transform .25s ease, box-shadow .25s ease }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow) }
.blog-card__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--blue-mist) }
.blog-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease }
.blog-card:hover .blog-card__img img { transform: scale(1.04) }
.blog-card__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.25rem 1.3rem; flex: 1 }
.blog-card h3 { margin: 0; color: var(--navy); font-size: 1.12rem; line-height: 1.35 }
.blog-card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.blog-more { margin-top: auto; padding-top: .4rem; display: inline-flex; align-items: center; gap: .35rem; font: 700 .9rem/1 var(--font-head); color: var(--navy) }
.blog-more .ico { width: 1em; height: 1em; transition: transform .2s }
.blog-card:hover .blog-more .ico { transform: translateX(3px) }
.blog-card--big { display: grid; grid-template-columns: 1.15fr 1fr }
.blog-card--big .blog-card__img { aspect-ratio: auto; min-height: 340px }
.blog-card--big .blog-card__body { padding: clamp(1.4rem, 3vw, 2.4rem); justify-content: center; gap: .8rem }
.blog-card--big h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.22 }
.blog-card--big p { font-size: 1.02rem; -webkit-line-clamp: 4 }
.blog-all { text-align: center; margin: clamp(24px, 3vw, 36px) 0 0 }
.blog-older { text-align: center; color: var(--muted); margin: clamp(28px, 3vw, 40px) 0 0 }
.blog-older a { color: var(--navy); font-weight: 600 }

@media (max-width: 1020px) {
  .post-grid { grid-template-columns: 1fr }
  .post-side { position: static; grid-template-columns: 1fr 1fr }
  .post-article { max-width: none }
}
@media (max-width: 900px) { .blog-grid--3 { grid-template-columns: 1fr 1fr } .blog-card--big { grid-template-columns: 1fr } .blog-card--big .blog-card__img { min-height: 0; aspect-ratio: 16 / 10 } }
@media (max-width: 640px) {
  .blog-grid--3 { grid-template-columns: 1fr }
  .post-side { grid-template-columns: 1fr }
  .post-byline { border-radius: var(--r); }
  .post-author { flex-direction: column; text-align: center }
  .post-intro > p:first-child::first-letter { font-size: 3em }
}
@media print {
  .site-header, .site-footer, .post-side, .cta-band, .section--tint, .to-top, .blog-hero .wave { display: none !important }
  .post-grid { display: block }
  .post-visit { background: none; color: inherit }
}
