/* ==========================================================================
   Preem Team — Features showcase page
   Clickable category cards, each opening a popup modal (native <dialog>,
   same open/close pattern as the changelog cards — see javascripts/features.js
   and stylesheets/changelog.css for the shared approach) listing that
   category's mods as media+text entries. Keeps the page short and fast to
   scroll instead of every mod's preview clip sitting inline on load.
   ========================================================================== */

.pt-feature-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.pt-feature-category {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5em;
  width: 100%;
  border: 1px solid rgba(0, 246, 255, 0.25);
  border-radius: 0.6rem;
  padding: 1.4em 1.5em;
  background: linear-gradient(180deg, rgba(0, 246, 255, 0.04), rgba(0, 0, 0, 0));
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pt-feature-category:hover,
.pt-feature-category:focus-visible {
  border-color: var(--pt-neon-pink);
  transform: translateY(-2px);
}

.pt-feature-category-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.pt-feature-category-name {
  font-family: var(--md-code-font);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pt-neon-cyan);
}

.pt-feature-category-count {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ---- the popup itself ----
   Wider than the changelog modal (40rem) since each entry inside carries
   a media preview alongside its text, not just a bullet list. */
.pt-feature-modal {
  max-width: 52rem;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid var(--pt-neon-cyan);
  border-radius: 0.6rem;
  padding: 0;
  background: var(--pt-void);
  color: inherit;
  box-shadow: 0 0 32px rgba(0, 246, 255, 0.25);
}

.pt-feature-modal::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(2px);
}

.pt-feature-modal-inner {
  position: relative;
  padding: 1.5em 1.75em;
}

.pt-feature-modal-inner > *:first-child {
  margin-top: 0;
}

.pt-feature-modal-close {
  position: absolute;
  top: 0.6em;
  right: 0.7em;
  width: 2em;
  height: 2em;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
}

.pt-feature-modal-close:hover,
.pt-feature-modal-close:focus-visible {
  opacity: 1;
  color: var(--pt-neon-pink);
}

/* Prev/next controls for stepping between a category's mods one at a
   time (see javascripts/features.js) -- hidden entirely by JS when a
   category only has one mod, since there's nothing to page through. */
.pt-feature-modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.4em;
}

.pt-feature-modal-nav-btn {
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.2em 0.7em;
  border-radius: 0.3rem;
  border: 1px solid rgba(0, 246, 255, 0.35);
  background: rgba(0, 246, 255, 0.08);
  color: inherit;
  cursor: pointer;
}

.pt-feature-modal-nav-btn:hover,
.pt-feature-modal-nav-btn:focus-visible {
  border-color: var(--pt-neon-pink);
}

.pt-feature-modal-nav-count {
  font-size: 0.8rem;
  opacity: 0.7;
  font-family: var(--md-code-font);
}

/* One mod's media + text inside an open category modal. Same left/right
   media+text idea as the old inline .pt-feature layout, just reused here
   at a smaller scale. Only the active entry is ever displayed -- see
   javascripts/features.js -- both so a category with several heavy AVIF
   clips only ever has ONE loaded into the DOM at a time (the others'
   <img> tags carry data-src, not src, until actually paged to) rather
   than loading every clip in the category the moment it's opened, which
   was grinding mobile to a halt on categories with 3-4 entries. */
.pt-feature-modal-entry {
  display: none;
  align-items: center;
  gap: 1.5rem;
  padding: 0.4em 0 1.2em;
}

.pt-feature-modal-entry.pt-feature-modal-entry--active {
  display: flex;
}

.pt-feature-modal-media {
  flex: 0 0 45%;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid rgba(0, 246, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.12);
  background: #0a0a12;
}

/* Two (or more) clips for the same mod — e.g. New Vehicles' Supra +
   Lamborghini — stacked with a gap instead of one wrapping border, since
   each clip gets its own frame rather than reading as one continuous shot. */
.pt-feature-modal-media--stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  border: none;
  box-shadow: none;
  background: none;
  border-radius: 0;
}

.pt-feature-modal-media--stack img {
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 246, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 246, 255, 0.12);
}

.pt-feature-modal-media img {
  display: block;
  width: 100%;
  height: auto;
}

.pt-feature-modal-text {
  flex: 1 1 auto;
  min-width: 0;
}

.pt-feature-modal-text h3 {
  margin: 0 0 0.4em;
}

.pt-feature-caption {
  display: block;
  margin-top: 0.6em;
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.7;
}

/* Stack media above text on narrower screens/viewports, same breakpoint
   the old inline layout used. */
@media screen and (max-width: 76.25em) {
  .pt-feature-modal-entry {
    flex-direction: column;
    align-items: stretch;
  }

  .pt-feature-modal-media {
    flex-basis: auto;
    width: 100%;
  }
}
