html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

@font-face {
    font-family: 'Rubik Dirt';
    src: url('fonts/RubikDirt-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Suez One';
    src: url('fonts/SuezOne-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --main-title-size: clamp(2.5rem, 5vw + 1rem, 3rem);
    --sub-title-size: clamp(2rem, 4vw + 1rem, 2rem);
    --text-size: clamp(1.5rem, 2.5vw + 0.5rem, 1.2rem);
}

body {
    font-family: 'Assistant', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: rgb(29, 12, 81);
    color: #fff;
    line-height: 1.6;
    direction: rtl;
    font-size: 20px;
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* ==========================================================================
   General Styles (Desktop First)
   ========================================================================== */

section {
    padding: 40px 20px;
    background-color: rgb(29, 12, 81);
    margin: 0;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1 {
    font-family: 'Suez One', serif;
    font-size: var(--main-title-size);
    margin-bottom: 15px;
}

.hero-content h1 {
    font-family: 'Rubik Dirt', sans-serif;
}
h2 {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    font-size: var(--sub-title-size);
    margin-bottom: 15px;
    text-align: center;
}

p {
    margin-top: 0;
}



/* ==========================================================================
   Layout & Components
   ========================================================================== */

/* Parallax Divider */
.parallax-divider {
    background-image: url('bookCover 2.png');
    background-attachment: scroll; /* Reverted to scroll */
    background-size: cover;
    background-repeat: no-repeat;
    height: 40vh; /* Reverted to original height */
}

.parallax-divider-1 {
    background-position: center 40%; /* Changed to 40% for visual variation */
}

.parallax-divider-2 {
    background-position: center 65%;
    height: 45vh;
}



.parallax-divider-4 {
    background-position: center 90%;
    height: 45vh;
}

/* Page Navigation */
.page-nav {
    background-image: url('bookCover 2.png');
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    background-attachment: scroll; /* Reverted to scroll */
    height: 55vh;
    display: flex;
    justify-content: center; /* Center horizontally */
    align-items: center; /* Center vertically */
}

.page-nav h1 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 2px;
    margin: 0; /* Remove default h1 margin */
    /* Removed padding-top to center vertically */
    white-space: nowrap; /* Ensure it stays on one line */
    /* overflow-wrap: break-word; */
    /* word-break: break-word; */
    font-size: clamp(0.7rem, 3vw + 0.5rem, 3rem); /* Adjusted responsive font size for smaller minimum */
    text-align: center; /* Ensure centering */
    overflow: hidden; /* Prevent text from overflowing its container */
}



/* Hero Section */
.hero {
    width: 90vw;
    margin: 0 auto; /* Center the hero section */
    min-height: 90vh;
    display: flex;
    flex-direction: column; /* Stack h1/h2 above content */
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    margin-bottom: 0; /* No extra space at the bottom of the hero section */
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0; /* No gap between hero-body and button */
    width: 100%;
    flex-grow: 1;
}

.hero-content h1,
.hero-content h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
}

.hero-content h1 {
    margin-bottom: 0; /* Remove space below h1 */
    font-size: calc(var(--main-title-size) + 0.5rem);
}

.hero-content h2 {
    margin-top: -20px; /* Make space smaller */
    margin-bottom: 10px; /* Small space below h2 */
    font-size: calc(var(--sub-title-size) + 0.5rem);
}

.hero-body {
    display: flex;
    flex-direction: row; /* Text on right, image on left (due to rtl) */
    align-items: center; /* Vertically align image and text */
    justify-content: center;
    gap: 20px; /* Make closer */
    width: 100%;
}

.hero-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-text p {
    max-width: 80%;
    margin-bottom: 30px;
}

.hero-images {
    flex: 1;
    display: flex;
    justify-content: center;
}

#book-cover-hero {
    width: 100%;
    max-width: 315px; /* Minimized by 10% */
    height: auto;
}

.hero .btn-primary {
    margin: 3vh 0; /* 1vh to top and 0 to other sides */
}
/* Buttons */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 25px;
    border-radius: 5px;
    background-color: #ffc107;
    color: #000;
    text-decoration: none;
    font-size: var(--text-size);
    font-weight: bold;
    transition: background-color 0.3s ease;
    border-radius: 20px;
}


