/* Testimonials Section - CSS Grid Layout */

/* CSS Variables for Testimonials Section */
:root {
  --testimonials-color-background: #f6f4f5;
  --testimonials-color-text-primary: #232228;
  --testimonials-color-text-secondary: #b1b1b1;
  --testimonials-color-highlight: #e3c37a;
  --testimonials-color-white: #ffffff;
  --testimonials-color-quote: #d9d9d9;
  --testimonials-font-primary: 'Montserrat', sans-serif;
  --testimonials-font-heading: 'Cormorant Garamond', serif;
}

/* Reset and Base Styles */
#testimonials * {
  box-sizing: border-box;
}

#testimonials img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Main Testimonials Section - CSS Grid Layout */
.testimonials-section {
  background-color: var(--testimonials-color-background);
  padding: 80px 20px;
  color: var(--testimonials-color-text-primary);
  font-family: var(--testimonials-font-primary);
}

.testimonials-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto;
  grid-template-areas: 
    "header"
    "content"
    "pagination";
  gap: 40px;
  justify-items: center;
}

/* Testimonials Header - Grid Layout */
.testimonials-header {
  grid-area: header;
  text-align: center;
  display: grid;
  grid-template-rows: auto auto;
  gap: 20px;
  justify-items: center;
}

.testimonials-subtitle {
  margin: 0;
  color: var(--testimonials-color-text-secondary);
  font-family: var(--testimonials-font-primary);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.32px;
}

.testimonials-title {
  margin: 0;
  color: var(--testimonials-color-text-primary);
  font-family: var(--testimonials-font-heading);
  font-weight: 400;
  font-size: 40px;
  line-height: 52px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.testimonials-title .highlight {
  color: var(--testimonials-color-highlight);
}

/* Testimonials Content - Grid Layout */
.testimonials-content {
  grid-area: content;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "prev card next";
  align-items: center;
  gap: 30px;
  width: 100%;
  max-width: 900px;
}

/* Navigation Arrows */
.testimonials-arrow {
  grid-area: prev;
  background-color: var(--testimonials-color-highlight);
  border: none;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: opacity 0.3s, transform 0.3s;
}

.testimonials-arrow img {
  display: none;
}

.testimonials-arrow.next {
  grid-area: next;
}

.testimonials-arrow:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

.testimonials-arrow::before {
  content: '';
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 12px 8px 0;
  border-color: transparent var(--testimonials-color-white) transparent transparent;
}

.testimonials-arrow.next::before {
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent var(--testimonials-color-white);
}

/* Testimonial Card - Grid Layout */
.testimonial-card {
  grid-area: card;
  position: relative;
  width: 100%;
  max-width: 800px;
  height: 350px;
  display: grid;
  grid-template-areas: "stack";
  justify-self: center;
}

.testimonial-card-bg {
  grid-area: stack;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--testimonials-color-white);
  border: 1px solid var(--testimonials-color-highlight);
  border-radius: 8px;
}

.testimonial-card-bg::before,
.testimonial-card-bg::after {
  content: '';
  position: absolute;
  top: 0;
  width: 1px;
  height: 100%;
  background-color: var(--testimonials-color-highlight);
}

.testimonial-card-bg::before {
  left: 0;
}

.testimonial-card-bg::after {
  right: 0;
}

.testimonial-card-content {
  grid-area: stack;
  position: relative;
  z-index: 2;
  padding: 80px 40px 40px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  height: 100%;
  align-items: center;
}

/* Avatar */
.testimonial-avatar {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 100px;
  z-index: 3;
}

.avatar-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--testimonials-color-text-primary);
  object-fit: cover;
}

/* Testimonial Text */
.testimonial-text {
  position: relative;
  text-align: center;
}

.quote {
  position: absolute;
  font-family: var(--testimonials-font-heading);
  font-size: 100px;
  line-height: 1;
  color: var(--testimonials-color-quote);
  user-select: none;
  z-index: 1;
}

