/* The public blog. Builds on app.css (tokens, .hp-* headings, .crumbs, .hp-banner.cta). */

/* Breadcrumbs: centered navigation */
.blog-crumbs {
  padding-top: clamp(16px, 3vw, 24px);
}
.blog-crumbs ol {
  justify-content: center;
}

/* Hero: beautifully centered & balanced */
.blog-hero {
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px) 0 clamp(16px, 2.5vw, 24px);
  max-width: 840px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.blog-hero .hp-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  font-size: 11.5px;
  letter-spacing: .14em;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-tint);
  padding: 4px 14px;
  border-radius: 999px;
}
.blog-hero .hp-display {
  font: 400 clamp(36px, 4.5vw, 54px)/1.1 var(--serif);
  letter-spacing: -.02em;
  color: var(--heading);
  text-wrap: balance;
  margin: 0;
}
.blog-hero .hp-lead {
  margin: 16px auto 0;
  max-width: 580px;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
  text-wrap: balance;
}

/* Centered Search Pill */
.blog-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px auto 0;
  max-width: 480px;
  width: 100%;
  padding: 5px 6px 5px 20px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(31, 27, 22, .04);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.blog-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(36, 76, 58, .12);
}
.blog-search input,
.blog-search input[type="search"] {
  flex: 1;
  min-width: 0;
  height: 44px;
  min-height: 0 !important;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 15.5px;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
.blog-search input:hover,
.blog-search input:active,
.blog-search input:focus,
.blog-search input:focus-visible,
.blog-search input[type="search"]:hover,
.blog-search input[type="search"]:active,
.blog-search input[type="search"]:focus,
.blog-search input[type="search"]:focus-visible {
  outline: none !important;
  outline-width: 0 !important;
  outline-offset: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
}
.blog-search input::-webkit-search-decoration,
.blog-search input::-webkit-search-cancel-button,
.blog-search input::-webkit-search-results-button,
.blog-search input::-webkit-search-results-decoration {
  -webkit-appearance: none !important;
  display: none !important;
}
.blog-search input::placeholder {
  color: #8c8276;
}
.blog-search .btn {
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  flex-shrink: 0;
}

/* Category Filter Pills: centered */
.blog-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 24px auto 0;
  padding: 4px 0;
  max-width: 780px;
}
.blog-filters a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all .15s ease;
  box-shadow: 0 1px 2px rgba(31, 27, 22, .03);
}
.blog-filters a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--ivory);
  transform: translateY(-1px);
}
.blog-filters a[aria-current] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.blog-results {
  text-align: center;
  margin: 20px auto 0;
  color: var(--ink-2);
  font-size: 15px;
}
.blog-results a {
  color: var(--accent);
  font-weight: 500;
  margin-left: 6px;
}

/* Blog Cards Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 36px);
  margin-top: 36px;
}
@media (max-width: 960px) {
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }
}
@media (max-width: 620px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Individual Blog Card: refined editorial styling */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s ease;
  box-shadow: 0 1px 3px rgba(31, 27, 22, .03);
  height: 100%;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(31, 27, 22, .08);
  border-color: var(--line-strong);
}
.blog-card-img {
  display: block;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: var(--sand-deep);
  position: relative;
  text-decoration: none;
}
.blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}
.blog-card:hover .blog-card-img img {
  transform: scale(1.04);
}

.blog-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 24px 24px;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.blog-card .hp-tag {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.blog-card-reading {
  font-size: 12px;
  color: var(--ink-3);
}
.blog-card h3 {
  font: 700 clamp(20px, 2.2vw, 23px)/1.25 var(--heading-font);
  color: var(--heading);
  margin: 4px 0 0;
  text-wrap: wrap;  /* fill each line before the next (balance cut lines short, mid-card) */
}
.blog-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}
.blog-card h3 a:hover {
  color: var(--accent);
}
.blog-card-excerpt {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.blog-card-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-3);
}
.blog-card-more {
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform .15s ease;
}
.blog-card:hover .blog-card-more {
  transform: translateX(3px);
}

