/* Import Expanded Font Selection */
@import url('https://fonts.googleapis.com/css2?family=Niconne&family=Rock+Salt&family=Slabo+27px&family=Spectral+SC:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* General Styles with Enhanced Texture */
body {
    background: #fff0 url('assets/aged-paper.jpg') no-repeat center center/cover fixed;
    color: #EAE4DE;
    font-family: 'Tahomal';
    line-height: 1.8;
    text-align: center;
    padding: 20px;
    position: relative;
}

/* Subtle Background Overlay */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: url('assets/dust-texture.png') repeat; */
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* Container with Aged Border Effect */
.container {
    max-width: 850px;
    margin: 0 auto;
    padding: 25px;
    background: #F5A933 url('https://i.imgur.com/ByjF06W.jpeg');
    background-size: 100%;
    background-repeat: repeat;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 8px #111111;
    position: relative;
    overflow: hidden;
}

/* Decorative Corner Embellishments */
/*.container::before, .container::after,*/
header::before, header::after {
    content: "";
    font-size: 24px;
    color: #EAE4DE;
    position: absolute;
    z-index: 1;
}

/* .container::before {
    top: 10px;
    left: 10px;
    transform: rotate(-30deg);
} */

.container::after {
    bottom: 10px;
    right: 10px;
    transform: rotate(150deg);
}

header::before {
    top: 10;
    right: 15px;
    transform: rotate(30deg);   
}

header::after {
    bottom: 10px;
    left: 10px;
    transform: rotate(-150deg);
}

/* Enhanced Header with Texture and Border Styling */
header {
    background: url('https://i.imgur.com/MiO0YpC.jpeg');
    background-size: 100%;
    background-repeat: repeat;
    padding: 10px 20px;
    color: #EAE4DE;
    border-bottom: 6px solid #1D1217;
    position: relative;
    border-radius: 8px 8px 0 0;
    margin-bottom: 35px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}
/* Particle Canvas Styling */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out, padding 0.6s ease-in-out;
    padding: 0 15px;
    position: relative !important;
    overflow: hidden;
}

.section-content.active {
    max-height: 2000px; /* Increased for longer content */
    padding: 20px 15px;
}

/* Toggle button active state */
.toggle-btn.active::after {
    transform: rotate(90deg);
}

/* Make sure text appears above canvas */
.section-content p, .section-content img {
    position: relative;
    z-index: 2;
}

/* Use as section divider between content sections */
.section-divider {
    position: relative;
    height: 60px;
    margin: 30px 0;
    text-align: center;
}

.section-divider::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 240%;
    background: url('https://i.imgur.com/N03AzA2.png') no-repeat center/contain;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

.section-divider::after {
    content: "";
    position: absolute;
    width: 80%;
    height: 1px;
    background: rgba(50, 90, 43, 0);
    left: 10%;
    top: 50%;
    z-index: 1;
}


/* Enhanced Typography */
h1 {
    font-size: 50px;
    font-family: 'Niconne';
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), 0 0 15px rgba(227, 201, 168, 0.4);
    margin-bottom: 20px;
    letter-spacing: 2px;
    position: relative;
    display: block;
}

/* Decorative Underline for Header */
h1::after {
    content: "";
    position: absolute;
    height: 3px;
    width: 100%;
    left: 0%;
    bottom: -10px;
    background: linear-gradient(to right, transparent, #EAE4DE, transparent);
}

.subtitle {
    font-size: 25px;
    font-style: italic;
    font-family: 'Spectral SC', serif;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Rich Story Section Styling with Aged Paper Effect */
.story-section {
    background: #26100E75;
    backdrop-filter: blur(20px);
    font-family: 'Slabo 27px', serif;
    padding: 20px;
    margin: 30px 0;
    border-radius: 6px;
    /* border: 2px dashed #e3c9a8; */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    background-blend-mode: overlay;
}

/* Scroll Design on Section Sides */
.story-section::before, .story-section::after {
    content: "◆";
    font-family: 'Spectral SC', serif;
    font-size: 16px;
    color: #EAE4DE;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.story-section::before {
    left: 4px;
}

.story-section::after {
    right: 4px;
}

.story-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

/* Enhanced Section Headers with Texture and Embellishments */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 14px 18px;
    font-size: calc(1.1rem + 0.3vw);
    font-weight: bold;
    background: #9A4660;
    background-image: url('https://i.imgur.com/MiO0YpC.jpeg');
    background-size: 106%;
    background-position: center;
    background-repeat: repeat;
    border-radius: 5px;
    color: #EAE4DE;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.9);
    /* border: 1px solid rgba(227, 201, 168, 0.3); */
}

.section-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(234, 228, 222, 0.05);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.section-header:hover::after {
    transform: translateX(0);
}

/* Enhanced Typography for Section Headers */
.section-header h2 {
    transition: transform 0.3s ease;
    font-family: 'Spectral SC', serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), 0 0 15px rgba(227, 201, 168, 0.4);
    font-style: italic;
    position: relative;
    color: #EAE4DE;
    display: flex;
    align-items: center;
}

