/* NeurodiverCity: the blog (home.php, archive.php, single.php). By hand; loaded on blog pages only (inc/blog.php).
   Same look as the case studies: a lilac band with the heading, white cards with a grey line, one purple panel. */

.ndc .sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0; }

/* The band at the top */
.ndc .blog-hero { background: #EFE8F5; }
.ndc .blog-hero > .w { padding-top: 56px; padding-bottom: 56px; }
.ndc .crumbs { margin: 0 0 28px; font-size: 18px; }
.ndc .crumbs a { color: #1B68AA; text-decoration: underline; text-decoration-thickness: 1px; } /* the site's blue is just under 4.5:1 on lilac */
.ndc .blog-hero__title { font-size: clamp(36px, 4.6vw, 56px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 20px; max-width: 900px; text-wrap: balance; }
.ndc .blog-hero__lead { margin: 0; font-size: 21px; max-width: 720px; }
.ndc .post-facts { margin: 32px 0 0; display: flex; flex-wrap: wrap; gap: 16px 48px; border-top: 1px solid #DCCDEA; padding-top: 24px; }
.ndc .post-facts dt { font-size: 17px; }
.ndc .post-facts dd { margin: 0; font-weight: 700; }

/* Topic links under the heading */
.ndc .topics { margin-top: 32px; }
.ndc .topics ul { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ndc .pill-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: #FFFFFF; border: 1px solid #DCCDEA; color: #14213D; text-decoration: none; font-weight: 700; }
.ndc .pill-link:hover { border-color: #14213D; color: #14213D; }
.ndc .pill-link[aria-current] { background: #14213D; border-color: #14213D; color: #FFFFFF; }

/* Lists of posts */
.ndc .blog-list { padding-top: 56px; padding-bottom: 32px; display: flex; flex-direction: column; gap: 32px; }
.ndc .blog-list__head { font-size: 30px; margin: 24px 0 0; }
.ndc .post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.ndc .post-card { position: relative; display: flex; flex-direction: column; background: #FFFFFF; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.ndc .post-card:hover { border-color: #14213D; }
.ndc .post-card:focus-within { outline: 3px solid var(--blue); outline-offset: 3px; }
.ndc .post-card__pic { aspect-ratio: 16 / 9; background: #EFE8F5; display: flex; align-items: center; justify-content: center; }
.ndc .post-card__pic img { display: block; width: 100%; height: 100%; object-fit: contain; } /* whole picture, on the lilac */
.ndc .post-card__pic img.post-card__mark { width: 72px; height: 72px; object-fit: contain; opacity: .9; }
.ndc .post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 24px 28px 28px; flex: 1; }
.ndc .post-card__body .lbl { margin: 0; }
.ndc .post-card__title { font-size: 22px; line-height: 1.3; margin: 0; }
.ndc .post-card__title a { color: #14213D; text-decoration: none; }
.ndc .post-card__title a:hover { text-decoration: underline; }
/* The whole card opens the post; the title link is the one thing focused and read out. */
.ndc .post-card__title a::after { content: ""; position: absolute; inset: 0; }
.ndc .post-card__title a:focus-visible { outline: none; }
.ndc .post-card__sum { margin: 0; }
.ndc .post-card__meta { margin: auto 0 0; padding-top: 6px; font-size: 17px; font-variant-numeric: tabular-nums; }
/* The newest post, first on the blog's first page: picture beside the text on wide screens. */
.ndc .post-card--lead { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.ndc .post-card--lead .post-card__pic { aspect-ratio: auto; min-height: 320px; }
.ndc .post-card--lead .post-card__pic img.post-card__mark { width: 120px; height: 120px; }
.ndc .post-card--lead .post-card__body { padding: 40px; justify-content: center; }
.ndc .post-card--lead .post-card__title { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2; }
.ndc .post-card--lead .post-card__sum { font-size: 19px; }
.ndc .post-card--lead .post-card__meta { margin-top: 8px; }
@media (max-width: 860px) {
  .ndc .post-card--lead { display: flex; }
  .ndc .post-card--lead .post-card__pic { aspect-ratio: 16 / 9; min-height: 0; }
  .ndc .post-card--lead .post-card__body { padding: 24px 28px 28px; }
}

/* Page numbers */
.ndc .blog-pages ul { margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ndc .blog-pages a, .ndc .blog-pages span { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); color: #14213D; text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.ndc .blog-pages a:hover { border-color: #14213D; }
.ndc .blog-pages .current { background: #14213D; border-color: #14213D; color: #FFFFFF; }
.ndc .blog-pages .dots { border-color: transparent; }

/* Nothing yet */
.ndc .blog-empty { max-width: 640px; padding: 24px 0 40px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.ndc .blog-empty h2 { font-size: 30px; margin: 0; }
.ndc .blog-empty p { margin: 0; }
.ndc .blog-empty__links { display: flex; flex-wrap: wrap; gap: 12px; }

/* A post */
.ndc .post-pic { margin: 0 auto; padding-top: 48px; }
/* The whole picture, whatever its shape: scaled down to fit (never cropped, never enlarged), centred. Pictures with
   words in them, such as diagrams, stay readable. */
.ndc .post-pic { text-align: center; }
.ndc .post-pic img { display: inline-block; width: auto; height: auto; max-width: 100%; max-height: min(560px, 75vh); object-fit: contain; border-radius: 24px; vertical-align: top; }
.ndc .post-pic figcaption { margin-top: 12px; font-size: 17px; }
.ndc .post-layout { padding-top: 56px; padding-bottom: 32px; }
.ndc .post-layout.has-toc { display: grid; grid-template-columns: 260px minmax(0, 720px); gap: 64px; justify-content: center; align-items: start; }
.ndc .post-layout:not(.has-toc) .post-body { max-width: 720px; margin: 0 auto; }
.ndc .post-toc { position: sticky; top: 24px; padding: 24px; border-radius: 20px; background: #F7F4F4; }
.ndc .post-toc ol { margin: 0; display: flex; flex-direction: column; gap: 4px; counter-reset: toc; }
.ndc .post-toc li { counter-increment: toc; display: flex; gap: 10px; line-height: 1.4; }
.ndc .post-toc li::before { content: counter(toc) "."; flex: none; min-width: 1.4em; color: var(--slate); font-variant-numeric: tabular-nums; padding-top: 6px; }
.ndc .post-toc a { display: block; padding: 6px 0; color: #14213D; text-decoration: none; }
.ndc .post-toc a:hover { text-decoration: underline; }
@media (max-width: 960px) {
  .ndc .post-layout.has-toc { display: block; }
  .ndc .post-toc { position: static; max-width: 720px; margin: 0 auto 40px; }
  .ndc .post-layout.has-toc .post-body { max-width: 720px; margin: 0 auto; }
}

/* The post's text, written in the block editor or the classic one. Lists get their bullets back (the site's own
   lists have none) and headings their space. */
.ndc .post-body { font-size: 19px; line-height: 1.7; }
.ndc .post-body > :first-child { margin-top: 0 !important; }
.ndc .post-body p { margin: 0 0 1.1em; }
.ndc .post-body h2 { font-family: Lexend, sans-serif; font-size: 30px; line-height: 1.25; margin: 1.8em 0 .6em; scroll-margin-top: 24px; }
.ndc .post-body h3 { font-family: Lexend, sans-serif; font-size: 23px; line-height: 1.3; margin: 1.6em 0 .5em; }
.ndc .post-body h4 { font-family: Lexend, sans-serif; font-size: 19px; margin: 1.4em 0 .4em; }
.ndc .post-body ul, .ndc .post-body ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.ndc .post-body ul li { list-style: disc; }
.ndc .post-body ol li { list-style: decimal; }
.ndc .post-body li { margin-bottom: .4em; padding-left: .2em; }
.ndc .post-body li::marker { color: var(--purple); }
.ndc .post-body a { text-decoration: underline; text-decoration-thickness: 1px; }
.ndc .post-body strong { font-weight: 700; }
.ndc .post-body blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--purple); font-size: 21px; }
.ndc .post-body blockquote p:last-child { margin-bottom: 0; }
.ndc .post-body blockquote cite { display: block; margin-top: 8px; font-size: 17px; font-style: normal; color: var(--slate); }
.ndc .post-body img { height: auto; border-radius: 16px; }
.ndc .post-body figure { margin: 1.6em 0; }
.ndc .post-body figcaption { margin-top: 10px; font-size: 17px; color: var(--slate); }
.ndc .post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.ndc .post-body code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: #F7F4F4; }
.ndc .post-body pre { overflow-x: auto; padding: 20px; border-radius: 14px; background: #F7F4F4; font-size: 16px; line-height: 1.5; }
.ndc .post-body pre code { padding: 0; background: none; }
.ndc .post-body table { width: 100%; border-collapse: collapse; font-size: 18px; margin: 0; }
.ndc .post-body .wp-block-table { overflow-x: auto; margin: 1.6em 0; }
.ndc .post-body th, .ndc .post-body td { padding: 12px 16px; text-align: left; border: 0; border-top: 1px solid var(--line); }
.ndc .post-body thead th { border-top: 0; background: #F7F4F4; font-weight: 700; }
.ndc .post-body .wp-block-button__link { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 12px; background: var(--navy); color: #FFFFFF; font-weight: 700; text-decoration: none; }
.ndc .post-body .alignwide, .ndc .post-body .alignfull { margin-left: 0; margin-right: 0; }
.ndc .post-body .aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
@media (min-width: 640px) {
  .ndc .post-body .alignleft { float: left; margin: .3em 1.6em 1em 0; max-width: 50%; }
  .ndc .post-body .alignright { float: right; margin: .3em 0 1em 1.6em; max-width: 50%; }
}
.ndc .post-body::after { content: ""; display: table; clear: both; }
.ndc .post-parts { margin-top: 24px; font-weight: 700; }

/* After the text */
.ndc .post-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; padding-top: 32px; padding-bottom: 48px; max-width: 1136px; }
.ndc .post-layout:not(.has-toc) + .post-end { max-width: 784px; }
.ndc .post-end h2.lbl { color: var(--slate); }
.ndc .post-end ul { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ndc .post-tags a.tag { color: #14213D; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.ndc .share-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid #14213D; color: #14213D; text-decoration: none; font-weight: 700; }
.ndc .share-link:hover { background: #14213D; color: #FFFFFF; }
.ndc .post-built { padding-top: 32px; }

/* Older and newer */
.ndc .post-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; padding-bottom: 56px; }
.ndc .post-next__link { display: flex; flex-direction: column; gap: 6px; padding: 28px 32px; border-radius: 20px; border: 1px solid var(--line); color: #14213D; text-decoration: none; }
.ndc .post-next__link:hover { border-color: #14213D; color: #14213D; }
.ndc .post-next__link .lbl { margin: 0; color: #1E6FB5; }
.ndc .post-next__link .h { font-size: 22px; line-height: 1.3; }
.ndc .post-next__link--newer { text-align: right; grid-column: -2; }

/* More on the topic */
.ndc .post-related { background: #F7F4F4; }
.ndc .post-related > .w { padding-top: 72px; padding-bottom: 72px; }
.ndc .post-related h2 { font-size: 30px; margin: 0 0 28px; }

/* Get in touch */
.ndc .blog-cta-wrap { padding-top: 56px; padding-bottom: 88px; }
.ndc .blog-cta { color: #FFFFFF; border-radius: 28px; padding: 56px 48px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; justify-content: space-between; }
.ndc .blog-cta__text { flex: 1 1 420px; min-width: 0; }
.ndc .blog-cta h2 { font-size: 34px; color: #FFFFFF; margin: 0 0 12px; }
.ndc .blog-cta p { margin: 0; font-size: 20px; color: #EFE8F5; }
.ndc .blog-cta .btn { min-height: 56px; }
@media (max-width: 720px) {
  .ndc .blog-hero > .w { padding-top: 40px; padding-bottom: 40px; }
  .ndc .blog-cta { padding: 40px 24px; }
  .ndc .post-related > .w { padding-top: 56px; padding-bottom: 56px; }
}

/* High contrast (reading options) */
html[data-contrast="high"] .ndc :is(.post-card, .post-next__link, .pill-link, .blog-pages a) { border: 2px solid var(--navy) !important; }
html[data-contrast="high"] .ndc :is(.post-card__title a, .post-toc a, .crumbs a, .post-body a) { color: var(--navy) !important; text-decoration: underline !important; }
html[data-contrast="high"] .ndc .post-card__title a:hover { text-decoration-thickness: 3px !important; }
html[data-contrast="high"] .ndc .post-toc { border: 2px solid var(--navy); }
html[data-contrast="high"] .ndc :is(.post-facts dt, .post-card__meta, .post-pic figcaption, .post-body figcaption, .post-body blockquote cite) { color: var(--navy) !important; }

@media print {
  .ndc :is(.topics, .post-toc, .post-share, .post-next, .post-related, .blog-cta-wrap) { display: none !important; }
}
