/*
Theme Name: Bookfairs Child Theme
Template: hello-elementor
Description: Child theme for Bookfairs
Author: Gene Paul Zafra
Author URI: https://bookfairs.ecpublishingllc.com
Version: 1.0
*/

.bookfair-list-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: block; /* Change from grid to block */
}

.bookfair-list-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  color: #333;
}

.bookfair-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden; /* Ensure inner content doesn't break radius */
  width: 100%;
}

.bookfair-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.bookfair-item .bookfair-title {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.bookfair-item .bookfair-title a {
  color: #333;
  text-decoration: none;
}

.bookfair-item .bookfair-title a:hover {
  color: #0056b3;
}

.bookfair-item .bookfair-image {
  margin-bottom: 1rem;
  overflow: hidden;
  border-radius: 4px;
}

.bookfair-item .bookfair-image img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.bookfair-item .bookfair-image:hover img {
  transform: scale(1.05);
}

.bookfair-item .bookfair-date,
.bookfair-item .bookfair-venue {
  margin-bottom: 0.8rem;
  color: #666;
}

.bookfair-item .bookfair-description {
  margin-top: 1rem;
  color: #555;
  line-height: 1.6;
  margin: 0.5rem 0 3rem 0; /* Add bottom margin for button */
}

.bookfair-item .bookfair-description a {
  color: #0056b3;
  text-decoration: none;
}

.bookfair-item .bookfair-description a:hover {
  text-decoration: underline;
}

.bookfair-gallery-carousel {
  position: relative;
  width: 100%;
  height: 300px;
  margin: 0 auto;
  overflow: hidden;
}

.bookfair-gallery-carousel .swiper-slide {
  text-align: center;
  background: #f8f8f8;
  display: flex;
  justify-content: center;
  align-items: center;
}

.bookfair-gallery-carousel .swiper-slide img {
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookfair-gallery-carousel .swiper-button-next,
.bookfair-gallery-carousel .swiper-button-prev {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  padding: 30px 15px;
  border-radius: 4px;
}

.bookfair-gallery-carousel .swiper-button-next:hover,
.bookfair-gallery-carousel .swiper-button-prev:hover {
  background: rgba(0, 0, 0, 0.7);
}

.bookfair-gallery-carousel .swiper-pagination-bullet {
  background: #ffffff;
  opacity: 0.7;
}

.bookfair-gallery-carousel .swiper-pagination-bullet-active {
  opacity: 1;
}

/* Hide pagination dots */
.poster-carousel .swiper-pagination,
.featured-carousel .swiper-pagination {
  display: none;
}

/* Or to be more specific */
.swiper-pagination-bullets,
.swiper-pagination-bullets.swiper-pagination-horizontal {
  display: none !important;
}

/* Responsive Grid */
@media (min-width: 768px) {
  .bookfair-list-container {
    display: block;
  }

  .bookfair-list-title {
    grid-column: 1 / -1;
  }
}

/* Add new styles for landscape layout */
.bookfair-item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 250px;
}

.bookfair-cover {
  position: relative;
  width: 100%;
  height: 300px;
}

.bookfair-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookfair-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  min-height: 300px;
}

.bookfair-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.bookfair-dates {
  color: #666;
  margin: 0;
}

.bookfair-description {
  color: #555;
  line-height: 1.6;
  margin: 0.5rem 0 3rem 0; /* Add bottom margin for button */
}

.bookfair-description a {
  color: #0056b3;
  text-decoration: none;
}

.bookfair-description a:hover {
  text-decoration: underline;
}

.bookfair-read-more {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
}

.bookfair-read-more-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #0056b3;
  color: #ffffff !important;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.bookfair-read-more-btn:hover {
  background-color: #003d80;
  text-decoration: none !important;
}

/* Responsive layout */
@media (min-width: 768px) {
  .bookfair-item {
    padding: 0;
  }

  .bookfair-item-grid {
    grid-template-columns: 1fr 1fr; /* 50/50 split */
    min-height: 300px;
  }

  .bookfair-cover {
    height: 100%; /* Full height in desktop */
  }

  .bookfair-content {
    padding: 2rem;
    justify-content: flex-start;
    min-height: 300px;
  }
}

@media (min-width: 1024px) {
  .bookfair-list-container {
    display: block;
  }
}

