﻿@media (min-width: 1200px) {

    .navmenu {
        left: 0;
        right: auto;
        width: 300px;
        top: 0;
        bottom: 0;
    }

    main {
        margin-left: 300px;
    }

    .mobile-nav-toggle {
        left: 250px;
        right: auto;
    }

    /* Desktop: Sidebar is always visible */
    .navmenu {
        left: 0 !important;
        right: auto !important;
        transform: none !important;
    }

    .mobile-nav-toggle {
        display: none !important;
    }
}
/* =========================================
   Sidebar Typography
   ========================================= */

@media (min-width: 1200px) {

    .navmenu {
        font-family: var(--default-font);
    }

        .navmenu .sitename {
            font-size: 24px;
            font-weight: 700;
            line-height: 1.2;
            color: var(--contrast-color);
            margin-bottom: 8px;
        }

        .navmenu .description {
            font-size: 15px;
            line-height: 1.5;
            color: color-mix(in srgb, var(--contrast-color), transparent 20%);
            margin-bottom: 20px;
        }

        .navmenu a,
        .navmenu a:focus {
            font-size: 16px;
            font-weight: 500;
        }
}
/* =========================================
   Sidebar Menu Typography
   ========================================= */

@media (min-width: 1200px) {

    .navmenu a,
    .navmenu a:focus {
        color: #1f4f85;
        font-size: 16px;
        font-weight: 500;
        padding: 9px 14px;
    }

        .navmenu a:hover,
        .navmenu .active,
        .navmenu .active:focus {
            color: #0d6efd;
        }
}
@media (min-width: 1200px) {

    .navmenu .social-links a {
        color: #1f4f85;
        background-color: #eef4fb;
    }

        .navmenu .social-links a:hover {
            color: #ffffff;
            background-color: #0d6efd;
        }
}
@media (min-width: 1200px) {

    .profile-info {
        margin: 25px 20px 20px;
    }

        .profile-info .sitename {
            font-size: 24px;
            font-weight: 700;
            line-height: 1.25;
            margin-bottom: 10px;
        }

        .profile-info .job-title {
            font-size: 15px;
            line-height: 1.6;
            margin: 0;
            opacity: 0.85;
        }
}

/* =========================================
   Sidebar - Desktop
   ========================================= */

@media (min-width: 1200px) {

    .navmenu {
        position: fixed !important;
        left: 0 !important;
        right: auto !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 300px !important;
        height: 100vh !important;
        background-color: #0d6efd;
        padding: 20px 20px;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden;
        box-shadow: none;
        z-index: 997;
    }


        /* Sidebar Menu */
        .navmenu ul {
            width: 100%;
            padding: 0;
            margin: 0;
            list-style: none;
            overflow: hidden;
        }


        /* Menu Items */
        .navmenu li {
            margin-bottom: 4px;
        }


        /* Menu Links */
        .navmenu a,
        .navmenu a:focus {
            color: #ffffff;
            font-size: 16px;
            font-weight: 600;
            padding: 8px 12px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            white-space: normal;
            line-height: 1.3;
            transition: all 0.3s ease;
        }


            /* Hover / Active */
            .navmenu a:hover,
            .navmenu .active,
            .navmenu .active:focus {
                color: #ffffff;
                background-color: rgba(255, 255, 255, 0.15);
            }


    /* Logo */
    .sidebar-logo {
        width: 180px;
        height: 180px;
        margin: 0 auto 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }


        .sidebar-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }


    /* Mobile toggle is hidden on desktop */
    .mobile-nav-toggle {
        display: none !important;
    }
}
/* =========================================
   Project Title
========================================= */

.portfolio .project-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--heading-color);
    margin: 0 0 12px 0;
    text-align: center;
}

/* =========================================
   Professional Experience - Subtitles
========================================= */

.experience-subtitle {
    font-size: 19px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--heading-color);
    margin-top: 22px;
    margin-bottom: 10px;
}


/* First subtitle in each experience card */

.card-body .experience-subtitle:first-child {
    margin-top: 0;
}


/* Achievement lists */

