/* Magazine Carousel Styles - Responsive Version */
.magazine-carousel-container {
  width: 90%;
  position: relative;
  overflow: hidden;
  padding: 40px 0;
  background: white;
  display: flex;
  justify-content: center;
  margin: 0 auto;
}

/* Swiper container */
.magazine-swiper {
  width: 100%;
  padding: 20px 0 60px;
  overflow: hidden;
}

/* Force wrapper to maintain proper flex behavior */
.magazine-swiper .swiper-wrapper {
  display: flex !important;
  align-items: center;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Desktop: 5 slides */
.magazine-swiper .swiper-slide {
  width: 20%;
  flex-shrink: 0;
  max-width: 20%;
  min-width: 20%;
  flex-basis: 20%;
  flex-grow: 0;
}

/* Override any inline styles from Swiper */
.magazine-swiper .swiper-slide[style*='width'] {
  width: 20% !important;
}

/* Magazine slide styling */
.magazine-slide {
  transition: all 0.3s ease;
  display: flex !important;
  justify-content: center;
  align-items: center;
  flex-shrink: 0 !important;
  position: relative;
}

.magazine-slide:hover {
  transform: translateY(-10px);
}

/* Magazine link wrapper */
.magazine-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
  outline: none;
}

.magazine-link:hover {
  text-decoration: none;
  color: inherit;
}

.magazine-link:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
  border-radius: 8px;
}

/* Magazine cover */
.magazine-cover {
  padding: 20px 0px;
  position: relative;
  width: 100%;
  max-width: 340px;
  height: 460px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(227, 227, 227, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.magazine-cover:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.magazine-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.magazine-cover:hover .magazine-image {
  transform: scale(1.05);
}

.magazine-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #999;
  font-weight: 500;
}

/* Magazine overlay */
.magazine-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  padding: 60px 20px 20px;
  color: white;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.3s ease;
}

.magazine-cover:hover .magazine-overlay {
  transform: translateY(0);
  opacity: 1;
}

.magazine-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.magazine-subtitle {
  font-size: 14px;
  margin: 0 0 12px;
  opacity: 0.9;
  font-style: italic;
}

.magazine-featured {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 12px;
  border-radius: 6px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Swiper Navigation */
.magazine-swiper .swiper-button-next,
.magazine-swiper .swiper-button-prev {
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 2px solid #ddd;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-top: -25px;
  transition: all 0.3s ease;
  cursor: pointer;
  z-index: 20;
}

.magazine-swiper .swiper-button-next:hover,
.magazine-swiper .swiper-button-prev:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #333;
  transform: scale(1.1);
}

.magazine-swiper .swiper-button-next::after,
.magazine-swiper .swiper-button-prev::after {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.magazine-swiper .swiper-button-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.magazine-swiper .swiper-button-disabled:hover {
  transform: none;
}

/* Swiper Pagination */
.magazine-swiper .swiper-pagination {
  bottom: 10px;
}

.magazine-swiper .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: rgba(51, 51, 51, 0.5);
  opacity: 1;
  transition: all 0.3s ease;
}

.magazine-swiper .swiper-pagination-bullet-active {
  background: #333;
  transform: scale(1.2);
}

/* RESPONSIVE BREAKPOINTS */

/* Large Desktop (1200px+) - 5 slides */
@media (min-width: 1200px) {
  .magazine-swiper .swiper-slide {
    width: 20% !important;
    flex-basis: 20% !important;
    max-width: 20% !important;
    min-width: 20% !important;
  }
}

/* Medium Desktop (992px - 1199px) - 4 slides */
@media (max-width: 1199px) and (min-width: 992px) {
  .magazine-swiper .swiper-slide {
    width: 25% !important;
    flex-basis: 25% !important;
    max-width: 25% !important;
    min-width: 25% !important;
  }
}

