:root {
  --hgl-navy: #131b35;
  --hgl-blue: #263b67;
  --hgl-teal: #1f5f53;
  --hgl-teal-dark: #174b42;
  --hgl-soft: #f5f7fb;
  --hgl-soft-green: #eef6f2;
  --hgl-border: rgba(19, 27, 53, .13);
  --hgl-muted: #5b6683;
}

.hgl-landing,
.hgl-library {
  color: var(--hgl-blue);
  margin: 20px 0 46px;
}

.hgl-landing * {
  box-sizing: border-box;
}

.hgl-intro-band {
  position: relative;
  overflow: hidden;
  margin: 0 0 28px;
  padding: 30px 34px;
  border: 1px solid var(--hgl-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(31, 95, 83, .12), transparent 34%),
    linear-gradient(135deg, #ffffff 0%, #f7f9fc 58%, #eef6f2 100%);
  box-shadow: 0 16px 36px rgba(19, 27, 53, .07);
}

.hgl-intro-band:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(120deg, rgba(31, 95, 83, .045) 25%, transparent 25%, transparent 50%, rgba(31, 95, 83, .045) 50%, rgba(31, 95, 83, .045) 75%, transparent 75%, transparent);
  background-size: 22px 22px;
  opacity: .35;
  pointer-events: none;
}

.hgl-intro-band > * {
  position: relative;
}

.hgl-eyebrow {
  margin: 0 0 9px !important;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .84rem;
  font-weight: 800;
  color: var(--hgl-teal);
}

.hgl-lede {
  max-width: 980px;
  margin: 0 !important;
  font-size: clamp(1.03rem, 1.45vw, 1.18rem);
  line-height: 1.7;
  color: var(--hgl-blue);
}

.hgl-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hgl-quick-stats span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 10px 13px;
  border: 1px solid rgba(31, 95, 83, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .74);
  color: var(--hgl-blue);
  font-size: .93rem;
}

.hgl-quick-stats strong {
  color: var(--hgl-teal-dark);
}

.hgl-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
  margin: 28px 0;
}

.hgl-home-card {
  display: block;
  min-height: 260px;
  padding: 30px;
  border: 1px solid var(--hgl-border);
  border-radius: 22px;
  text-decoration: none !important;
  background: #fff;
  box-shadow: 0 14px 30px rgba(19, 27, 53, .07);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hgl-home-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 44px rgba(19, 27, 53, .12);
  border-color: rgba(31, 95, 83, .35);
}

.hgl-primary-card {
  background: linear-gradient(180deg, #fff 0%, #fbfdfc 100%);
}

.hgl-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.hgl-card-icon {
  font-size: 34px;
  line-height: 1;
}

.hgl-home-card h2 {
  margin: 0 0 12px !important;
  color: var(--hgl-navy);
  font-size: clamp(1.7rem, 2.25vw, 2.55rem);
  line-height: 1.13;
}

.hgl-home-card p {
  margin: 0 0 22px !important;
  color: var(--hgl-blue);
  line-height: 1.65;
}

.hgl-button,
.hgl-download,
.hgl-callout-link {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--hgl-teal);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 800;
  line-height: 1.2;
}

.hgl-button:hover,
.hgl-download:hover,
.hgl-callout-link:hover {
  background: var(--hgl-teal-dark);
  color: #fff !important;
}

.hgl-secondary {
  background: #747b8c;
}

.hgl-coming-soon {
  opacity: .96;
}

.hgl-pill {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eaf3ef;
  color: var(--hgl-teal);
  font-size: .85em;
  font-weight: 800;
  white-space: nowrap;
}

.hgl-muted-pill {
  background: #eef0f5;
  color: #5b6376;
}

.hgl-callout {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 28px;
  padding: 18px 22px;
  border-left: 5px solid var(--hgl-teal);
  border-radius: 16px;
  background: var(--hgl-soft-green);
  color: var(--hgl-blue);
}

.hgl-callout strong {
  color: var(--hgl-navy);
}

.hgl-callout-link {
  margin-left: auto;
  padding: 9px 15px;
  font-size: .93rem;
}

.hgl-library {
  margin: 28px 0;
}

.hgl-toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--hgl-border);
  border-radius: 18px;
  background: var(--hgl-soft);
}

.hgl-search,
.hgl-filter {
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid rgba(19, 27, 53, .18);
  border-radius: 12px;
  background: #fff;
  color: var(--hgl-navy);
}

.hgl-search {
  min-width: 280px;
  flex: 1;
}

.hgl-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hgl-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(19, 27, 53, .05);
}

.hgl-table {
  width: 100%;
  border-collapse: collapse;
}

.hgl-table th,
.hgl-table td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(19, 27, 53, .09);
  vertical-align: middle;
}