/* Single Bookfair Styles */
.bookfair-single-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.bookfair-single-container .bookfair-cover-image {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.bookfair-single-container .bookfair-cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bookfair-single-container .bookfair-content {
  padding: 0;
  position: relative;
}

.bookfair-single-container .bookfair-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.bookfair-single-container .bookfair-dates,
.bookfair-single-container .bookfair-venue {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #666;
}

.bookfair-single-container .bookfair-description {
  margin: 2rem 0;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #444;
}

.bookfair-single-container .bookfair-featured-books {
  margin-top: 3rem;
}

.bookfair-single-container .bookfair-featured-books h3 {
  margin-bottom: 1.5rem;
}

.bookfair-single-container .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.bookfair-single-container .gallery img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Single Bookfair Layout */
.bookfair-section {
  margin-bottom: 4rem;
}

/* Title Section */
.bookfair-title-section .bookfair-title {
  text-transform: uppercase;
  font-size: 2.5rem;
  font-weight: 700;
  text-align: left;
  color: #333;
  margin: 0;
}

/* Cover Image Section */
.bookfair-cover-section {
  width: 100%;
  max-height: 600px;
  overflow: hidden;
}

.bookfair-cover-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Details Section */
.bookfair-details-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

/* Left column - Details */
.details-left {
  font-size: 1.1rem;
  line-height: 1.8;
  background: #f8f8f8;
  padding: 2rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Middle column - Poster Carousel */
.details-middle {
  position: relative;
}

.poster-carousel {
  height: 100%;
  min-height: 400px; /* Fallback minimum height */
  border-radius: 8px;
  overflow: hidden;
}

.poster-carousel .swiper-slide {
  height: 400px; /* Set explicit height */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.poster-carousel .swiper-slide img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Right column - Video */
.details-right {
  position: relative;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f8f8f8;
}

.bookfair-video {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px; /* Match poster carousel minimum height */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #fff;
}

.bookfair-video iframe {
  width: 100%;
  height: 100%;
  min-height: 300px; /* Ensure minimum height */
  border: none;
}

/* Description Section */
.bookfair-description-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.bookfair-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #444;
  text-align: left;
}

/* Featured Books Section */
.bookfair-featured-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.featured-carousel {
  height: 400px;
  padding: 20px 0; /* Add padding to accommodate larger center slide */
}

.featured-carousel .swiper-slide {
  text-align: center;
  transition: transform 0.3s ease;
}

.featured-carousel .swiper-slide img {
  max-height: 100%;
  width: auto;
  transition: all 0.3s ease;
}

.featured-carousel .swiper-slide-active {
  transform: scale(1.2); /* Make active slide 1.2x larger */
  z-index: 2; /* Ensure active slide appears above others */
}

/* Embed Section */
.bookfair-embed-section {
  width: 100%;
  margin-top: 2rem;
}

.bookfair-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.bookfair-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Carousel Navigation */
.swiper-button-next,
.swiper-button-prev {
  color: #000000 !important; /* Add !important to override Swiper defaults */
  background: rgba(255, 255, 255, 0.8);
  padding: 30px 15px;
  border-radius: 4px;
  width: 45px !important; /* Add fixed width */
  height: 45px !important; /* Add fixed height */
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: rgba(255, 255, 255, 0.95);
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 20px !important; /* Adjust arrow size */
  color: #000000 !important; /* Ensure arrows are black */
}

.swiper-pagination-bullet {
  background: #000000 !important; /* Add !important */
  opacity: 0.5;
  width: 8px !important;
  height: 8px !important;
}

.swiper-pagination-bullet-active {
  opacity: 1;
  background: #000000 !important;
}

/* Hide poster carousel arrows by default */
.poster-carousel .swiper-button-next,
.poster-carousel .swiper-button-prev {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

/* Show arrows on hover */
.poster-carousel:hover .swiper-button-next,
.poster-carousel:hover .swiper-button-prev {
  opacity: 1;
  pointer-events: auto;
}

/* Media Queries for Details Section Layout */
@media (min-width: 768px) {
  .bookfair-details-section.no-video {
    grid-template-columns: 30% 65%;
  }
  .bookfair-details-section.no-video .details-middle {
    grid-column: 2 / 3;
  }
  .bookfair-details-section.no-video .details-right {
    display: none;
  }
}

@media (min-width: 768px) {
  .bookfair-details-section {
    grid-template-columns: 25% 45% 30%;
    grid-template-rows: auto;
    min-height: 400px; /* Ensure consistent height */
  }

  .details-right {
    min-height: 400px; /* Match other columns */
  }
}
