@font-face {
    font-family: 'B-Titr';
    src: url('../fonts/BTITRBD.eot');
    src: url('../fonts/BTITRBD.eot?#iefix') format('embedded-opentype'),
         url('../fonts/BTITRBD.woff2') format('woff2'),
         url('../fonts/BTITRBD.woff') format('woff'),
         url('../fonts/BTITRBD.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-peach: #FFEBE0;
    --bg-white: #ffffff;
    --bg-gray: #f5f5f5;
    --text-dark: #383838;
    --border-peach: #f3e5dc;
    --border-gray: #e0e0e0;
    --footer-bg: #191919;
    --font-sans: 'Vazirmatn', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-b-titr: 'B-Titr', 'Vazirmatn', sans-serif;
    --nav-height: 70px;
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease;
}

/* Reset and Global Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: var(--bg-white);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

.page-container {
    max-width: 1920px;
    margin: 0 auto;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'B-Titr', var(--font-b-titr);
    font-weight: 700;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

p {
    margin-bottom: 0.9rem;
}

section > h2 {
    text-align: center !important;
}

.nav-brand,
.hamburger {
    display: none;
}

.hamburger {
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 1001;
}

.hamburger .line {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-dark);
    margin: 6px 0;
    transition: all var(--transition-fast);
}

/* Header & Hero Section */
.hero {
    --hero-padding-top: 2rem;
    background-color: var(--bg-peach);
    padding: var(--hero-padding-top) 0 0;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    width: 100%;
    max-width: 1200px;
    padding: var(--nav-height) 0 4rem;
    text-align: center;
}

.hero-text {
    order: 2;
    text-align: right;
}

.hero-text p {
    font-family: var(--font-b-titr);
    font-size: 1.3rem;
    font-style: normal;
}

.hero-image-container {
    order: 1;
    position: relative;
    margin: 0 auto;

    img {
        max-width: 400px;
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 3%;
    }
}

.hero-name-overlay {
    position: absolute;
    top: 50%;
    left: -45%;
    transform: translateY(-50%);
    z-index: 2;
    text-align: right !important;

    h1 {
        font-family: var(--font-serif) !important;
        font-size: 2rem !important;
        line-height: 1.0;
        text-align: right !important;
    }
}

.main-nav {
    display: none;
}

section {
    --section-padding: 4rem;
    --section-max-width: 960px;
    padding: var(--section-padding) 10%;
    max-width: var(--section-max-width);
    margin: 0 auto;
}

/* Timeline Component */
.timeline-container {
    --timeline-max-width: 700px;
    border: 1px solid var(--border-gray);
    padding: 2rem;
    max-width: var(--timeline-max-width);
    margin: 0 auto;
    text-align: right;
    border-radius: 8px;
}

/* Home Bio Section */
.home-bio {
    background-color: var(--bg-gray);
    width: 100%;
    max-width: 100%;

    .timeline-container {
        padding: 3rem;
    }

    .timeline-item {
        ul {
            list-style-type: none;
            padding-left: 1rem;
        }

        li {
            margin-bottom: 1rem;
            position: relative;
            padding-left: 20px;

            &::before {
                content: '■';
                position: absolute;
                left: 0;
                color: var(--text-dark);
            }
        }
    }
}

/* About Me Section */
.about-me {
    text-align: right;

    p {
        max-width: var(--timeline-max-width);
        margin: 0 auto 1.5rem;
        font-size: 1.1rem;
        line-height: 2;
    }
}

/* Education & Blog Sections */
.education,
.blog {
    background-color: var(--bg-white);

    .timeline-container {
        border-color: var(--border-peach);
    }
}

.book-cover-image {
    display: block;
    margin: 0 auto 2rem;
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}



.timeline-item ul {
    list-style-type: none;
    padding-left: 1rem;
}

.timeline-item li {
    margin-bottom: 1rem;
    position: relative;
    padding-left: 20px;
}

.timeline-item li::before {
    content: '■';
    position: absolute;
    left: 0;
    color: var(--text-dark);
}


.timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-item h3 {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-sans);
    margin-bottom: 1rem;
}

.timeline-item p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 0;
}

.timeline-item .poem {
    font-family: var(--font-sans) !important;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 2;
}

.poem-separator {
    border: 0;
    height: 2px;
    background-color: var(--border-peach);
    margin: 3rem 0;
}

