/*
 * أرحب — الترويسة والتذييل الموحدان لوثائق كل المنتجات.
 *
 * مقاسات بالمليمتر والنقطة لأنها للطباعة أولًا. الألوان من --lh-* (لون الهوية)،
 * والصفحة المضيفة تعلن هوامشها في --lh-bleed-* حتى تمتد الأشرطة إلى حافة الورقة.
 */

.lh,
.lf {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    --lh-gold: #b08d3c;
    --lh-text: #1e293b;
    --lh-muted: #5b6678;
    --lh-display: var(--font-display, 'Alexandria', 'IBM Plex Sans Arabic', sans-serif);
    position: relative;
    direction: rtl;
    color: var(--lh-text);
    line-height: 1.55;
}

.lh img,
.lf img {
    display: block;
}

/* سطور الترويسة لا تلتف: ارتفاعها ثابت فيعرف مرقّم الصفحات ما يتبقى للمحتوى. */
.lh-official__lines > div,
.lh-official__meta > *,
.lh-band__lines > div,
.lh-band__meta > *,
.lh-modern__lines > div,
.lh-modern__meta > *,
.lh-minimal__school strong,
.lh-minimal__school span,
.lh-centered__school,
.lf-lines__school > *,
.lf-band__school,
.lf-band__contact,
.lf-band__note,
.lf-minimal__note {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lh-centered__lines {
    max-height: 5.2mm;
    overflow: hidden;
}

.lh bdi,
.lf bdi {
    unicode-bidi: isolate;
    direction: ltr;
}

/* ------------------------------------------------------------------ */
/* رسمي كلاسيكي                                                        */
/* ------------------------------------------------------------------ */

.lh--official {
    margin-bottom: 6mm;
}

.lh-official {
    display: grid;
    grid-template-columns: 1fr 36mm 1fr;
    align-items: center;
    gap: 5mm;
    min-height: 21mm;
}

.lh-official__lines {
    min-width: 0;
    font-size: 9.6pt;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.62;
}

.lh-official__country {
    font-size: 10.5pt;
    font-weight: 800;
    color: #0f172a;
}

.lh-official__school {
    margin-top: 0.8mm;
    font-family: var(--lh-display);
    font-size: 11pt;
    font-weight: 900;
    color: var(--lh-ink);
}

.lh-official__center img {
    height: 21mm;
    width: auto;
    max-width: 36mm;
    object-fit: contain;
    margin: 0 auto;
}

.lh-official__meta {
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5mm;
    min-width: 34mm;
    font-size: 9pt;
    font-weight: 600;
    color: #475569;
}

.lh-official__meta strong {
    font-family: var(--lh-display);
    font-size: 10.5pt;
    font-weight: 800;
    color: var(--lh-ink);
}

.lh-official__school-logo {
    max-height: 13mm;
    max-width: 30mm;
    object-fit: contain;
    margin-bottom: 1mm;
}

.lh-rule {
    margin-top: 3mm;
    height: 0.9mm;
    border-top: 0.55mm solid var(--lh-ink);
    border-bottom: 0.2mm solid var(--lh-gold);
}

/* ------------------------------------------------------------------ */
/* شريط وزاري                                                          */
/* ------------------------------------------------------------------ */

.lh--band {
    margin: calc(-1 * var(--lh-bleed-top, 0mm)) calc(-1 * var(--lh-bleed-x, 0mm)) 6mm;
}

.lh-band {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6mm;
    padding: calc(var(--lh-bleed-top, 0mm) * 0.55 + 4mm) calc(var(--lh-bleed-x, 0mm) + 1mm) 6mm;
    background: var(--lh-deep);
    border-radius: var(--lh-band-radius, 0 0 7mm 7mm);
    color: #fff;
    overflow: hidden;
}

.lh-band::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 1.4mm;
    background: linear-gradient(90deg, #2c7fb8, var(--lh-bright) 55%, #6cc58b);
}


.lh-band__brand {
    display: flex;
    align-items: center;
    gap: 4.5mm;
    min-width: 0;
}

.lh-band__moe {
    height: 15.5mm;
    width: auto;
}

.lh-band__divider {
    width: 0.3mm;
    align-self: stretch;
    margin: 1.5mm 0;
    background: rgba(255, 255, 255, 0.45);
}

.lh-band__lines {
    min-width: 0;
}

.lh-band__authority {
    font-size: 8.6pt;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
}

.lh-band__region {
    font-family: var(--lh-display);
    font-size: 12pt;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
}

.lh-band__office {
    font-family: var(--lh-display);
    font-size: 11pt;
    font-weight: 600;
    line-height: 1.4;
    color: var(--lh-bright);
}

.lh-band__side {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.lh-band__logo {
    display: grid;
    place-items: center;
    padding: 1.6mm 2.6mm;
    background: #fff;
    border-radius: 2.6mm;
}

.lh-band__logo img {
    max-height: 13mm;
    max-width: 30mm;
    object-fit: contain;
}

.lh-band__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4mm;
    font-size: 7.8pt;
    color: rgba(255, 255, 255, 0.78);
}

.lh-band__meta strong {
    font-family: var(--lh-display);
    font-size: 9.4pt;
    color: #fff;
}

.lh-band__tab {
    display: flex;
    justify-content: center;
    margin-top: -0.2mm;
}

.lh-band__tab span {
    min-width: 58mm;
    padding: 1.4mm 10mm 2.2mm;
    background: var(--lh-deep);
    border: 0.35mm solid var(--lh-bright);
    border-top: 0;
    border-radius: 0 0 4mm 4mm;
    font-family: var(--lh-display);
    font-size: 9.4pt;
    font-weight: 700;
    color: #fff;
    text-align: center;
}

/* ------------------------------------------------------------------ */
/* مركزي                                                               */
/* ------------------------------------------------------------------ */

.lh--centered {
    margin-bottom: 6mm;
}

.lh-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1mm;
    text-align: center;
}