.achievements {
    margin-top: 0;
    margin-bottom: 0;
    padding-left: 0;
}


    /* Space between achievement items */

    .achievements li {
        margin-bottom: 7px;
        line-height: 1.5;
    }

/* =========================================
   Project Card Title Alignment
   ========================================= */

.portfolio .project-title {
    min-height: 64px;
    margin: 0;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.25;
    font-size: 20px;
    font-weight: 500;
    color: #1f4f85;
}



/* =========================================
   Project Image Alignment
   ========================================= */

.portfolio .entry-image {
    margin: 0;
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
}

    .portfolio .entry-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }



/* =========================================
   Project Title Alignment
   ========================================= */

.portfolio .entry-title {
    min-height: 72px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    text-align: center;
}

/* Language Switcher */
.language-switcher {
    margin-top: 10px;
    margin-bottom: 10px;
}

.language-box {
    display: inline-flex;
    align-items: center;
    border: 1px solid #000000;
    border-radius: 6px;
    padding: 2px 5px;
    background: transparent;
}

.language-button {
    display: inline-block;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 7px;
    text-decoration: none;
    white-space: nowrap;
}

    .language-button:hover {
        color: #ffffff;
        opacity: 0.7;
    }

.language-divider {
    color: #000000;
    font-size: 13px;
    user-select: none;
}

.career-journey-image {
    width: 100%;
    max-width: 1400px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 12px;
    cursor: zoom-in;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.publication-description {
    text-align: justify;
    white-space: pre-line;
}


/* =========================================
   Publications By Type
========================================= */

.publication-card-link {
    display: block;
    width: 100%;
    color: inherit;
}

.publication-card {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .publication-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    }

.publication-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.publication-card .card-body {
    padding: 1.5rem;
}

.publication-title {
    line-height: 1.4;
    margin-bottom: 1.25rem;
    /*
       فضای ثابت برای عنوان‌ها.
       بنابراین Type و Year در کارت‌ها
       در یک موقعیت منظم قرار می‌گیرند.
    */
    min-height: 120px;
}

.publication-meta {
    margin-top: auto;
}

/* =========================
   Resume Language Selection
   ========================= */

.resume-language-card {
    height: 100%;
    padding: 35px 25px;
    text-align: center;
    background: var(--surface-color);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .resume-language-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

.resume-language-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.resume-language-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.resume-language-card p {
    font-size: 14px;
    margin-bottom: 25px;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
}

.resume-language-button {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .resume-language-button:hover {
        background: var(--accent-color);
        color: #ffffff;
    }

/* =========================
   Resume List
   ========================= */

.resume-card {
    height: 100%;
    padding: 28px 30px;
    background: var(--surface-color);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .resume-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    }

.resume-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.resume-card h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.resume-details-button {
    flex-shrink: 0;
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

    .resume-details-button:hover {
        background: var(--accent-color);
        color: #ffffff;
    }

/* =========================
   Resume Details
   ========================= */

.resume-details-card {
    max-width: 1000px;
    margin: 0 auto;
    padding: 35px;
    background: var(--surface-color);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
    border-radius: 12px;
}

.resume-details-header {
    margin-bottom: 30px;
}

    .resume-details-header h3 {
        margin-bottom: 8px;
        font-size: 28px;
        font-weight: 700;
    }

.resume-area {
    margin: 0;
    color: color-mix(in srgb, var(--default-color), transparent 30%);
}

.resume-detail-section {
    margin-top: 30px;
}

    .resume-detail-section h4 {
        margin-bottom: 12px;
        font-size: 18px;
        font-weight: 700;
    }



.resume-pdf-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.resume-info-list {
    margin-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
}

.resume-info-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 25px;
    padding: 15px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--default-color), transparent 85%);
}

.resume-info-label {
    font-weight: 700;
    color: var(--default-color);
}

.resume-info-value {
    color: color-mix(in srgb, var(--default-color), transparent 20%);
}

@media (max-width: 576px) {

    .resume-info-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

.resume-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.resume-view-button,
.resume-details-button {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.resume-view-button {
    background: var(--accent-color);
    color: #ffffff;
    border: 1px solid var(--accent-color);
}

    .resume-view-button:hover {
        color: #ffffff;
        opacity: 0.85;
    }

.resume-details-button {
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

    .resume-details-button:hover {
        background: var(--accent-color);
        color: #ffffff;
    }

@media (max-width: 576px) {

    .resume-card-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .resume-card-actions {
        width: 100%;
    }
}

/* Sidebar Vertical Scrolling */
#navmenu {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

    /* Allow the sidebar list to use the parent's scroll */
    #navmenu > ul {
        max-height: none;
        overflow: visible !important;
        padding-bottom: 35px;
    }

/* Mobile Sidebar */
.mobile-nav-active #navmenu {
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Step 2: Professional Sidebar Navigation */

#navmenu > ul > li > a {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3px 10px !important;
    padding: 10px 12px !important;
    border-radius: 8px;
    transition: all 0.25s ease;
}

    /* Subtle hover effect */
    #navmenu > ul > li > a:hover {
        background-color: rgba(255, 255, 255, 0.08) !important;
        color: var(--accent-color) !important;
        transform: translateX(-3px);
    }

    /* Accent line on hover */
    #navmenu > ul > li > a::before {
        content: "";
        position: absolute;
        left: 8px;
        top: 25%;
        width: 3px;
        height: 50%;
        border-radius: 10px;
        background-color: var(--accent-color);
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    #navmenu > ul > li > a:hover::before {
        opacity: 1;
    }


