/* =========================
   Font
========================= */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/font/vazirmatn/vazirmatn[wght].woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
}

/* =========================
   General
========================= */

:root {
    --bg: #f8f5ef;
    --bg-soft: #eee7dc;
    --dark: #342c27;
    --text: #75675d;
    --green: #78816b;
    --green-dark: #5d6852;
    --border: #e8dfd3;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    position: relative;
    min-height: 100%;
}

body {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.9;
}

button,
input,
textarea,
select {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

::selection {
    background: var(--green);
    color: white;
}

/* =========================
   Forms
========================= */

.form-control:focus,
.form-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 0.2rem rgba(120, 129, 107, 0.2);
}

.btn:focus,
.btn:active:focus {
    box-shadow: 0 0 0 0.2rem rgba(120, 129, 107, 0.2);
}
/* =========================
   Authentication Pages
========================= */

.auth-section {
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 40px;
    box-shadow: 0 10px 35px rgba(52, 44, 39, 0.06);
}

.auth-title {
    text-align: center;
    color: var(--dark);
    font-size: 25px;
    font-weight: 700;
    margin-bottom: 30px;
}

.auth-card .form-label {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
}

.auth-card .form-control {
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 12px;
    background: var(--bg);
}

.auth-button {
    width: 100%;
    border: none;
    border-radius: 5px;
    padding: 12px;
    background: var(--green);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: .3s;
}

    .auth-button:hover {
        background: var(--green-dark);
    }

.auth-link {
    display: block;
    text-align: center;
    margin-top: 22px;
    color: var(--green-dark);
    font-size: 14px;
}

    .auth-link:hover {
        color: var(--green);
    }

@media (max-width: 500px) {
    .auth-card {
        padding: 25px 20px;
    }
}
/* =========================
   Account Menu
========================= */

.account-menu-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: var(--green);
    color: white;
    border: 1px solid var(--green);
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: .3s;
}

    .account-menu-button:hover {
        background: var(--green-dark);
    }

    .account-menu-button i {
        font-size: 20px;
    }

.account-dropdown {
    min-width: 220px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.account-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    color: var(--dark);
    font-weight: 600;
}

    .account-dropdown-header i {
        font-size: 24px;
        color: var(--green);
    }

.account-dropdown .dropdown-item {
    padding: 11px;
    color: var(--text);
    border-radius: 5px;
    text-align: right;
}

    .account-dropdown .dropdown-item:hover {
        background: var(--bg-soft);
        color: var(--green-dark);
    }

    .account-dropdown .dropdown-item i {
        margin-left: 8px;
    }

.logout-item {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}
/* حذف تزئ?نات پشت جلد کتاب */
.hero-circle,
.book-decoration {
    display: none;
}
/* =========================
   Library Home - New Design
========================= */

.library-home {
    --library-green: #687653;
    --library-green-dark: #35432d;
    --library-cream: #f7f0e3;
    --library-text: #443a30;
    --library-muted: #83776b;
}

/* Hero */

.library-hero {
    background: linear-gradient(rgba(248, 245, 239, 0.25), rgba(248, 245, 239, 0.25)), url('/images/4.png') center center / cover no-repeat;
    padding: 65px 0;
    overflow: hidden;
}
.library-hero-container {
    width: min(1200px, 92%);
    min-height: 430px;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 55px;
}

.library-hero-content {
    text-align: right;
}

.library-hero-label {
    display: inline-block;
    color: var(--library-green);
    font-size: 15px;
    margin-bottom: 20px;
}

    .library-hero-label::before {
        content: "?";
        margin-left: 10px;
    }

.library-hero-content h1 {
    font-size: clamp(35px, 4vw, 55px);
    line-height: 1.65;
    font-weight: 800;
    color: var(--library-text);
}

    .library-hero-content h1 span {
        color: var(--library-green);
    }