.lh-centered__moe {
    height: 16mm;
    width: auto;
    margin-bottom: 0.6mm;
}

.lh-centered__lines {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 2mm;
    font-size: 8.2pt;
    font-weight: 600;
    color: #475569;
}

.lh-centered__lines span + span::before {
    content: '•';
    margin-left: 2mm;
    color: var(--lh-line);
}

.lh-centered__school {
    font-family: var(--lh-display);
    font-size: 11.5pt;
    font-weight: 800;
    color: var(--lh-ink);
}

.lh-ornament {
    display: flex;
    align-items: center;
    gap: 2.4mm;
    width: 100%;
    margin-top: 1.2mm;
}

.lh-ornament span {
    flex: 1;
    height: 0.35mm;
    background: linear-gradient(90deg, transparent, var(--lh-ink));
}

.lh-ornament span:last-child {
    background: linear-gradient(90deg, var(--lh-ink), transparent);
}

.lh-ornament i {
    width: 2.2mm;
    height: 2.2mm;
    background: var(--lh-gold);
    transform: rotate(45deg);
}

.lh-centered__meta {
    display: flex;
    gap: 4mm;
    font-size: 7.8pt;
    color: var(--lh-muted);
}

.lh-centered__meta strong {
    color: var(--lh-ink);
}

/* ------------------------------------------------------------------ */
/* عصري                                                                */
/* ------------------------------------------------------------------ */

.lh--modern {
    margin-bottom: 6mm;
}

.lh-modern {
    position: relative;
    display: grid;
    grid-template-columns: 32mm 1fr auto;
    gap: 5mm;
    padding-bottom: 2.6mm;
    border-bottom: 0.5mm solid var(--lh-ink);
}

.lh-modern::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -0.5mm;
    width: 32mm;
    height: 0.5mm;
    background: var(--lh-gold);
}

.lh-modern__block {
    display: grid;
    place-items: center;
    margin-top: calc(-1 * var(--lh-bleed-top, 0mm));
    padding: calc(var(--lh-bleed-top, 0mm) + 3mm) 3mm 3.4mm;
    background: var(--lh-deep);
    border-radius: 0 0 0 6mm;
}

.lh-modern__block img {
    max-width: 25mm;
    max-height: 17mm;
    object-fit: contain;
}

.lh-modern__initial {
    font-family: var(--lh-display);
    font-size: 22pt;
    font-weight: 900;
    color: #fff;
}

