/* ==========================================================================
   Blog: the article list (blog/blog.php) and a post (blog/blog-post.php).
   Loaded after inner.css; cards use the .post styles from components.css.
   ========================================================================== */

/* 1. Article list
   ========================================================================== */

/* Heading on the left, article count on the right */
.blog-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.blog-bar__count {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Banner: the newest blog's title and summary, its image in a tilted frame
   (a wider version of .page-hero__card) */
.blog-hero .post-meta {
  justify-content: flex-start;
}

.blog-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-pill);
  background: var(--sun);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
}

.post-meta .blog-hero__label .icon {
  color: var(--ink);
}

/* Blog titles run longer than page titles */
.blog-hero .page-hero__title {
  max-width: 17em;
  font-size: clamp(2rem, 0.9rem + 2.2vw, 3.1rem);
  line-height: 1.08;
}

.blog-hero .page-hero__title a {
  color: inherit;
  text-decoration: none;
}

.blog-hero .page-hero__title a:hover {
  color: var(--sun-bright);
}

.blog-hero__photo {
  display: block;
  width: 100%;
  max-width: 40rem;
  padding: 0.6rem;
  border-radius: calc(var(--r-lg) + 0.6rem);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 40px 80px -30px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: rotate var(--medium) var(--ease-out);
}

.blog-hero__photo img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: var(--r-lg);
  object-fit: cover;
}

/* Wide screens: a large frame beside the copy, with a smaller gap between */
@media (min-width: 992px) {
  .blog-hero .page-hero__inner {
    gap: 3rem;
  }

  .blog-hero__photo {
    width: clamp(27rem, 42vw, 40rem);
    rotate: 2deg;
  }

  .blog-hero__photo:hover {
    rotate: 0deg;
  }
}

/* Cards keep one width; a last row that is not full sits in the centre
   rather than leaving a gap on the right */
.post-grid {
  --post-gap: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2.75rem var(--post-gap);
}

@media (min-width: 640px) {
  .post-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .post-grid > * {
    flex: 0 0 calc((100% - var(--post-gap)) / 2);
  }
}

@media (min-width: 992px) {
  .post-grid {
    --post-gap: clamp(1.5rem, 2.4vw, 2.25rem);
    row-gap: 3.5rem;
  }

  .post-grid > * {
    flex-basis: calc((100% - 2 * var(--post-gap)) / 3);
  }
}

/* Pages */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
}

.pager__list {
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager__num,
.pager__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.9rem;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--fast) ease, box-shadow var(--fast) ease;
}

.pager__num:hover,
.pager__step:hover {
  color: var(--green);
  box-shadow: inset 0 0 0 1px var(--green);
}

.pager__num[aria-current] {
  background: var(--green);
  box-shadow: none;
  color: var(--white);
}

.pager__step.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pager__gap {
  display: inline-flex;
  align-items: center;
  height: 2.75rem;
  padding: 0 0.2rem;
  color: var(--muted);
}

/* Phones: arrows only */
@media (max-width: 575.98px) {
  .pager__step {
    padding: 0;
  }

  .pager__step > span {
    display: none;
  }
}

/* Nothing to list */
.blog-empty {
  max-width: 38rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 4vw, 3rem);
  border-radius: var(--r-xl);
  background: var(--mist);
  text-align: center;
}

.blog-empty__icon {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 8px rgba(248, 168, 40, 0.22);
  color: var(--ink);
}

.blog-empty__icon .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.blog-empty p {
  margin: 0.75rem auto 1.75rem;
  max-width: 30em;
}

/* 2. Post banner: the dark frame without a photo, text centred
   ========================================================================== */

.page-hero--post .page-hero__inner {
  justify-items: center;
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(3.5rem, 7vw, 5.5rem);
  text-align: center;
}

/* Room for the post's photo, which overlaps the bottom of the frame */
.page-hero--banner .page-hero__inner {
  padding-bottom: clamp(8rem, 14vw, 13rem);
}

