/**
 * AI Prompt Library listing + cards.
 *
 * @package Innov8th
 */

.ai-prompt-library-main,
.ai-prompt-single-main {
  overflow: visible;
}

.ai-prompt-library-main .page-brand-hero,
.ai-prompt-single-main .page-brand-hero {
  padding-bottom: 0.75rem;
  overflow: visible;
}

.ai-prompt-library-main .page-brand-hero__blur,
.ai-prompt-single-main .page-brand-hero__blur {
  opacity: 0.9;
  transform: scale(1.08);
}

.ai-prompt-library-main .page-brand-hero__blur2,
.ai-prompt-single-main .page-brand-hero__blur2 {
  opacity: 0.9;
}

.ai-prompt-library-main .page-brand-hero__inner {
  max-width: 40rem;
}

.ai-prompt-library {
  position: relative;
  padding: 1.25rem 0 6.5rem;
  scroll-margin-top: 6rem;
  overflow: visible;
}

.ai-prompt-library__blur,
.ai-prompt-library__blur2,
.ai-prompt-single__wash,
.ai-prompt-single__wash2 {
  pointer-events: none;
  z-index: 0;
}

.ai-prompt-features {
  position: relative;
  z-index: 1;
  margin: 0 0 2.75rem;
}

.ai-prompt-features__swiper {
  overflow: hidden;
  cursor: grab;
}

.ai-prompt-features__swiper:active {
  cursor: grabbing;
}

.ai-prompt-features__swiper .swiper-slide {
  height: auto;
}

