/* Explain: Styles for the Professional Certificate template, including print view. */
/* ===== قالب الشهادة المهنية (PIAP) — تصميم فاخر مستقل =====
   مقاس A4 أفقي (297×210mm) • إنجليزي بالكامل • كحلي وذهبي وبترولي.
   قالب مستقل تماماً عن قالب شهادات حضور البرامج التدريبية. */

.pcert-scroll {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.pcert-scale {
    width: 100%;
    min-width: 680px;
    max-width: 1123px;
    margin: 0 auto;
    container-type: inline-size;
}

.pcert-sheet {
    position: relative;
    width: 100%;
    aspect-ratio: 297 / 210;
    overflow: hidden;
    border: 0.3em solid #0d2b3e;
    border-radius: 0.55em;
    background: radial-gradient(circle at 50% 38%, #ffffff 0%, #fffdf7 52%, #f4ecdb 100%);
    box-shadow: 0 0.8em 2.4em rgba(13, 43, 62, 0.22);
    color: #12333f;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.6cqw;
    line-height: 1.4;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* الإطار الذهبي المزدوج داخل الحد الكحلي */
.pcert-sheet::before {
    position: absolute;
    inset: 0.42em;
    z-index: 3;
    border: 0.075em solid #c9a24a;
    border-radius: 0.32em;
    content: "";
    pointer-events: none;
}

.pcert-sheet::after {
    position: absolute;
    inset: 0.74em;
    z-index: 3;
    border: 0.028em solid rgba(201, 162, 74, 0.6);
    border-radius: 0.2em;
    content: "";
    pointer-events: none;
}

/* علامة مائية أمنية خفيفة تحمل شعار الشركة */
.pcert-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('https://files.cdn-files-a.com/uploads/12457274/normal_filter_nobg_6adf0e4c2e3de.png?ratio=13:7&format=avif');
    background-position: center 40%;
    background-repeat: no-repeat;
    background-size: 44%;
    opacity: 0.05;
    filter: grayscale(1);
    pointer-events: none;
}

/* زخرفة هندسية دقيقة تشبه ورق الأمان */
.pcert-guilloche {
    position: absolute;
    inset: 0.74em;
    z-index: 0;
    border-radius: 0.2em;
    background-image:
        repeating-linear-gradient(45deg, rgba(13, 43, 62, 0.035) 0 0.04em, transparent 0.04em 0.6em),
        repeating-linear-gradient(-45deg, rgba(13, 43, 62, 0.035) 0 0.04em, transparent 0.04em 0.6em);
    pointer-events: none;
}

/* زوايا ذهبية */
.pcert-corner {
    position: absolute;
    z-index: 4;
    width: 4.2em;
    height: 4.2em;
    pointer-events: none;
}

.pcert-corner::before,
.pcert-corner::after {
    position: absolute;
    background: #c9a24a;
    content: "";
}

.pcert-corner::before {
    width: 100%;
    height: 0.1em;
}

.pcert-corner::after {
    width: 0.1em;
    height: 100%;
}

.pcert-corner-tl { top: 1.1em; left: 1.1em; }
.pcert-corner-tl::before { top: 0; left: 0; }
.pcert-corner-tl::after { top: 0; left: 0; }

.pcert-corner-tr { top: 1.1em; right: 1.1em; }
.pcert-corner-tr::before { top: 0; right: 0; }
.pcert-corner-tr::after { top: 0; right: 0; }

.pcert-corner-bl { bottom: 1.1em; left: 1.1em; }
.pcert-corner-bl::before { bottom: 0; left: 0; }
.pcert-corner-bl::after { bottom: 0; left: 0; }

.pcert-corner-br { bottom: 1.1em; right: 1.1em; }
.pcert-corner-br::before { bottom: 0; right: 0; }
.pcert-corner-br::after { bottom: 0; right: 0; }

/* إطار المحتوى */
.pcert-frame {
    position: relative;
    z-index: 5;
    display: flex;
    height: 100%;
    flex-direction: column;
    padding: 2.1em 4.2% 1.8em;
    text-align: center;
}

.pcert-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3em;
}

.pcert-logo {
    height: 4.4em;
    width: auto;
    max-width: 13em;
    object-fit: contain;
}

.pcert-brand-name {
    margin: 0.1em 0 0;
    color: #0d2b3e;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.15em;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.pcert-brand-sub {
    margin: 0.2em 0 0;
    color: #8a6a1f;
    font-family: 'Inter', sans-serif;
    font-size: 0.55em;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.pcert-title {
    margin: 0.55em 0 0;
    color: #0d2b3e;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 2.3em;
    font-weight: 600;
    letter-spacing: 0.045em;
    line-height: 1.08;
    text-transform: uppercase;
}

.pcert-divider {
    position: relative;
    display: block;
    width: 18em;
    height: 0.8em;
    margin: 0.45em auto 0;
}

.pcert-divider::before,
.pcert-divider::after {
    position: absolute;
    top: 50%;
    width: calc(50% - 1.6em);
    height: 0.05em;
    background: linear-gradient(90deg, rgba(201, 162, 74, 0), #c9a24a);
    content: "";
}

.pcert-divider::before { left: 0; }
.pcert-divider::after { right: 0; transform: scaleX(-1); }

.pcert-divider i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.5em;
    height: 0.5em;
    background: #b8903a;
    box-shadow: 0 0 0 0.11em #fffdf7, 0 0 0 0.2em rgba(201, 162, 74, 0.55);
    transform: translate(-50%, -50%) rotate(45deg);
}

.pcert-body {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1em;
    padding: 0.2em 0;
}

.pcert-lead {
    margin: 0.7em 0 0;
    color: #3b5560;
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 1.15em;
}

.pcert-name {
    max-width: 94%;
    margin: 0.2em 0 0;
    padding: 0 0.5em 0.1em;
    border-bottom: 0.045em solid rgba(201, 162, 74, 0.7);
    color: #0d2b3e;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.9em;
    font-weight: 700;
    line-height: 1.16;
    white-space: nowrap;
}

.pcert-name.is-wrapped { white-space: normal; }

.pcert-sub {
    max-width: 78%;
    margin: 0.75em 0 0;
    color: #3b5560;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.02em;
    line-height: 1.5;
}

/* شريط اسم الشهادة المهنية */
.pcert-program {
    display: inline-block;
    max-width: 96%;
    margin: 0.9em 0 0;
    padding: 0.1em;
    background: linear-gradient(180deg, #e2c989, #b8903a);
    clip-path: polygon(1.9em 0, calc(100% - 1.9em) 0, 100% 50%, calc(100% - 1.9em) 100%, 1.9em 100%, 0 50%);
}

.pcert-program-inner {
    display: block;
    padding: 0.45em 1.9em;
    background: linear-gradient(180deg, #16465b 0%, #0a2432 100%);
    color: #ffffff;
    font-family: 'Cinzel', Georgia, serif;
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
    clip-path: polygon(1.4em 0, calc(100% - 1.4em) 0, 100% 50%, calc(100% - 1.4em) 100%, 1.4em 100%, 0 50%);
}

.pcert-issued {
    margin: 0.9em 0 0;
    color: #3b5560;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.95em;
    line-height: 1.45;
}

.pcert-issued > span { display: block; }

.pcert-issued-label {
    font-style: italic;
    font-size: 0.95em;
}

.pcert-issued-name {
    margin-top: 0.16em;
    color: #0d2b3e;
    font-family: 'Inter', sans-serif;
    font-size: 0.92em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.pcert-issued-country {
    margin-top: 0.12em;
    color: #8a6a1f;
    font-family: 'Inter', sans-serif;
    font-size: 0.78em;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* صف عناصر التوثيق */
.pcert-foot {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1em;
    padding-top: 0.8em;
    border-top: 0.045em solid rgba(201, 162, 74, 0.55);
}

.pcert-foot-left {
    display: grid;
    justify-items: start;
    gap: 0.7em;
}

.pcert-foot-center {
    display: grid;
    place-items: center;
}

.pcert-foot-right {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 1.5em;
}

.pcert-verify {
    display: grid;
    justify-items: start;
    gap: 0.28em;
}

.pcert-qr {
    display: block;
    width: 3.9em;
    height: 3.9em;
    padding: 0.16em;
    border: 0.055em solid rgba(13, 43, 62, 0.45);
    border-radius: 0.18em;
    background: #ffffff;
    object-fit: contain;
}

.pcert-qr.is-hidden { display: none; }

.pcert-verify span {
    color: #3b5560;
    font-family: 'Inter', sans-serif;
    font-size: 0.58em;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.pcert-meta {
    display: grid;
    gap: 0.3em;
    color: #12333f;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 0.82em;
    text-align: left;
}

.pcert-meta p { margin: 0; }

.pcert-meta strong {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* الوسام الذهبي الفاخر PIAP */
.pcert-medal {
    display: grid;
    place-items: center;
    width: 6.6em;
    height: 6.6em;
    filter: drop-shadow(0 0.12em 0.32em rgba(20, 40, 50, 0.22));
}

.pcert-medal-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* التوقيع المعتمد */
.pcert-author {
    display: grid;
    flex: 0 1 auto;
    justify-items: center;
    gap: 0.14em;
    min-width: 0;
}

.pcert-signature {
    height: 5.9em;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.pcert-author-label {
    margin: 0;
    padding-top: 0.24em;
    border-top: 0.05em solid rgba(13, 43, 62, 0.4);
    color: #0d2b3e;
    font-family: 'Inter', sans-serif;
    font-size: 0.64em;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pcert-author-name {
    margin: 0.2em 0 0;
    color: #3b5560;
    font-family: 'Inter', sans-serif;
    font-size: 0.48em;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.35;
}

/* ختم الشركة الدائري */
.pcert-stamp {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 6.9em;
    height: 6.9em;
}

.pcert-stamp-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.pcert-stamp-svg.is-hidden { display: none; }

.pcert-stamp-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pcert-stamp-img.is-hidden { display: none; }

/* شعار الشركة الأصلي في مركز الختم الرسمي */
.pcert-stamp-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: auto;
    max-height: 46%;
    object-fit: contain;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* عند رفع ختم رسمي جاهز من لوحة الإدارة يُخفى الشعار الوسطي */
.pcert-stamp:has(.pcert-stamp-img:not(.is-hidden)) .pcert-stamp-logo {
    display: none;
}

/* علامة المعاينة التجريبية */
.pcert-specimen {
    position: absolute;
    top: 46%;
    left: 50%;
    z-index: 6;
    color: rgba(155, 74, 61, 0.13);
    font-family: 'Cinzel', Georgia, serif;
    font-size: 3.2em;
    font-weight: 700;
    letter-spacing: 0.22em;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%) rotate(-16deg);
}

@media print {
    @page {
        size: 297mm 210mm;
        margin: 0;
    }

    html,
    body {
        width: 297mm !important;
        height: 210mm !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #ffffff !important;
    }

    .no-print,
    .site-header,
    body > footer,
    a[href^="https://wa.me"],
    .mobile-book-bar,
    .booking-overlay,
    [class*="acsb"],
    [id*="acsb"],
    [class*="accessibility"],
    [id*="accessibility"],
    [class*="audioeye"],
    [id*="audioeye"],
    [class*="userway"],
    [id*="userway"],
    img[src*="6adc497207977"],
    a[href*="6adc497207977"],
    button,
    .btn,
    input,
    select,
    textarea {
        display: none !important;
    }

    main,
    section,
    #pcertContent,
    .pcert-scroll {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    .pcert-scroll {
        overflow: visible !important;
    }

    .pcert-scale {
        width: 297mm !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 !important;
        container-type: normal !important;
    }

    .pcert-sheet {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 297mm !important;
        height: 210mm !important;
        min-height: 0 !important;
        aspect-ratio: auto !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fffdf8 !important;
        font-size: 4.75mm !important;
    }
}