/* ========================================================================== */
/*           About Us Page Specific Styles - Mobile-First Approach            */
/* ========================================================================== */

/* --- Content Area - Overall Page Container --- */
.content-area {
  padding: 1.5rem 1rem; /* Smaller padding for mobile screens */
  overflow-x: hidden; /* Prevent horizontal scroll due to animations */
}

/* --- Hero Section - Top Banner --- */
.about-hero {
  position: relative;
  height: 40vh; /* Shorter height for mobile */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  /* Mobile-friendly background image - replace with your actual image path */
  background: url("Images/HomePage/slider2.jpg") no-repeat center center/cover;
  overflow: hidden;
  margin-bottom: 2rem; /* Smaller margin for mobile */
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.about-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(
    0,
    0,
    0,
    0.45
  ); /* Slightly darker overlay for mobile text readability */
  z-index: 1;
}

.about-hero .hero-content {
  position: relative;
  z-index: 2;
  padding: 0.5rem; /* Less padding on mobile */
  max-width: 90%; /* Max width for content */
}

.about-hero h1 {
  font-size: 2rem; /* Smaller font for mobile */
  margin-bottom: 0.5rem;
  font-weight: bold;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
  line-height: 1.2;
}

.about-hero p {
  font-size: 1rem; /* Smaller font for mobile */
  font-style: italic;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* --- General Section Styling (for all content blocks) --- */
.about-section {
  background-color: var(--white);
  padding: 1.5rem; /* Smaller padding for mobile */
  border-radius: 8px; /* Slightly smaller radius */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  margin-bottom: 2rem; /* Smaller margin for mobile */
  opacity: 0; /* Hidden by default for reveal-on-scroll */
  transform: translateY(15px); /* Smaller animation shift */
  transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* Faster transition */
}

.about-section.animate-active {
  opacity: 1;
  transform: translateY(0);
}

.about-section h2 {
  text-align: center;
  color: var(--primary-red);
  font-size: 1.8rem; /* Smaller font for mobile */
  margin-bottom: 1.5rem;
  position: relative;
  line-height: 1.3;
}

.about-section h2::after {
  content: "";
  display: block;
  width: 60px; /* Shorter underline */
  height: 3px; /* Thinner underline */
  background-color: var(--primary-red);
  margin: 0.8rem auto 0;
  border-radius: 1.5px;
}

.about-section p {
  font-size: 0.95rem; /* Smaller font for mobile paragraphs */
  line-height: 1.7;
  color: var(--text-color);
  margin-bottom: 0.8rem;
}

/* --- Featured Sections (Welcome, Our Journey, Community Engagement) --- */
.featured-section {
  display: flex;
  flex-direction: column; /* Always stack on mobile */
  gap: 1.5rem; /* Smaller gap */
  align-items: center;
  text-align: center; /* Center text for mobile */
}

.featured-section .section-image {
  width: 100%;
  height: 220px; /* Smaller image height for mobile */
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.featured-section .section-text {
  flex: 1;
  opacity: 0;
  transform: translateY(15px); /* Mobile-first, text animates up */
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Specific background images for each section (replace with your actual image paths) */
.featured-section:nth-of-type(1) .section-image {
  background-image: url("Images/Ai/Ai\ kalyani\ 1.png");
}
.featured-section:nth-of-type(2) .section-image {
  background-image: url("Images/Ai/Ai\ kalyani\ 3.png");
}
.featured-section:nth-of-type(3) .section-image {
  background-image: url("Images/Ai/Ai\ klayni\ 2.png");
}

/* Animation triggers for images and text in featured sections */
.featured-section.animate-active .section-image.animate-left {
  opacity: 1;
  transform: translateX(0);
}
.featured-section.animate-active .section-image.animate-right {
  opacity: 1;
  transform: translateX(0);
}
.featured-section.animate-active .section-text {
  opacity: 1;
  transform: translateY(0);
}

/* Reverse layout is only relevant on larger screens, handled in media queries */
.featured-section.reverse-layout {
  flex-direction: column; /* Ensure it stays column on mobile */
}

/* --- Mission & Vision Section (Icon Grid) --- */
.icon-grid-section .icon-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 1.5rem; /* Smaller gap */
  margin-top: 1.5rem;
}

.icon-grid .grid-item {
  text-align: center;
  padding: 1.2rem; /* Smaller padding */
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--light-bg);
  opacity: 0;
  transform: translateY(15px);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease-out,
    transform 0.5s ease-out;
}

.about-section.animate-active .grid-item {
  opacity: 1;
  transform: translateY(0);
}
/* Animation delays for sequential appearance */
.about-section.animate-active .grid-item:nth-child(1) {
  transition-delay: 0s;
}
.about-section.animate-active .grid-item:nth-child(2) {
  transition-delay: 0.1s;
}
.about-section.animate-active .grid-item:nth-child(3) {
  transition-delay: 0.2s;
} /* If you add more */

.icon-grid .grid-item:hover {
  transform: translateY(-5px); /* Smaller hover lift */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.icon-grid .grid-item i {
  font-size: 2.5rem; /* Smaller icon size */
  color: var(--primary-red);
  margin-bottom: 0.8rem;
}

.icon-grid .grid-item h3 {
  font-size: 1.3rem; /* Smaller heading */
  color: var(--secondary-dark);
  margin-bottom: 0.6rem;
}

.icon-grid .grid-item p {
  font-size: 0.9rem; /* Smaller paragraph text */
  color: var(--text-color);
}

/* --- Why Choose Us Section --- */
.why-choose-us .why-choose-grid {
  display: grid;
  grid-template-columns: 1fr; /* Single column on mobile */
  gap: 1.5rem; /* Smaller gap */
  margin-top: 1.5rem;
}

.why-choose-us .why-item {
  text-align: center;
  padding: 1.2rem; /* Smaller padding */
  background-color: var(--light-bg);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(15px);
  transition: transform 0.3s ease, opacity 0.5s ease-out,
    transform 0.5s ease-out;
}

.about-section.animate-active .why-item {
  opacity: 1;
  transform: translateY(0);
}
/* Animation delays for sequential appearance */
.about-section.animate-active .why-item:nth-child(1) {
  transition-delay: 0s;
}
.about-section.animate-active .why-item:nth-child(2) {
  transition-delay: 0.05s;
}
.about-section.animate-active .why-item:nth-child(3) {
  transition-delay: 0.1s;
}
.about-section.animate-active .why-item:nth-child(4) {
  transition-delay: 0.15s;
}

.why-choose-us .why-item:hover {
  transform: translateY(-3px); /* Smaller hover lift */
}

.why-choose-us .why-item i {
  font-size: 2.5rem; /* Smaller icon size */
  color: var(--primary-red);
  margin-bottom: 0.8rem;
}

.why-choose-us .why-item h3 {
  font-size: 1.3rem; /* Smaller heading */
  color: var(--secondary-dark);
  margin-bottom: 0.5rem;
}

.why-choose-us .why-item p {
  font-size: 0.9rem; /* Smaller paragraph text */
  color: var(--text-color);
}

/* --- Customer Testimonials Section --- */
.testimonials-carousel {
  padding: 1.5rem 0;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  position: relative;
}

.testimonials-carousel h2 {
  margin-bottom: 1.5rem;
}

.carousel-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  /* Minimal horizontal padding; buttons will slightly overlay content area */
  padding: 0 0.5rem;
}

.carousel-track-container {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.testimonial-card {
  flex: 0 0 auto;
  width: calc(
    100% - 1.5rem
  ); /* Full width minus total margin/gap for one card view */
  margin: 0 0.75rem; /* Half the total gap on each side */
  padding: 1.5rem;
  background-color: var(--light-bg);
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
  text-align: center;
  min-height: 160px; /* Adjusted min height for mobile */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.testimonial-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
  flex-grow: 1; /* Allows paragraph to take available space, pushing name to bottom */
}

.testimonial-card .customer-name {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--primary-red);
  margin-top: auto; /* Pushes name to the bottom */
}

/* --- Carousel Control Buttons --- */
.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(
    var(--primary-red-rgb),
    0.7
  ); /* Red with transparency */
  color: var(--white);
  border: none;
  padding: 0.6rem 0.4rem; /* Smaller padding for mobile */
  font-size: 1rem; /* Smaller icon size */
  cursor: pointer;
  z-index: 10;
  transition: background-color var(--transition-speed), transform 0.2s ease-out;
  border-radius: 4px; /* Slightly rounded corners */
  outline: none; /* Remove focus outline */
}

