/* Variables */
:root {
    --primary: #0CD49A;
    --dark: #053024;
    --light-bg: #f9fdfc;
    --white: #ffffff;
    --text-gray: #555;
}


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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: var(--dark);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden { display: none !important;}


/* Header / About Section */
.about-header {
    position: relative; 
    background-color: var(--dark);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    overflow: hidden;
    border-bottom: 5px solid var(--primary);
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.header-content {
    position: relative;
    z-index: 1; 
    pointer-events: none;
}

.profile-img {
    width: 180px;
    height: 180px;
}

.about-header h1 {
    font-family: 'Fahkwang', sans-serif;
    font-size: clamp(1.8rem, 6vw, 2.4rem); 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
    margin-bottom: 15px;
    width: auto; 
}

.line-header {
    display: flex;
    align-items: center;    
    text-align: center;
    justify-content: center;
    gap: clamp(15px, 4vw, 25px);        
    width: 83%;
    max-width: 390px;           
    margin: 0 auto; 
}

.line {
    flex-grow: 1;           
    height: 1px;           
    background-color: var(--white); 
    transform: translateY(-7px);    
}

.bio-ar {
    font-family: 'Kufam', sans-serif; 
    direction: rtl;
    font-size: clamp(1.1rem, 4.5vw, 1.5rem);
    color: var(--primary);
    margin-top: 15px;
    white-space: nowrap;
}

.bio-en {
    font-size: clamp(0.7rem, 3vw, 1rem);
    white-space: nowrap;
    width: 100%;
    margin: 0 auto;
}

.social-links {
    display: flex;           
    flex-direction: row;     
    justify-content: center; 
    gap: clamp(5px, 1.5vw, 10px);              
    margin: 25px auto 0;
    width: 100%;         
    flex-wrap: nowrap; /* Force one line */
    pointer-events: auto;     
}

.social-btn {
    flex: 0 1 auto;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    
    padding: 6px clamp(8px, 2vw, 16px); 
    
    border-radius: 50px;    
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    
    font-size: clamp(0.8rem, 2.2vw, 0.9rem);    
    
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.social-btn i {
    /* Tighten the gap between icon and text for mobile */
    margin-right: clamp(4px, 1vw, 8px);      
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

.social-btn:hover {
    background: var(--primary);
    color: var(--dark);
    transform: translateY(-2px);
}


/* Bookshelf Grid */
.section-title {
    text-align: center;
    margin-top: clamp(35px, 5vw, 50px);
    margin-bottom: clamp(35px, 5vw, 50px);
    font-size: clamp(1.6rem, 5vw, 2rem);
}

.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    cursor: pointer;
    text-align: left;

    display: flex;
    flex-direction: column;
    height: 100%;  
}

.book-card:hover {
    transform: translateY(-8px);
}

.book-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.book-card h3 {
    flex-grow: 1;
    font-family: 'DM Serif Display', serif;
    font-weight: 500;
    font-size: 1.2rem;
    line-height: 1.4;
    letter-spacing: 0.02em;

    padding-left: 20px;
    padding-right: 20px;
    padding-top: 15px;
}

.book-card p {
    font-size: 0.9rem;
    color: var(--primary);
    margin-top: auto; 

    padding-left: 20px;
    padding-top: 10px;
    padding-bottom: 20px;
}


/* Product Page Layout */
.top-nav {
    padding: 30px 0;
    background: var(--white);
    border-bottom: 1px solid var(--text-gray);
}

.back-link {
    background: none;
    border: none;
    color: var(--dark);
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: 0.8fr 1fr;
    gap: 50px;
    margin-top: 40px;
    align-items: start; 
}

.product-info h1 {
    font-family: 'DM Serif Display', serif;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;

    padding-bottom: 15px;
}

.description {
    margin-bottom: 10px;
}

.italic {
    font-style: italic;
}

.product-price {
    color: var(--primary);
    margin-top: 15px;
    margin-bottom: 20px;
}

.suggestions {
    margin-top: 40px;
}

.suggestions hr {
    border: none;
    background-color: var(--text-gray);
    height: 1px;
    margin-bottom: 35px;
}

.suggestions-title {
    margin-bottom: 25px;
}


/* Slider */
.slider-container {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    line-height: 0; 
    display: block; 
}

.slide {
    display: none;
    width: 100%;
    border-radius: 15px;
    height: auto;
}

.slide.active {
    display: block;
}

.slider-controls {
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    transform: translateY(-50%);
}

.slider-btn-left {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    border-radius: 0 20px 20px 0;
    pointer-events: auto;
}

.slider-btn-right {
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    border-radius: 20px 0 0 20px;
    pointer-events: auto;
}

.buy-now-btn {
    display: inline-block;
    background: var(--primary);
    color: var(--dark);
    padding: 15px 40px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 13px;
    margin-top: 25px;
     transition: 0.3s ease;
}

.buy-now-btn:hover {
    filter: brightness(0.9);
}

.footer {
    text-align: center;
    padding: 40px;
    color: var(--text-gray);
    font-size: clamp(0.4rem, 3vw, 0.9rem);
}


/* Mailing List Footer */
.footer-newsletter {
    background-color: var(--light-bg);
    color: var(--dark);
    padding: 35px 5px;
    text-align: center;
    border-top: 5px solid var(--primary);
    margin-top: clamp(50px, 5vw, 75px);
}

.footer-newsletter h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.footer-newsletter p {
    color: var(--text-gray);
    margin-bottom: 30px;
}

#footer-newsletter-form {
    display: flex;
    justify-content: center;
    gap: 25px;
    max-width: 320px;
    margin: 0 auto;
}

#footer-newsletter-form input {
    flex-grow: 1;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    height: 50px;
}

#footer-newsletter-form .subscribe-btn {
    width: auto;   
    white-space: nowrap; 
}

.success-text {
    color: var(--primary) !important;
    font-weight: 600;
    font-size: 1.2rem !important;
}


/* Mailing List Pop-Up */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 48, 36, 0.85); /* same colour as --dark */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
    pointer-events: auto;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--white);
    padding: clamp(30px, 8vw, 40px);
    border-radius: 25px;
    max-width: 450px;
    width: 85%;
    position: relative;
    text-align: center;

    transform: translateY(20px);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    color: var(--dark);
    font-family: 'Fahkwang', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
}

.modal-content p {
    color: var(--text-gray);
    font-size: 1rem;
    margin-top: 10px;
    margin-bottom: 18px;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--dark);
}

#newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#newsletter-form input {
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 11px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.subscribe-btn {
    background: var(--primary);
    color: var(--dark);
    border: none;
    padding: 15px;
    border-radius: 11px;
    font-weight: 550;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s ease;
}

.subscribe-btn:hover {
    filter: brightness(0.9);
}


/* Responsiveness */
@media (max-width: 600px) {
    .profile-img {
        width: 150px;
        height: 150px;
    }

    .bookshelf {
        grid-template-columns: repeat(2, 1fr); 
        gap: 20px; 
    }
    
    .book-card h3 {
        font-size: 1.1rem; 
        line-height: 1.5rem;
        padding-left: 15px;
        padding-right: 15px;
        padding-top: 10px;

        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;  
        overflow: hidden;
        text-overflow: ellipsis;

        min-height: calc(1.1rem * 1.5 * 2); /* Change 1.1 to font size, and 1.5 to line height */
    }

    .book-card p {
        font-size: 0.8rem;
        padding-left: 15px;
        padding-top: 9px;
        padding-bottom: 18px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
    
    #footer-newsletter-form {
        flex-direction: column;
    }
}