/* About & Author Bio Sections */
.about-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px;
    text-align: right;
}

.author-bio-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    text-align: right;
}

.author-bio {
    max-width: 900px;
    margin: 0 auto;
}

#author-bio {
    margin-top: -50px;
}

.about-text {
    max-width: 60%;
}

.about-image {
    width: 20vw;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
}

.author-bio-image {
    width: 15vw;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
}

/* Characters Section */
.character-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 40px;
    column-gap: 20px;
    margin-top: 30px;
    max-width: 830px;
    margin-left: auto;
    margin-right: auto;
}

.character {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 150px;
}

.character-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border: 3px solid #FFD700;
}

.character-image:hover {
    transform: scale(1.05);
}

.character-name {
    margin-top: 10px;
    font-weight: bold;
}

/* Carousel (Recommendations & Conferences) */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(50%); }
}

.carousel {
    display: flex;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
    direction: rtl;
}

.carousel-track {
    display: flex;
    animation: marquee 300s linear infinite;
}

.conferences-carousel-track {
    display: flex;
    animation: marquee 20s linear infinite;
}

.carousel:hover .carousel-track,
.carousel:hover .conferences-carousel-track {
    animation-play-state: paused;
}

.carousel-item {
    flex-shrink: 0;
    /* Removed fixed width */
    flex-basis: auto; /* Allow width to be determined by content, but respect min/max-width */
    min-width: 250px; /* Minimum width for the cards */
    max-width: 350px; /* Maximum width for the cards */
    margin: 0 15px;
    border: 1px solid #2A3B5C;
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    padding: 25px;
    text-align: center;
    direction: rtl;
    display: flex; /* Make carousel items flex containers */
    flex-direction: column; /* Stack content inside item vertically */
    justify-content: space-between; /* Push reviewer to bottom */
    min-height: 200px; /* Ensure a consistent minimum height for all cards */
}

.carousel-item p {
    font-style: italic;
    color: #ffffff;
    margin-bottom: 15px;
    flex-grow: 1;
    white-space: normal;
}

.carousel-item .reviewer {
    font-weight: bold;
    color: #FFD700;
    font-size: 1.1rem;
}

.recommendations .carousel-item {
    background-color: #1A2B4C;
}

.conferences .carousel-item {
    padding: 0;
    border: none;
    box-shadow: none;
}

.conferences .carousel-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Buy Section */
.buy-options {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 40px;
}

.buy-option-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.buy-option-image {
    width: 150px;
    height: 225px;
    object-fit: contain;
    border-radius: 8px;
}

.buy-option-image.book-cover {
    transform: rotate(-10deg);
}

.buy-option-item .btn-secondary {
    width: 200px; /* Wider for desktop */
    text-align: center;
    background-color: #FFC107;
    color: #000;
    border-radius: 20px;
    padding: 8px 25px; /* Less height for desktop */
}

/* About Section buttons - Desktop */
.center-buttons {
    display: flex;
    flex-direction: row; /* Display buttons in a row */
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    margin-top: 10px; /* Reduced gap from text above */
    flex-basis: 100%; /* Take full width to wrap to a new line */
}

/* Character Popup */
#character-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Keep background color for consistency, opacity will handle visibility */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

#character-popup-container.active {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.character-popup {
    display: none;
    background-color: rgb(29, 12, 81);
    color: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: right;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.character-popup.active {
    display: block;
    transform: scale(1);
}

.character-popup-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.character-popup-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #FFD700;
}

.character-popup-text {
    flex: 1;
}

.character-popup h3 {
    font-family: 'Rubik', sans-serif;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
    color: #FFC107;
}

.character-popup p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.character-popup .close-popup {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #FFC107;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 15px 0; /* Increased padding for better spacing */
}

footer h3 {
    margin-bottom: 15px; /* Increased margin for main h3 */
}