.ai-prompt-feature {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.ai-prompt-feature__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(160deg, rgba(102, 33, 146, 0.45), rgba(8, 4, 14, 0.92));
  isolation: isolate;
  transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.ai-prompt-feature:hover .ai-prompt-feature__media {
  border-color: rgba(255, 0, 184, 0.4);
}

.ai-prompt-feature__media img,
.ai-prompt-feature__placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-prompt-feature:hover .ai-prompt-feature__media img {
  transform: scale(1.04);
}

.ai-prompt-feature__placeholder {
  background:
    radial-gradient(80% 70% at 80% 20%, rgba(255, 0, 184, 0.28), transparent 55%),
    linear-gradient(160deg, rgba(102, 33, 146, 0.5), rgba(8, 4, 14, 0.92));
}

.ai-prompt-feature__kicker {
  margin: 0;
  font-family: "gri", sans-serif;
  font-size: clamp(0.82rem, 1.15vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-prompt-feature__copy {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0 0.1rem;
}

.ai-prompt-feature__title {
  margin: 0;
  font-family: "gri", sans-serif;
  font-size: clamp(0.82rem, 1.05vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-prompt-feature__subtitle {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.68);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-prompt-features__nav {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
  z-index: 2;
  pointer-events: none;
}

.ai-prompt-features__nav[hidden] {
  display: none !important;
}

.ai-prompt-features__btn {
  position: absolute;
  top: clamp(5.6rem, 11vw, 8.8rem);
  transform: translateY(-50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 5, 18, 0.72);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ai-prompt-features__btn:hover {
  border-color: rgba(255, 0, 184, 0.55);
  background: rgba(255, 0, 184, 0.2);
}

.ai-prompt-features__btn:focus-visible {
  outline: 2px solid #ff00b8;
  outline-offset: 3px;
}

.ai-prompt-features__btn[data-feature-prev] {
  left: 0.35rem;
}

.ai-prompt-features__btn[data-feature-next] {
  right: 0.35rem;
}

.ai-prompt-browse {
  position: relative;
  z-index: 1;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  scroll-margin-top: 6.5rem;
}

.ai-prompt-layout {
  display: grid;
  grid-template-columns: 16.25rem minmax(0, 1fr);
  grid-template-areas: "sidebar results";
  column-gap: 2rem;
  align-items: start;
}

.ai-prompt-layout:not(:has(.ai-prompt-sidebar)) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "results";
}

.ai-prompt-filter-dock {
  grid-area: sidebar;
}

.ai-prompt-filters-bar {
  display: none;
}

.ai-prompt-sidebar {
  position: sticky;
  top: 6.5rem;
}

.ai-prompt-results__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1.15rem;
  min-width: 0;
}

.ai-prompt-results {
  grid-area: results;
  min-width: 0;
}

.ai-prompt-sidebar__block {
  padding: 0 0 1.15rem;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 5, 18, 0.5);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
}

.ai-prompt-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  padding: 1.05rem 1.1rem;
  background:
    linear-gradient(135deg, rgba(255, 0, 184, 0.28) 0%, rgba(102, 33, 146, 0.35) 100%);
  border-bottom: 1px solid rgba(255, 0, 184, 0.28);
}

.ai-prompt-sidebar__title {
  margin: 0;
  font-family: "gri", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  color: #fff;
}

.ai-prompt-sidebar__clear {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.ai-prompt-sidebar__clear:hover {
  color: #fff;
}

.ai-prompt-sidebar__clear[hidden],
.ai-prompt-library__empty[hidden] {
  display: none !important;
}

.ai-prompt-sidebar__group {
  display: block;
  margin: 0 1.05rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.ai-prompt-sidebar__group + .ai-prompt-sidebar__group {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-prompt-sidebar__label {
  display: block;
  width: 100%;
  margin: 0 0 0.5rem;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: rgba(255, 255, 255, 0.92);
  cursor: default;
  list-style: none;
}

.ai-prompt-sidebar__label::-webkit-details-marker,
.ai-prompt-sidebar__label::marker {
  display: none;
  content: "";
}

@media (min-width: 993px) {
  .ai-prompt-sidebar__group .ai-prompt-sidebar__list {
    display: flex !important;
    flex-direction: column;
  }

  .ai-prompt-sidebar__label {
    pointer-events: none;
  }
}

.ai-prompt-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.ai-prompt-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.38rem 0.45rem;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 400;
  user-select: none;
}

.ai-prompt-check:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.ai-prompt-check__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.ai-prompt-check__box {
  flex: 0 0 1.02rem;
  width: 1.02rem;
  height: 1.02rem;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
  position: relative;
}

.ai-prompt-check__box::after {
  content: "";
  position: absolute;
  left: 0.26rem;
  top: 0.06rem;
  width: 0.3rem;
  height: 0.52rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  opacity: 0;
}

.ai-prompt-check__input:checked + .ai-prompt-check__box {
  border-color: #ff00b8;
  background: #ff00b8;
}

.ai-prompt-check__input:checked + .ai-prompt-check__box::after {
  transform: rotate(45deg) scale(1);
  opacity: 1;
}

.ai-prompt-check__input:focus-visible + .ai-prompt-check__box {
  outline: 2px solid #ff00b8;
  outline-offset: 3px;
}

.ai-prompt-check:has(.ai-prompt-check__input:checked) {
  color: #fff;
  background: rgba(255, 0, 184, 0.1);
}

.ai-prompt-check__text {
  min-width: 0;
  line-height: 1.3;
}

.ai-prompt-results__title {
  margin: 0;
  font-family: "gri", sans-serif;
  font-size: clamp(1.30rem, 2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
  min-width: 0;
  line-height: 1.2;
}

.ai-prompt-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.ai-prompt-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  padding: 8px;
  text-decoration: none;
  color: inherit;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 8, 24, 0.55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  overflow: hidden;
  transition: transform 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.ai-prompt-card:hover {
  border-color: rgba(255, 0, 184, 0.4);
}

.ai-prompt-card:focus-visible {
  outline: 2px solid #ff00b8;
  outline-offset: 4px;
}

.ai-prompt-card.is-filtered-out,
.ai-prompt-card.is-page-hidden {
  display: none;
}

.ai-prompt-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(102, 33, 146, 0.45), rgba(8, 4, 14, 0.9));
}

.ai-prompt-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-prompt-card:hover .ai-prompt-card__media img {
  transform: scale(1.05);
}

.ai-prompt-card__media--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  background:
    radial-gradient(80% 70% at 80% 20%, rgba(255, 0, 184, 0.22), transparent 55%),
    linear-gradient(160deg, rgba(102, 33, 146, 0.5), rgba(8, 4, 14, 0.92));
}

.ai-prompt-card__glyph {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(255, 95, 206, 0.9);
}

.ai-prompt-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  padding: 0.9rem 0.7rem 0.75rem;
}

.ai-prompt-card__title {
  margin: 0;
  font-family: "gri", sans-serif;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.28;
  font-weight: 500;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-prompt-card__excerpt {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.68);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-prompt-card__tags-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 0.65rem 0.65rem 1.35rem;
  pointer-events: none;
}

.ai-prompt-card__tags-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 4, 14, 0.7) 0%, rgba(8, 4, 14, 0.22) 62%, transparent 100%);
}

.ai-prompt-card__tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-prompt-card__tags li,
.ai-prompt-single__tags li {
  padding: 0.26rem 0.62rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(8, 4, 14, 0.35);
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-prompt-single__tags li {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.88);
}

