/* --- CSS Variables & Theme Setup --- */
:root {
    --bg-primary: #fdfbf7; 
    --bg-secondary: #f3f0e8; 
    --text-primary: #2c3e50; 
    --text-secondary: #5a6a7e;
    --accent-gold: #c5a059; 
    --accent-gold-dark: #a38243;
    --accent-green: #1e4d43; 
    --border-color: #e1dcc8;
    --shadow: rgba(30, 77, 67, 0.08);
    --pattern-opacity: 0.05;
}

body.darkmode {
    --bg-primary: #121a21; 
    --bg-secondary: #1a2632; 
    --text-primary: #e6e1d3; 
    --text-secondary: #b0b8c3;
    --accent-gold: #d4af67; 
    --accent-gold-dark: #b7892b;
    --accent-green: #2d6a5e; 
    --border-color: #2c3e50;
    --shadow: rgba(0, 0, 0, 0.3);
    --pattern-opacity: 0.03;
}

/* --- General Reset & Typography --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[lang="ar"] { font-family: 'Amiri', serif; line-height: 1.8; }
h1, h2, h3 { font-family: 'Merriweather', serif; color: var(--text-primary); }
h2.arabic-name, .logo-ar-text, .footer-arabic { font-family: 'Reem Kufi', sans-serif; }
a { text-decoration: none; color: inherit; transition: color 0.3s; }
ul { list-style: none; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
}

/* --- Header & Navigation --- */
header {
    background: var(--bg-primary);
    border-bottom: 3px solid var(--accent-gold);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background 0.3s;
}

.site-logo {
    height: 48px;
    width: auto;
    display: block;
}


@media (max-width: 768px) {
    .site-logo {
        height: 42px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    .logo-ar-text {
        font-size: 1.15rem;
    }
}


.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
}

/* Text-Only Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}



.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Merriweather', serif;
    color: var(--text-primary);
}

.logo-ar-text {
    font-size: 1.3rem;
    font-family: 'Reem Kufi', sans-serif;
    font-weight: 700;
    color: var(--accent-gold);
    margin-left: 4px; /* subtle separation */
}


/* Nav & Hamburger */
nav { display: flex; align-items: center; gap: 25px; }

.nav-links { display: flex; gap: 25px; align-items: center; }
.nav-links a { font-weight: 600; font-size: 0.95rem; position: relative; }
.nav-links a:hover { color: var(--accent-gold); }
.mobile-actions { display: none; }

.nav-actions-desktop { display: flex; align-items: center; gap: 15px; }

/* Social Icons & Buttons */
.social-icon { font-size: 1.2rem; color: var(--text-primary); transition: color 0.3s; }
.social-icon:hover { color: #E1306C; }

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}
#theme-toggle:hover { background: var(--accent-gold); color: var(--bg-primary); }

/* HAMBURGER MENU STYLES */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-primary);
}

.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- Hero Section --- */
.hero {
    background-color: var(--accent-green);
    color: #fff;
    text-align: center;
    padding: 110px 20px;
    position: relative;
    overflow: hidden;
}

.pattern-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: var(--pattern-opacity);
    background-image: radial-gradient(var(--accent-gold) 2px, transparent 2px);
    background-size: 30px 30px;
    pointer-events: none;
}

.hero-content { position: relative; z-index: 2; }
.bismillah { font-size: 1.8rem; color: var(--accent-gold); margin-bottom: 20px; }

.main-title { color: #fff; font-size: 3.5rem; margin-bottom: 5px; line-height: 1.2; }
.subtitle { font-size: 1.5rem; color: #ddd; font-weight: 300; margin-bottom: 25px; }

/* Dedication Box Style */
.dedication-box {
    margin: 0 auto 10px auto;
    max-width: 700px;
    color: var(--accent-gold);
    font-size: 1rem;
    font-family: 'Merriweather', serif;
    font-style: italic;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid rgba(197, 160, 89, 0.3);
}

.divider-ornament { color: var(--accent-gold); margin: 20px 0; font-size: 1.2rem; }
.tagline { opacity: 0.9; margin-bottom: 35px; letter-spacing: 0.5px; line-height: 1.8; }
.sadaqah-tag { color: var(--accent-gold); font-weight: 600; display: block; margin-top: 5px; }

.btn-gold {
    display: inline-block;
    background: var(--accent-gold);
    color: var(--bg-primary);
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 700;
    border: 2px solid var(--accent-gold);
    transition: all 0.3s;
}
.btn-gold:hover { background: transparent; color: var(--accent-gold); }

/* --- Sections & Typography --- */
section { padding: 80px 0; transition: background 0.3s; }
.section-primary { background: var(--bg-primary); }
.section-secondary { background: var(--bg-secondary); border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color); }

.section-title {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
    position: relative;
    padding-bottom: 15px;
}
.section-title::after { content: '♦'; position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); color: var(--accent-gold); }
.section-title::before { content: ''; position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: 100px; height: 2px; background: var(--accent-gold); }

.content-box { max-width: 800px; margin: 0 auto; text-align: center; }

