/* Page Title Styles */
.page-title-container {
    text-align: center;
    max-width: 1800px;
    width: 95%;
    margin: 8rem auto 2rem;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.7rem;
    font-weight: 700;
    color: #d14b00;
    margin-bottom: 0.8rem;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #d14b00;
    border-radius: 3px;
}

.page-subtitle {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    color: #5c534a;
    max-width: 680px;
    margin: 1.5rem auto 0;
    line-height: 1.5;
    min-height: 1.8rem;
    width: 100%;
}

/* Typewriter effect styling */
#flame-rotating-subtitle {
    font-style: italic;
    display: block;
    min-width: 260px;
    position: relative;
    margin-top: 1.8rem;
    width: 100%;
    text-align: center;
}

#flame-rotating-subtitle::after {
    content: '|';
    position: relative;
    right: 0;
    animation: blink 1s infinite;
    color: #d14b00;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Main Explore Section */
.explore-container {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: auto;
    margin: 2.5rem auto 2rem;
    padding: 0 2rem 4rem;
    gap: 3rem;
    max-width: 1800px;
    width: 95%;
}

.flame-list {
    flex: 0 0 22%;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding-top: 1.5rem;
}

.flame-link {
    font-size: 1.5rem;
    color: #b25b1a;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out forwards;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    text-align: center;
}

.flame-link:nth-child(1) {
    animation-delay: 0.2s;
}

.flame-link:nth-child(3) {
    animation-delay: 0.4s;
}

.flame-link:nth-child(5) {
    animation-delay: 0.6s;
}

.flame-link:nth-child(7) {
    animation-delay: 0.8s;
}

.flame-link.active {
    color: #d14b00;
    font-weight: bold;
    text-shadow: 0px 0px 1px rgba(209, 75, 0, 0.3);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flame-link:hover {
    color: #d14b00;
    text-shadow: 0px 0px 0.2px rgba(209, 75, 0, 0.5);
}

/* Fix for flame descriptions */
.flame-description {
    position: relative;
    z-index: 2;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    padding-bottom: 1rem;
    color: #5c534a;
    line-height: 2.0;
    margin-top: 0;
    pointer-events: none;
    max-width: 50ch;
    margin-bottom: 0;
    visibility: hidden;
    text-align: center;
}

.flame-description p {
    font-family: 'Lora', serif;
    font-size: 1rem;
}

.flame-description.active {
    height: auto;
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* Remove the problematic pseudo-element */
.flame-list::after {
    display: none;
}

/* Create a fixed-height container for all flames and descriptions */
.flame-list-container {
    height: 430px;
    position: relative;
}

/* Flame display wrapper */
.flame-display-wrapper {
    background: #fef9f6;
    border-radius: 18px;
    position: relative;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex: 1;
    padding: 2.5rem;
    max-height: none;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
    min-height: 470px;
}

.flame-video-container {
    flex: 0 0 45%;
    height: 380px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.flame-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    /* Hide all videos by default */
}

.flame-video.active {
    opacity: 1;
    display: block;
    /* Only show active video */
}

.flame-playlist-container {
    flex: 0 0 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 430px;
}

.playlist-title {
    font-family: 'Lora', serif;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #b94700;
    width: 100%;
    text-align: center;
}

.flame-cta {
    display: block;
    margin: 1rem auto 0;
    padding: 10px 24px;
    background-color: #d14b00;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.3s ease;
    width: fit-content;
}

.flame-cta:hover {
    background-color: #a63b00;
    transform: translateY(-2px);
}

.flame-cta.buy-button {
    background-color: #9B2335;
}

.flame-cta.buy-button:hover {
    background-color: #B12D42;
}

#invocation-line {
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    color: #b94700;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-style: italic;
}

/* Fix to ensure proper iframe behavior */
.flame-playlist-container iframe {
    width: 100% !important;
    height: calc(100% - 3rem) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}


/* Hide inactive playlists */
.flame-playlist-container iframe[id^="flickering-playlist"],
.flame-playlist-container iframe[id^="phantom-playlist"],
.flame-playlist-container iframe[id^="sparking-playlist"],
.flame-playlist-container iframe[id^="infernal-playlist"] {
    display: none;
}

/* Ensure no stacking issues with videos and playlists */
.flame-video-container,
.flame-playlist-container {
    position: relative;
    z-index: 1;
}



/* Responsive Adjustments */
@media (max-width: 1200px) {
    .page-title {
        font-size: 3rem;
    }

    .page-subtitle {
        font-size: 1.2rem;
    }

    .flame-list {
        gap: 1.5rem;
    }

    .flame-display-wrapper {
        padding: 2rem;
        gap: 2rem;
    }

    .flame-video-container {
        height: 380px;
    }
}

@media (max-width: 768px) {
    .page-title-container {
        margin: 6rem auto 2rem;
    }

    .page-title {
        font-size: 2.2rem;
    }

    .page-title::after {
        width: 60px;
        height: 2px;
    }

    .page-subtitle {
        font-size: 1rem;
        max-width: 90%;
    }

    .explore-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.5rem 1rem 2rem;
        gap: 2rem;
        margin-top: 1.5rem;
    }

    .flame-list-container {
        height: auto;
        margin-bottom: 1rem;
        width: 100%;
        order: 2;
    }

    .flame-display-wrapper {
        order: 1;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 500px;
        min-height: auto;
        padding: 1.5rem;
        margin: 0 auto 1.5rem;
        background: rgba(254, 249, 246, 0.98);
        border-radius: 16px;
        overflow: visible;
        gap: 1.5rem;
    }

    .flame-list {
        flex: 0 0 100%;
        gap: 1.5rem;
        width: 100%;
        max-width: 500px;
        padding-top: 0;
        margin: 0 auto;
    }

    .flame-link {
        font-size: 1.4rem;
        text-align: center;
    }

    .flame-description {
        max-width: 100%;
        font-size: 1rem;
        padding: 0 1rem;
        line-height: 1.8;
    }

    .flame-video-container {
        flex: 0 0 auto;
        width: 100%;
        height: 420px !important;
        /* Increased height */
        padding: 0;
        margin: 0 0 2rem;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        overflow: hidden;
        border-radius: 8px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    }

    .flame-video {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: none;
        /* Hide all videos by default */
        max-width: none !important;
    }

    .flame-video.active {
        opacity: 1;
        display: block;
        /* Only show active video */
    }

    .flame-playlist-container {
        flex: 0 0 auto;
        width: 100%;
        padding: 0;
        height: 380px;
        margin-top: 0.5rem;
        position: relative;
    }

    .flame-playlist-container iframe {
        height: 340px !important;
        position: relative;
        z-index: 1;
    }

    #invocation-line {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .flame-cta {
        padding: 12px 24px;
        width: auto;
        font-size: 0.95rem;
        margin: 1.2rem auto 0;
    }
}

