:root {
    --primary-color: #2C5530;    /* Deep forest green */
    --secondary-color: #7BA686;  /* Sage green */
    --background-color: #F5F8F5; /* Light mint */
    --text-color: #2F3E2F;      /* Dark green-gray */
    --accent-color: #4A7856;    /* Medium green */
    --heart-color: #FF6B6B;     /* Soft red */
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    font-size: var(--base-font-size);
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: calc(2rem + 80px); /* Added extra padding for fixed header */
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: var(--h1-font-size);
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: var(--h3-font-size);
    color: var(--secondary-color);
}

/* Main Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Section Styles */
.section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 0;  /* Remove default margin */
}

.comments-section p {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
}

.comments-section p a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.comments-section p a:hover {
    color: var(--accent-color);
}

.group-image-link {
    display: block;
    margin: 1.5rem 0;
    transition: transform 0.3s ease;
}

.group-image-link:hover {
    transform: scale(1.02);
}

.group-image {
    width: 100%;
    max-width: 600px;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.interview-section h2 {
    margin-bottom: 0.25rem;  /* Reduce space between heading and paragraph */
}

/* Video Section */
.video-section {
    flex: 0 0 auto;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container video,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* Gallery Section */
.gallery-section {
    flex: 1;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.gallery-grid img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.gallery-grid img:hover {
    transform: scale(1.05);
}

/* Gallery Scroll - More compact version */
.favorites-collections-section {
    max-width: 100%;
    overflow: hidden;
}

.gallery-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px; /* Space for arrows */
}

.gallery-viewport {
    width: 100%;
    overflow: hidden;
}

.gallery-track {
    display: flex;
    gap: 10px;
    width: 100%;
    flex-wrap: nowrap;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.gallery-item {
    flex: 0 0 calc(11.111% - 10px);
    min-width: calc(11.111% - 10px);
    aspect-ratio: 16/9;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(1.5);
    width: 30px;
    height: 30px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    background: transparent;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    padding-bottom: 3px; /* Optical centering */
}

.gallery-nav:hover {
    background: var(--background-color);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.gallery-nav.prev {
    left: 0;
}

.gallery-nav.next {
    right: 0;
}

.placeholder-img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-item:hover .placeholder-img {
    transform: scale(1.05);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
    text-align: center;
}

.lightbox-content .placeholder-img {
    width: 300px;  /* Smaller lightbox image */
    height: 300px;
    margin: auto;
}

.lightbox-caption {
    color: white;
    margin-top: 10px;
    font-size: 0.9rem;
    max-width: 150ch;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    padding: 8px;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    border-radius: 50%;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 15px;
}

.lightbox-nav.next {
    right: 15px;
}

/* Interview Section */
.audio-player {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 1rem;
    padding: 1rem;
    background: #f8f8f8;
    border-radius: 8px;
}

.player-image {
    flex: 0 0 200px;
}

.player-image img {
    width: 100%;
    border-radius: 8px;
}

.player-controls {
    flex: 1;
}

.player-controls audio {
    width: 100%;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

.social-icon {
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: transform 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.social-icon:hover {
    transform: scale(1.1);
    color: var(--accent-color);
}

.social-icon.group-icon {
    position: relative;
}

.social-icon.group-icon::after {
    content: '\f0c0';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6em;
    position: absolute;
    bottom: -2px;
    right: -2px;
    color: var(--secondary-color);
}

.interview-section h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
    text-align: center;
}

/* Lists Section */
.lists-section {
    flex: 1;
}

.lists-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.expandable-list {
    margin-bottom: 0.5rem;
}

.list-toggle {
    width: 100%;
    padding: 1rem;
    background: none;
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.list-toggle:hover {
    background: #f8f8f8;
}

.list-content {
    display: none;
    padding: 1rem;
}

.list-content.active {
    display: block;
}

/* Full Width Sections */
.full-width-sections {
    display: grid;
    gap: 2rem;
}










/* Favorites & Collections Section */
.favorites-collections-section {
    padding: 2rem;
}

.favorites-collections-section h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.favorites-collections-section .gallery-scroll {
    margin-bottom: 2rem;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
}

.favorites-collections-section .gallery-track {
    max-width: fit-content;
}

.favorites-collections-section .lists-container {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 0.5rem;
}

.favorites-collections-section .expandable-list {
    margin-bottom: 1rem;
}

/* Comments Section */
.comments-section {
    margin-bottom: 0;
}

.comments-container {
    margin-top: 1rem;
}

.comments-toggle {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    resize: vertical;
    min-height: 100px;
}

.submit-comment {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.comments-list {
    display: none;
}

.comments-list.active {
    display: block;
}

.comment {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.heart-button {
    background: none;
    border: none;
    color: var(--heart-color);
    cursor: pointer;
}

.social-charms-section {
    display: none;
}

/* Stories Player */
.stories-player {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.current-story {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--background-color);
}

.story-image {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--background-color);
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.story-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.story-info p {
    color: var(--text-color);
    font-size: 0.9rem;
    opacity: 0.8;
}

.audio-controls {
    margin-top: auto;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--background-color);
    border-radius: 2px;
    margin-bottom: 1rem;
    cursor: pointer;
}

.progress {
    width: 0;
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.main-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.control-btn:hover {
    background: var(--background-color);
}

.play-btn {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
}

.play-btn:hover {
    background: var(--accent-color);
}

.time {
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
}

.stories-list {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.list-content {
    display: none;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    position: relative;
}

.list-content.active {
    display: block;
    max-height: 70vh;
    overflow-y: auto;
    padding-bottom: 20px;
    scroll-behavior: smooth;
    /* Styling the scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) transparent;
}

/* Webkit scrollbar styles */
.list-content.active::-webkit-scrollbar {
    width: 8px;
}

.list-content.active::-webkit-scrollbar-track {
    background: transparent;
}

.list-content.active::-webkit-scrollbar-thumb {
    background-color: var(--secondary-color);
    border-radius: 4px;
}

/* Fade effect at the bottom */
.list-content.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--background-color));
    pointer-events: none;
}

.stories-list h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1rem;
}

/* Container for all stories */
.story-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-color-secondary);
    border-radius: 8px;
}

/* Individual story item */
.story-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Thumbnail container */
.story-item-thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.story-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Story text content */
.story-item-info {
    flex-grow: 1;
    min-width: 0; /* Prevents text overflow */
}

.story-item-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.story-item-description {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Active and hover states */
.story-item:hover {
    background: var(--bg-color-hover);
    transform: translateX(4px);
}

.story-item.active {
    background: var(--primary-color-light);
    border-left: 3px solid var(--primary-color);
}

/* Book list styles */
.book-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 1rem 2rem 1rem;
    position: relative;
}

.book-item {
    display: flex;
    gap: 1.25rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.book-cover {
    width: 100px;
    flex-shrink: 0;
}

.book-cover img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.book-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.book-title:hover {
    color: var(--primary-color);
}

.book-author {
    font-size: 1rem;
    color: var(--text-color-secondary);
    font-style: italic;
}

.book-description {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
    margin-top: 0.5rem;
}

.story-item {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: var(--background-color);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.story-item:hover {
    background: #e8ede8;
}

.story-item.active {
    background: var(--primary-color);
    color: white;
}

.story-item img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.story-item-info {
    overflow: hidden;
}

.story-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-item-duration {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* YouTube Container */
.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--background-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.music-section .list-content.active {
    padding: 1rem;
    background: white;
    border-radius: 0 0 12px 12px;
}

/* Responsive Design */
/* Base fluid typography */
:root {
    --h1-font-size: clamp(2rem, 5vw, 2.5rem);
    --h2-font-size: clamp(1.5rem, 4vw, 2rem);
    --h3-font-size: clamp(1.2rem, 3vw, 1.5rem);
    --base-font-size: clamp(1rem, 2vw, 1.1rem);
    --small-font-size: clamp(0.875rem, 1.5vw, 1rem);
}

/* Large Desktop (1200px and up) */
@media (max-width: 1200px) {
    .container {
        padding: 1.5rem;
        padding-top: calc(1.5rem + 80px);
    }

    .gallery-wrapper {
        padding: 0 1rem;
    }

    .gallery-track {
        gap: 1rem;
    }
}

/* Desktop to Tablet (992px to 1199px) */
@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-item {
        flex: 0 0 calc(20% - 10px);
        min-width: calc(20% - 10px);
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
        padding-top: calc(1rem + 80px);
    }

    .gallery-viewport {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 1rem;
    }

    .gallery-track {
        flex-wrap: nowrap;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem;
    }

    .gallery-item {
        flex: 0 0 calc(33.333% - 10px);
        min-width: calc(33.333% - 10px);
    }

    .gallery-item {
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
        scroll-snap-align: start;
    }

    .gallery-nav {
        display: none; /* Hide arrows on mobile, use native scrolling */
    }

    .youtube-playlist-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 400px;
    }

    .audio-player {
        grid-template-columns: 1fr;
    }

    .book-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* Mobile (576px to 767px) */
@media (max-width: 576px) {
    .gallery-item {
        flex: 0 0 calc(100% - 1rem);
        max-width: calc(100% - 1rem);
    }

    .section {
        padding: 1rem;
    }

    .book-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .book-cover {
        max-width: 200px;
        margin: 0 auto;
    }

    .reflections-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Small Mobile (375px and below) */
@media (max-width: 375px) {
    .container {
        padding: 0.75rem;
        padding-top: calc(0.75rem + 80px);
    }

    .section {
        padding: 0.75rem;
    }

    .book-cover {
        max-width: 150px;
    }
}
