.hse-page,
.hse-page * {
    box-sizing: border-box;
}

.hse-page {
    --hse-red: #d62927;
    --hse-gray: #686969;
    --hse-dark: #17212b;
    --hse-body: #526271;
    --hse-soft: #f6f7f8;
    --hse-white: #ffffff;
    --hse-border: rgba(23, 33, 43, 0.10);
    --hse-shadow: 0 24px 60px rgba(23, 33, 43, 0.10);
    --hse-radius: 24px;
    --hse-container: 1240px;
    --hse-header-offset: 96px;

    width: 100%;
    overflow-x: clip;
    background: #ffffff;
    color: var(--hse-body);
    font-family: "DM Sans", Arial, sans-serif;
}

.hse-container {
    width: min(calc(100% - 40px), var(--hse-container));
    margin-inline: auto;
}

.hse-anchor {
    scroll-margin-top: var(--hse-header-offset);
}

.hse-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    color: var(--hse-red);
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hse-hero {
    position: relative;
    min-height: calc(100svh - 68px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: #FFFF;
    background-image: var(--hse-hero-image);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    isolation: isolate;
}

.hse-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        linear-gradient(
            90deg,
            rgba(8, 13, 19, 0.70) 0%,
            rgba(8, 13, 19, 0.40) 46%,
            rgba(8, 13, 19, 0.16) 100%
        ),
        linear-gradient(
            180deg,
            rgba(8, 13, 19, 0.08) 0%,
            rgba(8, 13, 19, 0.22) 48%,
            rgba(8, 13, 19, 0.62) 100%
        );
}

.hse-hero__content {
    position: relative;
    z-index: 1;
    width: min(100%, 900px);
    padding: clamp(90px, 9vw, 150px) 0 clamp(60px, 7vw, 110px);
    color: #ffffff;
}

.hse-hero__title {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(3.6rem, 5.5vw, 7.4rem);
    line-height: 0.96;
    font-weight: 900;
    letter-spacing: -0.055em;
    text-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.hse-hero__subtitle {
    margin: 0 0 18px;
    color: #ffffff;
    font-size: clamp(1.45rem, 1.1vw, 2.3rem);
    line-height: 1.4;
    font-weight: 700;
}

.hse-hero__description {
    margin: 0;
    max-width: 760px;
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(1.1rem, 0.7vw + 0.9rem, 1.55rem);
    line-height: 1.85;
    font-weight: 400;
}

.hse-hero__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.hse-hero__nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.hse-hero__nav a:hover {
    background: var(--hse-red);
    border-color: var(--hse-red);
    transform: translateY(-2px);
}

/* ==========================================================================
   Base Sections
   ========================================================================== */

.hse-section {
    position: relative;
    padding: clamp(72px, 8vw, 128px) 0;
    background: #ffffff;
}

.hse-section--soft,
.hse-section--overview,
.hse-section--gallery {
    background: var(--hse-soft);
}

.hse-section-head {
    max-width: 820px;
    margin-bottom: clamp(34px, 4vw, 58px);
}

.hse-section-head h2,
.hse-copy h2,
.hse-dashboard h2 {
    margin: 0 0 20px;
    color: var(--hse-dark);
    font-size: clamp(2.55rem, 3vw, 4.8rem);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -0.045em;
}

.hse-section-head p,
.hse-copy p,
.hse-dashboard p {
    margin: 0;
    color: var(--hse-body);
    font-size: clamp(1.08rem, 0.45vw + 0.9rem, 1.35rem);
    line-height: 1.9;
    font-weight: 400;
}

/* ==========================================================================
   KPIs
   ========================================================================== */

.hse-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.hse-kpi {
    min-height: 190px;
    padding: 34px;
    border-radius: var(--hse-radius);
    background: #ffffff;
    border: 1px solid var(--hse-border);
    box-shadow: 0 20px 50px rgba(23, 33, 43, 0.06);
}

.hse-kpi strong {
    display: block;
    margin-bottom: 18px;
    color: var(--hse-red);
    font-size: clamp(3.4rem, 4vw, 5.6rem);
    line-height: 0.95;
    font-weight: 900;
    letter-spacing: -0.06em;
}

.hse-kpi span {
    display: block;
    color: var(--hse-gray);
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 700;
}

/* ==========================================================================
   Two-column sections
   ========================================================================== */

.hse-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
    gap: clamp(34px, 6vw, 84px);
    align-items: stretch;
}

.hse-grid--media-left {
    grid-template-columns: minmax(420px, 0.92fr) minmax(0, 1fr);
}

.hse-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 520px;
    padding: clamp(28px, 3vw, 44px) 0;
}

.hse-media {
    margin: 0;
    min-height: 520px;
    overflow: hidden;
    border-radius: var(--hse-radius);
    background: #e9ecef;
    box-shadow: var(--hse-shadow);
}

.hse-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hse-list {
    display: grid;
    gap: 14px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
}

.hse-list li {
    position: relative;
    margin: 0;
    padding-left: 28px;
    color: var(--hse-body);
    font-size: 1rem;
    line-height: 1.75;
    font-weight: 600;
}

