/* =============================================================================
   SAFI HOME PAGE STYLES - FIXED CAROUSEL VERSION
   ============================================================================= */

/* =============================================================================
   NOTE: Hero styles moved to hero.css component file
   This eliminates duplicate CSS and potential conflicts
   ============================================================================= */

/* =============================================================================
   OPENING PARAGRAPH SECTION
   ============================================================================= */

.opening-paragraph {
  padding: var(--spacing-3xl) 0 var(--spacing-xl) 0;
  background: var(--color-background);
}

.opening-text {
  max-width: 80vh;
  margin: 0 auto;
  text-align: center;
}

.opening-text p {
  font-family: var(--font-family-body);
  font-size: var(--font-size-lg);
  font-weight: 200;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
}

/* =============================================================================
   JOIN SAFI SECTION
   ============================================================================= */

.join-safi-section {
  padding: var(--spacing-lg) 0 var(--spacing-sm) 0;
}

.join-safi-content {
  display: flex;
  align-items: center;
  min-height: 400px;
}

.join-safi-text {
  flex: 1;
  max-width: 33.333%;
  padding-right: var(--spacing-sm);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.join-safi-description {
  margin-bottom: var(--spacing-lg);
}

.join-safi-description p {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
}

.join-safi-description p:last-child {
  margin-bottom: 0;
}

.join-safi-image {
  flex: 2;
  max-width: 66.667%;
  padding-left: var(--spacing-md);
}

.join-safi-image img {
  width: 100%;
  height: auto;
}

/* =============================================================================
   PRODUCT IMAGES SECTION
   ============================================================================= */

.product-images-section {
  padding: 0;
}

.product-images-content {
  display: flex;
  gap: var(--spacing-md);
}

.product-image-item {
  flex: 1;
  display: flex;
}

.product-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1;
}

/* =============================================================================
   MEMBERS RESOURCES SECTION - FIXED VERSION
   ============================================================================= */

.members-resources-section {
  padding: var(--spacing-2xl) 0;
}

.members-resources-carousel {
  position: relative;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: var(--spacing-md);
  transition: transform 0.3s ease;
  width: auto;
}

.resource-card {
  flex: 0 0 auto;
  width: calc(25% - 18px);
  aspect-ratio: 1 / 2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 280px;
}

.resource-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.4) 40%,
    transparent 100%
  );
}

.resource-content {
  position: relative;
  z-index: 2;
  padding: var(--spacing-md);
  width: 100%;
}

.resource-content h3 {
  color: white;
  font-size: var(--font-size-base);
  font-weight: 300;
  margin-bottom: var(--spacing-sm);
  line-height: 1.2;
}

.resource-content p {
  color: white;
  font-size: var(--font-size-sm);
  line-height: 1.4;
  margin-bottom: var(--spacing-md);
}

.resource-content .btn {
  background: transparent;
  color: white;
  border-color: white;
  padding: var(--spacing-xs) var(--spacing-md);
  font-size: var(--font-size-xs);
}

.resource-content .btn:hover {
  background: white;
  color: var(--color-primary);
  border-color: white;
}

.carousel-navigation {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  margin-top: 2px;
}

.carousel-nav {
  width: 30px;
  height: 30px;
  background: var(--color-primary);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.carousel-nav:hover {
  background: var(--color-secondary);
}

.carousel-nav i {
  font-size: var(--font-size-xs);
}

/* =============================================================================
   QUOTE SECTION - USING SEMANTIC BLOCKQUOTE
   ============================================================================= */

.quote-section {
  padding: var(--spacing-4xl) 0;
  background: var(--color-background);
}

.quote-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.quote-text {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-4xl);
  font-weight: 300;
  color: var(--color-accent);
  margin-bottom: var(--spacing-lg);
  line-height: 1.1;
  letter-spacing: -0.02em;
  border: none; /* Reset blockquote defaults */
  quotes: none;
}

.quote-sub-text {
  font-family: var(--font-family-body);
  font-size: var(--font-size-lg);
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
}

