/* Story Section - Two Column Grid */
.story-section {
  padding: 5rem 0;
}

.story-content {
  display: flex; 
  flex-wrap: wrap; 
  align-items: center; justify-content: space-between; 
  gap: 40px;
}

.story-text {
  flex: 1 1 500px;
}

.story-text .section-title {
  text-decoration: underline 5px var(--primary);
  text-underline-offset: 10px;
}

.story-paragraphs {
  line-height: 1.7; 
  color: #333; 
  font-size: 1rem;
}

.story-image {
    flex: 1 1 0%;
    display: flex; flex-direction: column; align-items: stretch; margin-top: 8px; padding: 0;
    overflow: visible !important; /* ensure image isn't clipped by parent */
}

.story-image img {
    width: 100%;
    max-width: none; /* allow full-width images in the story section */
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
    object-fit: contain; /* show full image without cropping */
    display: block;
}

.image-caption {
  margin-top: 1rem;
  text-align: center;
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Additional safety overrides to prevent cropping from other stylesheet rules */
.story-section, .story-content, .story-image, .story-image * {
    overflow: visible !important;
}

.story-image img {
    max-height: none !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 !important; /* remove extra spacing */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; /* top corners only */
    box-shadow: none !important;
    background: transparent !important;
}

/* Responsive adjustments
     - Desktop/Laptop: side-by-side (default)
     - Tablet (<=1024px): stack with image below text
     - Mobile (<=768px): stacked with tighter spacing
*/

@media (max-width: 1024px) {
    .story-content {
        flex-direction: column !important;
        gap: 20px;
        align-items: stretch;
    }

    .story-text,
    .story-image {
        flex: 1 1 100% !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .story-image {
        margin-top: 12px !important;
        align-items: center !important;
    }

    .image-caption p { font-size: 0.95rem; padding: 0 1rem; }
}

@media (max-width: 768px) {
    .story-content {
        gap: 12px;
    }

    .story-image img {
        width: 100% !important;
        max-width: 520px !important;
        height: auto !important;
    }

    .image-caption p { font-size: 0.85rem; padding: 0 0.75rem; }
    .story-text .section-title { font-size: 1.4rem; }
}

@media (min-width: 900px) {
    /* Desktop and laptop: force side-by-side and prevent wrapping */
    .story-content { flex-direction: row !important; flex-wrap: nowrap !important; gap: 48px; }
    .story-text { flex: 0 0 60% !important; max-width: 60% !important; }
    .story-image { flex: 0 0 40% !important; max-width: 40% !important; align-items: center; }

    .story-image img { width: 100% !important; height: auto !important; max-width: 100% !important; }
}

/* Center image vertically and avoid intersection with following sections */
@media (min-width: 900px) {
    .story-content { align-items: center !important; }
    .story-image { display: flex !important; align-items: center !important; justify-content: center !important; }
    .story-image img { max-height: 70vh !important; width: auto !important; max-width: 100% !important; }
    .story-section { position: relative; z-index: 1; }
}

@media (min-width: 1200px) {
    .story-text { flex: 0 0 55% !important; max-width: 55% !important; }
    .story-image { flex: 0 0 45% !important; max-width: 45% !important; }
}

.image-caption h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.image-caption {
    margin-top: 0.5rem;
    text-align: center;
    display: block;
    opacity: 1;
    visibility: visible;
    padding: 0 0.5rem; /* small horizontal padding for caption on narrow screens */
}
/* Remove any background, rounding or shadow so the story image displays as full image */
.story-image img {
    border-radius: 10 !important;
    box-shadow: none !important;
    background: transparent !important;
}


/* ===============================
        TESTIMONIAL AREA
   =============================== */

.testimonial-area {
    padding: 5rem 0;
    background: #f9f9f9;
}

.section-header {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.section-tag {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.section-header p {
    color: #666;
}

/* Wrapper */
.testimonial-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

/* Track */
.testimonial-track {
    overflow: hidden;
    width: 100%;
    position: relative;
}

/* Cards */
.testimonial-card {
    background: #fff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease;
    position: absolute;
    inset: 0;
}

.testimonial-card.active {
    opacity: 1;
    transform: scale(1);
    position: relative;
}

/* Quote */
.testimonial-quote {
    font-size: 4rem;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 1rem;
}

/* Text */
.testimonial-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

/* Author */
.testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.testimonial-author img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
}

.testimonial-author h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.testimonial-author span {
    font-size: 0.85rem;
    color: #777;
}

/* Navigation */
.testimonial-nav {
    background: #fff;
    border: none;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.testimonial-nav:hover {
    background: var(--primary);
    color: #fff;
}

.testimonial-nav.prev {
    margin-right: 1rem;
}

.testimonial-nav.next {
    margin-left: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .testimonial-card {
        padding: 2rem 1.5rem;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }
}
