/* ==========================================================
   تم ری‌دیزاین — پایهٔ مشترک صفحه‌های /redesign
   به bootstrap / style.css سایت وابسته نیست؛ فقط فونت را از assets می‌گیرد.
   ========================================================== */
@font-face {
    font-family: "AnjomanMax";
    font-weight: 400;
    font-display: swap;
    src: url("../assets/fonts/AnjomanMaxFN/woff2/AnjomanMaxFN-Regular.woff2") format("woff2");
}

@font-face {
    font-family: "AnjomanMax";
    font-weight: 500;
    font-display: swap;
    src: url("../assets/fonts/AnjomanMaxFN/woff2/AnjomanMaxFN-Medium.woff2") format("woff2");
}

@font-face {
    font-family: "AnjomanMax";
    font-weight: 600;
    font-display: swap;
    src: url("../assets/fonts/AnjomanMaxFN/woff2/AnjomanMaxFN-SemiBold.woff2") format("woff2");
}

@font-face {
    font-family: "AnjomanMax";
    font-weight: 700;
    font-display: swap;
    src: url("../assets/fonts/AnjomanMaxFN/woff2/AnjomanMaxFN-Bold.woff2") format("woff2");
}

@font-face {
    font-family: "AnjomanMax";
    font-weight: 800;
    font-display: swap;
    src: url("../assets/fonts/AnjomanMaxFN/woff2/AnjomanMaxFN-ExBold.woff2") format("woff2");
}

:root {
    --bg: #f8f7f5;
    --card: #ffffff;
    --ink: #111111;
    --text: #222222;
    --muted: #6b6b6b;
    --line: #e6e4df;
    --red: #f4513a;
    --red-dark: #d93a23;
    --pink: #ff00b8;
    --yellow: #fdd26c;
    --grad: linear-gradient(170deg, #fdd26c 0%, #fd7a3e 45%, #fd1932 100%);
    --radius: 22px;
    --radius-sm: 16px;
    --maxw: 1060px;
    --gutter: clamp(16px, 4vw, 44px);
    --ease: cubic-bezier(.16, 1, .3, 1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "AnjomanMax", Tahoma, sans-serif;
    font-size: 16px;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.4;
}

p {
    margin: 0;
}

.en {
    direction: ltr;
    unicode-bidi: isolate;
}

/* لوگوی کتابخونه — عنوان بخش‌ها */
.lib-mark {
    margin: 0;
    line-height: 0;
}

.lib-mark img {
    display: block;
    width: min(100%, 280px);
    height: auto;
}

.lib-mark--lg img {
    width: min(100%, 360px);
}

.wrap {
    width: 100%;
    max-width: calc(var(--maxw) + 2 * var(--gutter));
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    border-radius: 6px;
    background: var(--red);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    transition: background .25s var(--ease), transform .25s var(--ease);
}

.btn:hover {
    background: var(--red-dark);
    transform: translateY(-2px);
}

:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 3px;
}

/* ===================== هدر ===================== */
.site-header {
    padding-block: 34px 24px;
}

.site-header .wrap {
    display: flex;
    align-items: center;
    gap: 40px;
}

.brand img {
    width: 48px;
    height: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 40px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav a {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    transition: color .2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
    color: var(--red);
}

.menu-btn {
    display: none;
    margin-inline-start: auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: var(--card);
    cursor: pointer;
    place-items: center;
}

.menu-btn span,
.menu-btn span::before,
.menu-btn span::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .3s var(--ease), opacity .2s;
}

.menu-btn span {
    position: relative;
}

.menu-btn span::before,
.menu-btn span::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-btn span::before {
    top: -6px;
}

.menu-btn span::after {
    top: 6px;
}

.site-header.is-open .menu-btn span {
    background: transparent;
}

.site-header.is-open .menu-btn span::before {
    transform: translateY(6px) rotate(45deg);
}

.site-header.is-open .menu-btn span::after {
    transform: translateY(-6px) rotate(-45deg);
}

/* ===================== فوتر ===================== */
.footer {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1.1fr;
    gap: 40px;
    padding: 40px;
    margin-bottom: 70px;
}

.footer__brand img {
    width: 68px;
    height: auto;
    margin-bottom: 52px;
}

.footer__brand p {
    font-size: 15px;
    line-height: 2.05;
    color: var(--ink);
}

.footer h3 {
    font-size: 17px;
    margin: 70px 0 16px;
}

.footer ul {
    margin: 0;
    padding: 0 18px 0 0;
    font-size: 15px;
    line-height: 1.95;
    color: var(--ink);
}

.footer a:hover {
    color: var(--red);
}

.footer__mail {
    margin-top: 12px;
}

.footer__mail a {
    border-bottom: 1px solid var(--ink);
    direction: ltr;
    display: inline-block;
}

/* ===================== تبلت ===================== */
@media (max-width: 980px) {
    .nav {
        gap: 24px;
    }

    .nav a {
        font-size: 15px;
    }

    .footer {
        grid-template-columns: 1fr 1fr;
    }

    .footer__brand {
        grid-column: 1 / -1;
    }

    .footer__brand img {
        margin-bottom: 20px;
    }

    .footer h3 {
        margin-top: 0;
    }
}

/* ===================== موبایل ===================== */
@media (max-width: 760px) {
    body {
        font-size: 15px;
    }

    .site-header {
        position: sticky;
        top: 0;
        z-index: 20;
        padding-block: 12px;
        background: rgba(248, 247, 245, .92);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .site-header .wrap {
        flex-wrap: wrap;
        gap: 0;
    }

    .brand img {
        width: 40px;
    }

    .menu-btn {
        display: grid;
    }

    .nav {
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height .4s var(--ease);
    }

    .site-header.is-open .nav {
        max-height: 420px;
    }

    .nav li:first-child {
        margin-top: 10px;
    }

    .nav a {
        display: block;
        padding: 12px 4px;
        border-top: 1px solid var(--line);
        font-size: 16px;
    }

    .footer {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 26px 22px 28px;
        margin-bottom: 32px;
    }

    .footer h3 {
        margin-bottom: 8px;
    }
}

/* ---------- مودال پخش ویدیو (آپارات) ---------- */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    background: rgba(10, 10, 10, .78);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s var(--ease), visibility .22s var(--ease);
}

.video-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.video-modal__panel {
    position: relative;
    width: min(960px, 100%);
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
    transform: translateY(10px) scale(.98);
    transition: transform .22s var(--ease);
}

.video-modal.is-open .video-modal__panel {
    transform: none;
}

.video-modal__frame,
.video-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.video-modal__close {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.video-modal__close:hover {
    background: #fff;
}

body.video-modal-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation: none !important;
    }
}