/* View Articles Button */
.view-articles-btn {
    display: block;
    width: -moz-fit-content;
    width: fit-content;
    margin: 2rem auto 4rem;
    padding: 0.8rem 2.5rem;
    border: 1px solid var(--text-dark);
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.view-articles-btn:hover {
    background-color: var(--text-dark);
    color: var(--bg-white);
}

/* Contact Section */
.contact .contact-container {
    border: 1px solid var(--border-peach);
    padding: 3rem;
    text-align: center;
}

.contact-info {
    margin-bottom: 2rem;
}

.contact-info a {
    color: var(--text-dark);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-social {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.contact-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--bg-white);
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-social a:hover {
    opacity: 0.8;
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.back-to-top {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background-color: var(--bg-white);
    color: var(--text-dark);
    text-align: center;
    line-height: 36px;
    font-size: 1.5rem;
    text-decoration: none;
    border: 1px solid var(--footer-bg);
    border: 1px solid var(--footer-bg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --hero-text-size-large: 4.5rem;
        --hero-img-max-width: 350px;
    }

    .hero-text h1 {
        font-size: var(--hero-text-size-large);
    }

    .hero-image-container img {
        max-width: var(--hero-img-max-width);
    }

    .hero-name-overlay {
        position: relative !important;
        text-align: center;
        right: 0 !important;
        top: 0% !important;
        transform: translateY(-0%) !important;

        h1 {
            font-family: var(--font-serif) !important;
            font-size: 2rem !important;
            line-height: 1.0;
            text-align: right !important;
        }
    }

}

@media (max-width: 768px) {
    :root {
        --section-padding-mobile: 3rem;
        --mobile-heading-size: 2rem;
        --nav-padding: 1.5rem;
        --mobile-link-size: 1.8rem;
        --hero-img-max-width-mobile: 280px;
    }


    h2 {
        font-size: var(--mobile-heading-size);
    }

    /* Section Layouts */
    section {
        padding: var(--section-padding-mobile) 5%;
    }

    /* Navigation */
    /* Navigation */
    .main-nav {
        position: fixed;
        top: 0;
        width: 100%;
        height: var(--nav-height);
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--bg-peach);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border-peach);
        z-index: 1000;
    }

    .nav-links {
        display: flex;
    }

    .main-nav a {
        text-decoration: none;
        color: var(--text-dark);
        margin: 0 1rem;
        font-size: 1rem;
        transition: all var(--transition-fast);
        padding: 0.5rem 0;
        border-bottom: 2px solid transparent;
    }

    .main-nav a:hover {
        color: #000;
    }

    .main-nav a.active {
        font-weight: 700;
        border-bottom-color: var(--text-dark);
    }

    .main-nav {
        width: 100%;
        height: var(--nav-height);
        flex-direction: row;
        justify-content: space-between;
        padding: 0 var(--nav-padding);
        background-color: rgba(255, 235, 224, 0.98);
    }

    .nav-brand {
        display: block;
        font-weight: 700;
    }

    .hamburger {
        display: block;

        &.open {
            .line1 {
                transform: rotate(-45deg) translate(-5px, 6px);
            }

            .line2 {
                opacity: 0;
            }

            .line3 {
                transform: rotate(45deg) translate(-5px, -6px);
            }
        }
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background-color: rgba(255, 235, 224, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(-100%);
        transition: transform var(--transition-fast);

        &.open {
            transform: translateX(0);
        }

        a {
            margin: 1.5rem 0;
            font-size: var(--mobile-link-size);
            font-weight: 700;
        }
    }

    /* Hero Dots - Hide on mobile */
    .hero-dots {
        display: none;
    }



    .hero-dots a:hover span,
    .hero-dots a.active span {
        background-color: var(--text-dark);
    }

    .hero-image-container {
        order: 1;
        margin-bottom: 2rem;

        img {
            max-width: var(--hero-img-max-width-mobile);
        }
    }

    /* Bio Section */
    .home-bio {
        padding: var(--section-padding-mobile) 5%;
    }

    /* Timeline Containers */
    .timeline-container,
    .contact-container {
        padding: 2rem;
    }
}

@media (min-width: 1025px) {
    .hero-dots {
        position: fixed;
        right: 3rem;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        z-index: 10;
    }

    .hero-dots a {
        display: block;
        width: 10px;
        height: 10px;
    }

    .hero-dots span {
        display: block;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: 1.5px solid var(--text-dark);
        background-color: transparent;
        transition: all var(--transition-fast);
    }

    .hero-dots a:hover span,
    .hero-dots a.active span {
        background-color: var(--text-dark);
    }
}

html,
body,
p,
span,
a {
    line-height: 1.6 !important;
    font-size: 16px !important;
}

/* Reduce excessive paragraph gaps */
p {
    margin-top: 0 !important;
    margin-bottom: 0.9rem !important;
}


/* Hide paragraphs that only contain a single non-breaking space to remove empty gaps */
p[data-empty="true"] {
    display: none !important;
}

/* Apply B Titr font to Persian text */
.hero-text p {
    font-family: var(--font-b-titr) !important;
}
