/* ════════════════════════════════════════════════════
   GALLERY CARDS — gallery-cards.css
   Homepage view + Taxonomy term pages
   ════════════════════════════════════════════════════ */

/* ── GRID WRAPPER ── */
.rec-galleries-block,
.cards-by-girl,
.all-cards-page,
.taxonomy-cards-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem 1rem;
  max-width: 1280px;
  margin: 0 auto;
}

/* This block's outer wrapper was previously part of the shared grid rule
   above, giving it display:grid + auto-fill/minmax on top of the actual
   card grid (.taxonomy-cards-block) nested one level inside it. Two grid
   sizing algorithms one level apart were fighting each other and
   resolving to a too-narrow width. This wrapper just needs to be a
   normal block that caps/centers the content — the real grid work
   happens on .taxonomy-cards-block below. */
.recommended-galleries,
#block-synnfulgirls-views-block-taxonomy-term-block-1 {
  max-width: 1280px;
  margin: 0 auto;
}
.recommended-galleries {
  margin-top:50px;
}

.recommended-galleries .section-label {
   padding: 1.5rem 1rem 0;
}
/* .taxonomy-cards-block renders in a narrower part of the page (sidebar/
   related-content widget), so auto-fill/minmax(220px) previously couldn't
   fit a second column there — that was a symptom of the outer-wrapper
   conflict above, not a real space constraint. Now that the outer
   wrapper no longer competes with it, auto-fill/minmax sizes correctly. */
.rec-galleries-block,
.taxonomy-cards-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1.5rem 1rem;
}

/* ── CARD ── */
.recommended-galleries .rec-galleries-block .views-row,
.cards-by-girl .gallery-row,
.all-cards-page .views-row,
.taxonomy-cards-page .views-row,
.taxonomy-cards-block .views-row {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
  /* Image/title/count are position:absolute, so they're removed from flex flow.
     That leaves the two taxonomy fields as the only flex items, which lines
     them up in one row automatically. nowrap + min-width:0 on the fields
     (below) lets them shrink and truncate instead of wrapping/ballooning
     when the card is narrow. */
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0 0.85rem 0.85rem;
}

.recommended-galleries .rec-galleries-block .views-row:hover,
.cards-by-girl .gallery-row:hover,
.all-cards-page .views-row:hover,
.taxonomy-cards-page .views-row:hover,
.taxonomy-cards-block .views-row:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-3px);
}

/* ── GRADIENT OVERLAY (sits above image, below text) ── */
.recommended-galleries .rec-galleries-block .views-row::after,
.cards-by-girl .views-row::after,
.all-cards-page .views-row::after,
.taxonomy-cards-page .views-row::after,
.taxonomy-cards-block .views-row::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.35) 32%,
    rgba(0, 0, 0, 0) 60%
  );
  pointer-events: none;
  z-index: 1;
}

/* ── COVER IMAGE (fills entire card) ── */
.views-field-field-gallery,
.views-field-field-profile-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.views-field-field-gallery .field-content,
.views-field-field-gallery .field-content a,
.views-field-field-profile-photo .field-content,
.views-field-field-profile-photo .field-content a {
  display: block;
  width: 100%;
  height: 100%;
}

.views-field-field-gallery img,
.views-field-field-profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.35s ease;
}

.views-row:hover .views-field-field-gallery img,
.views-row:hover .views-field-field-profile-photo img {
  transform: scale(1.06);
}

/* ── IMAGE COUNT BADGE (top-left) ── */
/* CSS-only stacked-photos icon drawn with ::before/::after — no font
   dependency, so it can't fail to render like the Material Symbols
   version did (shown as a missing-glyph box). */
.gallery-image-count {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem 0.2rem 1.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
}

.gallery-image-count::before,
.gallery-image-count::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 7px;
  border-radius: 2px;
  border: 1.3px solid #e91e8c;
  box-sizing: border-box;
}

.gallery-image-count::before {
  top: 50%;
  left: 0.5rem;
  margin-top: -5px;
  background: #fff;
  z-index: 1;
}

.gallery-image-count::after {
  top: 50%;
  left: calc(0.5rem + 3px);
  margin-top: -2px;
  background: rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.gallery-image-count-number {
  display: inline-block;
}

/* ── TITLE (overlaid, bottom of image) ── */
.views-field-title {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 2.6rem;
  z-index: 2;
}

.views-field-title .field-content a {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.views-field-title .field-content a:hover {
  color: #f8b9dd;
}

/* ── TAXONOMY PILLS (body-type + one second-field tag, same row) ── */
.views-field-field-body-type,
.views-field-field-style-aesthetic,
.views-field-field-nationality,
.views-field-field-ethnicity {
  /* position:relative + z-index keeps these above the ::after gradient,
     since the gradient is a positioned (z-index:1) layer and would
     otherwise paint over non-positioned flex items. */
  position: relative;
  z-index: 2;
  /* Flex items default to min-width:auto, which blocks shrinking below
     content size and forces wrapping/overflow on narrow cards. This lets
     them shrink properly so the ellipsis rules below can kick in. */
  min-width: 0;
  flex-shrink: 1;
}

.views-field-field-body-type .field-content {
  display: flex;
  min-width: 0;
}

.views-field-field-body-type .field-content a {
  display: inline-block;
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(233, 30, 140, 0.85);
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  transition: background 0.2s;
}

.views-field-field-body-type .field-content a:hover {
  background: #c0237e;
}

.views-field-field-style-aesthetic .field-content,
.views-field-field-nationality .field-content,
.views-field-field-ethnicity .field-content {
  display: flex;
  gap: 0.35rem;
  min-width: 0;
}

/* Show only the first tag to match the single-pill look */
.views-field-field-style-aesthetic .field-content a,
.views-field-field-nationality .field-content a,
.views-field-field-ethnicity .field-content a {
  display: inline-block;
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 0.7rem;
  font-weight: 700;
  color: #e91e8c;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  transition: background 0.2s, color 0.2s;
}

.views-field-field-style-aesthetic .field-content a:hover,
.views-field-field-nationality .field-content a:hover,
.views-field-field-ethnicity .field-content a:hover {
  background: #e91e8c;
  color: #fff;
}

.views-field-field-style-aesthetic .field-content a:not(:first-child),
.views-field-field-nationality .field-content a:not(:first-child),
.views-field-field-ethnicity .field-content a:not(:first-child) {
  display: none;
}

/* ── TAXONOMY PAGE: hide feed icon + header ── */
.feed-icon {
  display: none;
}

.views-element-container header {
  display: none;
}

/* ════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .all-cards-page,
  .taxonomy-cards-page,
  .taxonomy-cards-block {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  .all-cards-page,
  .taxonomy-cards-page,
  .taxonomy-cards-block {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding: 0.75rem 0.65rem;
  }

  .views-field-title .field-content a {
    font-size: 0.82rem;
  }

  .views-field-title {
    bottom: 2.3rem;
  }

  .views-field-field-style-aesthetic .field-content a,
  .views-field-field-nationality .field-content a,
  .views-field-field-ethnicity .field-content a {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
  }

  .gallery-image-count {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
}