.quote-name {
  font-family: var(--font-family-body);
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin: 0;
  font-style: italic;
}

/* =============================================================================
   NEWS SECTION - FIXED: Clear, sharp thumbnails
   ============================================================================= */

.news-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  width: 100%;
  overflow: hidden;
}

.news-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: white;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  min-height: 300px;
  width: 100%;
  max-width: 100%;
}

.news-card:hover {
  transform: translateY(-2px);
  color: white;
}

.news-card__image {
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* Creates 1:1 aspect ratio for square */
  overflow: hidden;
  position: relative;
}

.news-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
}

.news-card:hover .news-card__image img {
  transform: scale(1.05);
}

.news-card__content {
  padding: var(--spacing-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
  justify-content: space-between;
}

.news-card__content h3 {
  color: white;
  font-size: var(--font-size-lg);
  font-weight: 200;
  margin-bottom: 0;
  line-height: 1.2;
}

.news-card__separator {
  border: none;
  height: 1px;
  background-color: white;
  margin: var(--spacing-md) 0;
  width: 100%;
}

.news-card__content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-sm);
  line-height: 1.5;
  margin: var(--spacing-sm) 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.news-card__arrow {
  margin-top: auto;
  align-self: flex-end;
  color: white;
  font-size: var(--font-size-base);
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1200px) {
  .resource-card {
    width: calc(33.333% - 16px);
  }
  
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }
}

@media (max-width: 1024px) {
  .resource-card {
    width: calc(33.333% - 16px);
    min-width: 250px;
  }
  
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }
}

@media (max-width: 768px) {
  .opening-text {
    max-width: 85%;
  }
  
  .opening-text p {
    font-size: var(--font-size-xl);
  }
  
  .join-safi-content {
    flex-direction: column;
    align-items: stretch;
  }
  
  .join-safi-text {
    max-width: 100%;
    padding-right: 0;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }
  
  .join-safi-image {
    max-width: 100%;
    padding-left: 0;
  }
  
  .product-images-content {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .resource-card {
    width: calc(50% - 12px);
    min-width: 200px;
  }
  
  .carousel-navigation {
    padding-right: 0;
  }
  
  .quote-text {
    font-size: var(--font-size-3xl);
  }
  
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }
  
  .news-card {
    min-height: 250px;
  }
  
  .news-card__content {
    padding: var(--spacing-sm);
  }
}

@media (max-width: 480px) {
  .opening-text {
    max-width: 95%;
  }
  
  .opening-text p {
    font-size: var(--font-size-lg);
  }
  
  .join-safi-section {
    padding: var(--spacing-md) 0;
  }
  
  .join-safi-content {
    padding: 0;
  }
  
  .product-images-content {
    padding: 0;
  }
  
  .resource-card {
    width: 100%;
    min-width: auto;
  }
  
  .carousel-track {
    gap: var(--spacing-sm);
  }
  
  .members-resources-section {
    padding: var(--spacing-md) 0;
  }
  
  .quote-section {
    padding: var(--spacing-3xl) 0;
  }
  
  .quote-text {
    font-size: var(--font-size-2xl);
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .news-card {
    min-height: 220px;
  }
  
  .news-card__content {
    padding: var(--spacing-sm);
  }
  
  .news-card__content h3 {
    font-size: var(--font-size-sm);
  }
  
  .news-card__content p {
    font-size: var(--font-size-xs);
  }
}

/* =============================================================================
   ACCESSIBILITY & PERFORMANCE
   ============================================================================= */

/* High contrast mode support */
@media (prefers-contrast: high) {
  .news-card {
    border: 2px solid transparent;
  }
  
  .news-card:focus {
    border-color: white;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .news-card,
  .carousel-nav,
  .carousel-track {
    transition: none;
  }
  
  .news-card:hover {
    transform: none;
  }
  
  .news-card:hover .news-card__image img {
    transform: none;
  }
}

/* Print styles */
@media print {
  .quote-text {
    color: black;
  }
}