/* =========================================================
   Publications Page
   ========================================================= */


/* ---------- General ---------- */

.publications-page {
    width: 100%;
    direction: rtl;
}


/* ---------- Filter & Sort ---------- */

.publications-filters {
    width: 100%;
    margin: 20px 0 30px;
    text-align: center;
    direction: rtl;
    font-family: "B Yekan", Tahoma, sans-serif;
}

.publications-filters form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center !important;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 auto !important;
    text-align: center;
}

.publications-filters label {
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 14px;
}


/* ---------- Native Select ---------- */
/* فقط برای حفظ ساختار فرم؛ در صفحه مخفی است */

.publication-select {
    font-family: "B Yekan", Tahoma, sans-serif !important;
    font-size: 14px !important;
    font-weight: normal !important;
    direction: rtl;
    text-align: right;
}


/* ---------- Custom Select ---------- */

.custom-select-wrapper {
    position: relative;
    width: 250px;
}

.custom-select-wrapper > .publication-select {
    display: none;
}

.custom-select-display {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 14px;
    line-height: 22px;
    direction: rtl;
    text-align: right;
    cursor: pointer;
}

.custom-select-options {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    z-index: 1000;
}

.custom-select-option {
    padding: 8px 12px;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 14px;
    direction: rtl;
    text-align: right;
    cursor: pointer;
}

.custom-select-option:hover {
    background-color: #f5f5f5;
}


/* ---------- Custom Select Arrow ---------- */

.custom-select-arrow {
    font-family: Tahoma, sans-serif;
    font-size: 10px;
    margin-right: 8px;

    transition: transform 0.2s ease;
}

.custom-select-display.open .custom-select-arrow {
    transform: rotate(180deg);
}


/* =========================================================
   Publication Layout
   ========================================================= */

.publication-item {
    width: 100%;
    margin-bottom: 30px;
    overflow: hidden;
}


/* ---------- Image + Information ---------- */

.publication-main { 
    width: 100%; 
    display: flex; 
    flex-direction: row-reverse; 
    align-items: flex-start; 
}


/* ---------- Publication Image ---------- */

.publication-image {
    width: 50%;
    text-align: center;
    box-sizing: border-box;
}

.publication-image img {
    width: 300px;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}


/* ---------- Publication Information ---------- */

.publication-info {
    width: 50%;
    box-sizing: border-box;
    padding: 0 15px;
}


/* ---------- Publication Text ---------- */

.publication-info p {
    line-height: 1.9;
}



/* ---------- Download Row ---------- */

.publication-download-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}


/* ---------- Download Button ---------- */

.download-box {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 40px;
    margin: 0 !important;
    padding: 8px 12px;
    box-sizing: border-box;
    background: #f5f5f5;
    border-right: 4px solid green;
    border-radius: 4px;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}


/* ---------- Download Count ---------- */

.download-count-box {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    height: 40px;
    margin: 0 !important;
    padding: 8px 12px;
    box-sizing: border-box;
    background-color: #f5f5f5;
    border-right: 4px solid green !important;
    border-radius: 4px;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}


/* ---------- Download Link ---------- */

.download-box a {
    display: block;
    margin: 0;
    padding: 0;
    color: #2e7d32;
    text-decoration: none;
    line-height: 1.5;
}

.download-box a:hover {
    text-decoration: underline;
}


.download-count-box strong {
    margin: 0;
    padding: 0;
    color: #333;
    font-size: 15px;
}

/* ---------- Publication Title ---------- */
.publication-title {
    font-family: "B Yekan", Tahoma, sans-serif;
    margin-top: 0;
    margin-bottom: 18px;
    padding-bottom: 12px;
    color: #333;
    border-bottom: 1px solid #ddd;
    line-height: 1.8;
}


/* عنوان کوچک */

.publication-title-label {
    display: block;
    margin-bottom: 4px;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 15px;
    font-weight: bold;
    color: #555;
}

/*عنوان محصول*/
.publication-title-text {
    display: block;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 19px;
    font-weight: bold;
    line-height: 2;
    color: #333;
}


/* ---------- Publication Meta ---------- */

.publication-meta {
    width: 100%;
    margin-top: 0;
    margin-bottom: 18px;
    font-family: "B Yekan", Tahoma, sans-serif;
    color: #444;
}


.publication-meta-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    line-height: 1.8;
}


.publication-meta-label {
    display: inline-block;
    min-width: 105px;
    font-size: 14px;
    font-weight: bold;
    color: #777;
}


.publication-meta-value {
    font-size: 15px;
    font-weight: normal;
    color: #444;
}


/* ---------- Publication Summary ---------- */


.publication-summary {
    width: 100%;
    margin-top: 22px;
    margin-bottom: 22px;
    padding: 15px 18px;
    box-sizing: border-box;
    background-color: #fafafa;
    border-right: 4px solid #2e7d32;
    border-radius: 4px;
    font-family: "B Yekan", Tahoma, sans-serif !important;
    text-align: justify;
    line-height: 2.1;
}


/* ---------- Summary Title ---------- */

.publication-summary-title {
    display: block;
    margin-bottom: 6px;
    font-family: "B Yekan", Tahoma, sans-serif !important;
    font-size: 15px;
    font-weight: bold;
    color: #555;
}


/* ---------- Summary Text ---------- */

.publication-summary-text {
    display: block;
    font-family: "B Yekan", Tahoma, sans-serif !important;
    font-size: 15px;
    font-weight: normal;
    line-height: 2.1;
    color: #444;
}