.lh-modern__lines {
    min-width: 0;
    align-self: center;
    font-size: 8.3pt;
    font-weight: 600;
    line-height: 1.62;
    color: #334155;
}

.lh-modern__authority:first-child {
    font-weight: 800;
    color: #0f172a;
}

.lh-modern__school {
    margin-top: 0.6mm;
    font-family: var(--lh-display);
    font-size: 10.6pt;
    font-weight: 800;
    color: var(--lh-ink);
}

.lh-modern__meta {
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5mm;
    font-size: 7.8pt;
    color: var(--lh-muted);
}

.lh-modern__meta strong {
    font-family: var(--lh-display);
    font-size: 9.6pt;
    font-weight: 800;
    color: var(--lh-ink);
}

.lh-modern__side-logo {
    max-height: 12mm;
    max-width: 28mm;
    object-fit: contain;
    margin-bottom: 0.8mm;
}

/* ------------------------------------------------------------------ */
/* مختصر، وترويسة الصفحات الداخلية                                      */
/* ------------------------------------------------------------------ */

.lh--minimal,
.lh--compact {
    margin-bottom: 5mm;
}

.lh-minimal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4mm;
    padding-bottom: 2mm;
    border-bottom: 0.3mm solid var(--lh-line);
}

.lh-minimal__school {
    display: flex;
    align-items: center;
    gap: 2.6mm;
    min-width: 0;
}

.lh-minimal__school img {
    height: 9mm;
    width: auto;
    max-width: 20mm;
    object-fit: contain;
}

.lh-minimal__school strong {
    display: block;
    font-family: var(--lh-display);
    font-size: 9.6pt;
    font-weight: 800;
    color: var(--lh-ink);
}

.lh-minimal__school span {
    display: block;
    font-size: 9pt;
    font-weight: 600;
    color: var(--lh-muted);
}

.lh-minimal__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 9pt;
    font-weight: 600;
    color: var(--lh-muted);
}

.lh-minimal__meta strong {
    font-size: 10pt;
    font-weight: 800;
    color: var(--lh-text);
}

/* ------------------------------------------------------------------ */
/* التذييل                                                             */
/* ------------------------------------------------------------------ */

.lf {
    margin-top: 5mm;
    font-size: 9pt;
    font-weight: 600;
    color: #334155;
}

.lf-lines {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 5mm;
    padding-top: 2.2mm;
    border-top: 0.25mm solid var(--lh-line);
}

.lf-lines::before {
    content: '';
    position: absolute;
    top: -0.45mm;
    right: 0;
    width: 24mm;
    height: 0.65mm;
    background: var(--lh-ink);
}

.lf-lines__school strong {
    display: block;
    font-weight: 700;
    color: #334155;
}

.lf-lines__school span {
    display: block;
}

.lf-lines__page {
    padding: 0.5mm 3.4mm;
    border-radius: 10mm;
    background: var(--lh-soft);
    color: var(--lh-ink);
    font-weight: 700;
    white-space: nowrap;
}

.lf-lines__meta {
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.lf--band {
    margin: 5mm calc(-1 * var(--lh-bleed-x, 0mm)) calc(-1 * var(--lh-bleed-bottom, 0mm));
}

.lf-band__note {
    padding: 0 var(--lh-bleed-x, 0mm) 1.6mm;
    text-align: center;
    font-size: 7.6pt;
    font-weight: 600;
    color: var(--lh-ink);
}

.lf-band {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5mm;
    min-height: 8.5mm;
    padding: 1.6mm calc(var(--lh-bleed-x, 0mm) + 1mm);
    background: var(--lh-deep);
    border-top: 0.7mm solid var(--lh-gold);
    color: rgba(255, 255, 255, 0.86);
}

.lf-band__school {
    font-weight: 700;
    color: #fff;
}

.lf-band__contact {
    flex: 1;
    text-align: center;
    color: var(--lh-bright);
}

.lf-band__page {
    padding: 0.4mm 3.2mm;
    border-radius: 10mm;
    background: #fff;
    color: var(--lh-deep);
    font-weight: 800;
    white-space: nowrap;
}

.lf-minimal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6mm;
    text-align: center;
}

.lf-minimal__page {
    font-weight: 700;
    color: var(--lh-ink);
}