.hgl-table th {
  background: #f6f8fb;
  color: var(--hgl-navy);
  font-weight: 900;
}

.hgl-table tr:last-child td {
  border-bottom: 0;
}

.hgl-table tbody tr:hover {
  background: #fbfcfe;
}

.hgl-muted {
  color: var(--hgl-muted);
}

.hgl-hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .hgl-intro-band {
    padding: 24px 20px;
  }
  .hgl-home-card {
    min-height: auto;
    padding: 24px 20px;
  }
  .hgl-toolbar {
    display: block;
  }
  .hgl-search,
  .hgl-filter {
    width: 100%;
    margin-bottom: 10px;
  }
  .hgl-table th,
  .hgl-table td {
    padding: 11px 12px;
  }
  .hgl-callout {
    display: block;
  }
  .hgl-callout strong {
    display: block;
    margin-bottom: 6px;
  }
  .hgl-callout-link {
    margin: 12px 0 0;
  }
}

/* Hopestone v1.6 visual fixes: page banners, home hero, and header navigation. */
:root {
  --hgl-banner-height-desktop: 320px;
  --hgl-banner-height-tablet: 250px;
  --hgl-banner-height-mobile: 200px;
  --hgl-home-hero-min: 455px;
}

/* Standardize interior page title banners without clipping content. */
body .wp-site-blocks > .wp-block-cover,
body .entry-content > .wp-block-cover:first-child,
body main .wp-block-cover:first-child,
body .wp-block-post-content > .wp-block-cover:first-child {
  min-height: var(--hgl-banner-height-desktop) !important;
  max-height: none !important;
  padding-top: 44px !important;
  padding-bottom: 44px !important;
}

body .wp-site-blocks > .wp-block-cover h1,
body .entry-content > .wp-block-cover:first-child h1,
body main .wp-block-cover:first-child h1,
body .wp-block-post-content > .wp-block-cover:first-child h1 {
  font-size: clamp(2.5rem, 4.35vw, 4rem) !important;
  line-height: 1.1 !important;
}

/* Homepage hero needs more vertical room because the headline wraps to several lines. */
body.home .wp-site-blocks > .wp-block-cover:first-of-type,
body.home main .wp-block-cover:first-child,
body.home .entry-content > .wp-block-cover:first-child,
body.front-page .wp-site-blocks > .wp-block-cover:first-of-type,
body.front-page main .wp-block-cover:first-child,
body.front-page .entry-content > .wp-block-cover:first-child {
  min-height: var(--hgl-home-hero-min) !important;
  max-height: none !important;
  padding-top: 76px !important;
  padding-bottom: 76px !important;
}

body.home .wp-block-cover:first-of-type h1,
body.front-page .wp-block-cover:first-of-type h1 {
  font-size: clamp(3rem, 5.1vw, 5.25rem) !important;
  line-height: 1.08 !important;
}

/* Keep the primary/header menu compact and on one row at desktop sizes. */
body header .wp-block-navigation,
body .wp-block-template-part .wp-block-navigation {
  font-size: 13px !important;
  line-height: 1.12 !important;
}

body header .wp-block-navigation__container,
body .wp-block-template-part .wp-block-navigation__container {
  column-gap: 16px !important;
  row-gap: 0 !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}

body header .wp-block-navigation-item__content,
body .wp-block-template-part .wp-block-navigation-item__content {
  white-space: nowrap !important;
}

body header .wp-block-site-title,
body .wp-block-template-part .wp-block-site-title {
  white-space: nowrap !important;
  font-size: clamp(1rem, 1.45vw, 1.35rem) !important;
}

body header .wp-block-group,
body .wp-block-template-part .wp-block-group {
  row-gap: 6px !important;
}

@media (min-width: 782px) {
  body header .wp-block-navigation__responsive-container-open:not(.always-shown),
  body .wp-block-template-part .wp-block-navigation__responsive-container-open:not(.always-shown) {
    display: none !important;
  }
}

@media (max-width: 1180px) {
  body header .wp-block-navigation,
  body .wp-block-template-part .wp-block-navigation {
    font-size: 12px !important;
  }
  body header .wp-block-navigation__container,
  body .wp-block-template-part .wp-block-navigation__container {
    column-gap: 12px !important;
  }
}

@media (max-width: 900px) {
  body .wp-site-blocks > .wp-block-cover,
  body .entry-content > .wp-block-cover:first-child,
  body main .wp-block-cover:first-child,
  body .wp-block-post-content > .wp-block-cover:first-child {
    min-height: var(--hgl-banner-height-tablet) !important;
    padding-top: 34px !important;
    padding-bottom: 34px !important;
  }
  body.home .wp-site-blocks > .wp-block-cover:first-of-type,
  body.home main .wp-block-cover:first-child,
  body.front-page .wp-site-blocks > .wp-block-cover:first-of-type,
  body.front-page main .wp-block-cover:first-child {
    min-height: 395px !important;
    padding-top: 58px !important;
    padding-bottom: 58px !important;
  }
}

