
:root {
    --navbar-height: 70px; /* valeur par défaut avant exécution JS */
}

body {
    padding-top: var(--navbar-height); /* remplace le 40px fixe */
    background-color: #f4f6f9;
}

.card img {
    height: 200px;
    object-fit: cover;
}

/* Image gauche */
.bg-login-image {
    background: linear-gradient(
        rgba(0,0,0,0.5),
        rgba(0,0,0,0.5)
    ),
    url('/images/login-btp.jpg') center/cover no-repeat;
}

/* Dark mode */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode .card {
    background-color: #1e1e1e;
}

.dark-mode .form-control,
.dark-mode .input-group-text {
    background-color: #2a2a2a;
    color: #fff;
    border-color: #444;
}

.dark-mode .btn-outline-secondary {
    color: #fff;
    border-color: #666;
}


.sidebar {
    min-height: 100vh;
    border-right: 1px solid #dee2e6;
}
.sidebar .nav-link {
    color: #495057;
    border-radius: .375rem;
    padding: .6rem .75rem;
}
.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #000;
    font-weight: 500;
}
.content-wrapper {
    background: #fff;
    border-radius: .5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}
.navbar-brand {
    font-weight: 600;
    letter-spacing: .5px;
}
.readonly-field {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.photo-box {
    position: relative;
    width: 100%;
    padding-top: 100%; /* carré */
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.photo-box img.photo-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* remplit tout le cadre */
    z-index: 1;
}

.photo-empty {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e9ecef; /* gris clair */
    display: flex;
    justify-content: center;
    align-items: center;
    color: #adb5bd; /* couleur icône */
    font-size: 2rem;
    z-index: 0;
    border: 2px dashed #ced4da; /* effet cadre photo vide */
    border-radius: 5px;
}

.photo-empty i {
    pointer-events: none;
}

.photo-buttons {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 2; /* devant l'image */
    display: flex;
    gap: 5px;
}

.publication-card{
    transition: all .25s ease;
    border-radius:12px;
}

.publication-card:hover{
    transform: translateY(-5px);
    box-shadow:0 10px 25px rgba(0,0,0,0.15);
}

.carousel img{
    border-top-left-radius:12px;
    border-top-right-radius:12px;
}

/* Effet de survol sur les cartes */
.hover-shadow {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-shadow:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* Style des contrôles du carousel au survol */
.carousel-control-prev, .carousel-control-next {
    opacity: 0;
    transition: opacity 0.3s ease;
}
.card:hover .carousel-control-prev,
.card:hover .carousel-control-next {
    opacity: 1;
}

/* Uniformité des boutons */
.btn-sm {
    padding: 0.5rem;
    font-weight: 500;
    border-radius: 8px;
}

/* Animation générale */
.transition-all {
    transition: all 0.3s ease-in-out;
}

.bg-blue-custom {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: #29235c;
    border-bottom: solid 5px #f39200;
}

.section {
    /*padding: 64px 0;*/
}
.section.gray {
    background: #e9ecef;
}
.section.orange {
    background: #f39200;
}
.section.bg-img {
    background: linear-gradient(rgba(238, 173, 75, 0.42), rgba(243,146,0,0.85)), 
        url('/images/hero-btp.jpg') center/cover no-repeat;
}
.section.blue {
    background: #29235c;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: #29235c;
}
.section-title span {
    color: #29235c;
}
.section-sub {
    font-size: 14px;
    color: #6c757d;
    margin-top: 4px;
}
.see-all {
    font-weight: 600;
    font-size: 14px;
    color: #29235c;
    text-decoration: none;
    white-space: nowrap;
}
.see-all:hover {
    color: #f39200;
}

/* ── Hero layout ── */
.hero-layout {
    display: flex;
    align-items: stretch;
    min-height: 420px;
}

.hero-block {
    flex: 0 0 36%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 48px 60px 40px;
    border-right: 1px solid rgba(255,255,255,0.15);
}

.hero-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(243,146,0,0.25);
    border: 1px solid rgba(243,146,0,0.5);
    color: #100547;
    padding: 4px 14px;
    border-radius: 999px;
    text-align: center;
}

.hero-title {
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    max-width: 340px;
    line-height: 1.6;
}

.hero-cta {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    background: #100547;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 13px 28px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 20px rgba(243,146,0,0.4);
}

.hero-cta:hover {
    background: #d97f00;
    color: #fff;
    transform: translateY(-2px);
}

/* ── Catégories ── */
.categories-section {
    /*padding: 60px 0;*/
    background: #6c757d;
}

.categories-section .container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.cats-wrapper {
    flex: 1;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(6px);
    padding: 36px 32px;
}

.cats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.cats-header .section-title {
    font-size: 20px;
    color: #fff;
}

.cats-header .section-sub {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 2px;
}

.cats-header .see-all {
    color: #29235c;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.08);;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.cats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    max-width: unset;
    margin: 0;
}

.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 14px 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    width: auto;
    height: auto;
}

