/* =============================================
   Shared: Alpha-Index Nav & Sections
   Used by: Glossary, Ingredient Index blocks
   ============================================= */

.entry-content{
  overflow: clip !important
}
/* Sticky nav wrapper */
.alpha-index__sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--wp--preset--color--base);
  padding-top: var(--wp--preset--spacing--15);
  margin-bottom: var(--wp--preset--spacing--05);
  transition: top 0.3s ease;
}

header.scrolled.scrolled--down + main .alpha-index__sticky {
  top: 0;
}
header.scrolled + main .alpha-index__sticky {
  top: 80px;
}

/* Fade rendered below the sticky bar via a pseudo-element */
.alpha-index__sticky::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--wp--preset--spacing--05);
  transform: translateY(100%);
  background: linear-gradient(to bottom, var(--wp--preset--color--base), transparent);
  pointer-events: none;
}

/* Nav */
.alpha-index__page-title {
  margin-top: 0;
  margin-bottom: var(--wp--preset--spacing--05);
}

.alpha-index__nav {
  display: flex;
  flex-wrap: wrap;
  font-size: var(--wp--preset--font-size--small) ;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
}

.alpha-index__nav-item {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  text-decoration: none;
  border-radius:6px;
}
.alpha-index__nav-item:hover{
  background-color: #fff;
}

.alpha-index__nav-item--empty {
  opacity: 0.3;
  pointer-events: none;
}

/* Section */
.alpha-index__section {
  margin-bottom: var(--wp--preset--spacing--05);
}

main{background-position: top center;}

hr{
  margin:3rem 0;
  border:none;
  height: 1px;
  background-color: rgba(0,0,0,0.1);
}
hr.spacer{margin:3rem 0;background-color:transparent;border:none;}

.home .pro-navbar-container .searchwp-form{display: none;}
.searchwp-form{margin-top:0 !important;}
.home main .searchwp-form{font-size:var(--wp--preset--font-size--h-4);border-radius:40px !important}
.home main .searchwp-form .swp-input--search{border-radius:60px !important;}

@media (max-width: 768px) {
  .home main .searchwp-form{font-size:var(--wp--preset--font-size--h-5);}
}

header.wp-block-template-part:not(.scrolled) .has-property-overlay{height:auto;}
header.scrolled .pro-navbar-container{box-shadow:0 0 20px rgba(0,0,0,0.1);}

.pro-navbar-drawer__inner{width:100%}
.pro-navbar-drawer__inner .swp-input--search{margin:auto;}

.wp-block-pluspro-pro-navbar-drawer-trigger{margin-top: 0 !important;}

/* Hide native browser × on search inputs */
input[type=search]::-webkit-search-cancel-button{display:none;}
input[type=search]::-ms-clear{display:none;}

/* Search input container — needed for clear button positioning */
.searchwp-form-input-container{
  position:relative;
}

/* Clear button — hidden until input has a value */
.swp-clear-btn{
  position:absolute;
  left:1em;
  top:50%;
  transform:translateY(-50%);
  display:flex;
  align-items:center;
  justify-content:center;
  width:1.25em;
  height:1.25em;
  padding:0;
  border:none;
  background:transparent;
  color:rgba(0,0,0,0.4);
  font-size:0.9em;
  line-height:1;
  cursor:pointer;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.15s, color 0.15s;
  z-index:1;
}
.swp-clear-btn:hover{color:rgba(0,0,0,0.75);}
.searchwp-form-input-container.has-value .swp-clear-btn{
  opacity:1;
  pointer-events:auto;
}