.publication-item > div:last-of-type p {
    text-align: justify;
    line-height: 2;
}



/* ---------- Separator ---------- */

.publication-separator {
    border: none;
    height: 1px;
    background-color: #ddd;
    width: 70%;
    margin: 35px auto;
}


/* ---------- Pagination ---------- */

.publications-pagination {
    text-align: center;
    margin: 40px 0;
}

.publications-pagination a,
.publications-pagination span {
    display: inline-block;
    margin: 0 3px;
    padding: 6px 12px;
    text-decoration: none;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.publications-pagination a {
    color: #333;
}

.publications-pagination a:hover {
    background-color: #f5f5f5;
}

.publications-pagination .current-page {
    background-color: #333;
    color: #fff;
    border-color: #333;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {

    /* ---------- Filters ---------- */

    .publications-filters form {
        flex-direction: column;
    }

    .custom-select-wrapper {
        width: 90%;
        max-width: 350px;
    }


    /* ---------- Publication Main ---------- */

    .publication-main {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }


    /* ---------- Image ---------- */

    .publication-image {
        width: 100%;
        margin-bottom: 20px;
        text-align: center;
    }

    .publication-image img {
        display: block;
        width: 250px;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }


    /* ---------- Information ---------- */

    .publication-info {
        width: 100%;
        margin-top: 10px;
        padding: 0;
    }

    /* ---------- Meta Information ---------- */

    .publication-meta {
        width: 100%;
    }

    .publication-meta-item {
        padding: 8px 0;
    }

    .publication-meta-label {
        min-width: 95px;
    }


    /* ---------- Download ---------- */

    .publication-download-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }


    /* ---------- Summary ---------- */

    .publication-summary {
        margin-top: 15px;
        padding: 12px 14px;
    }

    .publication-summary-text {
        font-size: 14px;
    }


    /* ---------- Separator ---------- */

    .publication-separator {
        width: 80%;
        margin: 30px auto;
    }


    /* ---------- Pagination ---------- */

    .publications-pagination a,
    .publications-pagination span {
        margin: 3px 1px;
        padding: 5px 9px;
    }

}
 /* =========================================================
    Tablet
    ========================================================= */

@media (min-width: 768px) and (max-width: 991px) {

    /* ---------- Publication Main ---------- */

    .publication-main {
        width: 100%;
        display: flex;
        flex-direction: row-reverse;
        align-items: flex-start;
        gap: 20px;
    }


    /* ---------- Image ---------- */

    .publication-image {
        width: 45%;
        text-align: center;
        box-sizing: border-box;
    }

    .publication-image img {
        display: block;
        width: 260px !important;
        max-width: 100%;
        height: auto;
        margin: 0 auto;
    }


    /* ---------- Information ---------- */

    .publication-info {
        width: 55%;
        margin-top: 0;
        padding: 0;
        box-sizing: border-box;
    }


    /* ---------- Title ---------- */

    .publication-title {
        margin-bottom: 15px;
    }

    .publication-title-text {
        font-size: 18px;
        line-height: 1.9;
    }


    /* ---------- Meta Information ---------- */

    .publication-meta-item {
        padding: 7px 0;
    }

    .publication-meta-label {
        min-width: 95px;
    }


    /* ---------- Summary ---------- */

    .publication-summary {
        margin-top: 18px;
        margin-bottom: 20px;
        padding: 13px 16px;
    }

    .publication-summary-text {
        font-size: 14px;
    }


    /* ---------- Download ---------- */

    .publication-download-row {
        flex-wrap: nowrap;
        gap: 8px;
    }


    /* ---------- Separator ---------- */

    .publication-separator {
        width: 70%;
        margin: 32px auto;
    }

}


/* =========================================================
   Publications Search & Filters Panel
   ========================================================= */

.publications-search-panel {
    width: 100%;
    margin: 30px 0;
    padding: 20px 15px;
    box-sizing: border-box;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    direction: rtl;
}


/* ---------- Search ---------- */

.publications-search {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-align: center;
    direction: rtl;
    background: transparent;
    border: none;
}


/* ---------- Filters ---------- */

.publications-search-panel .publications-filters {
    width: 100%;
    margin: 20px 0 0;
    padding: 0;
    background: transparent;
    border: none;
}

.publications-search form {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.publications-search-input {
    width: 70%;
    max-width: 500px;
    box-sizing: border-box;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 15px;
    direction: rtl;
    text-align: right;
}

.publications-search-input:focus {
    outline: none;
    border-color: #999;
}

.publications-search-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #2e7d32;
    color: #fff;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 15px;
    cursor: pointer;
}

.publications-search-button:hover {
    background-color: #256628;
    opacity: 0.9;
}

.publications-search-clear {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
    font-family: "B Yekan", Tahoma, sans-serif;
    font-size: 15px;
}

.publications-search-clear:hover {
    background-color: #eaeaea;
    text-decoration: none;
}


/* ---------- Search Mobile ---------- */

@media (max-width: 767px) {

    .publications-search-input {
        width: 90%;
        max-width: 350px;
    }

    .publications-search form {
        flex-direction: column;
        gap: 8px;
    }

    .publications-search-button,
    .publications-search-clear {
        margin: 0;
    }

}


/* ---------- Publication Filter Groups ---------- */

.publication-filter-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@media (max-width: 767px) {

    .publication-filter-group {
        flex-direction: column;
        gap: 6px;
    }

}