/* ==========================================
   Success Stories Page - Storybook Journal
   Warm narrative design with site colors
   ========================================== */

/* CSS Variables */
:root {
    /* Site colors */
    --story-primary: #007aec;
    --story-primary-dark: #0066cc;
    --story-accent: #00bac7;

    /* Warm palette */
    --story-warm-cream: #faf8f5;
    --story-warm-beige: #f5f1eb;
    --story-warm-tan: #e8e1d5;
    --story-warm-brown: #8b7355;

    /* Text */
    --story-text: #2d2d2d;
    --story-text-light: #666666;
    --story-text-lighter: #999999;

    /* Emotional accents */
    --story-heart: #ff6b9d;
    --story-heart-light: #ffa3c3;

    /* Typography */
    --font-story: 'Lora', Georgia, serif;
    --font-heading: 'Montserrat', sans-serif;
    --font-handwritten: 'Caveat', cursive;
}

/* Hero Section */
.stories-hero {
    background: linear-gradient(135deg, var(--story-warm-cream) 0%, var(--story-warm-beige) 100%);
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.hero-decoration-left,
.hero-decoration-right {
    position: absolute;
    animation: float 6s ease-in-out infinite;
}

.hero-decoration-left {
    top: 10%;
    left: 5%;
    color: var(--story-heart-light);
}

.hero-decoration-right {
    bottom: 15%;
    right: 8%;
    color: var(--story-primary);
    animation-delay: 1s;
}

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

.hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    color: var(--story-heart);
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.2);
    animation: heartBeat 2s ease-in-out infinite;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--story-text);
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-family: var(--font-handwritten);
    font-size: 1.75rem;
    color: var(--story-primary);
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.1s backwards;
}

.hero-description {
    font-family: var(--font-story);
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--story-text-light);
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    animation: fadeInUp 0.8s ease-out 0.3s backwards;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    color: var(--story-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-text {
    font-family: var(--font-story);
    font-size: 0.9375rem;
    color: var(--story-text-light);
    text-align: center;
}

/* Timeline Section */
.stories-timeline {
    padding: 5rem 0;
    background: white;
}

.timeline-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--story-text);
    margin-bottom: 1rem;
}

.section-description {
    font-family: var(--font-story);
    font-size: 1.125rem;
    color: var(--story-text-light);
    font-style: italic;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

/* Timeline line */
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--story-primary) 0%, var(--story-heart) 100%);
    transform: translateX(-50%);
}

/* Story Card */
.story-card {
    position: relative;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out backwards;
}

.story-card:nth-child(1) { animation-delay: 0.1s; }
.story-card:nth-child(2) { animation-delay: 0.2s; }
.story-card:nth-child(3) { animation-delay: 0.3s; }
.story-card:nth-child(4) { animation-delay: 0.4s; }
.story-card:nth-child(5) { animation-delay: 0.5s; }

/* Timeline Heart Icon */
.timeline-heart {
    position: absolute;
    left: 50%;
    top: 2rem;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: white;
    border: 3px solid var(--story-heart);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--story-heart);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.timeline-heart svg {
    width: 24px;
    height: 24px;
}

/* Alternate left/right layout */
.story-content {
    width: calc(50% - 3rem);
    background: var(--story-warm-cream);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    position: relative;
}

.story-card:nth-child(odd) .story-content {
    margin-left: 0;
    margin-right: auto;
}

.story-card:nth-child(even) .story-content {
    margin-left: auto;
    margin-right: 0;
}

/* Story connector arrow */
.story-content::before {
    content: '';
    position: absolute;
    top: 2rem;
    width: 0;
    height: 0;
    border: 15px solid transparent;
}

.story-card:nth-child(odd) .story-content::before {
    right: -30px;
    border-left-color: var(--story-warm-cream);
}

.story-card:nth-child(even) .story-content::before {
    left: -30px;
    border-right-color: var(--story-warm-cream);
}

/* Story Header */
.story-header {
    margin-bottom: 1.5rem;
}

