/* FeaturedProducts (fprod) — the home "Featured products" chapter as a
   shared section (Sofia, 2026-08-13). Every rule mirrors index.astro's
   x3-products / x3-prod recipe in x3.css; keep the two in sync when the
   home chapter evolves. Dark ground is explicit here because host pages
   (unlike the home) run bright bodies. */

.fprod {
  background: var(--color-rich-black);
  color: var(--color-white);
}
.fprod__inner {
  margin-inline: auto;
  max-width: var(--container-large);
  padding: var(--space-section-sm) var(--space-inline);
}
@media (min-width: 768px) { .fprod__inner { padding-block: var(--space-section); } }
@media (min-width: 1024px) { .fprod__inner { padding-inline: 24px; } }

.fprod__titlerow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.fprod__title {
  margin-top: 24px;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--track-tighter);
  font-size: 26px;
  line-height: 1.05;
  color: var(--color-white);
}
@media (min-width: 640px) { .fprod__title { font-size: 32px; } }
@media (min-width: 768px) { .fprod__title { font-size: 36px; } }
.fprod__showall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  white-space: nowrap;
}
.fprod__showall:hover { color: var(--color-white); }

.fprod__intro {
  margin-top: 16px;
  max-width: 560px;
  font-size: var(--fs-md);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
  text-wrap: pretty;
}

.fprod__grid {
  margin-top: 40px;
  display: grid;
  gap: 16px;
}

/* § carousel mode — the viewport clips a sliding flex track; the arrows
   in the title row rotate it (behaviors/fprod-carousel.js). Card widths
   keep the grid's 1 / 2 / 3-up rhythm via flex-basis. */
.fprod__viewport { overflow: hidden; }
.fprod__grid--carousel {
  display: flex;
  transition: transform 0.55s var(--ease-out-expo);
}
.fprod__grid--carousel > .fprod__card { flex: 0 0 100%; min-width: 0; }
@media (min-width: 768px) {
  .fprod__grid--carousel > .fprod__card { flex-basis: calc((100% - 16px) / 2); }
}
@media (min-width: 1024px) {
  .fprod__grid--carousel > .fprod__card { flex-basis: calc((100% - 32px) / 3); }
}
@media (prefers-reduced-motion: reduce) {
  .fprod__grid--carousel { transition: none; }
}
.fprod__nav {
  display: inline-flex;
  gap: 10px;
  align-self: center;
}
.fprod__navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: var(--color-white);
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.fprod__navbtn:hover { border-color: rgba(255, 255, 255, 0.55); }
/* minmax(0, 1fr), not bare 1fr: a bare 1fr track can't shrink below its
   content's min width (same guard as the home grid) */
@media (min-width: 768px) { .fprod__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* fixed 3 tracks on desktop even with fewer cards, so every card keeps
   the home chapter's exact proportions */
@media (min-width: 1024px) {
  .fprod__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fprod__visual {
    aspect-ratio: auto;
    height: 300px;
  }
  .fprod__line {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}

.fprod__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s ease, transform 0.5s var(--ease-out-expo);
}
.fprod__card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-4px);
}
.fprod__visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 16 / 8.5;
  min-height: 216px;
  border-radius: 14px;
  overflow: hidden;
  padding: 16px;
}
/* narrow columns: the ratio + min-height pair transfers a 406px min-width
   and bleeds the card off-screen — drop the ratio (home-grid guard) */
@media (max-width: 1023px) {
  .fprod__visual { aspect-ratio: auto; }
}
/* per-product aurora tiles — same token blues as the home hero blobs */
.fprod__visual--1 {
  background:
    radial-gradient(120% 95% at 12% 0%, color-mix(in oklab, var(--color-x3-blue-deep) 80%, transparent), transparent 62%),
    radial-gradient(110% 100% at 92% 100%, color-mix(in oklab, var(--color-x3-indigo) 65%, transparent), transparent 65%),
    color-mix(in oklab, var(--color-black) 86%, var(--color-x3-blue-deep));
}
.fprod__visual--2 {
  background:
    radial-gradient(120% 95% at 88% 0%, color-mix(in oklab, var(--color-x3-blue-bright) 70%, transparent), transparent 62%),
    radial-gradient(110% 100% at 8% 100%, color-mix(in oklab, var(--color-x3-blue-deep) 60%, transparent), transparent 65%),
    color-mix(in oklab, var(--color-black) 86%, var(--color-x3-blue-bright));
}
.fprod__visual--3 {
  background:
    radial-gradient(120% 95% at 15% 100%, color-mix(in oklab, var(--color-x3-indigo) 75%, transparent), transparent 62%),
    radial-gradient(110% 100% at 90% 5%, color-mix(in oklab, var(--color-blue) 45%, transparent), transparent 65%),
    color-mix(in oklab, var(--color-black) 86%, var(--color-x3-indigo));
}
.fprod__visual--4 {
  background:
    radial-gradient(120% 95% at 85% 100%, color-mix(in oklab, var(--color-x3-blue-deep) 70%, transparent), transparent 62%),
    radial-gradient(110% 100% at 10% 0%, color-mix(in oklab, var(--color-x3-blue-bright) 50%, transparent), transparent 65%),
    color-mix(in oklab, var(--color-black) 88%, var(--color-blue));
}
.fprod__meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fprod__pill {
  border: 1px solid rgba(204, 225, 255, 0.3);
  /* solid ink, not alpha glass: static contrast checkers can't resolve an
     alpha background (WCAG 1.4.3, a11y audit 2026-08-05) */
  background: var(--color-black);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--track-wider);
  color: var(--color-blue-200);
}
/* big product glyph — in flow between the pill row and the title block,
   centering in the tile's FREE space (home recipe) */
.fprod__glyph {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fprod__glyph-icon {
  width: 32px;
  height: 32px;
  -webkit-mask-size: contain;
  mask-size: contain;
  color: rgba(255, 255, 255, 0.9);
  transition: transform 0.5s var(--ease-out-expo);
}
.fprod__card:hover .fprod__glyph-icon { transform: scale(1.08); }
.fprod__id {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fprod__name {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: var(--track-tighter);
  font-size: var(--fs-3xl);
  line-height: 1.1;
  color: var(--color-white);
}
@media (min-width: 640px) { .fprod__name { font-size: 24px; } }
.fprod__line {
  font-size: var(--fs-xs);
  letter-spacing: var(--track-wide);
  line-height: var(--leading-snug);
  color: rgba(255, 255, 255, 0.65);
}
/* single-line description on desktop cards */
@media (min-width: 768px) {
  .fprod__line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
/* footer row: tags left, arrow right */
.fprod__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-inline: 8px;
  flex: 1;
}
.fprod__arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-black);
  transition: transform 0.3s ease;
}
.fprod__card:hover .fprod__arrow { transform: translate(2px, -2px); }
.fprod__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fprod__tag {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  font-size: var(--fs-xs);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .fprod__card,
  .fprod__glyph-icon,
  .fprod__arrow { transition: none !important; }
}