/* Empty State */
.blog-empty {
  margin: 40px auto;
  max-width: 540px;
  text-align: center;
  padding: 56px 24px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

/* Popular Tags: centered */
.blog-tags {
  margin: clamp(56px, 7vw, 88px) auto 0;
  text-align: center;
  max-width: 820px;
}
.blog-tags .hp-label {
  margin-bottom: 16px;
  display: inline-block;
}
.blog-tags p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 0;
}
.blog-tags a, .post-tags a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
  box-shadow: 0 1px 2px rgba(31, 27, 22, .03);
}
.blog-tags a:hover, .post-tags a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.blog-tags a[aria-current] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.blog-cta {
  margin-top: clamp(48px, 7vw, 80px);
}

/* A post detail: centered reading column */
.blog-preview {
  background: var(--reserved-tint);
  color: var(--reserved);
  padding: 12px var(--gutter);
  text-align: center;
  font-weight: 500;
}
/* An 800px reading column (.wrap's 1120px would otherwise win: app.css loads after this) */
.wrap.blog-post {
  max-width: calc(800px + 2 * var(--gutter));
  margin: 0 auto;
}
.post-head {
  padding-top: clamp(28px, 5vw, 48px);  /* no breadcrumbs above it */
}
.post-head .hp-tag a {
  color: inherit;
  text-decoration: none;
}
.post-head h1 {
  margin-top: 8px;
  font: 700 clamp(32px, 4vw, 40px)/1.3 var(--serif);  /* the size of the source's (2.5em); it fills the column */
  letter-spacing: -.01em;
  color: var(--heading);
}
.post-lead {
  margin-top: 16px;
  font-size: clamp(17px, 1.8vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
}
.post-meta {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-3);
}
.post-figure {
  margin: clamp(24px, 4vw, 36px) 0 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand-deep);
}
.post-figure img {
  width: 100%;
  height: auto;
  display: block;
}
.prose {
  margin-top: clamp(24px, 4vw, 36px);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: break-word;
}
.prose > * + * {
  margin-top: 1.1em;
}
.prose h2 {
  margin-top: 1.5em;
  font: 700 clamp(26px, 3vw, 32px)/1.25 var(--heading-font);
}
.prose h3 {
  margin-top: 1.5em;
  font: 700 clamp(21px, 2.4vw, 24px)/1.3 var(--heading-font);
}
.prose h4 {
  margin-top: 1.4em;
  font: 700 20px/1.4 var(--heading-font);
  color: var(--heading);
}
/* A table of contents' #links land just under the sticky header */
.prose h2, .prose h3, .prose h4 {
  scroll-margin-top: 96px;
}
.prose h5 {
  margin-top: 1.2em;
  font: 700 16px/1.4 var(--heading-font);
  color: var(--heading);
}
.prose ul, .prose ol {
  padding-left: 1.4em;
}
.prose li + li {
  margin-top: .5em;
}
.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 2px 0 2px 1em;
  border-left: 4px solid var(--accent);
  color: var(--ink-2);
}
.prose blockquote > * + * {
  margin-top: 1em;
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}
.prose figure {
  margin-left: 0;
  margin-right: 0;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--sand-deep);
}
.prose figure img {
  width: 100%;
}
.prose figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-3);
  text-align: center;
}
.prose .tableWrapper,
.prose .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.prose th,
.prose td {
  min-width: 90px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  text-align: left;
  vertical-align: top;
}
.prose table {
  background: var(--surface);
}
.prose th {
  background: var(--accent-tint);
  font-weight: 600;
}
.post-tags {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.post-share {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.post-share p {
  font-weight: 600;
  font-size: 14px;
  margin-right: 4px;
}
.post-share a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--accent);
}
.post-share a:hover {
  border-color: var(--accent);
}
.post-share .icon {
  width: 20px;
  height: 20px;
}
.author-box {
  margin-top: 28px;
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.author-box .who-dot {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font: 600 18px var(--sans);
}
.author-name {
  font-weight: 600;
}
.author-box p + p {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 15px;
}
.post-nav {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.post-nav a {
  display: block;
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--heading);
  text-decoration: none;
  font: 400 19px/1.3 var(--serif);
  overflow-wrap: break-word;
}
.post-nav a:hover {
  border-color: var(--accent);
}
.post-nav small {
  display: block;
  margin-bottom: 4px;
  font: 600 12px var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.post-nav .older {
  text-align: right;
}
.blog-related {
  margin-top: clamp(48px, 6vw, 72px);
}
@media (max-width: 600px) {
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav .older { text-align: left; }
  .blog-search .btn { padding: 0 16px; }
}
.prose .video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.prose .video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* A call to action in a post (blog/html.py cta_html): a white card on a soft sage panel, centred */
.prose .post-cta {
  margin: 28px 0;
  padding: min(22px, 3.2vw);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, #d8dfdc 0 150px, rgba(255, 255, 255, 0) 151px),
    radial-gradient(circle at 0% 100%, #d8dfdc 0 130px, rgba(255, 255, 255, 0) 131px),
    linear-gradient(180deg, #e5eae7 0%, #f2f4f3 100%);
}
.prose .post-cta-card {
  padding: 34px clamp(18px, 4vw, 30px);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .13);
  text-align: center;
}
.prose .post-cta-card > * {
  margin: 0;
}
.prose .post-cta-label {
  margin-bottom: 18px;
  line-height: 1;
}
.prose .post-cta-label span {
  display: inline-block;
  max-width: 100%;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 800 12px/1.3 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.prose .post-cta-title {
  font: 700 clamp(22px, 3vw, 26px)/1.2 var(--heading-font);
  letter-spacing: -.01em;
  color: var(--heading);
}
.prose .post-cta-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 6px;
  margin: 12px auto 14px;
  border-radius: 3px;
  background: var(--accent);
}
.prose .post-cta-text {
  max-width: 44em;
  margin: 0 auto 24px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.prose .post-cta-action a {
  color: #fff;
  text-decoration: none;
}
.prose .post-cta-action a::after {
  content: "→";
  margin-left: 8px;
}

/* A table of contents that opens and closes (blog/html.py _collapsible_contents), closed to start with */
.prose .post-toc {
  /* as wide as its links, not the column */
  width: fit-content;
  min-width: min(100%, 320px);
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1.5em;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  scroll-margin-top: 96px;
}
.prose .post-toc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 0;
  cursor: pointer;
  list-style: none;
  font: 600 clamp(19px, 2.2vw, 22px)/1.3 var(--heading-font);
  color: var(--heading);
}
.prose .post-toc > summary::-webkit-details-marker {
  display: none;
}
.prose .post-toc > summary::after {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-3px) rotate(45deg);
  transition: transform .2s ease;
}
.prose .post-toc[open] > summary::after {
  transform: translateY(2px) rotate(-135deg);
}
.prose .post-toc[open] > summary {
  border-bottom: 1px solid var(--line);
}
.prose .post-toc > summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.prose .post-toc > ul,
.prose .post-toc > ol {
  margin: 14px 0 18px;
}
.prose .post-toc li p {
  margin: 0;
}

/* A blog article reads on white, like the source page (the rest of the site keeps its pale green) */
body.blog-article {
  background: #fff;
}

/* Sources (and the like) in a plain box, always open, as wide as its links like the contents box */
.prose .post-box {
  width: fit-content;
  min-width: min(100%, 320px);
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 1.5em;
  padding: 4px 18px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
}
.prose .post-box > h2,
.prose .post-box > h3 {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: clamp(19px, 2.2vw, 22px);
  font-weight: 700;
}
.prose .post-box > ul,
.prose .post-box > ol {
  margin: 14px 0 0;
}
.prose .post-box li p {
  margin: 0;
}
