/* Section hub (/ibs/) - v2 */

.hub-hero {
  padding: clamp(3rem, 7vw, 4.5rem) 0 clamp(2.5rem, 5vw, 3.5rem);
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.hub-hero-inner {
  display: grid;
  gap: 1.5rem 2.5rem;
}

.hub-test-cta {
  margin: 0.85rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.hub-test-cta a {
  text-decoration: none;
}

.hub-test-cta a:hover {
  text-decoration: underline;
}

.hub-hero .lead {
  max-width: 52ch;
  margin-bottom: 0;
}

.hub-hero-search {
  position: relative;
  align-self: end;
}

.hub-search {
  display: flex;
  align-items: stretch;
  background: var(--green-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.hub-search:focus-within {
  border-color: var(--green-dark);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.hub-search input {
  flex: 1;
  border: none;
  padding: 0.85rem 1.125rem;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  min-height: 50px;
  min-width: 0;
}

.hub-search input::placeholder { color: var(--text-muted); }
.hub-search input:focus { outline: none; }

.hub-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  flex-shrink: 0;
  border: none;
  background: var(--green);
  color: var(--white);
  cursor: pointer;
}

.hub-search button:hover { background: var(--green-dark); }

.hub-search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 0.375rem;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  max-height: min(18rem, 50vh);
  overflow-y: auto;
}

.hub-search-results[hidden] { display: none; }

.hub-search-results a {
  display: block;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}

.hub-search-results a:hover,
.hub-search-results a:focus-visible {
  background: var(--green-muted);
  color: var(--green-darker);
}

.hub-search-results .result-type {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
  margin-bottom: 0.15rem;
}

.hub-search-results .result-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}

.hub-search-status {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hub-search-status[hidden] { display: none; }

.hub-search-empty {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-align: center;
}

.hub-search-empty[hidden] { display: none; }

.hub-searchable.is-hidden { display: none !important; }
.hub-section.is-search-empty { display: none; }

@media (min-width: 768px) {
  .hub-hero-inner {
    grid-template-columns: 1fr minmax(280px, 380px);
    align-items: end;
  }
}

.hub-main {
  padding: clamp(2.5rem, 5vw, 4rem) 0 clamp(3rem, 6vw, 4.5rem);
}

.pillar-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.topic-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.topic-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.topic-card-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

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

.topic-card-body {
  padding: 1.125rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Hub pillar grid (/ibs/) — category label + title spacing */
.pillar-grid .topic-card-body > p.topic-card-cat {
  margin: 0 0 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
  line-height: 1.15;
  flex: none;
}

.pillar-grid .topic-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.topic-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.topic-card-body > p:not(.topic-card-cat) {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-muted);
  flex: 1;
}

.topic-card-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--green-dark);
}

.topic-card:hover .topic-card-link { color: var(--green-darker); }

.app-banner {
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding: 2rem 1.75rem;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.app-banner-phone {
  display: flex;
  justify-content: flex-start;
  max-width: 9rem;
  margin-inline: 0;
}

.app-banner-phone img {
  width: 100%;
  height: auto;
  display: block;
}

.app-banner h2 {
  color: var(--white);
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.app-banner-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.app-banner-lead {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  max-width: 50ch;
  font-size: 1.0625rem;
}

.app-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

/* Arrow styles: shared .btn--arrow / .btn__arrow in main.css */

.hub-symptoms {
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.hub-symptoms-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  align-items: start;
}

.hub-symptoms-nav .eyebrow {
  margin-bottom: 0.5rem;
}

.hub-symptoms-lead {
  margin: 0 0 1.25rem;
}

.hub-symptoms-panel {
  margin: 0;
  padding: clamp(1.35rem, 3vw, 1.75rem);
  border: 1.5px solid rgba(68, 126, 126, 0.18);
  border-radius: var(--radius);
  background: var(--cream);
}

.hub-symptoms-panel > .eyebrow {
  margin: 0 0 0.4rem;
  /* Same as global .eyebrow — beat .hub-symptoms-panel > p specificity */
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  line-height: 1.4;
}

.hub-symptoms-panel h3 {
  margin: 0 0 0.65rem;
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  color: var(--green-darker);
}

.hub-symptoms-panel > p:not(.eyebrow) {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hub-symptoms-cta {
  margin: 0;
}

.hub-symptoms-cta .btn {
  display: inline-flex;
}

@media (min-width: 900px) {
  .hub-symptoms-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.9fr);
    gap: clamp(2rem, 4vw, 3rem);
    align-items: stretch;
  }

  .hub-symptoms-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

.hub-articles {
  padding: clamp(3rem, 6vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.hub-articles-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2rem;
}

.hub-articles-header h2 { margin-bottom: 0; }

.hub-articles-header p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.hub-article-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

.hub-article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hub-article-card:hover {
  border-color: var(--green);
  box-shadow: var(--shadow);
}

.hub-article-card img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

.hub-article-card-body { padding: 1.125rem 1.25rem 1.25rem; }

.hub-article-card h3 {
  font-size: 1.0625rem;
  line-height: 1.4;
  margin: 0 0 0.35rem;
}

.hub-article-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.hub-articles-more {
  margin: 1.5rem 0 0;
  text-align: center;
}

.hub-articles-more a {
  font-weight: 700;
  text-decoration: none;
}

.blog-hero {
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
}

.blog-listing-meta {
  justify-content: flex-end;
  margin-bottom: 1.25rem;
}

.search-hero {
  padding-bottom: clamp(1.75rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
}

.search-listing.hub-articles {
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
  border-top: 0;
  background: var(--green-muted);
}

.search-result-type {
  margin: 0 0 0.35rem !important;
  font-size: 0.6875rem !important;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark) !important;
}

.hub-article-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--green-muted);
}

.hub-article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: auto;
}

.hub-article-card-media.card-media-empty {
  display: grid;
  place-items: center;
  color: var(--green);
}

.hub-article-card-media.card-media-empty .card-media-mark {
  width: 2.5rem;
  height: 2.5rem;
  opacity: 0.55;
}

.hub-article-card-media.card-media-empty .card-media-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.search-empty {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 3rem) 0;
  text-align: center;
}

.search-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.search-pagination {
  margin-top: 2rem;
}

/* Blog listing sits directly under blog-hero - avoid double band gap. */
.blog-listing.hub-articles {
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
  border-top: 0;
}

.blog-pagination {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.blog-pagination a,
.blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  color: var(--green-dark);
}

.blog-pagination span.current {
  background: var(--green-muted);
  border-color: var(--green-dark);
}

@media (min-width: 640px) {
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-article-grid { grid-template-columns: repeat(3, 1fr); }
  .app-banner { grid-template-columns: 1fr auto; }
  .app-banner--with-phone {
    grid-template-columns: auto 1fr auto;
    gap: 1.75rem;
    padding: 1.25rem 1.75rem;
  }
  .app-banner--with-phone .app-banner-phone {
    max-width: 8.5rem;
    margin: 0;
  }
}

@media (min-width: 900px) {
  .pillar-grid { grid-template-columns: repeat(3, 1fr); }
  .app-banner--with-phone .app-banner-phone {
    max-width: 10rem;
  }
}