.hse-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--hse-red);
}

/* ==========================================================================
   Dashboard
   ========================================================================== */

.hse-section--dashboard {
    background: linear-gradient(135deg, #17212b 0%, #222f3a 100%);
    color: #ffffff;
}

.hse-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
    gap: clamp(30px, 5vw, 70px);
    align-items: center;
}

.hse-dashboard h2,
.hse-dashboard p {
    color: #ffffff;
}

.hse-dashboard p {
    color: rgba(255, 255, 255, 0.82);
}

.hse-dashboard__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 34px;
}

.hse-dashboard__stats div {
    padding: 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hse-dashboard__stats strong {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 900;
}

.hse-dashboard__stats span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
    line-height: 1.6;
}

.hse-dashboard__panel {
    min-height: 420px;
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hse-upload-box {
    height: 100%;
    min-height: 370px;
    border-radius: 22px;
    border: 1px dashed rgba(255, 255, 255, 0.30);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 34px;
}

.hse-upload-box__icon {
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
    border-radius: 999px;
    background: var(--hse-red);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    line-height: 1;
    font-weight: 300;
}

.hse-upload-box strong {
    display: block;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1.3;
    font-weight: 900;
}

.hse-upload-box p {
    max-width: 380px;
    margin: 0;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.hse-gallery {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    user-select: none;
}

.gallery-item {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.18;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 22px;
    overflow: hidden;
    background: #dfe4e8;
    cursor: pointer;
    box-shadow: 0 16px 42px rgba(23, 33, 43, 0.08);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.45s ease;
}

.gallery-item:hover img {
    transform: scale(1.045);
}

.g-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 18px;
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.62) 0%,
            rgba(0, 0, 0, 0.20) 50%,
            rgba(0, 0, 0, 0.02) 100%
        );
    pointer-events: none;
}

.g-label {
    color: #ffffff;
    font-size: 0.96rem;
    line-height: 1.35;
    font-weight: 900;
    text-align: left;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.hse-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(5, 9, 14, 0.92);
    user-select: none;
}

.hse-lightbox.is-open {
    display: flex;
}