.cat-card:hover {
    background: rgba(243,146,0,0.2);
    border-color: #f39200;
    transform: translateY(-3px);
}

.cat-img-wrap {
    /*width: 44px;
    height: 44px;*/
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.cat-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-name {
    font-size: 11px;
    font-weight: 600;
    color: #080d47;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-layout {
        flex-direction: column;
    }

    .hero-block {
        flex: none;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.15);
        padding: 40px 24px;
        text-align: center;
    }

    .hero-cta {
        align-self: center;
    }

    .hero-sub {
        max-width: 100%;
    }

    .cats-wrapper {
        padding: 24px 16px;
    }

    .cats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 400px) {
    .cats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .cats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 576px) {
    .cats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Layout deux colonnes */
.catalogue-layout {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

/* Sidebar */
.catalogue-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f39200;
    /*border-radius: 8px;
    padding: 1.25rem;*/
    position: sticky;
    top: 1.5rem;          /* colle au viewport lors du scroll */
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #ffff;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    border-bottom: solid 1px #29235c;
    /*border-radius: 6px;*/
    transition: background 0.2s;
}

.category-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.category-img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    font-size: 16px;
}

.category-name {
    flex: 1;          /* pousse le count tout à droite */
    font-size: 14px;
    color: #29235c;
}

.category-count {
    margin-left: auto;
    background: #e8e8e8;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 24px;
    text-align: center;
}

.category-item a:hover {
    background: #e9ecef;
    color: #29235c;
}

.category-item.active a {
    background: #f5f0ff;
    color: #29235c;
}

.category-item.active .category-count {
    background: #29235c;
    color: #fff;
}

.category-search {
    padding: 0 12px 12px;
}

.category-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.category-search-input:focus {
    border-color: #6200ea;
}

/* Zone principale */
.catalogue-main {
    flex: 1;
    min-width: 0;          /* évite le débordement en flex */
}

/* Responsive : sidebar au-dessus sur mobile */
@media (max-width: 768px) {
    .catalogue-layout {
        flex-direction: column;
    }

    .catalogue-sidebar {
        width: 100%;
        position: static;
    }
}

/*----------------------------------*/
.categorie-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: var(--navbar-height, 70px);
    align-self: flex-start;
    max-height: calc(100vh - var(--navbar-height, 70px) - 2rem);
    overflow-y: auto;
}

.categorie-sidebar-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.categorie-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categorie-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #dee2e6;
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    color: #333;
}

.categorie-sidebar-btn:hover {
    background: #f8f9fa;
}

.categorie-sidebar-btn.active {
    background: #f5f0ff;
    color: #29235c;
    font-weight: 600;
    border-left: 3px solid #29235c;
}

.categorie-sidebar-img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.categorie-sidebar-placeholder {
    width: 28px;
    height: 28px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    color: #6c757d;
}