.carousel-control:hover {
  background-color: var(--primary-red); /* Solid red on hover */
  transform: translateY(-50%) scale(1.05); /* Slight scale effect on hover */
}

.carousel-control:active {
  transform: translateY(-50%) scale(0.95); /* Press effect */
}

.carousel-control.prev-testimonial {
  left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.carousel-control.next-testimonial {
  right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* --- Carousel Dots --- */
.carousel-dots {
  text-align: center;
  margin-top: 1rem; /* Smaller margin for mobile */
  display: flex; /* Use flex for centering and spacing */
  justify-content: center;
  align-items: center;
  flex-wrap: wrap; /* Allow dots to wrap if too many */
  padding: 0 1rem; /* Small horizontal padding */
}

.carousel-dots .dot {
  display: inline-block; /* Still inline-block for specific sizing */
  width: 8px; /* Smaller dots for mobile */
  height: 8px;
  background-color: #ccc; /* Light gray for inactive */
  border-radius: 50%;
  margin: 0 4px; /* Smaller spacing between dots */
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.1); /* Subtle border for definition */
}

.carousel-dots .dot.active {
  background-color: var(--primary-red); /* Primary red for active dot */
  transform: scale(1.2); /* Slightly larger active dot */
  border-color: var(--primary-red);
}

.carousel-dots .dot:hover:not(.active) {
  background-color: #aaa; /* Darker gray on hover for inactive */
  transform: scale(1.1);
}

/* --- Animation Keyframes (used by reveal-on-scroll and other elements) --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply fade-in-up to elements that need it, with optional delays */
.fade-in-up {
  animation: fadeInUp 0.7s ease-out forwards;
}
/* Example delays: */
.fade-in-up.delay-1 {
  animation-delay: 0.15s;
}
.fade-in-up.delay-2 {
  animation-delay: 0.3s;
}
.fade-in-up.delay-3 {
  animation-delay: 0.45s;
}

/* ========================================================================== */
/*                Media Queries for Larger Screens (Mobile-First)             */
/* ========================================================================== */

/* --- Tablet and Small Desktops (min-width: 768px) --- */
@media (min-width: 768px) {
  .content-area {
    padding: 2.5rem 1.5rem; /* More padding for tablet */
  }

  .about-hero {
    height: 50vh; /* Taller hero */
    margin-bottom: 3rem;
    background-image: url("https://source.unsplash.com/1200x675/?ice-cream-parlour-interior,shop"); /* Higher res image */
  }
  .about-hero h1 {
    font-size: 3.5rem;
  }
  .about-hero p {
    font-size: 1.5rem;
  }

  .about-section {
    padding: 2.5rem;
    margin-bottom: 3rem;
  }
  .about-section h2 {
    font-size: 2.5rem;
  }
  .about-section h2::after {
    width: 80px;
    height: 4px;
  }
  .about-section p {
    font-size: 1rem;
  }

  /* Featured Sections - Side-by-side layout */
  .featured-section {
    flex-direction: row; /* Side-by-side */
    gap: 2.5rem;
    text-align: left; /* Align text left */
  }
  .featured-section .section-image {
    flex: 1;
    height: 350px; /* Taller image */
  }
  .featured-section .section-text {
    flex: 1.2;
    transform: translateY(0); /* Reset text animation for side-by-side */
  }
  /* Animation for images in featured sections on larger screens */
  .featured-section.animate-active .section-image.animate-left {
    animation: fadeInLeft 0.8s ease-out forwards;
    background-image: url("Images/Ai/Ai\ kalyani\ 4.png");
  }
  .featured-section.animate-active .section-image.animate-right {
    animation: fadeInRight 0.8s ease-out forwards;
  }
  .featured-section.animate-active .section-text {
    opacity: 1; /* Text appears with its parent section */
    transform: translateY(0);
  }

  /* Reverse layout for alternating sections */
  .featured-section.reverse-layout {
    flex-direction: row-reverse;
  }
  /* Special animation adjustments for reverse layout if needed */

  .icon-grid-section .icon-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 2rem;
  }
  .icon-grid .grid-item i {
    font-size: 3rem;
  }
  .icon-grid .grid-item h3 {
    font-size: 1.4rem;
  }
  .icon-grid .grid-item p {
    font-size: 1rem;
  }

  .why-choose-us .why-choose-grid {
    grid-template-columns: repeat(2, 1fr); /* Two columns */
    gap: 2rem;
  }
  .why-choose-us .why-item i {
    font-size: 3rem;
  }
  .why-choose-us .why-item h3 {
    font-size: 1.4rem;
  }
  .why-choose-us .why-item p {
    font-size: 1rem;
  }

  /* Testimonials Carousel */
  .testimonials-carousel {
    background-color: var(--white);
    padding: 80px 0;
  }

  .carousel-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden; /* Hide overflowing cards */
  }

  .carousel-track-container {
    overflow: hidden;
  }

  .carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: max-content; /* Allow track to be as wide as its content */
  }

  .testimonial-card {
    flex: 0 0 300px; /* Fixed width for each card */
    margin: 0 15px; /* Spacing between cards */
    background-color: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    padding: 30px;
    text-align: center;
    min-height: 220px; /* Ensure consistent height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; /* For the customer image */
  }

  .testimonial-card p {
    font-size: 1.1em;
    color: var(--dark-gray);
    margin-bottom: 15px;
    flex-grow: 1; /* Allows text to take up available space */
  }

  .testimonial-card .customer-name {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1em;
    margin-top: auto; /* Pushes name to the bottom */
  }

  .customer-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 4px solid var(--secondary-color);
    box-shadow: var(--shadow-light);
  }

  .carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 15px 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5em;
    color: var(--primary-color);
    box-shadow: var(--shadow-light);
    transition: background-color 0.3s ease, color 0.3s ease;
    z-index: 10;
  }

  .carousel-control:hover {
    background-color: var(--primary-color);
    color: var(--white);
  }

  .prev-testimonial {
    left: -40px; /* Adjust as needed */
  }

  .next-testimonial {
    right: -40px; /* Adjust as needed */
  }

  .carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 40px;
  }

  .dot {
    height: 12px;
    width: 12px;
    margin: 0 8px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
  }

  .dot.active {
    background-color: var(--primary-color);
    transform: scale(1.2);
  }

  /* Responsive Adjustments */
  @media (max-width: 768px) {
    h2 {
      font-size: 2em;
    }

    .testimonial-card {
      flex: 0 0 80%; /* Make cards wider on smaller screens */
      margin: 0 10px;
      min-height: 200px;
    }

    .carousel-control {
      padding: 12px 15px;
      font-size: 1.2em;
    }

    .prev-testimonial {
      left: -20px;
    }

    .next-testimonial {
      right: -20px;
    }
  }

  @media (max-width: 480px) {
   
    .about-section {
      padding: 40px 15px;
    }

    h2 {
      font-size: 1.8em;
    }

    .testimonial-card {
      flex: 0 0 90%;
      min-height: 180px;
    }

    .prev-testimonial {
      left: 5px;
    }

    .next-testimonial {
      right: 5px;
    }
  }
}

/* --- Desktop (min-width: 1024px) --- */
@media (min-width: 1024px) {
  .content-area {
    padding: 3rem 2rem; /* Even more padding */
  }

  .about-hero {
    height: 60vh;
    background-image: url("/Images/HomePage/slider1.jpg"); /* Desktop high-res image */
  }
  .about-hero h1 {
    font-size: 4.5rem;
  }
  .about-hero p {
    font-size: 2rem;
  }

  .about-section {
    padding: 3.5rem;
  }
  .about-section h2 {
    font-size: 3rem;
  }
  .about-section p {
    font-size: 1.1rem;
  }

  .featured-section .section-image {
    height: 400px;
  }

  .why-choose-us .why-choose-grid {
    grid-template-columns: repeat(4, 1fr); /* Four columns */
  }
}

/* --- Large Desktop (min-width: 1200px) --- */
@media (min-width: 1200px) {
  .content-area {
    padding: 3rem 0; /* Remove horizontal padding if container max-width handles it */
    max-width: var(--max-width); /* Centralize content */
    margin-left: auto;
    margin-right: auto;
  }
}
