/* ---------- Blog, white papers, podcast ----------
   Post pages (/slug/), listings (/resources/blog/, /resources/<category>/)
   and /podcasts/. Same system as the rest of the site: hairline white
   cards, 16px radius, blue on hover, plain blue labels. */

.wk-back {
  display: inline-block;
  margin-bottom: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.wk-back:hover {
  text-decoration: underline;
}

/* ---------- Listing head ---------- */

.blog-head {
  padding: 2.6rem 0 1.4rem;
}

.blog-head h1 {
  margin: 0 0 0.8rem;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.blog-intro {
  max-width: 60ch;
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* Search: one field and a button, same field style as the site's forms */
.blog-search {
  position: relative;
  display: flex;
  gap: 0.6rem;
  max-width: 640px;
  margin-top: 1.8rem;
}

.blog-search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  width: 1.15rem;
  height: 1.15rem;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.blog-search input {
  flex: 1;
  min-width: 0;
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.blog-search input::placeholder {
  color: var(--ink-faint);
}

.blog-search input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(14, 20, 207, 0.18);
}

.blog-search .btn {
  border: 0;
  cursor: pointer;
  font-size: 1rem;
}

.blog-search-empty {
  margin: 0.5rem 0 0;
  font-size: 1.05rem;
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Category filter: plain text links, current one in blue with an underline */
.blog-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.blog-cats a {
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.blog-cats a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.blog-cats a[aria-current="page"] {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.blog-list {
  padding: 1rem 0 4rem;
}

.blog-count {
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cards ----------
   Two columns of row cards: thumbnail on the left at about its real size
   (older posts carry ~240px thumbnails, so they stay sharp), text on the
   right. Same white card, hairline border and hover lift as the rest of
   the site's cards. */

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.post-card {
  display: flex;
}

.post-card-link,
.post-feature-link {
  display: grid;
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 20px 40px rgba(7, 7, 38, 0.06);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 160ms ease;
}

.post-card-link:hover,
.post-feature-link:hover {
  transform: translateY(-4px);
  border-color: var(--accent-blue);
  box-shadow: 0 28px 52px rgba(7, 7, 38, 0.14);
}

.post-card-link {
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  padding: 1rem;
}

.post-card-media {
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-alt);
}

.post-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Wide banners: show the whole graphic on white instead of cropping it */
.post-card-media.is-banner {
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.post-card-media.is-banner img {
  object-fit: contain;
}

/* No image: the Hurley Write mark on a quiet tile */
.post-card-mark {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(7, 7, 38, 0.18);
  -webkit-mask: url("/images/favicon.svg") center / 46% no-repeat;
  mask: url("/images/favicon.svg") center / 46% no-repeat;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding-top: 0.15rem;
}

.post-card-cat {
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-blue);
}

.post-card-title {
  margin-bottom: 0.4rem;
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: pretty;
}

.post-card-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.post-card-date {
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Featured (newest) post ---------- */

.post-feature {
  margin-bottom: 2.2rem;
}

.post-feature-link {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  overflow: hidden;
}

.post-feature-media {
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--surface-alt);
}

.post-feature-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-feature-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.4rem, 3vw, 2.4rem);
}

.post-feature-title {
  margin: 0.2rem 0 0.8rem;
  font-weight: 700;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.post-feature-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.post-feature-cta {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* ---------- Pagination ---------- */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.pager-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
}

.pager a,
.pager span {
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.pager a {
  color: var(--accent-blue);
}

.pager a:hover {
  text-decoration: underline;
}

.pager-num.is-current {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.pager-gap {
  color: var(--ink-faint);
}

.pager-step.is-off {
  color: var(--ink-faint);
  opacity: 0.5;
}

/* ---------- Post page ---------- */

.post-head {
  max-width: 820px;
  padding: 2.6rem 0 1.6rem;
}

/* Small (older) thumbnails sit beside the title at their real size */
.post-head.has-thumb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem 2.4rem;
  align-items: end;
}

.post-head-thumb {
  display: block;
  max-width: 260px;
  height: auto;
  border-radius: 12px;
}

.post-cat {
  display: block;
  width: fit-content;
  margin-bottom: 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-blue);
  text-decoration: none;
}

.post-cat:hover {
  text-decoration: underline;
}

.post-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-faint);
}

.post-hero {
  max-width: 820px;
  margin-bottom: 2.2rem;
}

.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.post-body {
  max-width: 820px;
  padding-bottom: 3.6rem;
}

/* Article text: about 68 characters a line */
.prose {
  max-width: 68ch;
  font-size: 1.12rem;
  line-height: 1.72;
  color: var(--ink-soft);
}

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

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose figure,
.prose table {
  margin: 0 0 1.3em;
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  font-size: 1.6rem;
}

.prose h3 {
  margin: 1.8em 0 0.6em;
  font-size: 1.28rem;
}

.prose h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.1rem;
}

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

.prose a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.prose a:hover {
  color: var(--accent-blue-deep);
  text-decoration-thickness: 2px;
}

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

.prose li {
  margin-bottom: 0.45em;
}

.prose li::marker {
  color: var(--ink-faint);
}

/* Quotes: set apart by size and indent, no colored rule */
.prose blockquote {
  margin-left: 0;
  padding: 0 0 0 1.4em;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em 0;
  border-radius: 12px;
}

.prose iframe,
.prose video {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.8em 0;
  border: 0;
  border-radius: 12px;
}

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

/* A few imported posts carry HTML tables: let them scroll on their own */
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.45;
}

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

.prose code {
  padding: 0.1em 0.3em;
  border-radius: 4px;
  background: rgba(7, 7, 38, 0.06);
  font-size: 0.92em;
}

/* ---------- Related posts ---------- */

.post-related {
  padding: 3.4rem 0 4rem;
  border-top: 1px solid var(--line);
}

.post-related h2 {
  margin: 0 0 1.6rem;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  color: var(--ink);
}

/* ---------- Podcast ---------- */

.pod-subscribe {
  margin: 1.2rem 0 0;
}

.pod-subscribe a {
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: none;
}

.pod-subscribe a:hover {
  text-decoration: underline;
}

.pod-list {
  display: grid;
  gap: 1.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pod-ep {
  padding: 1.5rem 1.6rem;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.pod-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.pod-title {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.pod-title a {
  color: var(--ink);
  text-decoration: none;
}

.pod-title a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.pod-summary {
  max-width: 72ch;
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.pod-audio {
  display: block;
  width: 100%;
  max-width: 560px;
}

/* ---------- Responsive ---------- */

/* Two columns get too narrow for titles below 1100px: one card per row */
@media (max-width: 1100px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .post-feature-link {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  /* Search runs as you type and the keyboard has a Search key */
  .blog-search .btn {
    display: none;
  }

  .post-card-link {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.8rem;
  }

  .post-card-excerpt {
    display: none;
  }

  .post-card-title {
    font-size: 1rem;
  }

  .post-head.has-thumb {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-head-thumb {
    grid-row: 1;
    max-width: 180px;
  }

  .blog-head,
  .post-head {
    padding-top: 1.8rem;
  }

  .prose {
    font-size: 1.05rem;
  }

  .prose blockquote {
    padding-left: 1em;
    font-size: 1.1rem;
  }

  .pod-ep {
    padding: 1.2rem 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card-link:hover,
  .post-feature-link:hover {
    transform: none;
  }
}