.quote-top {
  top: -50px;
  right: 20px;
  transform: rotate(180deg);
}

.quote-bottom {
  bottom: -60px;
  left: 20px;
}

.testimonial-text blockquote {
  margin: 0;
  position: relative;
  z-index: 2;
}

.testimonial-text p {
  margin: 0;
  color: var(--testimonials-color-text-primary);
  font-family: var(--testimonials-font-primary);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.32px;
  text-align: center;
}

/* Author */
.testimonial-author {
  text-align: center;
  margin-top: 20px;
}

.author-name {
  margin: 0 0 8px 0;
  color: var(--testimonials-color-text-primary);
  font-family: var(--testimonials-font-heading);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  text-transform: uppercase;
}

.author-title {
  margin: 0;
  color: var(--testimonials-color-text-secondary);
  font-family: var(--testimonials-font-primary);
  font-weight: 300;
  font-size: 14px;
  line-height: 21px;
}

/* Pagination */
.testimonials-pagination {
  grid-area: pagination;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background-color: var(--testimonials-color-text-secondary);
  cursor: pointer;
  transition: all 0.3s;
}

.pagination-dot.active {
  background-color: var(--testimonials-color-highlight);
  transform: scale(1.5);
}

.pagination-dot:hover {
  background-color: var(--testimonials-color-highlight);
  transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
  .testimonials-section {
    padding: 60px 20px;
  }
  
  .testimonials-container {
    gap: 30px;
  }
  
  .testimonials-title {
    font-size: 32px;
    line-height: 42px;
  }
  
  .testimonials-content {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "card"
      "arrows";
    gap: 20px;
  }
  
  .testimonials-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
  }
  
  .testimonials-arrow.prev {
    left: 20px;
  }
  
  .testimonials-arrow.next {
    right: 20px;
  }
  
  .testimonial-card {
    margin: 0 60px;
    height: 300px;
  }
  
  .testimonial-card-content {
    padding: 60px 20px 30px;
  }
  
  .testimonial-avatar {
    width: 80px;
    height: 80px;
    top: -40px;
  }
  
  .avatar-photo {
    width: 80px;
    height: 80px;
  }
  
  .quote {
    font-size: 80px;
  }
  
  .quote-top {
    top: -40px;
    right: 10px;
  }
  
  .quote-bottom {
    bottom: -50px;
    left: 10px;
  }
}

@media (max-width: 480px) {
  .testimonials-section {
    padding: 40px 15px;
  }
  
  .testimonials-title {
    font-size: 28px;
    line-height: 38px;
  }
  
  .testimonial-card {
    margin: 0 40px;
    height: 280px;
  }
  
  .testimonial-card-content {
    padding: 50px 15px 25px;
  }
  
  .testimonial-text p {
    font-size: 14px;
    line-height: 20px;
  }
  
  .testimonials-arrow {
    width: 40px;
    height: 40px;
  }
  
  .testimonials-arrow::before {
    border-width: 6px 10px 6px 0;
  }
  
  .testimonials-arrow.next::before {
    border-width: 6px 0 6px 10px;
  }
}

/* Grid Animation Support */
.testimonials-container {
  transition: grid-template-rows 0.3s ease;
}

.testimonials-content {
  transition: grid-template-columns 0.3s ease;
}

.testimonial-card {
  transition: all 0.3s ease;
}

/* Focus and Accessibility */
.testimonials-arrow:focus {
  outline: 2px solid var(--testimonials-color-white);
  outline-offset: 2px;
}

.pagination-dot:focus {
  outline: 2px solid var(--testimonials-color-highlight);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .testimonial-card-bg {
    border-color: var(--testimonials-color-text-primary);
  }
  
  .testimonials-arrow {
    background-color: var(--testimonials-color-text-primary);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .testimonials-arrow,
  .pagination-dot,
  .testimonial-card {
    transition: none;
  }
  
  .testimonials-arrow:hover {
    transform: none;
  }
}