/* Tablet Landscape (768px - 991px) - 3 slides */
@media (max-width: 991px) and (min-width: 768px) {
  .magazine-carousel-container {
    padding: 30px 0;
  }

  .magazine-swiper .swiper-slide {
    width: 33.333333% !important;
    flex-basis: 33.333333% !important;
    max-width: 33.333333% !important;
    min-width: 33.333333% !important;
  }

  .magazine-cover {
    max-width: 280px;
    height: 380px;
  }

  .magazine-title {
    font-size: 16px;
  }

  .magazine-subtitle {
    font-size: 13px;
  }

  .magazine-featured {
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Tablet Portrait & Small Laptop (576px - 767px) - 2 slides */
@media (max-width: 767px) and (min-width: 576px) {
  .magazine-carousel-container {
    padding: 20px 0;
    width: 95%;
  }

  .magazine-swiper .swiper-slide {
    width: 50% !important;
    flex-basis: 50% !important;
    max-width: 50% !important;
    min-width: 50% !important;
  }

  .magazine-cover {
    max-width: 240px;
    height: 340px;
  }

  .magazine-title {
    font-size: 15px;
  }

  .magazine-subtitle {
    font-size: 12px;
  }

  .magazine-featured {
    font-size: 11px;
    padding: 5px 8px;
  }

  .magazine-overlay {
    padding: 40px 15px 15px;
  }
}

/* Mobile (320px - 575px) - 1 slide */
@media (max-width: 575px) {
  .magazine-carousel-container {
    padding: 15px 0;
    width: 100%;
  }

  .magazine-swiper {
    padding: 15px 0 50px;
  }

  .magazine-swiper .swiper-slide {
    width: 100% !important;
    flex-basis: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }

  .magazine-cover {
    max-width: 280px;
    height: 400px;
    margin: 0 auto;
  }

  .magazine-title {
    font-size: 16px;
  }

  .magazine-subtitle {
    font-size: 13px;
  }

  .magazine-featured {
    font-size: 12px;
    padding: 6px 10px;
  }

  .magazine-overlay {
    padding: 50px 20px 20px;
  }

  /* Hide navigation arrows on mobile */
  .magazine-swiper .swiper-button-next,
  .magazine-swiper .swiper-button-prev {
    display: none;
  }

  /* Make pagination more prominent on mobile */
  .magazine-swiper .swiper-pagination {
    bottom: 20px;
  }

  .magazine-swiper .swiper-pagination-bullet {
    width: 14px;
    height: 14px;
    margin: 0 6px;
  }
}

/* Small Mobile (below 480px) */
@media (max-width: 479px) {
  .magazine-cover {
    max-width: 250px;
    height: 360px;
  }

  .magazine-title {
    font-size: 15px;
  }

  .magazine-subtitle {
    font-size: 12px;
  }

  .magazine-featured {
    font-size: 11px;
    padding: 5px 8px;
  }

  .magazine-overlay {
    padding: 40px 15px 15px;
  }
}

/* Very Small Mobile (below 360px) */
@media (max-width: 359px) {
  .magazine-cover {
    max-width: 220px;
    height: 320px;
  }

  .magazine-title {
    font-size: 14px;
  }

  .magazine-subtitle {
    font-size: 11px;
  }

  .magazine-featured {
    font-size: 10px;
    padding: 4px 6px;
  }

  .magazine-overlay {
    padding: 30px 12px 12px;
  }
}

/* Loading Animation */
.magazine-carousel-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  color: #666;
}

.magazine-carousel-loading::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 4px solid rgba(51, 51, 51, 0.3);
  border-top: 4px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Center slide styling for better focus */
.magazine-swiper .swiper-slide-active {
  z-index: 2;
}

.magazine-swiper .swiper-slide-active .magazine-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth transitions */
.magazine-swiper .swiper-slide {
  transition: transform 0.3s ease;
}

/* Additional hover effects */
.magazine-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  z-index: 1;
}

.magazine-cover:hover::before {
  transform: translateX(100%);
}

/* Text animations */
.magazine-title,
.magazine-subtitle,
.magazine-featured {
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.magazine-cover:hover .magazine-title,
.magazine-cover:hover .magazine-subtitle,
.magazine-cover:hover .magazine-featured {
  transform: translateY(0);
}

.magazine-cover:hover .magazine-subtitle {
  transition-delay: 0.1s;
}

.magazine-cover:hover .magazine-featured {
  transition-delay: 0.2s;
}

/* Enterprise Theme Variations */
.magazine-carousel-container.enterprise-dark {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d3748 100%);
}

.magazine-carousel-container.enterprise-blue {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
}

.magazine-carousel-container.enterprise-green {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

/* Accessibility improvements */
.magazine-link:focus-visible {
  outline: 3px solid #007cba;
  outline-offset: 2px;
  border-radius: 8px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .magazine-slide,
  .magazine-cover,
  .magazine-image,
  .magazine-overlay,
  .magazine-title,
  .magazine-subtitle,
  .magazine-featured,
  .magazine-cover::before {
    transition: none;
  }

  .magazine-swiper .swiper-slide {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .magazine-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
  }

  .magazine-swiper .swiper-button-next,
  .magazine-swiper .swiper-button-prev {
    border-color: #000;
    background: #fff;
  }

  .magazine-swiper .swiper-pagination-bullet-active {
    background: #000;
  }
}
