/* =============================
   Blog Post Template (clean)
   ============================= */

:root {
  --blog-gap: 32px;
  --sidebar-width: 320px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 30px;
  --border-ui: #e5e7eb;
  --text-muted: #6b7280;
}

/* ===== Layout: article (100% - 320px) | sidebar (320px) ===== */
.blog-post-wrapper {
  display: flex;
  align-items: flex-start;
}
.blog-post-wrapper .blog-post {
  flex: 0 1 auto;
  width: calc(100% - var(--sidebar-width) - var(--blog-gap));
  min-width: 0;
}
.blog-post-wrapper .blog__sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  margin-left: var(--blog-gap);
}
.hs-search-field__suggestions {
  display: none !important;
}

/* Stack on ≤1024px (sidebar below) */
@media (max-width: 1024px) {
  .blog-post-wrapper {
    display: block;
  }
  .blog-post-wrapper .blog-post {
    width: 100%;
  }
  .blog-post-wrapper .blog__sidebar {
    width: 100%;
    margin-left: 0;
    margin-top: 24px;
  }
  .blog-post-wrapper {
    padding-top: 40px;
    padding-bottom: 40px;
  }
}

@media screen and (min-width: 1024px) {
  .blog-post-wrapper {
    padding-top: 80px;
    padding-bottom: 80px;
  }
}

/* ===== Article ===== */
.blog-post h1 {
  margin: 0 0 8px;
  line-height: 1.1;
  font-size: 50px;
}
.blog-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.blog-post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.blog-post__tag-link {
  color: var(--color-primary, #0b5fff);
  text-decoration: underline;
}
.blog-post__readtime {
  position: relative;
  padding-left: 14px;
}
.blog-post__tags + .blog-post__readtime::before {
  content: '•';
  position: absolute;
  left: 4px;
  color: var(--text-muted);
}
.blog-post__featured {
  margin: 10px 0 18px;
}
.blog-post__featured-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
}
.blog-post__body > p {
  margin: 0 0 1.1em;
}
.blog-post__author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.blog-post__author-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}
.blog-post__author-name {
  font-weight: 700;
}

/* Images inside body */
.blog-post__body img {
  border-radius: var(--radius-xl);
  max-width: 100%;
  height: auto;
}

/* ===== Sidebar ===== */
.blog__sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Search wrapper */
.blog__sidebar__search {
  background: var(--color-bg-light, #f7f9fc);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* HubSpot native search_input layout */
.blog__sidebar__search .hs-search-field__bar {
  /* container HubSpot renders */
  width: 100%;
}
.blog__sidebar__search .hs-search-field__bar form {
  display: flex;
  align-items: center;
  gap: 10px; /* space between input and button */
  width: 100%;
}

/* Input (left, expands) */
.blog__sidebar__search .hs-search-field__input,
.blog__sidebar__search input[type='search'],
.blog__sidebar__search input[type='text'] {
  flex: 1 1 auto; /* makes it fill available space */
  height: 50px;
  border-radius: var(--radius-pill);
  border: 1px solid #ccc;
  background: #fff;
  padding: 0 16px;
  font: inherit;
  color: #333;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.blog__sidebar__search .hs-search-field__input::placeholder {
  color: #9aa2af;
}
.blog__sidebar__search .hs-search-field__input:hover {
  border-color: #bfc7d0;
}
.blog__sidebar__search .hs-search-field__input:focus {
  border-color: var(--color-primary, #0b5fff);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primary, #0b5fff) 18%, transparent);
}

/* Button (right, fixed size) */
.blog__sidebar__search .hs-search-field__bar button,
.blog__sidebar__search .hs-search-field__button {
  flex: 0 0 44px; /* fixed width */
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary, #0b5fff);
  color: #fff;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.05s ease;
}
.blog__sidebar__search .hs-search-field__bar button:hover,
.blog__sidebar__search .hs-search-field__button:hover {
  background: var(--color-secondary, #1e3a8a);
}
.blog__sidebar__search .hs-search-field__bar button:active,
.blog__sidebar__search .hs-search-field__button:active {
  transform: translateY(1px);
}
.blog__sidebar__search .hs-search-field__bar button:focus,
.blog__sidebar__search .hs-search-field__button:focus {
  outline: none;
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--color-primary, #0b5fff) 18%, transparent);
}
/* Normalize icon inside the button */
.blog__sidebar__search .hs-search-field__bar button svg {
  width: 18px;
  height: 18px;
  display: block;
}
.blog__sidebar__search .hs-search-field__bar button svg *,
.blog__sidebar__search .hs-search-field__button svg * {
  fill: #fff;
  stroke: #fff;
}

/* Suggestions dropdown */
.blog__sidebar__search .hs-search-field__suggestions {
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--border-ui);
  border-radius: 12px;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: var(--shadow-md, 0 6px 24px rgba(0, 0, 0, 0.08));
}
.blog__sidebar__search .hs-search-field__suggestions li {
  list-style: none;
  border-bottom: 1px solid #f3f4f6;
}
.blog__sidebar__search .hs-search-field__suggestions li:last-child {
  border-bottom: 0;
}
.blog__sidebar__search .hs-search-field__suggestions a {
  display: block;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
}
.blog__sidebar__search .hs-search-field__suggestions a:hover {
  background: #f9fafb;
}

/* CTA wrapper (Blog CTA module has its own styles) */
.blog__sidebar__cta {
}

/* Mobile */
/* Stack on ≤1024px (sidebar below) */
@media (max-width: 1024px) {
  .blog-post h1 {
    line-height: 1;
    font-size: 40px;
  }
}

/* Blog Listing Page */
article.hs-blog-post {
  display: flex;
  flex-direction: column;
  height: auto !important;
  max-width: 100%;
  overflow: hidden;
  background-color: #fff;
  box-shadow: var(--shadow-lg);
  border-radius: 20px !important;
  padding: 20px;
}

.hs-blog-post__image-wrapper {
  margin: -20px -20px 10px -20px !important;
  width: calc(100% + 40px) !important;
}

.hs-blog-post h3 {
  font-size: 20px;
}

.hs-blog-post h3:hover {
  text-decoration: underline;
}

.hs-blog-post__tag {
  margin-top: 0;
  margin-bottom: 0;
}

.hs-blog-post__tag:not(:last-child) {
  content: '•';
}

.hs-blog-post__content-wrapper > div:has(.button) {
  margin-top: auto;
}