.hse-lightbox__figure {
    width: min(100%, 1180px);
    height: min(86svh, 820px);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hse-lightbox__figure img {
    max-width: 100%;
    max-height: calc(100% - 54px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 18px;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.hse-lightbox__figure figcaption {
    min-height: 34px;
    margin-top: 18px;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 800;
    text-align: center;
}

.hse-lightbox__close,
.hse-lightbox__nav {
    position: absolute;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}

.hse-lightbox__close:hover,
.hse-lightbox__nav:hover {
    background: var(--hse-red);
    transform: scale(1.04);
}

.hse-lightbox__close {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    font-size: 34px;
    line-height: 1;
}

.hse-lightbox__nav {
    top: 50%;
    width: 54px;
    height: 54px;
    transform: translateY(-50%);
    font-size: 48px;
    line-height: 1;
}

.hse-lightbox__nav:hover {
    transform: translateY(-50%) scale(1.04);
}

.hse-lightbox__nav--prev {
    left: 24px;
}

.hse-lightbox__nav--next {
    right: 24px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 1600px) {
    .hse-page {
        --hse-container: 1440px;
    }

    .hse-gallery {
        gap: 22px;
    }
}

@media (max-width: 1199.98px) {
    .hse-grid,
    .hse-grid--media-left {
        grid-template-columns: 1fr 1fr;
        gap: 34px;
    }

    .hse-copy,
    .hse-media {
        min-height: 460px;
    }

    .hse-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .hse-page {
        --hse-header-offset: 86px;
    }

    .hse-hero {
        min-height: 720px;
    }

    .hse-grid,
    .hse-grid--media-left {
        grid-template-columns: 1fr;
    }

    .hse-grid--media-left .hse-media {
        order: 2;
    }

    .hse-grid--media-left .hse-copy {
        order: 1;
    }

    .hse-copy {
        min-height: auto;
        padding: 0;
    }

    .hse-media {
        min-height: 420px;
    }

    .hse-kpi-grid,
    .hse-dashboard,
    .hse-dashboard__stats {
        grid-template-columns: 1fr;
    }

    .hse-dashboard__panel {
        min-height: 320px;
    }

    .hse-upload-box {
        min-height: 280px;
    }
}

@media (max-width: 767.98px) {
    .hse-container {
        width: calc(100% - 28px);
    }

    .hse-hero {
        min-height: calc(100svh - 72px);
        background-position: center center;
    }

    .hse-hero__content {
        padding: 90px 0 42px;
    }

    .hse-hero__title {
        font-size: clamp(2.75rem, 11vw, 4.3rem);
        line-height: 1;
    }

    .hse-hero__subtitle {
        font-size: 1.2rem;
    }

    .hse-hero__description {
        font-size: 1rem;
        line-height: 1.7;
    }

    .hse-hero__nav {
        gap: 9px;
        margin-top: 24px;
    }

    .hse-hero__nav a {
        min-height: 38px;
        padding: 0 13px;
        font-size: 12px;
    }

    .hse-section {
        padding: 58px 0;
    }

    .hse-section-head {
        margin-bottom: 28px;
    }

    .hse-section-head h2,
    .hse-copy h2,
    .hse-dashboard h2 {
        font-size: clamp(2.15rem, 9vw, 3.2rem);
    }

    .hse-section-head p,
    .hse-copy p,
    .hse-dashboard p {
        font-size: 1rem;
        line-height: 1.75;
    }

    .hse-kpi {
        min-height: auto;
        padding: 26px;
    }

    .hse-media {
        min-height: auto;
        aspect-ratio: 1.12 / 1;
        border-radius: 18px;
    }

    .hse-list li {
        font-size: 0.96rem;
    }

    .hse-gallery {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .gallery-item {
        aspect-ratio: 1.18 / 1;
        border-radius: 18px;
    }

    .hse-lightbox {
        padding: 16px;
    }

    .hse-lightbox__figure {
        height: 78svh;
    }

    .hse-lightbox__close {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
        font-size: 30px;
    }

    .hse-lightbox__nav {
        width: 42px;
        height: 42px;
        font-size: 36px;
    }

    .hse-lightbox__nav--prev {
        left: 12px;
    }

    .hse-lightbox__nav--next {
        right: 12px;
    }
}

@media (max-width: 420px) {
    .hse-hero__title {
        font-size: 2.65rem;
    }

    .hse-gallery {
        gap: 14px;
    }
}

/* RTL safety */
html[dir="rtl"] .hse-page {
    direction: rtl;
}

html[dir="rtl"] .hse-copy,
html[dir="rtl"] .hse-section-head,
html[dir="rtl"] .hse-hero__content,
html[dir="rtl"] .g-label {
    text-align: right;
}

html[dir="rtl"] .hse-list li {
    padding-left: 0;
    padding-right: 28px;
}

html[dir="rtl"] .hse-list li::before {
    left: auto;
    right: 0;
}

/* =========================================================
   HSE Fix: scrollbar + large typography + check icons
   ========================================================= */

/* منع ظهور سكرولين في صفحة HSE */
html:has(.hse-page),
body:has(.hse-page) {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    max-height: none !important;
}

body:has(.hse-page) .hse-page {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    min-height: 100vh !important;
}

/* تحسين انتقال الروابط مع الهيدر الثابت */
.hse-anchor {
    scroll-margin-top: 120px !important;
}

/* تكبير عناوين أقسام Safety / Health / Environment */
.hse-copy h2 {
    font-size: clamp(4.6rem, 5vw, 7.8rem) !important;
    line-height: 1.02 !important;
    font-weight: 900 !important;
    letter-spacing: -0.055em !important;
}

/* تكبير وصف الأقسام */
.hse-copy p {
    font-size: clamp(1.75rem, 1.35vw, 2.35rem) !important;
    line-height: 1.9 !important;
    font-weight: 400 !important;
    color: #4f5870 !important;
}

/* تكبير القائمة */
.hse-list {
    gap: 18px !important;
    margin-top: 38px !important;
}

/* علامة صح بدل النقطة */
.hse-list li {
    position: relative !important;
    padding-left: 58px !important;
    min-height: 38px !important;

    font-size: clamp(1.55rem, 1.08vw, 2rem) !important;
    line-height: 1.65 !important;
    font-weight: 500 !important;
    color: #4f5870 !important;
}

.hse-list li::before {
    content: "✓" !important;
    position: absolute !important;
    left: 0 !important;
    top: -2px !important;

    width: 36px !important;
    height: 36px !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    border-radius: 50% !important;
    background: rgba(23, 166, 151, 0.12) !important;
    color: #17a697 !important;

    font-size: 20px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
}

/* تكبير العناوين الحمراء الصغيرة */
.hse-copy .hse-eyebrow {
    font-size: 1.35rem !important;
    letter-spacing: 0.22em !important;
    margin-bottom: 22px !important;
}

/* تحسين عرض الأقسام */
.hse-copy {
    min-height: 620px !important;
}

.hse-media {
    min-height: 620px !important;
}

/* Mobile */
@media (max-width: 767.98px) {
    .hse-anchor {
        scroll-margin-top: 95px !important;
    }

    .hse-copy h2 {
        font-size: clamp(3.4rem, 13vw, 5.2rem) !important;
        line-height: 1.02 !important;
    }

    .hse-copy p {
        font-size: 1.45rem !important;
        line-height: 1.85 !important;
    }

    .hse-list {
        gap: 14px !important;
        margin-top: 28px !important;
    }

    .hse-list li {
        padding-left: 48px !important;
        font-size: 1.28rem !important;
        line-height: 1.7 !important;
    }

    .hse-list li::before {
        width: 32px !important;
        height: 32px !important;
        font-size: 18px !important;
        top: 0 !important;
    }

    .hse-copy {
        min-height: auto !important;
    }

    .hse-media {
        min-height: auto !important;
    }
}
 
 