.ai-prompt-card__tags-more {
  opacity: 0.72;
}

.ai-prompt-library__empty {
  margin: 1.25rem 0 0;
  padding: 1.5rem 1.25rem;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 1rem;
}

.ai-prompt-pagination {
  margin-top: 2.25rem;
}

.ai-prompt-pagination[hidden] {
  display: none !important;
}

.ai-prompt-pagination ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-prompt-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ai-prompt-pagination .page-numbers:hover,
.ai-prompt-pagination .page-numbers:focus-visible {
  border-color: rgba(255, 0, 184, 0.4);
  background: rgba(255, 0, 184, 0.1);
  color: #fff;
}

.ai-prompt-pagination .page-numbers.current {
  border-color: rgba(255, 0, 184, 0.55);
  background: rgba(255, 0, 184, 0.18);
  color: #fff;
  cursor: default;
}

@media (max-width: 1200px) {
  .ai-prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 992px) {
  .ai-prompt-features {
    margin-bottom: 1.1rem;
  }

  .ai-prompt-browse {
    padding-top: 0.85rem;
    scroll-margin-top: calc(72px + env(safe-area-inset-top, 0px));
  }

  .ai-prompt-layout {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: none;
    column-gap: 0;
    row-gap: 0;
  }

  .ai-prompt-results {
    grid-area: auto;
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .ai-prompt-results__head {
    grid-area: auto;
    margin: 15px 0px 1.75rem;
    padding: 0 7.25rem 0 0;
    min-width: 0;
  }

  .ai-prompt-results__title {
    font-size: 1.12rem;
    white-space: nowrap;
  }

  .ai-prompt-filter-dock {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    grid-area: auto;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    position: sticky;
    top: calc(72px + env(safe-area-inset-top, 0px));
    z-index: 12;
    width: max-content;
    max-width: calc(100vw - 2rem);
    margin: 0;
    padding: 0;
    background: none;
  }

  .ai-prompt-filters-bar {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 0.5rem;
  }

  .ai-prompt-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.48rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 0, 184, 0.38);
    background: rgba(18, 8, 28, 0.88);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .ai-prompt-filters-toggle[aria-expanded="true"] {
    border-color: rgba(255, 0, 184, 0.6);
    background: rgba(255, 0, 184, 0.22);
  }

  .ai-prompt-filters-toggle__count {
    min-width: 1.2rem;
    height: 1.2rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #ff00b8;
    color: #fff;
    font-size: 0.68rem;
    line-height: 1.2rem;
    text-align: center;
  }

  .ai-prompt-filters-toggle__count[hidden],
  .ai-prompt-filters-bar__clear[hidden] {
    display: none !important;
  }

  .ai-prompt-filters-bar__clear {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  .ai-prompt-sidebar {
    grid-area: auto;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: auto;
    display: none;
    margin: 0;
    width: min(20.5rem, calc(100vw - 2rem));
    z-index: 13;
  }

  .ai-prompt-layout.is-filters-open .ai-prompt-sidebar {
    display: block;
  }

  .ai-prompt-sidebar__head {
    display: none;
  }

  .ai-prompt-sidebar__block {
    padding-bottom: 0.85rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }

  .ai-prompt-sidebar__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
    cursor: pointer;
  }

  .ai-prompt-sidebar__label::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    margin-left: 0.5rem;
    border-right: 1.5px solid rgba(255, 255, 255, 0.7);
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.7);
    transform: rotate(45deg);
    transition: transform 160ms ease;
  }

  .ai-prompt-sidebar__group[open] > .ai-prompt-sidebar__label::after {
    transform: rotate(-135deg);
    margin-top: 0.25rem;
  }

  .ai-prompt-sidebar__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.1rem 0.45rem;
    padding-bottom: 0.35rem;
  }

  .ai-prompt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .ai-prompt-features__nav {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .ai-prompt-features {
    margin-bottom: 0.95rem;
  }

  .ai-prompt-grid {
    grid-template-columns: 1fr;
  }

  .ai-prompt-check {
    padding: 0.45rem 0.35rem;
    font-size: 0.86rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-prompt-card,
  .ai-prompt-card__media img,
  .ai-prompt-feature__media,
  .ai-prompt-feature__media img {
    transition: none;
  }

  .ai-prompt-card:hover,
  .ai-prompt-feature:hover .ai-prompt-feature__media {
    transform: none;
  }

  .ai-prompt-card:hover .ai-prompt-card__media img {
    transform: none;
  }
}
