/* =========================================================
   POLICES
   ========================================================= */

@font-face {
    font-family: 'ikaros';
    src: url('../Fonts/Ikaros.woff2') format('woff2');
}

@font-face {
    font-family: 'pier';
    src: url('../Fonts/pier.woff') format('woff');
}

@font-face {
    font-family: 'charlevoix';
    src: url('../Fonts/Charlevoix.woff') format('woff');
}

@font-face {
    font-family: 'Cairo';
    src: url('../Fonts/Cairo.ttf') format('truetype');
}


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --primary: #0d6efd;
    --primary-dark: #084298;
    --secondary: #0b3d66;
    --light: #f5f8fc;
    --text: #263648;
    --muted: #6c7a89;
    --white: #fff;
    --border: #e5ebf2;
    --shadow: 0 10px 30px rgba(22, 52, 80, .10);
    --radius: 16px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Cairo', "Segoe UI", sans-serif;
    background: var(--light);
    color: var(--text);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: auto;
}


/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 18px rgba(0, 0, 0, .07);
}

.header-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo-wrap img {
    width: 72px;
    height: auto;
    display: block;
}

.brand {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    margin-left: 10px;
}

.brand strong {
    font-size: 16px;
    color: var(--secondary);
}

.brand span {
    font-size: 10px;
    color: #778494;
    margin-top: 4px;
    max-width: 190px;
}

.main-nav {
    margin-left: auto;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #394b5d;
    transition: .2s;
}

.main-nav a:hover,
.main-nav a.active {
    background: #eaf3ff;
    color: var(--primary);
}

.language {
    position: relative;
    flex-shrink: 0;
}

.lang-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 9px;
    padding: 9px 12px;
    cursor: pointer;
    font-weight: 600;
    color: #34495e;
}

.lang-btn img,
.lang-content img {
    width: 20px;
    vertical-align: middle;
    margin-right: 6px;
}

.lang-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    min-width: 145px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
    border: 1px solid var(--border);
}

.lang-content.show {
    display: block;
}

.lang-content a {
    display: block;
    padding: 9px;
    border-radius: 7px;
}

.lang-content a:hover {
    background: #f1f6fb;
}


/* =========================================================
   BANNIERE / DIAPORAMA
   ========================================================= */

#banner {
    position: relative;
    width: 100%;
    height: clamp(390px, 48vw, 610px);
    min-height: 390px;
    overflow: hidden;
    background: #082d4a;
}

.banner-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease, visibility .8s ease;
}

.banner-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.banner-slide > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(4, 34, 62, .78),
        rgba(4, 34, 62, .28) 65%,
        rgba(4, 34, 62, .12)
    );
}

.banner-caption {
    position: absolute;
    z-index: 3;
    left: max(22px, calc((100% - 1180px) / 2));
    top: 50%;
    transform: translateY(-50%);
    width: min(680px, calc(100% - 90px));
    color: #fff;
}

.banner-caption h2 {
    margin: 0 0 12px;
    font-size: clamp(28px, 4vw, 50px);
    line-height: 1.12;
    color: #fff;
}

.banner-caption p {
    margin: 0;
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.7;
    color: #eef6fc;
}

.banner-prev,
.banner-next {
    position: absolute;
    z-index: 4;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(0, 0, 0, .22);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
    transition: .2s;
}

.banner-prev {
    left: 20px;
}

.banner-next {
    right: 20px;
}

.banner-prev:hover,
.banner-next:hover {
    background: rgba(13, 110, 253, .85);
    border-color: #fff;
}

.banner-dots {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 11px;
    height: 11px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
    transition: .2s;
}

.banner-dot.active {
    width: 30px;
    border-radius: 10px;
    background: #fff;
}


/* =========================================================
   QUICK SERVICES
   ========================================================= */

.section {
    padding: 54px 0;
}

.section-head {
    text-align: center;
    margin-bottom: 30px;
}

.section-head .eyebrow {
    color: var(--primary);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.section-head h2 {
    margin: 7px 0 8px;
    font-size: 30px;
    color: var(--secondary);
}

.section-head p {
    margin: 0;
    color: var(--muted);
}

.services {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.service-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 5px 18px rgba(30, 60, 90, .05);
    transition: .25s;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf3ff;
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 15px;
}

.service-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.service-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   MAIN GRID
   ========================================================= */

.main-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    grid-template-areas: "sidebar content";
    gap: 28px;
    align-items: start;

    /*
       IMPORTANT :
       La grille reste LTR.
       Cela permet de contrôler la position physique
       des colonnes indépendamment de la langue.
    */
    direction: ltr;
}

