/*
 * Wonderboy Creative - the blog surface.
 *
 * Its own .wbb-* vocabulary, layered on the shared chrome in wonderboy.css the
 * same way .wsp-*, .dseo-* and .pf-* are. Nothing here restyles a component
 * another surface owns; the home page's latest-posts row keeps its own .wb-*
 * markup and is untouched by this file.
 *
 * Three views, one stylesheet: the index at /blog/, the archives at
 * /blog/<service-area>/ and the posts at /<service-area>/<slug>/.
 */

/* -- shell ----------------------------------------------------------------- */

.wbb-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.wbb-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--hero-600); margin: 0 0 14px;
}

.wbb-dot {
  display: inline-block; width: 3px; height: 3px; border-radius: 50%;
  background: var(--gray-300); vertical-align: middle; margin: 0 9px;
}

.wbb-crumbs {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 13px; color: var(--fg-secondary); margin: 0 0 20px;
}
.wbb-crumbs a { color: inherit; text-decoration: none; }
.wbb-crumbs a:hover { color: var(--hero-600); text-decoration: underline; }
.wbb-crumbs span { color: var(--gray-300); }

/* -- the article page: two columns ----------------------------------------- */
/*
 * Reading column left, sidebar right, and the sidebar starts level with the
 * breadcrumb rather than under the image, so it is beside the article from the
 * first pixel. 344px is the width the service page's own rail uses, so the two
 * sidebars on this site are the same object at the same size.
 */

.wbb-post { padding: 44px 0 96px; }

.wbb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 60px;
  align-items: start;
}

.wbb-col { min-width: 0; }

.wbb-post-head { margin: 0 0 36px; }

.wbb-post-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--midnight-900);
  text-wrap: balance;
  margin: 0 0 20px;
}

/*
 * Author on the left, date and reading time pushed to the right edge of the
 * reading column, with a rule under the pair.
 */
.wbb-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 0 0 20px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 14px;
  color: var(--fg-secondary);
}
.wbb-byline-who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--midnight-900);
}
.wbb-byline-who svg { color: var(--hero-500); }
.wbb-byline-meta { display: inline-flex; align-items: center; }

/*
 * The image is part of the article, at the reading column's width. It does not
 * break out and it does not upscale: several of these came off production at
 * their real size and two are only ~510px wide with no larger original, so a
 * forced full-width banner made a blurry stripe out of a small illustration.
 */
.wbb-post-hero {
  /* Never wider than the image really is. The figure shrinks to it and centres
     rather than pillarboxing a small illustration in a grey band. */
  max-width: min(100%, var(--wbb-hero-w, 100%));
  margin: 28px auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gray-100);
}
.wbb-post-hero img { display: block; width: 100%; height: auto; }

/* -- what the reader gets -------------------------------------------------- */

.wbb-takeaways {
  margin: 0 0 40px;
  padding: 24px 26px 26px;
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--hero-500);
}
.wbb-takeaways-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .01em;
  color: var(--midnight-900);
  margin: 0 0 14px;
}
.wbb-takeaways ul { margin: 0; padding: 0; list-style: none; }
.wbb-takeaways li {
  position: relative;
  padding-left: 24px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-primary);
}
.wbb-takeaways li + li { margin-top: 10px; }
.wbb-takeaways li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: .55em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--hero-500);
}

/* -- the sidebar ----------------------------------------------------------- */
/*
 * Sticky and viewport-tall. The inner box is what scrolls when the sidebar
 * holds more than fits, so the page behind it never does something strange.
 */

.wbb-side { position: sticky; top: calc(88px + var(--wb-admin-bar, 0px)); }
.wbb-side-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 112px - var(--wb-admin-bar, 0px));
}

/*
 * The CONTENTS is what scrolls when the sidebar has more in it than fits, not
 * the sidebar. Scrolling the whole column pushes the one thing a reader might
 * act on off the bottom of a long article's contents, which is the opposite of
 * what a sticky sidebar is for.
 */
.wbb-toc { display: flex; flex-direction: column; min-height: 0; }
.wbb-toc-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Room for the scrollbar so a row's hover state is never under it. */
  padding-right: 4px;
}

.wbb-card-box {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px 22px 22px;
}

.wbb-side-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--midnight-900);
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--gray-200);
}

.wbb-toc-list { margin: 0; padding: 0; list-style: none; }
.wbb-toc-list li + li { margin-top: 2px; }
.wbb-toc-list a {
  display: flex;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg-secondary);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.wbb-toc-list a:hover { background: var(--gray-50); color: var(--midnight-900); }
