/* Community Picks Section */
.community-picks-section {
  padding: 4rem 2rem;
  background: linear-gradient(180deg, #F8F9FA 0%, #FFFFFF 100%);
  position: relative;
}

.community-picks-section .container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Section Header */
.community-picks-section .section-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.community-picks-section .section-title {
  font-family: 'Roboto Slab', serif;
  font-size: 30px;
  font-weight: 600;
  font-style: normal;
  color: #2C3E50;
  margin-bottom: 0.5rem;
  margin-top: 0;
  line-height: 100%;
  letter-spacing: 0%;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

/* Community Picks Grid */
.community-picks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Community Pick Wrapper - Vertical Fan Container */
.community-pick-wrapper {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* Define fixed height to prevent layout collapse with absolute positioning */
  min-height: 400px;
  /* Maintain aspect ratio based on book cover dimensions */
  aspect-ratio: 244 / 358;
  /* Enable 3D transforms */
  perspective: 1200px;
  /* Minimal padding - cards stay tightly grouped */
  padding: 0 1.5rem;
}

/* Community Pick Card - Center Card (Main) with Counter-Tilt */
.community-pick-card {
  /* Absolute positioning for layering control */
  position: absolute;
  bottom: 0;
  left: 50%;
  /* Straighten the card - no rotation */
  transform: translateX(-50%) rotateZ(0deg);
  /* Card dimensions */
  width: 100%;
  max-width: 244px;
  /* Styling */
  display: block;
  text-decoration: none;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  /* Shadow for depth */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  /* Highest z-index - appears on top */
  z-index: 10;
  /* Transform origin at bottom center for fanning effect */
  transform-origin: bottom center;
  /* Playful "back" easing with slight overshoot */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Main Card Hover State - Subtle lift with no rotation */
.community-pick-wrapper:hover .community-pick-card {
  /* Minimal lift, keep straight, slight scale */
  transform: translateX(-50%) translateY(-8px) rotateZ(0deg) scale(1.03);
  /* Enhanced shadow when lifted */
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Pick Card Image */
.community-pick-card .pick-card-image {
  width: 100%;
  height: auto;
  aspect-ratio: 244 / 358;
  object-fit: cover;
  display: block;
}

.community-pick-card .pick-card-placeholder {
  width: 100%;
  aspect-ratio: 244 / 358;
  background: linear-gradient(135deg, #E0E0E0 0%, #F5F5F5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
}

/* Book Wings - Shared Styles (Vertical Fan Effect) */
.book-wing {
  /* Absolute positioning - stacked behind center card */
  position: absolute;
  bottom: 0;
  left: 50%;
  /* Same size as main card */
  width: 100%;
  max-width: 244px;
  height: auto;
  /* COMPLETELY HIDDEN by default - invisible until hover */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* Behind the main card */
  z-index: 5;
  /* Transform origin at bottom center - cards pivot from bottom */
  transform-origin: bottom center;
  /* Playful "back" easing creates slight overshoot/bounce */
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-wing img,
.book-wing .wing-placeholder {
  width: 100%;
  height: auto;
  aspect-ratio: 244 / 358;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.book-wing .wing-placeholder {
  background: linear-gradient(135deg, #BDBDBD 0%, #E0E0E0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 12px;
}

/* Left Wing - Initial State (The "Hidden Stack") */
.book-wing-left {
  /* Perfectly centered and hidden behind main card */
  transform: translateX(-50%) rotateZ(0deg) translateY(0);
  /* Base shadow (invisible initially due to opacity: 0) */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Left Wing Hover State - The "Vertical Fan" Emerges */
.community-pick-wrapper:hover .book-wing-left {
  /* Become visible with playful pop */
  opacity: 1;
  visibility: visible;
  /* Vertical fan: slight left rotation (-10deg), move left (-20%), RISE UP (-50px) */
  transform: translateX(-50%) translateX(-20%) rotateZ(-10deg) translateY(-50px);
  /* Intensified shadow - casts darkness onto card behind */
  box-shadow: 3px 6px 16px rgba(0, 0, 0, 0.28);
}

/* Right Wing - Initial State (The "Hidden Stack") */
.book-wing-right {
  /* Perfectly centered and hidden behind main card */
  transform: translateX(-50%) rotateZ(0deg) translateY(0);
  /* Base shadow (invisible initially due to opacity: 0) */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Right Wing Hover State - The "Vertical Fan" Emerges */
.community-pick-wrapper:hover .book-wing-right {
  /* Become visible with playful pop */
  opacity: 1;
  visibility: visible;
  /* Vertical fan: slight right rotation (10deg), move right (20%), RISE UP (-50px) */
  transform: translateX(-50%) translateX(20%) rotateZ(10deg) translateY(-50px);
  /* Intensified shadow - casts darkness onto card behind */
  box-shadow: -3px 6px 16px rgba(0, 0, 0, 0.28);
}

/* No Picks Message */
.community-picks-section .no-picks {
  text-align: center;
  font-family: 'Roboto Slab', serif;
  font-size: 18px;
  color: #999;
  padding: 3rem;
  grid-column: 1 / -1;
}

/* Decorative Elements */
/* Removed gradient line above section */

/* Responsive Design */
@media (max-width: 1024px) {
  .community-picks-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  /* Adjust wrapper height for medium screens */
  .community-pick-wrapper {
    min-height: 350px;
    padding: 0 1.5rem;
  }
  
  /* Wings still hidden initially */
  .book-wing-left,
  .book-wing-right {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) rotateZ(0deg) translateY(0);
  }
  
  /* Maintain tight fan on medium screens */
  .community-pick-wrapper:hover .book-wing-left {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateX(-10%) rotateZ(-7deg) translateY(-12px);
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.18);
  }
  
  .community-pick-wrapper:hover .book-wing-right {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateX(10%) rotateZ(8deg) translateY(-12px);
    box-shadow: -2px 4px 10px rgba(0, 0, 0, 0.18);
  }
}

@media (max-width: 768px) {
  .community-picks-section {
    padding: 3rem 1.5rem;
  }

  .community-picks-section .section-title {
    font-size: 24px;
    padding: 0 1rem;
  }

  .community-picks-grid {
    grid-template-columns: repeat(2, minmax(0, 170px));
    justify-content: center;
    gap: 1.1rem;
  }
  
  /* Smaller wrapper height */
  .community-pick-wrapper {
    width: 170px;
    min-height: 255px;
    padding: 0;
  }
  
  /* Reduce card size on tablets */
  .community-pick-card,
  .book-wing {
    max-width: 170px;
  }
  
  /* Wings hidden initially */
  .book-wing-left,
  .book-wing-right {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) rotateZ(0deg) translateY(0);
  }
  
  /* Very subtle tight fan on tablets */
  .community-pick-wrapper:hover .book-wing-left {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateX(-8%) rotateZ(-6deg) translateY(-10px);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
  }
  
  .community-pick-wrapper:hover .book-wing-right {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateX(8%) rotateZ(7deg) translateY(-10px);
    box-shadow: -2px 3px 8px rgba(0, 0, 0, 0.15);
  }
}

@media (max-width: 480px) {
  .community-picks-section {
    padding: 2rem 1rem;
  }

  .community-picks-section .section-title {
    font-size: 20px;
  }

  .community-picks-grid {
    grid-template-columns: repeat(2, minmax(0, 150px));
    justify-content: center;
    gap: 0.85rem;
  }
  
  /* Simplify on mobile - hide wings completely (no hover effect) */
  .community-pick-wrapper {
    width: 150px;
    min-height: 225px;
    padding: 0;
  }
  
  .book-wing {
    display: none;
  }
  
  /* Center card only on mobile */
  .community-pick-card {
    max-width: 150px;
    transform: translateX(-50%) rotateZ(0deg);
  }
  
  .community-pick-wrapper:hover .community-pick-card {
    transform: translateX(-50%) translateY(-8px) rotateZ(0deg) scale(1.03);
  }
}