@media (min-width: 992px) {
  .page-hero--post .page-hero__frame {
    display: block;
    min-height: 0;
  }

  .page-hero--post .page-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.page-hero--post .page-hero__copy {
  max-width: 58rem;
}

.page-hero--post .crumbs ol {
  justify-content: center;
}

/* A long title is cut short in the trail; the full title is the H1 below */
.page-hero--post .crumbs li:last-child {
  min-width: 0;
}

.page-hero--post .crumbs li:last-child a {
  display: block;
  max-width: min(26ch, 60vw);
  overflow: hidden;
  line-height: 2rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Phones keep "Blog" in the trail (inner.css hides middle crumbs there) */
@media (max-width: 575.98px) {
  .page-hero--post .crumbs li:not(:first-child):not(:last-child) {
    display: inline-flex;
  }
}

.page-hero--post .page-hero__title {
  max-width: 20em;
  margin-inline: auto;
  font-size: clamp(2rem, 1rem + 3vw, 3.6rem);
  line-height: 1.08;
}

.page-hero--post .page-hero__lede {
  margin-inline: auto;
}

.page-hero--post .page-hero__actions {
  justify-content: center;
}

/* Date */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem 1.25rem;
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--text-xs);
  font-weight: 600;
}

.post-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.post-meta .icon {
  width: 1rem;
  height: 1rem;
  color: var(--sun-bright);
}

/* The post's photo, pulled up over the frame */
.post-banner {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * clamp(6rem, 11vw, 10rem));
}

.post-banner__media {
  max-width: 68rem;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .post-banner__media {
    aspect-ratio: 2 / 1;
  }
}

/* 3. Article layout: body, with contents and sharing beside it
   ========================================================================== */

.post-body {
  padding-top: clamp(3rem, 6vw, 5rem);
}

.post-layout {
  display: grid;
  gap: 3rem;
}

@media (min-width: 992px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 19rem;
    gap: clamp(3rem, 5vw, 6rem);
  }

  .post-aside {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

@media (min-width: 1200px) {
  .post-layout {
    grid-template-columns: minmax(0, 1fr) 21rem;
  }
}

.post-layout__main {
  min-width: 0;
}

.post-aside {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

/* Article body: HTML from the admin's editor
   -------------------------------------------------------------------------- */

.prose {
  max-width: 46rem;
  color: var(--body);
  font-size: var(--text-base);
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.25em;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  color: var(--ink);
  font-weight: 700;
}

.prose h2 {
  margin-top: 2.2em;
  font-size: clamp(1.6rem, 1.15rem + 1.4vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.prose h3 {
  margin-top: 1.9em;
  font-size: var(--text-h3);
}

.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.7em;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + *,
.prose h5 + *,
.prose h6 + * {
  margin-top: 0.7em;
}

.prose a {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(24, 120, 80, 0.35);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose strong,
.prose b {
  color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.4em;
}

.prose li + li,
.prose li > ul,
.prose li > ol {
  margin-top: 0.5em;
}

.prose li::marker {
  color: var(--green);
  font-weight: 700;
}

.prose blockquote {
  margin: 2em 0;
  padding: 1.4rem 1.6rem;
  border-left: 4px solid var(--sun);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--mist);
  color: var(--ink);
  font-size: var(--text-lead);
}

.prose blockquote > * + * {
  margin-top: 0.8em;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
}

.prose figure {
  margin: 2em 0;
}

.prose figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: var(--text-xs);
}

.prose iframe {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--r-md);
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
  opacity: 1;
}

/* Tables scroll sideways on phones instead of widening the page */
.prose .blog-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.prose table {
  width: 100%;
  min-width: 32rem;
  border-collapse: collapse;
  font-size: var(--text-sm);
  line-height: 1.55;
}

.prose thead th {
  background: var(--pine);
  color: var(--white);
}

.prose th,
.prose td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose tbody tr:nth-child(even) {
  background: var(--mist);
}

.prose tbody tr:last-child > * {
  border-bottom: 0;
}

.prose table p {
  margin: 0;
}

/* Questions in an older post's Bootstrap accordion keep Bootstrap's size */
.prose .accordion-header {
  margin: 0;
  font-size: inherit;
  letter-spacing: normal;
}

/* Text pasted into the editor can carry another font; keep the site's */
.prose [style*="font-family"] {
  font-family: inherit !important;
}

/* Video: a poster until played, then the YouTube player (blog.js) */
.post-video {
  max-width: 46rem;
  margin: 2.5rem 0 0;
}

.post-video__frame {
  aspect-ratio: 16 / 9;
}

.post-video__link {
  position: absolute;
  inset: 0;
  display: block;
}

.post-video__link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 40, 29, 0.55), rgba(6, 40, 29, 0.1));
}