@media (max-width: 700px) {
  body .wp-site-blocks > .wp-block-cover,
  body .entry-content > .wp-block-cover:first-child,
  body main .wp-block-cover:first-child,
  body .wp-block-post-content > .wp-block-cover:first-child {
    min-height: var(--hgl-banner-height-mobile) !important;
    padding-top: 28px !important;
    padding-bottom: 28px !important;
  }
  body .wp-site-blocks > .wp-block-cover h1,
  body .entry-content > .wp-block-cover:first-child h1,
  body main .wp-block-cover:first-child h1,
  body .wp-block-post-content > .wp-block-cover:first-child h1 {
    font-size: clamp(2.1rem, 10vw, 3rem) !important;
  }
  body.home .wp-site-blocks > .wp-block-cover:first-of-type,
  body.home main .wp-block-cover:first-child,
  body.front-page .wp-site-blocks > .wp-block-cover:first-of-type,
  body.front-page main .wp-block-cover:first-child {
    min-height: 360px !important;
  }
}

/* Hopestone v1.6: homepage hero clipping fix and top-level duplicate menu cleanup. */
:root {
  --hgl-home-hero-min: 620px;
}

/* Give the homepage hero enough actual vertical room and prevent title clipping. */
body.home .wp-site-blocks > .wp-block-cover:first-of-type,
body.home main .wp-block-cover:first-child,
body.home .entry-content > .wp-block-cover:first-child,
body.home .wp-block-post-content > .wp-block-cover:first-child,
body.front-page .wp-site-blocks > .wp-block-cover:first-of-type,
body.front-page main .wp-block-cover:first-child,
body.front-page .entry-content > .wp-block-cover:first-child,
body.front-page .wp-block-post-content > .wp-block-cover:first-child {
  min-height: 620px !important;
  height: auto !important;
  overflow: visible !important;
  padding-top: 120px !important;
  padding-bottom: 110px !important;
  align-items: center !important;
}