.library-hero-description {
    max-width: 520px;
    margin-top: 20px;
    color: var(--library-muted);
    font-size: 15px;
    line-height: 2.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-hero-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.library-primary-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 13px 27px;
    background: var(--library-green);
    color: white;
    border-radius: 6px;
    transition: .3s;
}

    .library-primary-button:hover {
        background: var(--library-green-dark);
        color: white;
        transform: translateY(-3px);
    }

.library-secondary-button {
    padding: 12px 23px;
    border: 1px solid #d9cfbd;
    border-radius: 6px;
    color: var(--library-text);
    transition: .3s;
}

    .library-secondary-button:hover {
        border-color: var(--library-green);
        color: var(--library-green);
    }

.library-hero-note {
    margin-top: 35px;
    color: #968979;
    font-size: 13px;
}

/* Hero Image */

.library-hero-image {
    min-height: 420px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

    .library-hero-image img {
        width: 100%;
        max-width: 360px;
        height: 420px;
        object-fit: contain;
        filter: drop-shadow(12px 18px 22px rgba(52, 44, 39, .2));
        transition: .4s;
    }

        .library-hero-image img:hover {
            transform: translateY(-8px);
        }

.library-no-image {
    width: 280px;
    min-height: 360px;
    padding: 30px;
    background: var(--library-green-dark);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 12px 18px 30px rgba(0,0,0,.15);
}

    .library-no-image span {
        font-size: 45px;
        color: #d6c6a1;
    }

    .library-no-image h2 {
        font-size: 27px;
        line-height: 1.8;
        margin: 20px 0;
    }

/* Books Section */

.library-books-section {
    padding: 75px 0 90px;
    background: #fffaf1;
}

.library-section-heading {
    width: min(1200px, 92%);
    margin: 0 auto 35px;
}

    .library-section-heading span {
        color: var(--library-green);
        font-size: 14px;
    }

    .library-section-heading h2 {
        color: var(--library-text);
        font-size: 30px;
        font-weight: 800;
        margin-top: 5px;
    }

.library-books-grid {
    width: min(1200px, 92%);
    margin: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 25px;
}

.library-book-card {
    background: white;
    border: 1px solid #eee5d8;
    border-radius: 10px;
    overflow: hidden;
    transition: .3s;
}

    .library-book-card:hover {
        transform: translateY(-7px);
        box-shadow: 0 15px 35px rgba(52, 44, 39, .1);
    }

.library-book-image {
    height: 290px;
    padding: 15px;
    background: #f1e9db;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .library-book-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        transition: .4s;
    }

.library-book-card:hover .library-book-image img {
    transform: scale(1.04);
}

.library-book-placeholder {
    width: 180px;
    height: 240px;
    background: var(--library-green);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
}

    .library-book-placeholder h3 {
        font-size: 20px;
        line-height: 1.8;
    }

.library-book-info {
    padding: 20px;
}

    .library-book-info h3 {
        font-size: 17px;
        font-weight: 700;
        color: var(--library-text);
        margin-bottom: 10px;
    }

    .library-book-info p {
        min-height: 55px;
        color: var(--library-muted);
        font-size: 12px;
        line-height: 2;
    }

.library-book-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 18px;
}

    .library-book-footer span {
        font-size: 12px;
        font-weight: 700;
        color: var(--library-green-dark);
    }

    .library-book-footer a {
        padding: 8px 13px;
        background: var(--library-green);
        color: white;
        border-radius: 5px;
        font-size: 12px;
        white-space: nowrap;
    }

        .library-book-footer a:hover {
            background: var(--library-green-dark);
            color: white;
        }

.library-empty-books {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--library-muted);
}

/* About */

.library-about {
    padding: 85px 0;
    background: var(--library-cream);
}

.library-about-container {
    width: min(1100px, 90%);
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 70px;
    align-items: center;
}

.library-about-decoration {
    min-height: 300px;
    background: #e9e1d1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--library-green);
}

    .library-about-decoration span {
        font-size: 85px;
    }

    .library-about-decoration p {
        font-size: 13px;
        letter-spacing: 2px;
    }