.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.news-area {
    grid-area: content;
    width: 100%;
    min-width: 0;
    display: block;
    position: relative;
}


/* =========================================================
   PANELS / SIDEBAR
   ========================================================= */

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 5px 18px rgba(30, 60, 90, .05);
}

.panel h3 {
    margin: 0 0 15px;
    color: var(--secondary);
    font-size: 18px;
}

.side-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-menu li {
    margin: 5px 0;
}

.side-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 13px;
    border-radius: 9px;
    color: #425466;
    font-weight: 600;
    font-size: 14px;
}

.side-menu a:hover {
    background: #edf5ff;
    color: var(--primary);
}

.badge-new {
    font-size: 9px;
    background: #198754;
    color: #fff;
    padding: 3px 7px;
    border-radius: 20px;
    margin-left: 7px;
}


/* =========================================================
   RECHERCHE
   ========================================================= */

.search-form input[type="text"] {
    width: 100%;
    height: 42px;
    border: 1px solid #dce4ec;
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
}

.search-form input[type="text"]:focus {
    border-color: var(--primary);
}

.search-form input[type="submit"] {
    width: 100%;
    margin-top: 8px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}


/* =========================================================
   CONNEXION
   ========================================================= */

.login-form input {
    width: 100%;
    height: 42px;
    margin-bottom: 9px;
    border: 1px solid #dce4ec;
    border-radius: 8px;
    padding: 0 12px;
}

.login-form button {
    width: 100%;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--secondary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.error-message {
    color: #b02a37;
    background: #f8d7da;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    margin-bottom: 10px;
}


/* =========================================================
   NEWS
   ========================================================= */

.news-header {
    width: 100%;
    display: block;
    position: relative;
    margin-bottom: 18px;
}

.news-header h2 {
    margin: 0;
    color: var(--secondary);
    font-size: 27px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.news-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 5px 18px rgba(30, 60, 90, .05);
    transition: .25s;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.news-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    display: block;
    background: #f5f5f5;
}

.news-body {
    padding: 18px;
}

.news-body h3 {
    margin: 0 0 10px;
    font-size: 19px;
    color: var(--secondary);
}

.news-body p {
    margin: 0 0 16px;
    color: #637383;
    line-height: 1.7;
    font-size: 14px;
}

.news-link {
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}

.empty-news {
    background: #fff;
    border: 1px dashed #cbd6e2;
    border-radius: var(--radius);
    padding: 35px;
    text-align: center;
    color: var(--muted);
}


/* =========================================================
   PAGE DG
   ========================================================= */

.dg-content {
    width: 100%;
    display: block;
    position: relative;
}

.dg-content p {
    display: block;
    width: 100%;
    margin: 0 0 18px;
    padding: 0;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;
    justify-content: center;
    gap: 7px;
    margin-top: 28px;
}

.pagination a {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--secondary);
    font-weight: 700;
}

.pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}


/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
    background: #082d4a;
    color: #d9e5ef;
    margin-top: 30px;
}

.footer-main {
    padding: 42px 0;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 35px;
}

.footer-brand {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.footer-brand img {
    width: 65px;
}

.site-footer h3 {
    color: #fff;
    margin: 0 0 13px;
    font-size: 17px;
}

.site-footer p,
.site-footer a {
    font-size: 13px;
    line-height: 1.7;
    color: #c7d5e1;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin: 6px 0;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: #afc0ce;
}


/* =========================================================
   RTL - ARABE
   ========================================================= */

/*
   Le body et le texte sont RTL.
   La grille principale reste LTR afin de contrôler
   physiquement les colonnes.
*/

body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .brand {
    margin-left: 0;
    margin-right: 10px;
}

body.rtl .main-nav {
    margin-left: 0;
    margin-right: auto;
}

body.rtl .lang-content {
    right: auto;
    left: 0;
}

body.rtl .lang-btn img,
body.rtl .lang-content img {
    margin-right: 0;
    margin-left: 6px;
}


/* Bannière arabe */

body.rtl #banner .banner-slide::after {
    background: linear-gradient(
        270deg,
        rgba(4, 34, 62, .78),
        rgba(4, 34, 62, .28) 65%,
        rgba(4, 34, 62, .12)
    );
}

