/* =========================================================
   Modern editorial blog – index + single reading layout
   ========================================================= */

.hh-blog-shell {
  /* Full editorial shell — content + sticky aside */
  --hh-blog-layout: min(1152px, calc(100% - 3rem));
  --hh-blog-max: min(52rem, 100%);
  --hh-blog-aside: 18.75rem;
  --hh-blog-gap: 2rem;
  --hh-blog-ink: #18212f;
  --hh-blog-muted: #66707d;
  --hh-blog-line: rgba(24, 33, 47, 0.12);
  --hh-blog-surface: #ffffff;
  --hh-blog-wash: #f3f5f8;
  --hh-blog-teal: #5bb5c1;
  background:
    radial-gradient(circle at 12% -10%, rgba(91, 181, 193, 0.14), transparent 28rem),
    radial-gradient(circle at 88% 0%, rgba(1, 135, 141, 0.08), transparent 24rem),
    linear-gradient(180deg, #f7f8fb 0%, #eef1f5 100%);
  color: var(--hh-blog-ink);
}

.hh-container {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

/* Blog index + singles use shared .rc-page-hero (rc-pages.css) under the floating chrome. */
.hh-blog-shell > .rc-page-hero {
  /* Keep wash gradients from painting over the teal hero edge. */
  position: relative;
  z-index: 1;
}

.hh-blog-shell > .rc-page-hero a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.hh-blog-shell > .rc-page-hero a:hover,
.hh-blog-shell > .rc-page-hero a:focus-visible {
  border-bottom-color: #fff;
}

.hh-blog-index {
  padding: 1.75rem 0 4.5rem;
}

.hh-blog-empty {
  padding: 2rem 0 4rem;
  color: var(--hh-blog-muted);
}

/* ---------- Post cards ---------- */
.hh-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}

.hh-post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--hh-blog-surface);
  border: 1px solid rgba(24, 33, 47, 0.06);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(24, 33, 47, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hh-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(24, 33, 47, 0.1);
}

.hh-post-card__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #d9e1ea;
}

.hh-post-card__img,
.hh-post-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.hh-post-card__placeholder {
  background: linear-gradient(135deg, #d7e8ec, #f0d7db);
}

.hh-post-card:hover .hh-post-card__img {
  transform: scale(1.04);
}

.hh-post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.25rem 1.3rem 1.4rem;
}

.hh-post-card__meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--hh-blog-muted);
  font-size: 0.78rem;
}