.post-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 10px rgba(248, 168, 40, 0.28);
  color: var(--ink);
  translate: -50% -50%;
  transition: transform var(--medium) var(--ease-out);
}

.post-video__play .icon {
  width: 1.6rem;
  height: 1.6rem;
  margin-left: 0.2rem;
}

.post-video__link:hover .post-video__play {
  transform: scale(1.08);
}

.post-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-video figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: var(--text-xs);
}

/* Back link and sharing, under the article */
.post-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: 46rem;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-foot__back:hover .icon {
  transform: translateX(-3px);
}

/* Contents ("On this page")
   -------------------------------------------------------------------------- */

.toc {
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--mist);
  counter-reset: toc;
}

.toc__title {
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  gap: 0.15rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color var(--fast) ease, color var(--fast) ease;
}

.toc a::before {
  flex: none;
  color: var(--green);
  content: counter(toc, decimal-leading-zero);
  counter-increment: toc;
  font-variant-numeric: tabular-nums;
}

.toc a:hover,
.toc a.is-active {
  background: var(--white);
  color: var(--green-deep);
}

/* Phones and tablets: a fold above the article */
.toc--inline {
  margin-bottom: 2.25rem;
  padding: 0;
}

.toc--inline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
  padding: 0 1.5rem;
  cursor: pointer;
  list-style: none;
}

.toc--inline summary::-webkit-details-marker {
  display: none;
}

.toc--inline summary .icon {
  width: 1.1rem;
  height: 1.1rem;
  transition: transform var(--fast) ease;
}

.toc--inline[open] summary .icon {
  transform: rotate(180deg);
}

.toc--inline ol {
  margin: 0;
  padding: 0 0.85rem 1rem;
}

.toc--side {
  display: none;
}

/* Beside the blog: five sections until Read more (blog.js), which opens
   the box to its full length */
.toc.is-clamped .toc__extra {
  display: none;
}

.toc__extra {
  animation: toc-in var(--medium) var(--ease-out);
}

@keyframes toc-in {
  from {
    opacity: 0;
    transform: translateY(-0.4rem);
  }
}

.toc__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.25rem;
  margin: 0.35rem 0 0 0.65rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
}

.toc__more:hover {
  color: var(--green-deep);
}

.toc__more .icon {
  width: 1rem;
  height: 1rem;
  transition: transform var(--fast) ease;
}

.toc__more[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}

@media (min-width: 992px) {
  .toc--inline {
    display: none;
  }

  .toc--side {
    display: block;
  }
}

/* Sharing, at the end of the blog
   -------------------------------------------------------------------------- */

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.share__label {
  margin-right: 0.25rem;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}

.share__btn {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--mist);
  color: var(--ink);
  cursor: pointer;
  transition: background-color var(--fast) ease, color var(--fast) ease;
}

.share__btn:hover {
  background: var(--green);
  color: var(--white);
}

.share__btn .icon {
  width: 1.15rem;
  height: 1.15rem;
}

.share__status {
  flex-basis: 100%;
  text-align: right;
  color: var(--green-deep);
  font-size: var(--text-xs);
  font-weight: 600;
}

.share__status:empty {
  display: none;
}

/* Quote card
   -------------------------------------------------------------------------- */

.aside-cta {
  position: relative;
  isolation: isolate;
  padding: 1.5rem 1.35rem;
  border-radius: var(--r-lg);
  background: var(--pine);
  color: var(--on-dark);
  font-size: var(--text-sm);
  overflow: hidden;
}

.aside-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 198, 85, 0.25), transparent 70%);
}

.aside-cta__icon {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 6px rgba(248, 168, 40, 0.22);
  color: var(--ink);
}

.aside-cta__icon .icon {
  width: 1.25rem;
  height: 1.25rem;
  animation: spin 18s linear infinite;
}

.aside-cta .aside-cta__title {
  margin-top: 0.95rem;
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.2;
}

.aside-cta p + p {
  margin-top: 0.5rem;
}

.aside-cta .button {
  width: 100%;
  margin-top: 1.1rem;
}

/* Short laptop screens: drop the icon so the card fits under the contents */
@media (min-width: 992px) and (max-height: 820px) {
  .aside-cta__icon {
    display: none;
  }

  .aside-cta .aside-cta__title {
    margin-top: 0;
  }
}

.aside-cta__call {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
}

.aside-cta__call:hover {
  color: var(--sun-bright);
}

.aside-cta__call .icon {
  color: var(--sun-bright);
}