.story-date {
    font-family: var(--font-handwritten);
    font-size: 1.125rem;
    color: var(--story-primary);
    margin-bottom: 0.5rem;
}

.story-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--story-text);
    margin-bottom: 0.5rem;
}

.story-subtitle {
    font-family: var(--font-story);
    font-size: 1rem;
    color: var(--story-text-light);
    font-style: italic;
}

/* Photo Section - Polaroid Style */
.story-photos {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* When only one photo is provided, keep it from stretching full-width */
.story-photos.single-photo {
    justify-content: center;
}

.story-photos.single-photo .photo-polaroid {
    flex: 0 1 65%;
    max-width: 65%;
}

.photo-polaroid {
    flex: 1;
    background: white;
    padding: 0.75rem;
    padding-bottom: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: rotate(-2deg);
    transition: all 0.3s ease;
}

.photo-polaroid:hover {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.photo-polaroid:nth-child(2) {
    transform: rotate(2deg);
}

.photo-polaroid:nth-child(2):hover {
    transform: rotate(0deg) scale(1.05);
}

.polaroid-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.polaroid-caption {
    font-family: var(--font-handwritten);
    font-size: 1.125rem;
    color: var(--story-text);
    text-align: center;
}

/* Story Title */
.story-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--story-text);
    margin-bottom: 1rem;
}

/* Story Text */
.story-text {
    font-family: var(--font-story);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--story-text);
    margin-bottom: 1.5rem;
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Quote Box */
.story-quote {
    background: white;
    border-left: 4px solid var(--story-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 12px 12px 0;
    position: relative;
}

.story-quote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--story-primary);
    opacity: 0.2;
    line-height: 1;
}

.quote-text {
    font-family: var(--font-handwritten);
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--story-text);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.quote-author {
    font-family: var(--font-story);
    font-size: 0.9375rem;
    color: var(--story-text-light);
    text-align: right;
    font-style: italic;
}

/* Tags */
.story-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.story-tag {
    font-family: var(--font-story);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: white;
    color: var(--story-primary);
    border: 2px solid var(--story-primary);
    border-radius: 50px;
    font-weight: 600;
}

/* Share Story CTA */
.share-story-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--story-warm-cream) 0%, white 100%);
}

.share-story-card {
    background: white;
    border-radius: 24px;
    padding: 3rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3rem;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 122, 236, 0.15);
    border: 2px solid var(--story-warm-tan);
}

.share-story-content {
    flex: 1;
}

.share-story-title {
    font-family: var(--font-heading);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--story-text);
    margin-bottom: 1rem;
}

.share-story-text {
    font-family: var(--font-story);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--story-text-light);
    margin-bottom: 2rem;
}

.share-story-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: var(--story-primary);
    color: white;
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 236, 0.3);
}

.share-story-button:hover {
    background: var(--story-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 236, 0.4);
}

.share-story-illustration {
    flex-shrink: 0;
    animation: float 4s ease-in-out infinite;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-heart {
        left: 30px;
    }

    .story-content {
        width: calc(100% - 80px);
        margin-left: 80px !important;
        margin-right: 0 !important;
    }

    .story-content::before {
        left: -30px !important;
        right: auto !important;
        border-right-color: var(--story-warm-cream) !important;
        border-left-color: transparent !important;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }

    .stat-card {
        width: 100%;
    }

    .section-title {
        font-size: 2rem;
    }

    .story-name {
        font-size: 1.75rem;
    }

    .story-photos {
        flex-direction: column;
    }

    .share-story-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 2rem;
    }

    .share-story-title {
        font-size: 1.75rem;
    }

    .share-story-illustration {
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-heart {
        left: 20px;
        width: 40px;
        height: 40px;
    }

    .timeline-heart svg {
        width: 20px;
        height: 20px;
    }

    .story-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        padding: 1.75rem;
    }

    .story-card {
        margin-bottom: 3rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1.125rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .quote-text {
        font-size: 1.25rem;
    }
}