body.rtl .banner-caption {
    left: auto;
    right: max(22px, calc((100% - 1180px) / 2));
}


/* =========================================================
   ARABE - MAIN GRID
   ========================================================= */

/*
   Français :
   [ SIDEBAR ] [ CONTENT ]

   Arabe :
   [ CONTENT ] [ SIDEBAR ]
*/

body.rtl .main-grid {
    direction: ltr;
    grid-template-columns: minmax(0, 1fr) 280px;
    grid-template-areas: "content sidebar";
}

body.rtl .sidebar {
    grid-area: sidebar;
}

body.rtl .news-area {
    grid-area: content;
    direction: rtl;
    text-align: right;
}


/* =========================================================
   ARABE - PAGE DG
   ========================================================= */

body.rtl .news-header {
    direction: rtl;
    text-align: right;
}

body.rtl .dg-content {
    direction: rtl;
    text-align: right;
    display: block;
    width: 100%;
    position: relative;
}

body.rtl .dg-content p {
    direction: rtl;
    text-align: justify;
    display: block;
    width: 100%;
    margin: 0 0 18px;
    position: relative;
    line-height: 2.1;
    font-family: 'Cairo', Tahoma, Arial, sans-serif;
}

body.rtl .badge-new {
    margin-left: 0;
    margin-right: 7px;
}


/* =========================================================
   FRANÇAIS - PAGE DG
   ========================================================= */

body.ltr {
    direction: ltr;
    text-align: left;
}

body.ltr .main-grid {
    direction: ltr;
}

body.ltr .news-area {
    direction: ltr;
    text-align: left;
}

body.ltr .dg-content {
    direction: ltr;
    text-align: left;
}

body.ltr .dg-content p {
    direction: ltr;
    text-align: justify;
    line-height: 1.8;
}


/* =========================================================
   MOBILE
   ========================================================= */

.mobile-toggle {
    display: none;
    border: 0;
    background: #edf4fb;
    color: var(--secondary);
    width: 42px;
    height: 42px;
    border-radius: 9px;
    font-size: 22px;
}


/* =========================================================
   TABLETTE
   ========================================================= */

@media (max-width: 1050px) {

    .header-inner {
        gap: 14px;
    }

    .brand {
        display: none;
    }

    .main-nav a {
        padding: 9px 8px;
        font-size: 13px;
    }

    .services {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 800px) {

    .mobile-toggle {
        display: block;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        position: absolute;
        left: 16px;
        right: 16px;
        top: 75px;
        background: #fff;
        padding: 8px;
        border-radius: 12px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border);
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        display: block;
    }

    .main-nav a {
        padding: 12px;
    }

    .language {
        margin-left: 0;
    }

    .header-inner {
        min-height: 72px;
    }


    /* Grille mobile */

    .main-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "sidebar";
        direction: ltr;
    }

    .sidebar {
        grid-area: sidebar;
    }

    .news-area {
        grid-area: content;
    }


    /* Arabe mobile */

    body.rtl .main-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "sidebar";
        direction: ltr;
    }

    body.rtl .sidebar {
        grid-area: sidebar;
    }

    body.rtl .news-area {
        grid-area: content;
    }


    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   PETITS ECRANS
   ========================================================= */

@media (max-width: 560px) {

    .container {
        width: min(100% - 22px, 1180px);
    }

    #banner {
        height: 430px;
        min-height: 430px;
    }

    .banner-caption {
        left: 22px;
        width: calc(100% - 70px);
    }

    body.rtl .banner-caption {
        left: auto;
        right: 22px;
    }

    .banner-caption h2 {
        font-size: 31px;
    }

    .banner-caption p {
        font-size: 15px;
    }

    .banner-prev,
    .banner-next {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .banner-prev {
        left: 10px;
    }

    .banner-next {
        right: 10px;
    }

    .services {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 38px 0;
    }

    .logo-wrap img {
        width: 62px;
    }

    .language .lang-btn {
        padding: 8px;
    }
}