.library-about-content > span {
    color: var(--library-green);
    font-size: 14px;
}

.library-about-content h2 {
    margin-top: 15px;
    font-size: 32px;
    line-height: 1.9;
    color: var(--library-text);
}

    .library-about-content h2 strong {
        color: var(--library-green);
    }

.library-about-content p {
    margin-top: 20px;
    color: var(--library-muted);
    line-height: 2.5;
}

/* Responsive */

@media (max-width: 992px) {
    .library-books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .library-hero-container {
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .library-hero {
        padding: 45px 0;
    }

    .library-hero-container {
        grid-template-columns: 1fr;
    }

    .library-hero-content {
        text-align: center;
    }

    .library-hero-description {
        margin-right: auto;
        margin-left: auto;
    }

    .library-hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .library-hero-image {
        min-height: 330px;
    }

        .library-hero-image img {
            height: 330px;
        }

    .library-books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .library-book-image {
        height: 230px;
    }

    .library-book-info {
        padding: 13px;
    }

    .library-book-footer {
        flex-wrap: wrap;
    }

    .library-about-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .library-about-content {
        text-align: center;
    }
}

@media (max-width: 420px) {
    .library-books-grid {
        grid-template-columns: 1fr;
    }

    .library-book-image {
        height: 300px;
    }

    .library-hero-content h1 {
        font-size: 31px;
    }

}
@media (max-width: 768px) {

    .library-hero {
        padding: 30px 0 45px;
    }

    .library-hero-container {
        width: 92%;
        gap: 10px;
        min-height: auto;
    }

    .library-hero-content h1 {
        font-size: 30px;
        line-height: 1.8;
    }

    .library-hero-description {
        font-size: 13px;
        line-height: 2;
    }

    .library-hero-image {
        min-height: 270px;
    }

        .library-hero-image img {
            width: 100%;
            max-width: 250px;
            height: 270px;
        }

    .library-hero-buttons {
        gap: 10px;
    }

    .library-primary-button,
    .library-secondary-button {
        padding: 10px 15px;
        font-size: 13px;
    }
}
/* پا??ن‌تر آمدن تصو?ر کتاب در تمام اندازه‌ها */
.library-hero-image {
    transform: translateY(40px);
}

/* تنظ?م موقع?ت تصو?ر در موبا?ل */
@media (max-width: 768px) {
    .library-hero-image {
        transform: translate(90px, 40px);
    }
}


/* هدر اصل? سا?ت */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 250, 241, 0.97);
    border-bottom: 1px solid #e8dfd3;
    box-shadow: 0 4px 18px rgba(52, 44, 39, 0.06);
}

.header-container {
    width: min(1200px, 92%);
    min-height: 85px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #35432d;
    font-size: 21px;
    font-weight: 800;
    white-space: nowrap;
}

.logo-icon {
    color: #78816b;
    font-size: 27px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

    .main-nav a {
        color: #62594f;
        font-size: 14px;
        transition: .3s;
        white-space: nowrap;
    }

        .main-nav a:hover {
            color: #687653;
        }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-cart,
.header-login,
.header-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 7px;
    font-size: 13px;
    white-space: nowrap;
    transition: .3s;
}

.header-cart {
    color: #687653;
    border: 1px solid #d9dfcf;
}

    .header-cart:hover {
        background: #eef0e8;
        color: #35432d;
    }

    .header-cart i {
        font-size: 18px;
    }

.header-login {
    color: #687653;
}

.header-button {
    background: #687653;
    color: white;
}

    .header-button:hover {
        background: #35432d;
        color: white;
    }

@media (max-width: 768px) {
    .header-container {
        min-height: 75px;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
        padding: 12px 0;
    }

    .logo {
        font-size: 17px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 22px;
        overflow-x: auto;
        padding: 8px 0;
    }

        .main-nav a {
            font-size: 12px;
        }

    .header-actions {
        gap: 6px;
    }

    .header-cart,
    .header-login,
    .header-button {
        padding: 8px 10px;
        font-size: 12px;
    }
}