body.home .wp-block-cover:first-of-type .wp-block-cover__inner-container,
body.front-page .wp-block-cover:first-of-type .wp-block-cover__inner-container {
  overflow: visible !important;
  transform: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.home .wp-block-cover:first-of-type h1,
body.front-page .wp-block-cover:first-of-type h1 {
  font-size: clamp(3rem, 4.65vw, 4.85rem) !important;
  line-height: 1.12 !important;
  margin-top: 0 !important;
  margin-bottom: 26px !important;
  overflow: visible !important;
}

body.home .wp-block-cover:first-of-type p,
body.front-page .wp-block-cover:first-of-type p {
  overflow: visible !important;
}

/* Hide the duplicated top-level Q&RA Tools item when it is already under Resources.
   This targets only the primary/top-level item and leaves submenu entries available. */
@supports selector(:has(*)) {
  body header .wp-block-navigation__responsive-container-content > .wp-block-navigation__container > .wp-block-navigation-item:has(> .wp-block-navigation-item__content[href$="/tools/"]),
  body header .wp-block-navigation__responsive-container-content > .wp-block-navigation__container > .wp-block-navigation-item:has(> .wp-block-navigation-item__content[href*="/qra"]),
  body .wp-block-template-part .wp-block-navigation__responsive-container-content > .wp-block-navigation__container > .wp-block-navigation-item:has(> .wp-block-navigation-item__content[href$="/tools/"]),
  body .wp-block-template-part .wp-block-navigation__responsive-container-content > .wp-block-navigation__container > .wp-block-navigation-item:has(> .wp-block-navigation-item__content[href*="/qra"]) {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.home .wp-site-blocks > .wp-block-cover:first-of-type,
  body.home main .wp-block-cover:first-child,
  body.front-page .wp-site-blocks > .wp-block-cover:first-of-type,
  body.front-page main .wp-block-cover:first-child {
    min-height: 540px !important;
    padding-top: 90px !important;
    padding-bottom: 90px !important;
  }
  body.home .wp-block-cover:first-of-type h1,
  body.front-page .wp-block-cover:first-of-type h1 {
    font-size: clamp(2.65rem, 7vw, 4rem) !important;
  }
}

@media (max-width: 700px) {
  body.home .wp-site-blocks > .wp-block-cover:first-of-type,
  body.home main .wp-block-cover:first-child,
  body.front-page .wp-site-blocks > .wp-block-cover:first-of-type,
  body.front-page main .wp-block-cover:first-child {
    min-height: 470px !important;
    padding-top: 70px !important;
    padding-bottom: 70px !important;
  }
  body.home .wp-block-cover:first-of-type h1,
  body.front-page .wp-block-cover:first-of-type h1 {
    font-size: clamp(2.25rem, 10vw, 3.1rem) !important;
  }
}


/* Hopestone v1.7: stronger homepage hero and header cleanup rules. */
:root {
  --hgl-home-hero-height-v17: 560px;
}

/* Keep the actual site header on one line and use the Resources dropdown as the hub. */
body header .wp-block-site-title,
body header .wp-block-site-title a,
body .wp-block-template-part .wp-block-site-title,
body .wp-block-template-part .wp-block-site-title a {
  font-size: clamp(1rem, 1.25vw, 1.22rem) !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}

body header .wp-block-navigation,
body .wp-block-template-part .wp-block-navigation {
  font-size: 12px !important;
  line-height: 1 !important;
}

body header .wp-block-navigation__container,
body .wp-block-template-part .wp-block-navigation__container {
  gap: 10px 18px !important;
}

/* Homepage: the prior theme cover used very large text, which clipped under the header.
   These rules intentionally make only the first homepage cover more controlled. */
body.home .wp-block-cover:first-of-type,
body.front-page .wp-block-cover:first-of-type,
body.home main .wp-block-cover:first-child,
body.front-page main .wp-block-cover:first-child,
body.home .wp-block-post-content > .wp-block-cover:first-child,
body.front-page .wp-block-post-content > .wp-block-cover:first-child {
  min-height: var(--hgl-home-hero-height-v17) !important;
  height: auto !important;
  max-height: none !important;
  overflow: hidden !important;
  padding: 88px 20px 82px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.home .wp-block-cover:first-of-type .wp-block-cover__inner-container,
body.front-page .wp-block-cover:first-of-type .wp-block-cover__inner-container,
body.home main .wp-block-cover:first-child .wp-block-cover__inner-container,
body.front-page main .wp-block-cover:first-child .wp-block-cover__inner-container,
body.home .wp-block-post-content > .wp-block-cover:first-child .wp-block-cover__inner-container,
body.front-page .wp-block-post-content > .wp-block-cover:first-child .wp-block-cover__inner-container {
  width: 100% !important;
  max-width: 1160px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
  transform: none !important;
  text-align: center !important;
  overflow: visible !important;
}

body.home .wp-block-cover:first-of-type h1,
body.front-page .wp-block-cover:first-of-type h1,
body.home main .wp-block-cover:first-child h1,
body.front-page main .wp-block-cover:first-child h1,
body.home .wp-block-post-content > .wp-block-cover:first-child h1,
body.front-page .wp-block-post-content > .wp-block-cover:first-child h1 {
  max-width: 1050px !important;
  margin: 0 auto 24px !important;
  padding: 0 !important;
  font-size: clamp(3rem, 4.15vw, 4.35rem) !important;
  line-height: 1.12 !important;
  letter-spacing: -0.02em !important;
  overflow: visible !important;
  text-wrap: balance;
}

body.home .wp-block-cover:first-of-type p,
body.front-page .wp-block-cover:first-of-type p,
body.home main .wp-block-cover:first-child p,
body.front-page main .wp-block-cover:first-child p,
body.home .wp-block-post-content > .wp-block-cover:first-child p,
body.front-page .wp-block-post-content > .wp-block-cover:first-child p {
  max-width: 1080px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: clamp(1rem, 1.55vw, 1.25rem) !important;
  line-height: 1.45 !important;
}

/* Interior covers stay shorter and consistent. */
body:not(.home):not(.front-page) main .wp-block-cover:first-child,
body:not(.home):not(.front-page) .wp-block-post-content > .wp-block-cover:first-child {
  min-height: 300px !important;
  padding-top: 50px !important;
  padding-bottom: 50px !important;
}

body:not(.home):not(.front-page) main .wp-block-cover:first-child h1,
body:not(.home):not(.front-page) .wp-block-post-content > .wp-block-cover:first-child h1 {
  font-size: clamp(2.6rem, 4.2vw, 4.25rem) !important;
  line-height: 1.1 !important;
}

@media (max-width: 900px) {
  body.home .wp-block-cover:first-of-type,
  body.front-page .wp-block-cover:first-of-type,
  body.home main .wp-block-cover:first-child,
  body.front-page main .wp-block-cover:first-child {
    min-height: 500px !important;
    padding-top: 72px !important;
    padding-bottom: 72px !important;
  }
  body.home .wp-block-cover:first-of-type h1,
  body.front-page .wp-block-cover:first-of-type h1,
  body.home main .wp-block-cover:first-child h1,
  body.front-page main .wp-block-cover:first-child h1 {
    font-size: clamp(2.45rem, 7vw, 3.75rem) !important;
  }
}