/* Restore bullets for About the Author list */
#about ul {
    list-style: disc;
    margin: 20px auto;
    padding-left: 20px;
    max-width: 650px;
    text-align: left;
}

#about ul li {
    margin-bottom: 10px;
    color: var(--text-primary);
}



.lead { font-size: 1.1rem; margin-bottom: 20px; color: var(--text-primary); }
.bio-divider { border: 0; height: 1px; background: var(--border-color); width: 50%; margin: 30px auto; }

/* --- CAROUSEL STYLES --- */
.carousel-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

.slide {
    display: none;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slide.active { display: block; opacity: 1; }

.quote-text {
    font-family: 'Merriweather', serif;
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 25px;
    position: relative;
}

.quote-text::before, .quote-text::after {
    color: var(--accent-gold);
    font-size: 3rem;
    opacity: 0.3;
    position: absolute;
}
.quote-text::before { content: '“'; top: -20px; left: -20px; }
.quote-text::after { content: '”'; bottom: -40px; right: -20px; }

.citation { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.scholar { font-weight: 700; color: var(--accent-green); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rahima { font-family: 'Amiri', serif; font-weight: normal; color: var(--accent-gold); font-size: 0.9em; }
.source { font-size: 0.9rem; color: var(--text-secondary); }

.carousel-btn {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: var(--accent-gold);
    background: none;
    border: none;
    font-weight: bold;
    font-size: 24px;
    transition: 0.3s;
    user-select: none;
}
.carousel-btn:hover { color: var(--text-primary); }
.prev { left: 0; }
.next { right: 0; }

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: var(--border-color);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}
.active-dot, .dot:hover { background-color: var(--accent-gold); }

/* --- Works & Magazine Grid --- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }

.card {
    background: var(--bg-primary);
    padding: 35px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 5px 15px var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.desk-ornament::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 50px; height: 50px;
    border-top: 3px solid var(--accent-gold);
    border-left: 3px solid var(--accent-gold);
    opacity: 0.3;
    border-top-left-radius: 8px;
}

/* Magazine Card Specifics */
.magazine-card { text-align: center; }
.mag-icon { font-size: 3rem; color: var(--accent-gold); margin-bottom: 20px; }

.card:hover { transform: translateY(-7px); box-shadow: 0 15px 30px var(--shadow); }
.card h3 { margin-bottom: 15px; font-size: 1.4rem; }
.card .desc { margin-bottom: 25px; color: var(--text-secondary); font-size: 0.95rem; }

.card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.magazine-card .card-footer { justify-content: center; }

.type-badge { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-gold-dark); font-weight: 700; }
.type-badge.forthcoming { color: var(--text-secondary); opacity: 0.7; }

.btn-text {
    background: none; border: none;
    color: var(--accent-green);
    font-weight: 700; cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    transition: color 0.3s;
}
.btn-text i { margin-left: 5px; font-size: 0.8rem; transition: transform 0.3s; }
.btn-text:hover { color: var(--accent-gold); }
.btn-text:hover i { transform: translateX(5px); }

/* --- Contact & Footer --- */
/* --- Contact & Footer --- */
.contact-links {
    margin-top: 30px;
    display: flex;
    flex-direction: row;          /* horizontal */
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;              /* wraps nicely on mobile */
}


.email-link {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 1.1rem;
    color: var(--accent-green);
    font-weight: 700;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s;
    word-break: nowrap;
}

/* Make social links more compact so all fit in one row */
.social-link {
    padding: 8px 14px;
    font-size: 1rem;
}


.email-link:hover { background: var(--accent-green); color: #fff; border-color: var(--accent-green); }

.instagram-link { border-color: transparent; color: #E1306C; }
.instagram-link:hover { background: #E1306C; color: white; border-color: #E1306C; }

footer { background: var(--accent-green); color: #fff; text-align: center; padding: 40px 0; }
.footer-arabic { font-size: 1.5rem; color: var(--accent-gold); margin-bottom: 15px; }
footer p { opacity: 0.8; font-size: 0.9rem; }

/* Footer social icons contrast fix */
footer .social-icon {
    color: var(--accent-gold);
    font-size: 1.3rem;
    margin: 0 8px;
    transition: color 0.3s ease;
}

footer .social-icon:hover {
    color: #ffffff;
}


/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .hamburger { display: block; }
    .nav-actions-desktop { display: none; }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: 60px; /* Adjusted based on header padding */
        gap: 0;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 100%;
        height: 100vh;
        text-align: center;
        transition: 0.3s;
        border-top: 1px solid var(--border-color);
        padding-top: 20px;
    }

    .nav-links.active { left: 0; }
    .nav-links li { margin: 20px 0; }
    
    .mobile-actions { display: block; font-size: 1.5rem; }

    #theme-toggle {
        display: block;
        position: absolute;
        right: 70px; 
        top: 20px;
    }

    .hero { padding: 80px 20px; }
    .main-title { font-size: 2.8rem; }
    .subtitle { font-size: 1.2rem; }
    
    .dedication-box { font-size: 0.95rem; padding: 15px; }
    
    .quote-text { font-size: 1.1rem; }
    .carousel-container { padding: 0; }
    .carousel-btn { display: none; }
}

