/* Permits2Go blog index (/blog) for the Nexsas "automation-saas" theme: the
   search field, the topic filters, the featured card and the no-results
   state, built from the theme's own tokens like article.css. The filtering
   itself is /ns/assets/blog-search.js. Loaded after article.css. */

/* Search + topic filters, under the hero copy */
.p2g-finder {
  max-width: 900px;
  margin-inline: auto;
  padding-top: calc(var(--spacing) * 3);
}

.p2g-search {
  position: relative;
  max-width: 640px;
  margin-inline: auto;
}

.p2g-search-icon {
  position: absolute;
  top: 50%;
  left: 22px;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: color-mix(in oklab, var(--color-secondary) 50%, transparent);
  pointer-events: none;
}

.p2g-search input {
  width: 100%;
  height: 60px;
  padding: 0 60px 0 54px;
  border: 1px solid var(--color-stroke-3);
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 18px 40px -24px rgba(110, 52, 146, 0.45);
  font-family: var(--font-inter-tight);
  /* 16px or larger, or iOS zooms the page when the field is focused. */
  font-size: var(--text-tagline-1);
  color: var(--color-secondary);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.p2g-search input::placeholder {
  color: color-mix(in oklab, var(--color-secondary) 50%, transparent);
}

/* The clear button only shows once there is text, so an empty field can give
   its room to the placeholder on a narrow phone. */
.p2g-search input:placeholder-shown {
  padding-right: 24px;
}

.p2g-search input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-primary-500) 16%, transparent);
}

/* The field has its own clear button; hide the browser's. */
.p2g-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.p2g-search-clear {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border-radius: 9999px;
  background: var(--color-background-3);
  color: var(--color-secondary);
  cursor: pointer;
  transition: background-color .2s ease;
}

.p2g-search-clear:hover {
  background: var(--color-stroke-3);
}

.p2g-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--spacing) * 2);
  margin-top: calc(var(--spacing) * 5);
}

.p2g-topic {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--spacing) * 1.5);
  padding: 7px 14px;
  border: 1px solid var(--color-stroke-3);
  border-radius: 9999px;
  background: #fff;
  font-family: var(--font-inter-tight);
  font-size: var(--text-tagline-2);
  line-height: 150%;
  color: var(--color-secondary);
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.p2g-topic:hover {
  border-color: color-mix(in oklab, var(--color-secondary) 45%, transparent);
}

.p2g-topic[aria-pressed="true"] {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
}

.p2g-topic-count {
  font-size: var(--text-tagline-3);
  color: color-mix(in oklab, currentColor 60%, transparent);
}

.p2g-topic:focus-visible,
.p2g-search-clear:focus-visible,
.p2g-search-reset:focus-visible,
.p2g-empty button:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* One line under the filters saying what is showing, with a way back. It
   keeps its height while empty so the page does not jump as it fills. */
.p2g-search-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0 calc(var(--spacing) * 3);
  min-height: 1.5rem;
  margin-top: calc(var(--spacing) * 4);
}

.p2g-search-summary p {
  font-size: var(--text-tagline-2);
  line-height: 150%;
  color: color-mix(in oklab, var(--color-background-14) 60%, transparent);
}

.p2g-search-reset {
  font-size: var(--text-tagline-2);
  line-height: 150%;
  font-weight: 500;
  color: var(--color-primary-500);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Results. The sections keep a fixed-header's worth of room above them when
   scrolled to. */
.p2g-blog-results {
  padding-top: calc(var(--spacing) * 12);
  scroll-margin-top: 110px;
}

@media (min-width: 48rem) {
  .p2g-blog-results {
    padding-top: calc(var(--spacing) * 16);
  }
}

#licence-guides {
  scroll-margin-top: 110px;
}

/* While a search is on, the directory follows the matching articles closely
   instead of a full section's gap below them, and the hub links step aside. */
.p2g-blog[data-searching] #licence-guides {
  padding-top: calc(var(--spacing) * 16);
}

.p2g-blog[data-searching] .p2g-blog-hubs {
  display: none;
}

/* A directory count reads "(2 of 10)" during a search; keep it on one line. */
.p2g-blog .licence-directory .text-muted {
  white-space: nowrap;
}

/* Featured card: the listing card at full width, with a soft brand wash. */
.p2g-card.p2g-card-featured {
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(110, 52, 146, 0.1) 0%, rgba(110, 52, 146, 0) 55%),
    #fff;
}

@media (min-width: 48rem) {
  .p2g-card.p2g-card-featured {
    padding: calc(var(--spacing) * 12);
  }
}

.p2g-card.p2g-card-featured .p2g-card-title {
  font-size: var(--text-heading-5);
  line-height: var(--text-heading-5--line-height);
}

@media (min-width: 48rem) {
  .p2g-card.p2g-card-featured .p2g-card-title {
    font-size: var(--text-heading-4);
    line-height: var(--text-heading-4--line-height);
  }
}

.p2g-card.p2g-card-featured .p2g-card-excerpt {
  max-width: 760px;
  font-size: var(--text-tagline-1);
}

.p2g-badge.p2g-badge-dark {
  background: var(--color-secondary);
  color: #fff;
}

/* No results */
.p2g-empty {
  max-width: 640px;
  margin-inline: auto;
  padding: calc(var(--spacing) * 12) calc(var(--spacing) * 6);
  border-radius: 20px;
  background: #fff;
  text-align: center;
}

.p2g-empty h3 {
  font-size: var(--text-heading-6);
  line-height: var(--text-heading-6--line-height);
  font-weight: 500;
}

.p2g-empty p {
  margin-top: calc(var(--spacing) * 3);
  font-size: var(--text-tagline-1);
  line-height: 160%;
}

.p2g-empty a {
  color: var(--color-primary-500);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.p2g-empty button {
  margin-top: calc(var(--spacing) * 6);
  padding: 10px 22px;
  border-radius: 9999px;
  background: var(--color-secondary);
  font-size: var(--text-tagline-2);
  color: #fff;
  cursor: pointer;
}

/* Links to the two hub pages under the article cards */
.p2g-blog-hubs {
  margin-top: calc(var(--spacing) * 10);
  text-align: center;
  font-size: var(--text-tagline-2);
  line-height: 170%;
  color: color-mix(in oklab, var(--color-background-14) 60%, transparent);
}

.p2g-blog-hubs a {
  color: var(--color-primary-500);
  text-decoration: underline;
  text-underline-offset: 3px;
}