/* Step 3: Better Multi-line Sidebar Links */

#navmenu > ul > li > a {
    line-height: 1.5;
    min-height: 42px;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
}

/* Better spacing for long navigation labels */
#navmenu > ul > li > a {
    padding: 10px 18px !important;
}


/* Center Logout Button */
#navmenu > ul > li form button {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    width: 100% !important;
    padding: 10px 12px !important;
}

/* Align Language Switcher with Sidebar Items */

#navmenu > ul > li.language-switcher {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 10px 0 !important;
}

#navmenu .language-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Step 4: Divider Below Sidebar Logo */

#navmenu .sidebar-logo {
    padding-bottom: 18px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

/* Step 5: Sidebar Navigation Spacing */

#navmenu > ul > li > a {
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}

/* Sidebar icons aligned to the left */
#navmenu .icon-link {
    position: relative;
}

    #navmenu .icon-link i {
        position: absolute;
        left: 18px;
        margin: 0 !important;
    }


.credential-description p {
    text-align: justify !important;
    text-justify: inter-word;
}
/* Justified text for detail descriptions */
.detail-description {
    text-align: justify !important;
    text-justify: inter-word;
}

/* Project cards - equal title area */
.portfolio-entry {
    height: 100%;
}

    .portfolio-entry .portfolio-info {
        min-height: 78px;
        padding: 14px 12px 16px;
        display: flex;
        align-items: flex-start;
    }

    .portfolio-entry .project-title {
        margin: 0;
        width: 100%;
        font-size: 18px;
        line-height: 1.45;
        font-weight: 600;
    }

    /* Project images - equal height */
    .portfolio-entry .entry-image {
        position: relative;
        overflow: hidden;
        aspect-ratio: 16 / 10;
        margin: 0;
    }

        .portfolio-entry .entry-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

/* =========================================
   Publications - Card Layout
========================================= */

.publication-card-link {
    display: block;
    height: 100%;
}

.publication-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
}

.publication-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.publication-card .card-body {
    min-height: 180px;
    padding: 18px;
}

.publication-title {
    margin-bottom: 18px;
    width: 100%;
    line-height: 1.45;
    font-size: 19px;
    font-weight: 600;
    text-align: justify !important;
    text-justify: inter-word;
}


/* Project Details - Justified Text */
.project-details-text {
    text-align: justify !important;
    text-justify: inter-word;
    line-height: 1.8;
}


/* Project title link */
.portfolio-entry .project-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

    .portfolio-entry .project-title-link:hover {
        color: var(--accent-color);
    }

.about-content .intro p {
    text-align: justify;
    text-justify: inter-word;
}

.about-content {
    padding-right: 30px;
    padding-left: 10px;
}