/* Folder Preview Visualizer — Styles */

.folder-preview-visualizer {
  margin-bottom: var(--spacing-xl, 2rem);
}

.folder-preview__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}

.folder-preview__item {
  border-bottom: 1px solid var(--border-color, rgba(0,0,0,0.08));
}

.folder-preview__link {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 0.25em;
  text-decoration: none;
  color: var(--link-color, #914c9a);
  font-weight: 500;
  transition: color 0.12s;
}

.folder-preview__link:hover {
  color: var(--accent-dark, #6b2f75);
}

.folder-preview__icon {
  width: 1.1em;
  height: 1.1em;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 0;
}

.folder-preview__empty {
  color: var(--text-light);
  font-style: italic;
}

/* --- Cards layout (default) --- */
.fp-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.fp-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-radius: 0.5rem;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.fp-card__img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--card-bg, #f4f2f8);
}

.fp-card__img-wrap--placeholder {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-color, #9b6dff) 18%, var(--bg-color, #ece8f4) 82%) 0%,
    var(--bg-color, #ece8f4) 100%
  );
}

.fp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-card__body {
  padding: 0.75rem 1rem 1rem;
  flex: 1;
}

/* fp-card__title: small identifier label above the headline.
   Themes override color/size in their visualizer CSS override file. */
.fp-card__title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-color, #333);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

/* fp-card__subtitle: main catching headline, shown when the page has a ## subtitle.
   Themes override in their visualizer CSS override file. */
.fp-card__subtitle {
  display: block;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-color, #1a1a1a);
  margin: 0 0 0.5rem;
}

/* --- Bubbles layout (MELT theme / scatter mode) --- */
.fp-bubbles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px 24px 60px;
  align-items: flex-start;
}

.fp-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  text-align: center;
  padding: 16px;
  cursor: pointer;
  flex-shrink: 0;
  /* Light blue-lavender glassmorphism — fades at edges */
  background: radial-gradient(
    circle at 40% 32%,
    rgba(190, 210, 248, 0.52) 0%,
    rgba(165, 185, 232, 0.32) 55%,
    transparent 100%
  );
  box-shadow: 0 8px 32px rgba(80, 60, 140, 0.2);
  -webkit-mask-image: radial-gradient(circle, black 50%, transparent 80%);
  mask-image: radial-gradient(circle, black 50%, transparent 80%);
  transition: transform 0.2s ease;
}

.fp-bubble:hover {
  transform: scale(1.06);
  -webkit-mask-image: radial-gradient(circle, black 60%, transparent 86%);
  mask-image: radial-gradient(circle, black 60%, transparent 86%);
}

.fp-bubble__type {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Both bubble layouts render a light/translucent fill (glassmorphism gradient here, or the
     page background showing through on .fp-marble below) — hardcoded white was illegible on
     light themes. Token-driven so each theme's own text color applies (dark-on-light themes
     get dark text, dark-background themes still get their own light --text-color). */
  color: var(--text-light, rgba(0, 0, 0, 0.55));
  margin-bottom: 5px;
  pointer-events: none;
}

.fp-bubble__title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-color, #1a1a1a);
  line-height: 1.3;
  pointer-events: none;
}

@media (max-width: 480px) {
  .fp-bubble {
    width: 110px !important;
    height: 110px !important;
    margin-top: 0 !important;
  }
  .fp-bubbles { gap: 12px; }
}

/* --- Marbles layout --- */
.fp-marbles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 20px 24px 60px;
  align-items: flex-start;
}

.fp-marble {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  cursor: grab;
  border-radius: 50%;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.fp-marble--dragging {
  cursor: grabbing;
  z-index: 100;
}

.fp-marble__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0.38;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.fp-marble__title {
  position: relative;
  z-index: 1;
  /* .fp-marble has no background of its own — the marble.png texture sits at 38% opacity over
     whatever the page background shows through, so hardcoded white was illegible on light
     themes. Token-driven (see .fp-bubble__title above for the same fix + rationale); shadow
     flipped from dark to a light halo so it still adds contrast now that the text is dark. */
  color: var(--text-color, #1a1a1a);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0 14px;
  text-shadow: 0 1px 6px rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

@media (max-width: 480px) {
  .fp-marble {
    width: 110px !important;
    height: 110px !important;
    margin-top: 0 !important;
  }
  .fp-marbles { gap: 10px; }
}

/* --- SEO card grid (seo: true) --- */

.fp-seo-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm, 1rem);
}

.fp-search-input {
  width: 100%;
  padding: 0.6em 0.9em;
  border: 1px solid var(--border-color, rgba(0,0,0,0.15));
  border-radius: var(--border-radius, 6px);
  font-family: var(--font-body, sans-serif);
  font-size: 1rem;
  color: var(--text-color, #333);
  background: var(--bg-color, #fff);
  box-sizing: border-box;
}

.fp-search-input:focus {
  outline: 2px solid var(--accent-color, #555);
  outline-offset: 1px;
  border-color: transparent;
}

.fp-filter-placeholder {
  /* reserved for filter chips — empty for now */
  min-height: 0;
}

.fp-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md, 1.5rem);
}

.fp-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-color, #333);
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0,0,0,0.1));
  border-radius: var(--border-radius, 6px);
  overflow: hidden;
  transition: box-shadow 0.15s, transform 0.15s;
}

.fp-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.fp-card[hidden] {
  display: none;
}

.fp-card__image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--border-color, rgba(0,0,0,0.06));
  flex-shrink: 0;
}

.fp-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-card__image-wrap--placeholder {
  background: linear-gradient(
    135deg,
    var(--border-color, rgba(0,0,0,0.06)) 0%,
    transparent 100%
  );
}

.fp-card__body {
  padding: var(--spacing-sm, 1rem);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.fp-card__title {
  font-family: var(--font-heading, sans-serif);
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-color, #333);
  line-height: 1.35;
}

/* One field per line, kept tight. Mirrors collection/styles.css — this file
   loads later, so a divergence here silently overrides that one. */
.fp-card__fields {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.25rem;
}

.fp-field {
  display: inline-flex;
  gap: 0.25em;
  font-size: 0.78rem;
  line-height: 1.4;
}

.fp-field__label {
  font-weight: 600;
  color: var(--accent-color, #555);
}

.fp-field__label::after {
  content: ":";
}

.fp-field__value {
  color: var(--text-color, #555);
  opacity: 0.8;
}

/* Card column ladder: 3 desktop -> 2 tablet -> 1 phone.
   Must stay in sync with the identical ladder in collection/styles.css. This
   file loads LATER (alphabetical), so any step declared there but missing here
   is overridden and silently never applies — which is exactly how the phone
   step was lost: collection declared `560px -> 1fr`, this file stopped at
   `900px -> 2`, and AE shipped 2 cards at 132px wide on a 360px phone.
   Guarded by tests/card-layout.test.js, which loads BOTH stylesheets.
   Keep the explicit repeat(N, 1fr) ladder — auto-fill/auto-fit would make the
   column count a function of available width and reintroduce 3-up on phones
   the moment a container gets wider. */
@media (max-width: 900px) {
  .fp-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .fp-cards { grid-template-columns: 1fr; }
}