/* Tablet-specific styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .page-title-container {
        margin: 7rem auto 2rem;
    }

    .explore-container {
        flex-direction: column;
        align-items: center;
        padding: 0 1.5rem 3rem;
        gap: 2.5rem;
    }

    .flame-list-container {
        height: auto;
        width: 100%;
        margin-bottom: 1rem;
    }

    .flame-list {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 2rem;
        padding-top: 0;
        width: 100%;
    }

    .flame-link {
        flex: 0 0 45%;
    }

    .flame-description {
        text-align: center;
        max-width: 100%;
    }

    .flame-description.active {
        width: 100%;
        margin: 1rem 0;
    }

    .flame-display-wrapper {
        width: 90%;
        max-width: 800px;
        min-height: auto;
        padding: 2rem;
    }

    .flame-video-container {
        height: 320px;
    }

    .flame-playlist-container {
        height: 400px;
    }
}

/* Improve touch targets on mobile */
@media (max-width: 480px) {
    .flame-display-wrapper {
        padding: 1.25rem;
        width: 95%;
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: auto;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    .flame-video-container {
        height: 460px !important;
        /* Even larger on smallest devices */
        margin-bottom: 2.5rem;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
        overflow: hidden;
        width: 100% !important;
    }

    .flame-video {
        display: none;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        max-width: none !important;
    }

    .flame-video.active {
        display: block;
        opacity: 1;
        z-index: 5;
    }

    /* Move invocation between video and playlist */
    #invocation-line {
        margin: 1rem 0;
        padding: 0.5rem 1rem;
        order: 1;
        /* Places it between video and playlist */
        font-size: 0.95rem;
        font-style: italic;
        line-height: 1.4;
        text-align: center;
        color: #b94700;
        width: 100%;
    }

    /* Adjust playlist container */
    .flame-playlist-container {
        width: 100%;
        height: auto;
        padding: 0;
        margin-top: 0.5rem;
        position: relative;
        z-index: 2;
        flex: 0 0 auto;
        background: transparent;
        box-shadow: none;
        flex-direction: column;
        /* Standard column flow */
    }

    /* Adjust playlist iframe */
    .flame-playlist-container iframe {
        height: 380px !important;
        /* Increased height to fill the container */
        position: relative;
        display: block;
        margin: 0;
        order: 2;
        /* Places it after the invocation */
        box-shadow: 0px 6px 15px rgba(0, 0, 0, 0.1);
        border-radius: 12px !important;
        background: rgba(254, 249, 246, 0.98);
        max-width: 100%;
        overflow: hidden;
    }

    /* Container for the playlist iframe */
    .flame-playlist-container>iframe {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Improve touch targets */
    .flame-cta {
        padding: 14px 28px;
        margin: 1.5rem auto 0;
        display: block;
        width: auto;
        min-width: 200px;
    }

    .flame-link {
        padding: 8px 0;
    }
}