.wbb-toc-list a.is-current { background: var(--gray-50); color: var(--midnight-900); font-weight: 600; }
.wbb-toc-n {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--hero-500);
}

.wbb-side-cta p {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-secondary);
}
.wbb-side-btn { width: 100%; justify-content: center; }
.wbb-side-alt {
  display: block;
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--fg-secondary);
}
.wbb-side-alt:hover { color: var(--hero-600); }

/* -- the article ----------------------------------------------------------- */
/*
 * The bodies came off a page builder that had no styles of its own outside it,
 * so everything below is styling raw tags rather than classes. Scoped to
 * .wbb-prose so it cannot reach any other surface.
 */

.wbb-prose { font-size: 18px; line-height: 1.72; color: var(--fg-primary); }

/*
 * Spacing comes from the gap between siblings, not from each element's own
 * margin, so the first and last child sit flush against the column.
 *
 * The reset and the gap are both (0,1,0), so the gap wins by being second.
 * Do NOT reintroduce a `.wbb-prose p { margin: 0 }` rule: that is (0,1,1), it
 * beats the gap, and every paragraph in every post ran into the next one.
 */
.wbb-prose > * { margin-top: 0; margin-bottom: 0; }
.wbb-prose > * + * { margin-top: 1.15em; }

/* Clears the sticky header when a contents link jumps here. */
.wbb-prose h2, .wbb-prose h3 { scroll-margin-top: calc(96px + var(--wb-admin-bar, 0px)); }

.wbb-prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 31px);
  line-height: 1.22;
  letter-spacing: -.01em;
  color: var(--midnight-900);
  text-wrap: balance;
  margin-top: 2em;
  margin-bottom: .55em;
}

.wbb-prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.3;
  color: var(--midnight-900);
  margin-top: 1.7em;
  margin-bottom: .45em;
}

.wbb-prose a { color: var(--hero-600); text-decoration: underline; text-underline-offset: 2px; }
.wbb-prose a:hover { color: var(--hero-700); }

.wbb-prose ul, .wbb-prose ol { margin: 1.15em 0 0; padding-left: 1.4em; }
.wbb-prose li + li { margin-top: .45em; }
.wbb-prose li { padding-left: .2em; }

.wbb-prose img {
  display: block;
  width: 100%;
  height: auto;
  margin: 2em 0;
  border-radius: var(--radius-md);
  background: var(--gray-100);
}

.wbb-prose blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--hero-500);
  font-size: 20px;
  line-height: 1.55;
  color: var(--midnight-800);
}

.wbb-prose strong { font-weight: 700; color: var(--midnight-900); }
.wbb-prose em { font-style: italic; }
.wbb-prose hr { border: 0; border-top: 1px solid var(--gray-200); margin: 2.5em 0; }

/* -- bio and the service hand-off ------------------------------------------ */

.wbb-bio {
  margin: 48px 0 0;
  padding: 22px 24px;
  border-left: 3px solid var(--hero-500);
  background: var(--gray-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.wbb-bio p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--fg-secondary); }
.wbb-bio strong { color: var(--midnight-900); }
.wbb-bio a { color: var(--hero-600); }

.wbb-area-cta {
  margin: 40px 0 0; padding: 28px 0 0;
  border-top: 1px solid var(--gray-200);
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.wbb-area-cta-label {
  margin: 0; font-size: 13px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--fg-secondary);
}

/* -- index, archive and the related row ------------------------------------ */

.wbb-index { padding: 56px 0 96px; }
.wbb-index-head { padding: 0 0 34px; }

.wbb-index-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(32px, 4.4vw, 50px);
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--midnight-900);
  text-wrap: balance;
  margin: 0 0 14px;
}
.wbb-index-deck {
  max-width: 620px; margin: 0;
  font-size: 18px; line-height: 1.6; color: var(--fg-secondary);
}
.wbb-index-service { margin: 18px 0 0; font-size: 15px; }
.wbb-index-service a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--hero-600); text-decoration: none; font-weight: 600;
}
.wbb-index-service a:hover { text-decoration: underline; }