.hh-post-card__title {
  margin: 0 0 0.7rem;
  font-family: var(--rc-font, Outfit, system-ui, sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.hh-post-card__title a {
  color: var(--hh-blog-ink);
  text-decoration: none;
}

.hh-post-card__title a:hover {
  color: #045482;
}

.hh-post-card__excerpt {
  margin: 0 0 1.2rem;
  color: var(--hh-blog-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.hh-post-card__more {
  margin-top: auto;
  color: #045482;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.hh-post-card__more span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.hh-post-card:hover .hh-post-card__more span {
  transform: translateX(3px);
}

/* ---------- Pills ---------- */
.hh-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.85rem;
  border: 1px solid var(--hh-blog-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--hh-blog-ink);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.hh-pill--soft {
  border-color: rgba(1, 135, 141, 0.18);
  background: rgba(1, 135, 141, 0.08);
  color: #016a70;
}

/* ---------- Single article ---------- */
.hh-article {
  /* Top clearance comes from .rc-page-hero above. */
  padding: 2rem 0 4.5rem;
}

.hh-article__header--meta {
  margin-bottom: 1.75rem;
}

.hh-article__header--meta .hh-article__meta {
  padding-top: 0;
}

.hh-article__inner {
  width: var(--hh-blog-layout);
  max-width: 100%;
  margin-inline: auto;
  padding-inline: 0;
  box-sizing: border-box;
}

/* Content + sticky tools sidebar — one consistent shell */
.hh-article__inner--with-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--hh-blog-aside);
  gap: var(--hh-blog-gap);
  align-items: start;
  width: var(--hh-blog-layout);
}

.hh-article__main {
  min-width: 0;
  max-width: 100%;
}

.hh-article__aside {
  position: sticky;
  top: 7.5rem;
  margin-top: 0;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- AI summarize card ---------- */
.hh-ai-summarize {
  padding: 1.2rem 1.15rem 1.25rem;
  background: var(--hh-blog-surface);
  border: 1px solid rgba(24, 33, 47, 0.07);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(24, 33, 47, 0.08);
}

.hh-ai-summarize__title {
  margin: 0 0 0.4rem;
  color: var(--hh-blog-ink);
  font-family: var(--rc-font, Outfit, system-ui, sans-serif);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hh-ai-summarize__hint {
  margin: 0 0 0.95rem;
  color: var(--hh-blog-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.hh-ai-summarize__buttons {
  display: grid;
  gap: 0.5rem;
}

.hh-ai-btn {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgba(24, 33, 47, 0.1);
  border-radius: 12px;
  background: #f4f6f9;
  color: var(--hh-blog-ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.hh-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(24, 33, 47, 0.1);
  color: var(--hh-blog-ink);
}

.hh-ai-btn__icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: inherit;
}

.hh-ai-btn__icon svg {
  width: 17px;
  height: 17px;
}

.hh-ai-btn--chatgpt {
  background: #eaf6f3;
  border-color: rgba(47, 143, 154, 0.28);
  color: #1f6f6a;
}

.hh-ai-btn--chatgpt:hover {
  background: #dff0ec;
  border-color: rgba(47, 143, 154, 0.4);
  color: #175a56;
}

.hh-ai-btn--google {
  background: #f7eef0;
  border-color: rgba(1, 135, 141, 0.22);
  color: #033d5e;
}

.hh-ai-btn--google:hover {
  background: #f3e4e7;
  border-color: rgba(1, 135, 141, 0.35);
  color: #014a4e;
}

.hh-ai-btn--perplexity {
  background: #eef3f8;
  border-color: rgba(24, 33, 47, 0.14);
  color: #2a3a4f;
}

.hh-ai-btn--perplexity:hover {
  background: #e5edf5;
  border-color: rgba(24, 33, 47, 0.22);
  color: #18212f;
}

.hh-ai-btn--claude {
  background: #f7f1ea;
  border-color: rgba(224, 162, 64, 0.35);
  color: #8a5a1c;
}

.hh-ai-btn--claude:hover {
  background: #f1e8dd;
  border-color: rgba(224, 162, 64, 0.5);
  color: #6f4816;
}

.hh-article__header {
  margin-bottom: 2rem;
  text-align: left;
  width: 100%;
}

.hh-article__eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hh-article__eyebrow a {
  color: #045482;
  text-decoration: none;
}

.hh-article__title {
  margin: 0 0 1rem;
  color: var(--hh-blog-ink);
  font-family: var(--rc-font, Outfit, system-ui, sans-serif);
  font-size: clamp(1.65rem, 3.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: none;
}

.hh-article__dek {
  margin: 0;
  color: var(--hh-blog-muted);
  font-size: 1.12rem;
  line-height: 1.7;
  max-width: none;
}

.hh-article__rule {
  width: 100%;
  height: 1px;
  margin: 1.6rem 0 1.35rem;
  border: 0;
  background: var(--hh-blog-line);
}

.hh-article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.hh-article__author {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-width: 0;
}

.hh-article__avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(91, 181, 193, 0.45);
}

.hh-article__author-text {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.hh-article__byline {
  color: var(--hh-blog-muted);
  font-size: 0.8rem;
}

.hh-article__author-text strong {
  color: var(--hh-blog-ink);
  font-size: 1rem;
  font-weight: 700;
}

.hh-article__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hh-article__feature {
  margin: 0 0 2.4rem;
  width: 100%;
}

.hh-article__feature-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(24, 33, 47, 0.12);
}

.hh-article__content {
  width: 100%;
  max-width: none;
  color: #2d3642;
  font-family: var(--rc-font, Outfit, system-ui, sans-serif);
  font-size: 1.08rem;
  line-height: 1.8;
}

/* Legacy WP/Tatsu images: same column width as text — no inset/float */
.hh-article__content img.alignleft,
.hh-article__content img.alignright,
.hh-article__content img.aligncenter,
.hh-article__content img.alignnone,
.hh-article__content .wp-caption,
.hh-article__content .wp-block-image {
  float: none !important;
  clear: both;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
  margin: 2rem 0 !important;
}

.hh-article__content .wp-caption {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.hh-article__content .wp-caption img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(24, 33, 47, 0.1);
}

.hh-article__content .wp-caption-text {
  margin: 0.75rem 0 0;
  color: var(--hh-blog-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: left;
}

/* Paragraphs that only contain an image (common in old posts) */
.hh-article__content p:has(> img:only-child) {
  clear: both;
  margin: 2rem 0;
  padding: 0;
}

.hh-article__content p:has(> img:only-child) img {
  margin: 0 !important;
}

/* Keep headings and lists from snagging beside old floats */
.hh-article__content h2,
.hh-article__content h3,
.hh-article__content h4,
.hh-article__content ul,
.hh-article__content ol,
.hh-article__content blockquote {
  clear: both;
}

.hh-article__content > *:first-child {
  margin-top: 0;
}

.hh-article__content p {
  margin: 0 0 1.35rem;
  max-width: none;
}

.hh-article__content h2,
.hh-article__content h3,
.hh-article__content h4 {
  margin: 2.4rem 0 0.85rem;
  color: var(--hh-blog-ink);
  font-family: var(--rc-font, Outfit, system-ui, sans-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  max-width: none;
  scroll-margin-top: 7.5rem;
}

.hh-article__content h2 {
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
}

.hh-article__content h3 {
  font-size: 1.3rem;
}

.hh-article__content a {
  color: #045482;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.hh-article__content ul,
.hh-article__content ol {
  margin: 0 0 1.4rem;
  padding-left: 1.25rem;
}

.hh-article__content li + li {
  margin-top: 0.45rem;
}

.hh-article__content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.6rem;
  font-size: 0.95rem;
}

.hh-article__content th,
.hh-article__content td {
  border: 1px solid var(--hh-blog-line);
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: top;
}

.hh-article__content thead th,
.hh-article__content th {
  background: var(--hh-blog-wash);
  font-weight: 700;
}

.hh-article__content blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 3px solid #045482;
  color: #405060;
  font-size: 1.12rem;
  font-style: italic;
}

.hh-article__content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(24, 33, 47, 0.1);
}

/* Strip legacy inline widths on media only */
.hh-article__content img[style*="width"],
.hh-article__content img[style*="max-width"],
.hh-article__content .wp-caption[style*="width"],
.hh-article__content figure[style*="width"] {
  width: 100% !important;
  max-width: 100% !important;
}

.hh-article__content .aligncenter,
.hh-article__content .alignnone,
.hh-article__content .alignleft,
.hh-article__content .alignright {
  float: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.hh-article__footer {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hh-blog-line);
}

.hh-article__back {
  color: var(--hh-blog-ink);
  font-weight: 700;
  text-decoration: none;
}

.hh-article__back:hover {
  color: #045482;
}

/* ---------- Sticky table of contents ---------- */
.article-aside .blog-toc {
  padding: 1.15rem 1.1rem 1.2rem;
  background: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(24, 33, 47, 0.08);
}

.blog-toc__title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.85rem;
  color: var(--hh-blog-ink);
  font-family: var(--rc-font, Outfit, system-ui, sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.blog-toc__title::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  background-color: #045482;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01' stroke='%23000' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.blog-toc__list {
  max-height: 52vh;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(1, 135, 141, 0.35) transparent;
}

.blog-toc__list::-webkit-scrollbar {
  width: 5px;
}

.blog-toc__list::-webkit-scrollbar-thumb {
  background: rgba(1, 135, 141, 0.35);
  border-radius: 999px;
}

.blog-toc__item {
  margin: 0;
}

.blog-toc__item + .blog-toc__item {
  margin-top: 0.15rem;
}

.blog-toc__item a {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.42rem 0.35rem 0.42rem 0.15rem;
  border-radius: 8px;
  color: #66707d;
  font-size: 0.9rem;
  font-weight: 550;
  line-height: 1.4;
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.blog-toc__item a:hover,
.blog-toc__item a:focus-visible {
  color: #045482;
  background: rgba(1, 135, 141, 0.06);
  outline: none;
}

.blog-toc__item--h2 a::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.35rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  opacity: 0.45;
  transform: rotate(-45deg);
  transition: opacity 0.15s ease;
}

.blog-toc__item--h2 a:hover::before,
.blog-toc__item--h2 a:focus-visible::before {
  opacity: 1;
}

.blog-toc__item--h3 a {
  padding-left: 1.05rem;
  color: #7a8491;
  font-size: 0.84rem;
  font-weight: 500;
}

.blog-toc__item--h3 a::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 0.28rem;
  height: 0.28rem;
  margin-top: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.blog-toc__item--h3 a:hover,
.blog-toc__item--h3 a:focus-visible {
  color: #045482;
}

.hh-blog-shell.single-post,
body.single-post {
  scroll-behavior: smooth;
}

html:has(.hh-blog-shell) {
  scroll-behavior: smooth;
}

/* ---------- Pagination ---------- */
.hh-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.hh-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--hh-blog-ink);
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(24, 33, 47, 0.04);
}

.hh-pagination .page-numbers.current,
.hh-pagination .page-numbers:hover {
  background: #045482;
  color: #fff;
}

@media (max-width: 1024px) {
  .hh-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hh-article__inner--with-aside {
    grid-template-columns: 1fr;
    gap: 0;
    width: min(var(--hh-blog-layout), calc(100% - 2.5rem));
  }

  .hh-article__aside {
    position: static;
    order: -1;
    margin-top: 0;
    margin-bottom: 1.75rem;
  }

  .article-aside .blog-toc {
    max-width: none;
  }

  .blog-toc__list {
    max-height: 14rem;
  }

  .hh-ai-summarize__buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .hh-posts-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .hh-article__meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .hh-article__feature-img {
    border-radius: 16px;
  }

  .hh-article {
    padding-top: 1.5rem;
  }

  .hh-pagination .page-numbers {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .hh-ai-summarize {
    margin-top: 0.5rem;
  }

  .hh-ai-summarize__buttons {
    grid-template-columns: 1fr;
  }

  .hh-ai-btn {
    min-height: 48px;
  }

  .hh-article__content {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .hh-article__content img {
    border-radius: 12px;
  }
}

/* overflow-x: hidden on html/body creates a scroll container that
   kills position: sticky — use clip on blog pages instead */
html:has(.hh-blog-shell),
body:has(.hh-blog-shell) {
  overflow-x: clip !important;
  overflow-y: visible !important;
}


/* Rock City: blog shell sits under fixed header */
body.rc-native-chrome .hh-blog-shell {
  --rc-font: Outfit, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body.rc-native-chrome:has(.hh-blog-shell) #rc-content.inside-content {
  padding: 0;
  max-width: none;
  width: 100%;
}
body.rc-native-chrome:has(.hh-blog-shell) .wrap-fullwidth {
  max-width: none;
  width: 100%;
  padding: 0;
}