footer p {
    margin-top: 15px; /* Add space above copyright */
}

.social-media {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Increased gap for better spacing */
}

.social-text h3 {
    font-size: 1.1rem; /* Smaller font size for the text between icons */
    font-weight: normal; /* Less emphasis */
    margin: 0;
    padding: 0;
}

.social-media a {
    text-decoration: none;
    transition: transform 0.2s;
}

.social-media a:hover {
    transform: scale(1.1);
}

.social-media img {
    width: 32px;  /* Reduced icon size */
    height: 32px; /* Reduced icon size */
}

/* Small screens (max-width: 599px) */
@media (max-width: 599px) {
    :root {
        --main-title-size: 2rem;
        --sub-title-size: 1.5rem;
        --text-size: 1rem;
    }

    section {
        padding: 20px 10px;
    }

    .page-nav {
        height: 15vh;
    }

        .page-nav h1 {

            display: flex;

            justify-content: center;

            align-items: center;

            padding-top: 2.5vh;

        }

        
.parallax-divider-1 {
    background-position: center 40%; /* Changed to 40% for visual variation */
    height: 15vh
}

.parallax-divider-2 {
    background-position: center 65%;
    height: 20vh
}



.parallax-divider-4 {
    background-position: center 100%;
    height: 20vh
}


    .hero-body {
        flex-direction: column;
        gap: 20px;
    }

    .hero-text p {
        max-width: 95%;
    }

    #book-cover-hero {
        max-width: 250px;
    }

    .about-content,
    .author-bio-content {
        flex-direction: column;
        gap: 20px;
    }

    .about-text {
        max-width: 100%;
    }

    .about-image,
    .author-bio-image {
        width: 50vw;
        max-width: 200px;
    }

    .buy-options {
        flex-direction: column;
        gap: 20px;
        align-items: center; /* Center items horizontally in column layout */
    }

    .buy-option-item {
        gap: 0; /* Minimized gap for mobile */
    }

    .buy-option-item .btn-secondary {
        padding: 10px 25px; /* Reduced vertical padding for mobile */
    }



    .page-nav h2 {
        font-size: 1.2rem;
    }



.carousel-item {

    width: 250px;

}



    .character-popup {

        padding: 15px; /* Reduced padding for smaller screens */

    }



    .character-popup-content {

        flex-direction: column; /* Stack items vertically */

        align-items: center; /* Center items when stacked */

        text-align: center;

        gap: 10px; /* Adjust gap for stacked items */

    }



    .character-popup-image {

        width: 100px;

        height: 100px;

    }

    /* Reorder about section for mobile */

    .about-content .about-text {

        order: 1;

    }

    .about-content .about-image {

        order: 2;

    }

        .about-content .center-buttons {

            order: 3;

            margin-bottom: 40px; /* Increased space below buttons */

        }

}



/* Medium screens (min-width: 600px and max-width: 1199px) */

@media (min-width: 600px) and (max-width: 1199px) {

    :root {

        --main-title-size: 2.8rem;

        --sub-title-size: 2.2rem;
        --text-size: 1.1rem;
    }

    section {
        padding: 30px 15px;
    }

    .page-nav {
        height: 20vh;
    }

    .page-nav h1 {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 2.2rem;
    }

    .parallax-divider-1,
    .parallax-divider-2,
    .parallax-divider-4,
    .parallax-divider-3 {
        height: 20vh;
    }

    .hero-body {
        gap: 30px;
    }

    .hero-text p {
        max-width: 90%;
    }

    #book-cover-hero {
        max-width: 300px;
    }

    .about-content,
    .author-bio-content {
        gap: 30px;
    }

    .about-image,
    .author-bio-image {
        width: 25vw;
        max-width: 250px;
    }

    .buy-options {
        gap: 30px;
    }

    .buy-option-image {
        width: 130px;
        height: 195px;
    }

    .buy-option-item .btn-secondary {
        width: 130px;
    }

    .page-nav h2 {
        font-size: 1.8rem;
    }

    .carousel-item {
        width: 280px;
    }
}