.wbb-topics { padding: 0 0 34px; }
.wbb-topics-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0; padding: 0; list-style: none;
}
.wbb-topic {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  color: var(--fg-secondary); text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.wbb-topic:hover { border-color: var(--hero-400); color: var(--midnight-900); }
.wbb-topic.is-current {
  background: var(--midnight-900); border-color: var(--midnight-900); color: #fff;
}
.wbb-topic-n { font-size: 12px; opacity: .6; }

.wbb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.wbb-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.wbb-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.wbb-card-link { display: block; color: inherit; text-decoration: none; }

.wbb-card-thumb {
  position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--gray-100);
}
.wbb-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.wbb-card:hover .wbb-card-thumb img { transform: scale(1.04); }
.wbb-card-noimg {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--midnight-800), var(--midnight-950));
}
.wbb-card-cat {
  position: absolute; left: 12px; top: 12px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.94);
  font-size: 12px; font-weight: 600; color: var(--midnight-900);
  backdrop-filter: blur(4px);
}

.wbb-card-body { padding: 20px 22px 22px; }
.wbb-card-meta {
  display: flex; align-items: center;
  font-size: 13px; color: var(--fg-secondary); margin: 0 0 10px;
}
.wbb-card-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 20px; line-height: 1.25; text-wrap: balance;
  color: var(--midnight-900); margin: 0 0 8px;
}
.wbb-card-blurb {
  font-size: 15px; line-height: 1.6; color: var(--fg-secondary); margin: 0 0 14px;
}
.wbb-card-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--hero-600);
}

.wbb-more { margin-top: 88px; padding: 56px 0 0; border-top: 1px solid var(--gray-200); }
.wbb-more-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(22px, 2.4vw, 28px); color: var(--midnight-900);
  margin: 0 0 28px;
}

.wbb-empty { font-size: 17px; color: var(--fg-secondary); }

.wbb-pagination { margin: 48px 0 0; }
.wbb-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--gray-200); border-radius: 10px;
  margin-right: 6px;
  color: var(--fg-secondary); text-decoration: none; font-size: 15px;
}
.wbb-pagination .page-numbers.current {
  background: var(--midnight-900); border-color: var(--midnight-900); color: #fff;
}
.wbb-pagination .page-numbers:hover:not(.current) { border-color: var(--hero-500); color: var(--midnight-900); }

@media (prefers-reduced-motion: reduce) {
  .wbb-card { transition: none; }
  .wbb-card:hover { transform: none; }
  .wbb-card-thumb img, .wbb-card:hover .wbb-card-thumb img { transition: none; transform: none; }
}

/* -- responsive ------------------------------------------------------------ */

@media (max-width: 1100px) {
  /*
   * One column. The sidebar moves ABOVE the article rather than below it: a
   * contents is worth something before you start reading and worth nothing
   * after, and stacking it at the foot is how a sidebar becomes furniture.
   * It stops being sticky, because a sticky block in the flow of a phone
   * screen eats the page.
   */
  .wbb-layout { grid-template-columns: 1fr; gap: 0; }
  .wbb-side { position: static; order: -1; margin: 0 0 32px; }
  .wbb-side-inner { max-height: none; overflow: visible; padding-right: 0; }
  .wbb-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .wbb-container { padding: 0 18px; }
  .wbb-grid { grid-template-columns: 1fr; }
  .wbb-post { padding: 28px 0 64px; }
  .wbb-index { padding: 34px 0 64px; }
  .wbb-prose { font-size: 17px; }
  .wbb-post-head { margin-bottom: 28px; }
  .wbb-takeaways { padding: 20px 20px 22px; }
  .wbb-more { margin-top: 56px; padding-top: 40px; }
  .wbb-area-cta { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* -- sub-articles on a service page ---------------------------------------- */
/*
 * The one place the blog's cards appear outside the blog. The service page
 * owns the space above; this section only has to sit correctly at the foot of
 * it, so it brings its own rhythm and nothing else.
 */
.wbb-service-articles { padding: 72px 0 8px; }
.wbb-service-articles .wbb-more-title { margin-bottom: 28px; }

@media (max-width: 680px) {
  .wbb-service-articles { padding-top: 48px; }
}

/* -- the live filter ------------------------------------------------------- */
/*
 * A hidden card is hidden with the hidden attribute, which the grid has to be
 * told about: display:grid on the container overrides the browser's own
 * [hidden]{display:none} on its children, and without this the filter appears
 * to do nothing at all.
 */
.wbb-grid > [hidden] { display: none; }

.wbb-count {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--fg-secondary);
}

/* Thumb targets - see the same block in wonderboy.css for the reasoning. */
@media (max-width: 860px) {
	.wbb-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
	.wbb-topic { min-height: 44px; }
	.wbb-side-alt { display: inline-flex; align-items: center; min-height: 44px; }
	.wbb-toc-list a { min-height: 44px; align-items: center; }
}
