/* Persian fonts for CKEditor content */
@font-face {
    font-family: 'Vazir';
    src: url('/fonts/farsifonts/Vazir-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'B Nazanin';
    src: url('/fonts/farsifonts/BNazanin.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'B Roya';
    src: url('/fonts/farsifonts/BRoya.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'B Titr';
    src: url('/fonts/farsifonts/BTitrBd.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'B Traffic';
    src: url('/fonts/farsifonts/BTraffic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Iran Nastaliq';
    src: url('/fonts/farsifonts/IranNastaliq.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Morabba';
    src: url('/fonts/farsifonts/Morabba-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fedra Arabic';
    src: url('/fonts/farsifonts/FedraArabic.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Afsaneh';
    src: url('/fonts/farsifonts/A.Afsaneh.Font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Araz';
    src: url('/fonts/farsifonts/Araz.Persian.Font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Casablanca';
    src: url('/fonts/farsifonts/Casablanca.Font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Delbar';
    src: url('/fonts/farsifonts/Delbar Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dima Shekaste';
    src: url('/fonts/farsifonts/Dima.Shekaste.Font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Dima Tahriri';
    src: url('/fonts/farsifonts/Dima.Tahriri.Font.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Eliya';
    src: url('/fonts/farsifonts/Eliya Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mj Ghalam';
    src: url('/fonts/farsifonts/Mj.Ghalam.1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mj Dinar';
    src: url('/fonts/farsifonts/Mj_Dinar One Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mj Flow';
    src: url('/fonts/farsifonts/Mj_Flow Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mj SS Three';
    src: url('/fonts/farsifonts/Mj_SS Three Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Mosalas';
    src: url('/fonts/farsifonts/MosalasFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Ordibehesht';
    src: url('/fonts/farsifonts/Ordibehesht.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sogand';
    src: url('/fonts/farsifonts/SOGAND.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Sofi';
    src: url('/fonts/farsifonts/Sofi.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Badkhat';
    src: url('/fonts/farsifonts/badkhat.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Danstevis';
    src: url('/fonts/farsifonts/danstevis.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Leyla';
    src: url('/fonts/farsifonts/leyla_0.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Editor + published content base */
.ck-editor__editable,
.ck-content,
.ck-content-body {
    direction: rtl;
    text-align: right;
    font-family: Vazir, Tahoma, sans-serif;
    line-height: 1.8;
}

.ck-editor__editable {
    min-height: 320px;
}

.ck.ck-editor {
    width: 100%;
}

/* Custom image styles (shadow / border / radius / ...) */
.ck-content img.image-style-shadow,
.ck-content figure.image.image-style-shadow img,
.ck-content .image-style-shadow > img {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.ck-content img.image-style-shadow-soft,
.ck-content figure.image.image-style-shadow-soft img,
.ck-content .image-style-shadow-soft > img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.ck-content img.image-style-shadow-strong,
.ck-content figure.image.image-style-shadow-strong img,
.ck-content .image-style-shadow-strong > img {
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

.ck-content img.image-style-border,
.ck-content figure.image.image-style-border img,
.ck-content .image-style-border > img {
    border: 2px solid #333;
    padding: 4px;
}

.ck-content img.image-style-border-thin,
.ck-content figure.image.image-style-border-thin img,
.ck-content .image-style-border-thin > img {
    border: 1px solid #ccc;
    padding: 2px;
}

.ck-content img.image-style-border-thick,
.ck-content figure.image.image-style-border-thick img,
.ck-content .image-style-border-thick > img {
    border: 4px solid #222;
    padding: 6px;
}

.ck-content img.image-style-border-primary,
.ck-content figure.image.image-style-border-primary img,
.ck-content .image-style-border-primary > img {
    border: 3px solid #0d6efd;
    padding: 4px;
}

.ck-content img.image-style-rounded,
.ck-content figure.image.image-style-rounded img,
.ck-content .image-style-rounded > img {
    border-radius: 12px;
}

.ck-content img.image-style-rounded-sm,
.ck-content figure.image.image-style-rounded-sm img,
.ck-content .image-style-rounded-sm > img {
    border-radius: 6px;
}

.ck-content img.image-style-rounded-lg,
.ck-content figure.image.image-style-rounded-lg img,
.ck-content .image-style-rounded-lg > img {
    border-radius: 24px;
}

.ck-content img.image-style-circle,
.ck-content figure.image.image-style-circle img,
.ck-content .image-style-circle > img {
    border-radius: 50%;
}

.ck-content img.image-style-frame,
.ck-content figure.image.image-style-frame img,
.ck-content .image-style-frame > img {
    border: 8px solid #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
}

.ck-content img.image-style-grayscale,
.ck-content figure.image.image-style-grayscale img,
.ck-content .image-style-grayscale > img {
    filter: grayscale(100%);
}

.ck-content img.image-style-polaroid,
.ck-content figure.image.image-style-polaroid img,
.ck-content .image-style-polaroid > img {
    background: #fff;
    border: 1px solid #ddd;
    padding: 12px 12px 36px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.ck-content figure.image {
    margin: 1rem auto;
}

/* Scrollable CKEditor dropdowns (font family, image styles, ...) */
.ck.ck-dropdown__panel,
.ck.ck-balloon-panel .ck-dropdown__panel,
.ck-body-wrapper .ck.ck-dropdown__panel {
    max-height: min(280px, 50vh) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.ck.ck-dropdown__panel > .ck.ck-list, .ck.ck-balloon-panel .ck.ck-list, .ck-body-wrapper .ck.ck-dropdown__panel .ck.ck-list {
    /* max-height: min(280px, 50vh) !important; */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* width: 100% !important; */
    padding: 5px 15px;
  }

.ck-content figure.image img {
    max-width: 100%;
    height: auto;
}

/* Text style presets */
.ck-content .ck-style-title {
    font-family: 'B Titr', Vazir, Tahoma, sans-serif;
    font-size: 1.6rem;
    margin: 1.25rem 0 0.75rem;
}

.ck-content .ck-style-quote {
    border-right: 4px solid #0d6efd;
    padding: 0.75rem 1rem;
    background: #f7f9fc;
    font-style: italic;
}

.ck-content .ck-style-info-box {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 8px;
    padding: 0.85rem 1rem;
}