/* Decorative elements before and after section titles */
.section-header h2::before, .section-header h2::after {
    content: "•";
    color: #EAE4DE60;
    margin: 0 10px;
    font-size: 14px;
}

.section-header:hover h2 {
    transform: translateX(5px);
}

/* Custom Toggle Button - Complete Rebuild */
.toggle-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(76, 75, 73, 0.3);
    border: 2px solid rgba(234, 228, 222, 0.3);
    position: relative;
    transition: all 0.3s ease-in-out;
    flex-shrink: 0; /* Prevent the button from shrinking */
}

/* Create centered plus symbol with pseudo-elements */
.toggle-btn::before,
.toggle-btn::after {
    content: "";
    position: absolute;
    background-color: #EAE4DE;
    transition: all 0.3s ease;
    /* Perfect centering calculations */
    top: 50%;
    left: 50%;
}

/* Horizontal line */
.toggle-btn::before {
    width: 14px;
    height: 2px;
    /* Center the line precisely */
    margin-top: -1px; /* half of height */
    margin-left: -7px; /* half of width */
}

/* Vertical line */
.toggle-btn::after {
    width: 2px;
    height: 14px;
    /* Center the line precisely */
    margin-top: -7px; /* half of height */
    margin-left: -1px; /* half of width */
}

/* For active state, only rotate to create × */
.toggle-btn.active::after {
    transform: scaleY(0);
}

.toggle-btn:hover {
    background: rgba(227, 201, 168, 0.2);
}

/* No need to rotate the entire button, just the vertical line */
.toggle-btn.active {
    /* Remove the transform: rotate(45deg); */
}


/* Content Section with Parchment Styling */
.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out;
    padding: 0 15px;
    position: relative !important;
	overflow: hidden;
}
/* New CSS for particles */
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Ensure content stays above particles */
.section-content p, 
.section-content img, 
.section-content h2, 
.section-content h3 {
    position: relative;
    z-index: 2;
}
.section-content.active {
    max-height: 2000px; /* Increased for longer content */
    padding: 20px 15px;
}

.section-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #EAE4DE;
    text-shadow: 10px 10px 30px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 2;
}

/* First letter styling for paragraphs */
.section-content p:first-of-type::first-letter {
    font-size: 2.2em;
    font-family: 'Spectral SC', serif;
    float: left;
    color: #EAE4DE;
    line-height: 0.8;
    margin-right: 1px;
    margin-top: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Enhanced Image Styling with Frame Effect */
.story-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 5px;
    position: relative;
    background: #EAE4DE;
    transition: transform 0.3s ease, filter 0.4s ease;
    filter: sepia(20%) brightness(90%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Decorative Frame */
.story-image {
    border: 12px solid transparent;
    border-image: url('assets/wooden-frame.png') 30 round;
}

.story-image:hover {
    transform: scale(1.02);
    filter: sepia(10%) brightness(105%);
}

/* Enhanced Footer with Scroll Design */
footer {
    margin-top: 60px;
    padding: 20px;
    background-image: url('https://i.imgur.com/MiO0YpC.jpeg');
    background-size: 100%;
    background-repeat: repeat;
    color: #EAE4DE;
    font-family: 'Slabo 27px', serif;
    font-size: 18px;
    font-style: italic;
    border-top: 5px solid #1D1217;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), 0 0 15px rgba(227, 201, 168, 0.4);
    border-radius: 0 0 8px 8px;
    position: relative;
    box-shadow: 0 3px 10px rgba(0,0,0,0.6);
}

footer::before {
    content: ":3";
    position: absolute;
    top: -55px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    color: #EAE4DE;
}

/* Media Queries */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        padding: 30px 15px;
    }
    
    .section-header h2::before, .section-header h2::after {
        margin: 0 5px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .story-section {
        margin: 15px 0;
        padding: 10px;
    }
    
    .section-header {
        padding: 10px;
    }
    
    .section-header h2::before, .section-header h2::after {
        display: none;
    }
}

/* Ripple Effect on Click */
.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(234, 228, 222, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(1);
        opacity: 0;
    }
}

/* Section Divider Styling */
.section-divider {
    height: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.section-divider svg {
    opacity: 0.7;
}

/* Dust Particles for Image Reveal */
.dust-particle {
    position: absolute;
    background: rgba(228, 205, 162, 0.2);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: float-dust 3s ease-in-out forwards;
}

@keyframes float-dust {
    0% {
        transform: translateY(0) translateX(0) scale(0.2);
        opacity: 0;
    }
    20% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-50px) translateX(20px) scale(0);
        opacity: 0;
    }
}

/* First Letter Styling Animation */
.section-content.active p:first-of-type::first-letter {
    animation: letter-glow 1.5s ease-in-out;
}

@keyframes letter-glow {
    0% { text-shadow: 0 0 5px rgba(227, 201, 168, 0.5); }
    50% { text-shadow: 0 0 15px rgba(227, 201, 168, 0.8); }
    100% { text-shadow: 0 0 5px rgba(227, 201, 168, 0.5); }
}