.swp-input--search.swp-input{
  font: inherit !important;
  padding: calc(0.667em + 2px) calc(1.333em + 2px) !important;
  border-radius: var(--wp--custom--border-radius);
  border:none;
  box-shadow: 0px 0px 1px rgba(0,0,0,0.1);
  transition:0.2s all;
  padding-right: 2.5em !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.swp-input--search.swp-input:focus{
  box-shadow: 0px 0px 10px var(--wp--preset--color--secondary);
  outline:none;
}
/* Shift text right when the clear button is visible */
.searchwp-form-input-container.has-value .swp-input--search.swp-input{
  padding-left: 2.5em !important;
}

form.searchwp-form input.swp-input--search{
  background-size: 1.25em auto !important;
  background-position: right 1em top 50% !important;
}

/* =============================================
   Common Terms: inline info icon + popup
   ============================================= */

.common-term {
  display: inline;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: none;
  vertical-align: baseline;
}

.common-term:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

.common-term__icon {
  display: inline-block;
  margin-left: 0.2em;
  color: var(--wp--preset--color--custom-dark-primary, currentColor);
  line-height: 1;
  pointer-events: none; 
} 
.common-term:hover .common-term__icon {
  color: var(--wp--preset--color--tertiary, currentColor);
}

/* Popup is appended to <body> by JS and positioned via absolute coords */
.common-term__popup {
  position: absolute;
  z-index: 9999;
  min-width: 220px;
  max-width: 340px;
  background: var(--wp--preset--color--contrast, #000);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 1.25rem;
  color: var(--wp--preset--color--base, #fff);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: var(--wp--preset--font-size--small, 0.875em);
  line-height: 1.5;
}

.common-term__popup-close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  border-radius: 50%;
  opacity: 0.7;
}

.common-term__popup-close:hover,
.common-term__popup-close:focus-visible {
  opacity: 1;
  outline: none;
}

.common-term__popup-label {
  display: block;
  margin-bottom: 0.4em;
  font-size: var(--wp--preset--font-size--medium, 0.875em);
  border-bottom:1px solid rgba(255,255,255,0.5);
  padding-bottom: 0.4em;
  padding-right:1em;
}

.common-term__popup-body > :first-child { margin-top: 0; }
.common-term__popup-body > :last-child  { margin-bottom: 0; }

/* this is to hide the emphasized text in the popup but allow it to show on the glossary */
.common-term__popup-body em{display:none;}

.searchwp-live-search-results-showing{
  border-radius: 30px !important;
  box-shadow: 0px 0px 1px rgba(0,0,0,0.1) !important;
  border:none !important;
}

.searchwp-live-search-result--title{
  font-size: var(--wp--preset--font-size--base) !important;
  text-decoration: none !important;
  margin-bottom:0 !important;
}
.searchwp-live-search-result--title a{
  text-decoration: none !important;
  font-size: inherit !important;
  display: block !important;
  padding: 1.2em !important;
  border-radius: 1em;
}
.searchwp-live-search-result--title a:hover{
  background-color: var(--wp--preset--color--base) !important;
}
.searchwp-live-search-result{
  padding:0.8em !important;
}
p.searchwp-live-search-no-results{
  display:none !important;
}
/* Hide results excluded by the non- prefix filter */
.searchwp-live-search-result:has(.searchwp-live-search-result--title a[href=""]),
.searchwp-live-search-result:has(.searchwp-live-search-result--title a:not([href])){
  display:none !important;
}
/* Match attribution label */
.swp-match-label{
  color: var(--wp--preset--color--contrast) ;
  display:block;
  font-size: var(--wp--preset--font-size--small) ;
  margin-top:0.5em;
}
.searchwp-highlight{
  background: color-mix(in srgb, var(--wp--preset--color--secondary) 20%, transparent 80%);
  color:inherit;
  font-style:normal;
  border-radius:3px;
  padding:0 3px;
}

.ingredient-question{position:relative !important;}
.ingredient-question .ginput_container input:not([type="checkbox"]):not([type="radio"]),
.ingredient-question .ginput_container textarea{border-radius:30px !important;border:none !important;padding:1.5em !important ;}
.ingredient-question .ginput_container textarea{padding-bottom:50px !important;}
.ingredient-question .ginput_container input:focus,
.ingredient-question .ginput_container textarea:focus{outline:2px solid var(--wp--preset--color--tertiary) !important;}
.ingredient-question .gform-footer{position:absolute;bottom:8px; right:8px;}
.ingredient-question .gform_button{background-color: var(--wp--preset--color--secondary) !important;}
.ingredient-question .gform_button:hover{background-color: var(--wp--preset--color--tertiary) !important;}