/* ===== بخش نامه رسمی ===== */
#letter {
    position: relative;
    max-width: 850px;
    margin: 80px auto;
    padding: 60px 70px;
    background:
        linear-gradient(180deg, rgba(20, 20, 24, 1) 0%, rgba(12, 12, 16, 1) 100%);
    color: #e8e4d8;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.08),
        0 30px 80px rgba(0, 0, 0, 0.6),
        inset 0 0 120px rgba(212, 175, 55, 0.03);
    direction: rtl;
    text-align: justify;
    overflow: hidden;
}

/* خط تزئینی گوشه‌ها */
#letter::before,
#letter::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    pointer-events: none;
}
#letter::before {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
}
#letter::after {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
}

/* ===== سرصفحه نامه ===== */
.letter-header {
    text-align: center;
    margin-bottom: 40px;
}

.letter-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: bolder;
}

/* جداکننده تزئینی */
.letter-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 20px 0;
}

.letter-divider .divider-line {
    height: 1px;
    width: 90px;
    background: linear-gradient(to left,
        transparent,
        rgba(212, 175, 55, 0.6),
        transparent);
}

.letter-divider .divider-diamond {
    color: #d4af37;
    font-size: 10px;
    letter-spacing: 0;
    opacity: 0.8;
}

/* عنوان نامه */
#letter-title {
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, serif;
    font-size: 20px;
    font-weight: 500;
    color: rgba(232, 228, 216, 0.55);
    letter-spacing: 0.05em;
    margin: 0;
    padding-top: 6px;
}

/* ===== بدنه نامه ===== */
.letter-body {
    padding: 0 10px;
}

#letter p {
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, serif;
    font-size: 17px;
    line-height: 2.4;
    color: #ddd8c9;
    text-align: justify;
    text-justify: inter-word;
    text-indent: 2.5em;
    margin: 0;
    letter-spacing: 0.01em;
}

/* نام برند داخل متن */
#letter .brand-inline {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 700;
    font-style: normal;
    color: #d4af37;
    letter-spacing: 0.1em;
    white-space: nowrap;
    padding: 0 4px;
}

#letter .brand-number {
    color: #e63946;
}

/* ===== امضا ===== */
.letter-signature {
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-right: 20px;
}

.letter-signature .signature-line {
    display: block;
    width: 160px;
    height: 1px;
    background: linear-gradient(to left,
        rgba(212, 175, 55, 0.8),
        transparent);
}

.letter-signature .signature-name {
    font-family: 'Vazirmatn', 'IRANSans', Tahoma, serif;
    font-style: normal;
    font-size: 15px;
    color: rgba(212, 175, 55, 0.85);
    letter-spacing: 0.08em;
    font-weight: 500;
}

/* ===== موبایل ===== */
@media (max-width: 800px) {
    #letter {
        margin: 50px 15px;
        padding: 40px 25px;
    }
    .letter-brand .brand-en {
        font-size: 22px;
        letter-spacing: 0.18em;
    }
    .letter-brand .brand-fa {
        font-size: 12px;
        letter-spacing: 0.35em;
    }
    #letter-title {
        font-size: 16px;
    }
    #letter p {
        font-size: 15px;
        line-height: 2.2;
        text-indent: 1.8em;
    }
    .letter-divider .divider-line {
        width: 50px;
    }
    .letter-signature {
        padding-right: 0;
    }
    .letter-signature .signature-line {
        width: 110px;
    }
}