
/* Gestion Media | custom styles */

h1, h2, h3, h4, h5, h6, p {
    overflow-wrap: break-word;
    word-break: break-word;
}

:root {
    --portal-bp-mobile: 991.98px;
    --portal-header-height: 3.5rem;
    --portal-gutter-mobile: 0.85rem;
}

.admin-layout-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* Override Vuexy .content { margin-left: 260px } | we use our own sidebar */
.admin-dashboard .app-content.content,
.admin-layout-wrapper .admin-main-content,
.admin-layout-wrapper .app-content.content {
    margin-left: 0 !important;
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
}

.admin-layout-wrapper .content-wrapper.container-xxl {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: #fff;
    border-right: 1px solid #ebe9f1;
    position: sticky;
    top: 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.admin-main-content {
    flex: 1;
    min-width: 0;
}

/* Navbar is above the flex row, not overlapping content — trim Vuexy top padding */
.admin-dashboard .admin-main-content.content.app-content {
    padding: 0.75rem 1.5rem 0;
}

.sidebar-group {
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.sidebar-group-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: #b9b9c3;
    margin-bottom: 0.5rem;
    padding-left: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.375rem;
    color: #6e6b7b;
    text-decoration: none;
    margin-bottom: 0.15rem;
}

.sidebar-link:hover {
    background: #f8f8f8;
    color: #7367f0;
}

.sidebar-link.active {
    background: rgba(115, 103, 240, 0.12);
    color: #7367f0;
    font-weight: 500;
}

.sidebar-link .badge {
    margin-left: auto;
}

.marketing-page .hero-section {
    min-height: 60vh;
}

.client-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.client-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        left: -280px;
        z-index: 1050;
        transition: left 0.3s;
        height: 100vh;
        height: 100dvh;
        top: 0;
        padding-top: 4rem;
        width: min(280px, 88vw);
        min-width: min(280px, 88vw);
    }

    .admin-sidebar.open {
        left: 0;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }

    .admin-layout-wrapper.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
    }

    .admin-layout-wrapper .admin-main-content {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }
}

/* ── Portail public (page d'accueil) ── */

.portal-page {
    font-family: 'Montserrat', sans-serif;
    background: #f4f4f4;
    overflow-x: hidden;
}

.portal-main {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

.portal-page main > .container,
.portal-page main > .container-fluid,
.portal-main > .container,
.portal-main > .container-fluid {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.portal-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    z-index: 1030;
    --portal-header-height: 3.5rem;
}

.portal-nav {
    min-height: var(--portal-header-height);
}

@media (min-width: 992px) {
    .portal-nav .navbar-collapse {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

    .portal-menu {
        flex-wrap: nowrap;
    }

    .portal-menu .nav-link {
        white-space: nowrap;
        padding: 1rem 0.75rem;
        font-size: 0.875rem;
    }

    .portal-menu-actions {
        margin-left: 0 !important;
        flex-shrink: 0;
    }

    .portal-brand {
        margin-right: 1rem;
        flex-shrink: 0;
    }
}

.portal-menu .nav-link {
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
    border-radius: 0;
}

.portal-menu .nav-link:hover,
.portal-menu .nav-link.active {
    color: #c0392b;
    background: transparent;
}

.portal-dropdown {
    border: 1px solid #e8e8e8;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    padding: 0.35rem 0;
    min-width: 220px;
}

.portal-dropdown .dropdown-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.5rem 1rem 0.25rem;
}

.portal-dropdown-member .dropdown-header:first-child {
    color: #333;
    font-size: 0.85rem;
    font-weight: 600;
    padding-top: 0.65rem;
}

.portal-dropdown .dropdown-item {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.55rem 1rem;
    text-transform: none;
    letter-spacing: 0;
    color: #333;
}

.portal-dropdown .dropdown-item:hover,
.portal-dropdown .dropdown-item:focus {
    background: #f5f5f5;
    color: #c0392b;
}

.portal-dropdown .dropdown-divider {
    margin: 0.35rem 0;
    border-color: #eee;
}

.portal-dropdown-logout {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #c0392b !important;
}

.portal-dropdown-logout:hover {
    background: #fff5f5 !important;
    color: #a93226 !important;
}

.portal-hero {
    background: #fff;
    overflow: hidden;
}

.portal-hero-top {
    background: #e67e22;
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.65rem 1rem;
}

.portal-hero-collage {
    position: relative;
    height: 320px;
    background-color: #2c3e50;
    background-image:
        linear-gradient(135deg, rgba(44, 62, 80, 0.82) 0%, rgba(52, 73, 94, 0.78) 45%, rgba(192, 57, 43, 0.25) 100%),
        url('../images/hero/hero-bg.svg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.portal-hero-collage::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.35) 100%);
    pointer-events: none;
}

.portal-hero-panel {
    position: absolute;
    width: 140px;
    height: 260px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.9);
    z-index: 1;
}

.portal-hero-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portal-hero-panel.panel-1 { transform: rotate(-8deg) translateX(-320px); z-index: 1; }
.portal-hero-panel.panel-2 { transform: rotate(-4deg) translateX(-190px); z-index: 2; }
.portal-hero-panel.panel-3 { transform: rotate(-1deg) translateX(-60px); z-index: 3; }
.portal-hero-panel.panel-4 { transform: rotate(1deg) translateX(60px); z-index: 4; }
.portal-hero-panel.panel-5 { transform: rotate(4deg) translateX(190px); z-index: 5; }
.portal-hero-panel.panel-6 { transform: rotate(8deg) translateX(320px); z-index: 6; }

.portal-banner-red {
    background: #c0392b;
    text-align: center;
    padding: 0.85rem 1rem;
}

.portal-banner-red h1 {
    color: #fff !important;
    font-size: clamp(1.1rem, 2.5vw, 1.75rem);
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    letter-spacing: 0.01em;
}

.portal-banner-orange {
    background: #e67e22;
    color: #fff;
    text-align: center;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
}

.portal-section-title {
    color: #555;
    font-weight: 600;
    font-size: 1.35rem;
}

.portal-publications {
    background: #f4f4f4;
}

.portal-publications-alt {
    background: #ececec;
}

#publications {
    scroll-margin-top: calc(var(--portal-header-height, 3.5rem) + 0.75rem);
}

.portal-publications-container {
    max-width: 100%;
}

.portal-publications-header .portal-section-title {
    font-size: clamp(1.15rem, 4vw, 1.35rem);
}

.portal-empty-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #ececec;
}

.portal-type-filters-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding: 0.15rem 0.25rem 0.35rem;
}

.portal-type-filters-scroll::-webkit-scrollbar {
    display: none;
}

.portal-type-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    width: max-content;
    min-width: 100%;
}

.portal-type-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #555;
    background: #fff;
    border: 1px solid #e2e2e2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.portal-type-filter:hover {
    color: #c0392b;
    border-color: #c0392b;
}

.portal-type-filter.active {
    color: #fff;
    background: linear-gradient(135deg, #c0392b, #d64541);
    border-color: #c0392b;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.28);
}

@media (min-width: 992px) {
    .portal-type-filters-scroll {
        overflow: visible;
        margin: 0;
        padding: 0;
    }

    .portal-type-filters {
        flex-wrap: wrap;
        width: auto;
        min-width: 0;
    }
}

.portal-pagination .pagination {
    margin-bottom: 0;
}

.portal-count-badge {
    background: #e67e22;
    color: #fff;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
}

.portal-section-lead {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 42rem;
}

/* Grille cartes portail (documents, médias, organisations) */
.portal-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.portal-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Aperçu organisations — 5 par rangée, logo + nom */
.org-preview {
    width: 100%;
    max-width: 100%;
}

.org-preview-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.85rem;
}

.org-preview-row {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 1.25rem;
}

.org-preview-heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #999;
}

.org-preview-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #c0392b;
    text-decoration: none;
}

.org-preview-more:hover {
    color: #a93226;
    text-decoration: underline;
}

.org-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-height: 7.5rem;
    padding: 0.5rem 0.35rem 0.55rem;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.org-tile:hover {
    border-color: #d4a59e;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.org-tile-logo {
    width: 100%;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.4rem;
    padding: 0.35rem;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

.org-tile-logo img,
.org-tile-logo-img {
    max-width: 100%;
    max-height: 52px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.org-tile-logo-img--missing {
    opacity: 0.55;
    filter: grayscale(0.2);
}

.org-tile-logo-img--default {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    border-radius: 4px;
}

.org-tile-name {
    width: 100%;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    color: #2c3e50;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.org-tile:hover .org-tile-name {
    color: #c0392b;
}

/* Fiche organisation */
.organisation-read-card {
    max-width: 800px;
    margin: 0 auto;
}

.organisation-read-logo-wrap {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f6f7;
    border-radius: 12px;
    border: 1px solid #eee;
}

.organisation-read-logo {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}

.organisation-read-logo--default {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 8px;
}

.organisation-read-logo-fallback {
    color: #b0b8c0;
}

.organisation-read-title {
    color: #2c3e50;
    line-height: 1.3;
    word-break: break-word;
}

.organisation-read-summary {
    font-size: 0.9rem;
    line-height: 1.5;
}

.organisation-read-section {
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
}

.organisation-read-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin-bottom: 0.75rem;
}

.organisation-read-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #444;
    overflow-wrap: break-word;
    word-break: break-word;
}

.organisation-read-contact li {
    display: grid;
    grid-template-columns: minmax(110px, 140px) 1fr;
    gap: 0.5rem 1rem;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    line-height: 1.45;
    border-bottom: 1px solid #f8f8f8;
    min-width: 0;
}

.organisation-read-contact span,
.organisation-read-contact a {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.organisation-read-contact li:last-child {
    border-bottom: none;
}

.organisation-read-contact strong {
    color: #666;
    font-weight: 600;
}

.organisation-read-contact a {
    color: #c0392b;
    word-break: break-word;
}

.publication-card-thumb.type-organisation {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.publication-card {
    display: flex;
    flex-direction: column;
    color: inherit;
    height: 100%;
}

.publication-card:hover {
    color: inherit;
}

.publication-card-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #ddd;
}

.publication-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publication-card-thumb.type-audio { background: linear-gradient(135deg, #667eea, #764ba2); }
.publication-card-thumb.type-video { background: linear-gradient(135deg, #11998e, #38ef7d); }
.publication-card-thumb.type-document { background: linear-gradient(135deg, #eb3349, #f45c43); }

.publication-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
}

.publication-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    text-transform: uppercase;
}

.publication-card-body {
    padding: 0.85rem;
}

.publication-card-title {
    color: #2c3e50;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.publication-card-meta {
    color: #777;
    font-size: 0.8rem;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.portal-cta {
    background: linear-gradient(135deg, #c0392b, #e67e22);
}

.portal-footer {
    background: #2c3e50;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
}

.portal-footer .site-credit-link {
    color: #fff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.portal-footer .site-credit-link:hover {
    color: #f5b041;
}

.site-credit-link {
    color: #c0392b;
    font-weight: 600;
    text-decoration: none;
}

.site-credit-link:hover {
    text-decoration: underline;
}

/* Boutons icônes admin */
.admin-row-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.2rem;
    justify-content: flex-end;
    vertical-align: middle;
}

.admin-icon-action-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.btn-icon {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
}

.btn-icon svg {
    width: 15px;
    height: 15px;
}

/* Lecteur vidéo responsive (80 % du cadre 16:9) */
.video-player-frame {
    background: #3d3d3d;
}

.video-player-frame iframe,
.video-player-frame .media-embed-iframe {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 0;
}

/* Fiche lecture contenu (aperçu public) */
.content-read-compact .card-body {
    padding: 1.15rem 1.35rem;
}

.content-read-compact .content-read-title {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.content-read-compact .content-read-meta {
    font-size: 0.9rem;
    margin-bottom: 0.65rem;
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: break-word;
}

.content-read-compact .content-read-block {
    margin-bottom: 0.85rem;
}

.content-read-compact .content-read-block:last-child {
    margin-bottom: 0;
}

.content-read-compact .content-read-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.content-read-compact .content-read-actions {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid #eee;
}

/* Formulaires de contribution publics */
.contrib-form-compact .card-body {
    padding: 1.15rem 1.35rem;
}

.contrib-form-compact .contrib-form-title {
    font-size: 1.35rem;
    line-height: 1.3;
}

.contrib-form-compact .contrib-form-lead {
    font-size: 0.9rem;
    line-height: 1.4;
}

.contrib-form-compact .contrib-form-row {
    margin-bottom: 0.75rem;
}

.contrib-form-compact .form-label {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.contrib-form-compact .contrib-form-publish {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin-bottom: 0;
}

.contrib-form-compact .contrib-form-publish .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
    padding-left: 0;
    min-height: auto;
}

.contrib-form-compact .contrib-form-publish .form-check-input {
    float: none;
    margin: 0;
    flex-shrink: 0;
}

.contrib-form-compact .contrib-form-publish .form-check-label {
    font-size: 0.85rem;
    line-height: 1.3;
}

.contrib-form-compact .contrib-form-actions {
    margin-top: 0.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
}

.contrib-form-compact .contrib-form-actions .d-flex {
    justify-content: center;
}

.contrib-form-compact .thematique-checkboxes-wrapper {
    max-height: 120px;
    overflow-y: auto;
    padding: 0.35rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background: #fff;
}

.contrib-form-compact .mb-2 {
    margin-bottom: 0.65rem !important;
}

/* Modal demande de téléchargement */
.download-request-modal .modal-dialog {
    max-width: 480px;
}

.download-request-modal .modal-header,
.download-request-modal .modal-footer {
    border-color: #eee;
}

.download-request-modal .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.8125rem;
    font-weight: 600;
}

.download-request-modal .download-request-lead {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.download-request-modal .form-control-sm {
    font-size: 0.875rem;
}

.download-request-modal textarea.form-control-sm {
    min-height: 2.5rem;
}

.download-request-modal .modal-footer {
    justify-content: flex-end;
}

/* Cartes documents bibliothèque */
.document-library-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1px solid #ececec;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.document-library-cover-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.document-library-card--compact {
    flex-direction: row;
    align-items: stretch;
}

.document-library-card--compact .document-library-cover-link {
    flex: 0 0 108px;
    max-width: 108px;
}

.document-library-card--compact .document-library-cover {
    height: 100%;
    min-height: 124px;
}

.document-library-card--compact .document-library-body {
    padding: 0.75rem 0.85rem 0.85rem 0.35rem;
    min-width: 0;
}

.document-library-card--compact .document-library-title {
    font-size: 0.92rem;
    -webkit-line-clamp: 3;
}

.document-library-card--compact .document-library-actions .btn {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
}

@media (min-width: 576px) {
    .document-library-card--compact {
        flex-direction: column;
    }

    .document-library-card--compact .document-library-cover-link {
        flex: none;
        max-width: none;
    }

    .document-library-card--compact .document-library-cover {
        height: 180px;
        min-height: 0;
    }

    .document-library-card--compact .document-library-body {
        padding: 1rem;
    }
}

.document-library-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.document-library-cover {
    height: 200px;
    background: #ececec;
    overflow: hidden;
}

.document-library-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-library-cover-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: #fff;
}

.document-library-cover-placeholder svg {
    width: 48px;
    height: 48px;
}

.document-library-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.document-library-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-library-meta {
    font-size: 0.8rem;
    color: #888;
}

.document-library-resume {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.45;
    margin-bottom: 0.75rem;
    flex: 1;
}

.document-read-cover {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

.document-read-cover-placeholder {
    height: 280px;
    background: linear-gradient(135deg, #eb3349, #f45c43);
    color: #fff;
}

.document-read-cover-placeholder svg {
    width: 64px;
    height: 64px;
}

.document-read-meta {
    font-size: 0.95rem;
    color: #444;
}

.document-read-meta p {
    line-height: 1.5;
}

.document-read-resume h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.document-read-resume p,
.document-read-description {
    line-height: 1.65;
    color: #444;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Fiche détail document — layout flexbox natif (sans row/col Bootstrap) ── */

.doc-detail-layout {
    display: flex;
    flex-direction: row;
    gap: 1.75rem;
    align-items: flex-start;
}

.doc-detail-cover {
    flex: 0 0 200px;
    width: 200px;
}

.doc-detail-cover img,
.doc-detail-cover .document-read-cover {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}

.doc-detail-cover .document-read-cover-placeholder {
    width: 100%;
    height: 220px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.doc-detail-body {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.doc-detail-body h3,
.doc-detail-body h4,
.doc-detail-body h5,
.doc-detail-body h6,
.doc-detail-body p {
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.doc-detail-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.doc-detail-meta p {
    margin: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.doc-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (max-width: 767.98px) {
    .doc-detail-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .doc-detail-cover {
        flex: none;
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
        text-align: center;
    }

    .doc-detail-cover .document-read-cover-placeholder {
        height: 160px;
    }

    .doc-detail-meta {
        grid-template-columns: 1fr;
    }

    .doc-detail-body {
        width: 100%;
        flex: 1 1 auto;
    }

    .doc-detail-actions {
        flex-direction: column;
    }

    .doc-detail-actions .btn,
    .doc-detail-actions form {
        width: 100%;
    }

    .doc-detail-actions form .btn {
        width: 100%;
    }

    .document-read-card .card-body {
        padding: 1rem;
    }
}

/* ── Protection défensive : ancienne structure row/col (si vue Blade encore en cache serveur) ── */
.document-read-card .row {
    flex-wrap: wrap;
}

.document-read-card .row > * {
    min-width: 0;
}

.document-read-card img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 767.98px) {
    .document-read-card .row > [class*="col-md"],
    .document-read-card .row > [class*="col-sm"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }
}

.publication-card-placeholder svg {
    color: rgba(255, 255, 255, 0.9);
}

.publication-card-thumb {
    position: relative;
}

.publication-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.publication-card-video .publication-card-title {
    color: #2563eb;
}

.publication-card-description,
.video-card-description {
    font-size: 0.85rem;
    line-height: 1.45;
    color: #666;
    margin-bottom: 0.5rem;
}

.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    pointer-events: none;
}

.video-play-overlay svg {
    width: 48px;
    height: 48px;
    padding: 12px;
    background: rgba(235, 51, 73, 0.92);
    border-radius: 12px;
}

.video-card-preview {
    position: relative;
    display: block;
}

.video-card-preview img {
    height: 180px;
    object-fit: cover;
    width: 100%;
}

.thematique-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.thematique-checkbox-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #ddd;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    background: #fff;
}

.thematique-checkbox-item:has(input:checked) {
    border-color: #eb3349;
    background: #fff5f6;
    color: #eb3349;
}

.thematique-checkbox-item input {
    margin: 0;
}

.form-help-icon {
    width: 1.25rem;
    height: 1.25rem;
    min-width: 1.25rem;
    border-radius: 50%;
    border: 1px solid #adb5bd;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.form-help-icon:hover {
    border-color: #eb3349;
    color: #eb3349;
    background: #fff5f5;
}

.form-help-tooltip .tooltip-inner {
    max-width: 280px;
    text-align: left;
    font-size: 0.8rem;
}

.media-form-hint {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    font-size: 0.82rem;
    color: #495057;
}

.media-form-hint code {
    font-size: 0.78rem;
    word-break: break-all;
}

.validation-summary {
    border-left: 4px solid #dc3545;
    font-size: 0.9rem;
}

.validation-summary-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.field-error-message {
    color: #dc3545;
    font-size: 0.84rem;
    font-weight: 600;
    margin-top: 0.35rem;
}

.is-invalid-group {
    outline: 2px solid rgba(220, 53, 69, 0.35);
    outline-offset: 2px;
    border-radius: 8px;
    padding: 0.35rem;
}

.empty-state-icon svg {
    opacity: 0.45;
}

.document-library-meta svg {
    vertical-align: -2px;
}

@media (max-width: 991.98px) {
    .portal-hero-collage,
    .portal-hero-panel {
        display: none;
    }

    .portal-menu .nav-link {
        padding: 0.65rem 1rem;
    }
}

/* Auth pages: login & register */
.auth-page {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #fff5f3 0%, #ffe8e4 45%, #fff 100%);
}

.auth-page-inner {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.auth-decoration-panel {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #eb3349 0%, #f45c43 55%, #ff8a65 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-library-scene {
    position: relative;
    width: min(420px, 90vw);
    height: min(420px, 70vw);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-library-glow {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, transparent 70%);
    animation: auth-glow-pulse 4s ease-in-out infinite;
}

.auth-books-orbit {
    position: absolute;
    inset: 0;
    animation: auth-orbit-spin 80s linear infinite;
}

.auth-book-orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 60px;
    margin: -30px 0 0 -26px;
    transform: rotate(var(--orbit-angle)) translate(165px) rotate(calc(-1 * var(--orbit-angle)));
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.2));
    animation: auth-book-float 3s ease-in-out infinite;
    animation-delay: calc(var(--orbit-angle) / 45 * 0.3s);
}

.auth-book-icon {
    width: 100%;
    height: 100%;
}

.auth-library-center {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 1.5rem;
}

.auth-library-logo svg {
    width: 64px;
    height: 64px;
    margin-bottom: 0.75rem;
}

.auth-library-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.auth-library-tagline {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 0.25rem;
}

.auth-library-sub {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
    letter-spacing: 0.05em;
}

.auth-library-shelves {
    position: absolute;
    bottom: -10%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 120%;
    opacity: 0.25;
}

.auth-library-shelves span {
    display: block;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    overflow: hidden;
}

.auth-form-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    box-shadow: 0 12px 40px rgba(235, 51, 73, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.auth-form-card-compact {
    max-width: 420px;
    padding: 1.25rem 1.4rem;
    flex-shrink: 0;
}

.auth-form-card-register {
    max-width: 420px;
}

.auth-form-grid {
    --bs-gutter-y: 0.35rem;
    --bs-gutter-x: 0.65rem;
}

.auth-form-grid > [class*="col-"] {
    margin-bottom: 0.15rem;
}

.auth-form-header {
    margin-bottom: 0.75rem;
}

.auth-form-brand {
    margin-bottom: 0.75rem;
}

.auth-form-favicon {
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(235, 51, 73, 0.25);
}

.auth-form-brand .auth-form-title {
    font-size: 1.2rem;
}

.auth-form-subtitle {
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.auth-form-card-compact .form-label {
    margin-bottom: 0.1rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.auth-form-card-compact .form-control-sm {
    padding: 0.32rem 0.6rem;
    font-size: 0.84rem;
}

.auth-submit-btn {
    margin-top: 0.65rem;
    padding: 0.45rem 0.75rem;
    font-weight: 600;
}

.auth-form-footer {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    line-height: 1.4;
}

@media (max-height: 760px) and (min-width: 992px) {
    .auth-form-card-compact {
        padding: 1rem 1.15rem;
    }

    .auth-form-brand {
        margin-bottom: 0.5rem;
    }

    .auth-form-brand .auth-form-title {
        font-size: 1.05rem;
    }

    .auth-form-favicon {
        width: 34px;
        height: 34px;
    }

    .auth-library-scene {
        width: min(340px, 38vw);
        height: min(340px, 38vw);
    }

    .auth-book-orbit-item {
        transform: rotate(var(--orbit-angle)) translate(140px) rotate(calc(-1 * var(--orbit-angle)));
    }
}

.auth-form-title {
    color: #eb3349;
}

.auth-form-card .btn-primary {
    background: linear-gradient(135deg, #eb3349, #f45c43);
    border: none;
    padding: 0.65rem 1rem;
    font-weight: 600;
}

.auth-form-card .btn-primary:hover {
    background: linear-gradient(135deg, #d62839, #eb3349);
}

.auth-form-card a {
    color: #eb3349;
}

@keyframes auth-orbit-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes auth-book-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -6px; }
}

@keyframes auth-glow-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 991.98px) {
    .auth-page {
        height: auto;
        max-height: none;
        overflow: auto;
    }

    .auth-page-inner {
        flex-direction: column;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .auth-decoration-panel {
        min-height: 220px;
        flex: none;
        padding: 1rem;
    }

    .auth-library-scene {
        width: 240px;
        height: 240px;
    }

    .auth-book-orbit-item {
        transform: rotate(var(--orbit-angle)) translate(95px) rotate(calc(-1 * var(--orbit-angle)));
    }

    .auth-library-title {
        font-size: 1.2rem;
    }

    .auth-library-shelves {
        display: none;
    }

    .auth-form-panel {
        flex: none;
        width: 100%;
        min-width: 0;
        padding: 1rem;
        overflow: visible;
    }

    .auth-form-card,
    .auth-form-card-compact,
    .auth-form-card-register {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
}

.admin-content-action-bar .btn svg {
    vertical-align: -2px;
    margin-right: 2px;
}

.admin-content-action-bar {
    background: #fafafa;
    border-color: #ebe9f1 !important;
}

/* Dashboard admin */
.admin-dashboard .content-body > .dashboard-stats-row {
    --bs-gutter-y: 0.5rem;
    margin-bottom: 0.5rem !important;
}

.dashboard-stat-card .card-body {
    padding: 0.65rem 1rem;
}

.dashboard-stat-card .avatar.p-50 {
    padding: 0.35rem !important;
}

.dashboard-stat-card h4 {
    font-size: 1.35rem;
}

.dashboard-compact-card .card-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.dashboard-compact-card .card-body {
    padding: 0.65rem 1rem;
}

.dashboard-hero .dashboard-views-card {
    box-shadow: 0 2px 8px rgba(115, 103, 240, 0.12);
}

.dashboard-hero .dashboard-views-card.border-success {
    box-shadow: 0 2px 8px rgba(40, 199, 111, 0.12);
}

.dashboard-views-count {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #5e5873;
}

.dashboard-list-card .card-header {
    background: #fff;
    border-bottom: 1px solid #ebe9f1;
}

.dashboard-list-item {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f3;
}

.dashboard-list-item:last-child {
    border-bottom: none;
}

.dashboard-list-title {
    font-weight: 500;
    color: #5e5873;
    text-decoration: none;
}

.dashboard-list-title:hover {
    color: #7367f0;
}

.dashboard-mini-pagination .pagination {
    margin-bottom: 0;
    justify-content: center;
}

.dashboard-mini-pagination .page-link {
    padding: 0.25rem 0.55rem;
    font-size: 0.85rem;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 2.5rem;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0.35rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #6e6b7b;
    padding: 0.25rem;
    line-height: 0;
    border-radius: 0.25rem;
    cursor: pointer;
}

.password-toggle-btn:hover {
    color: #7367f0;
}

.password-toggle-icon--hide {
    display: none;
}

.password-input-wrapper.is-visible .password-toggle-icon--show {
    display: none;
}

.password-input-wrapper.is-visible .password-toggle-icon--hide {
    display: inline-flex;
}

@media (max-width: 767.98px) {
    .dashboard-hero .dashboard-views-card .card-body {
        text-align: left !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-books-orbit,
    .auth-book-orbit-item,
    .auth-library-glow {
        animation: none;
    }
}

/* Espace d'apprentissage — aligné charte portail (#c0392b, #e67e22, #2c3e50) */
.learning-page {
    background: #f4f4f4;
}

.learning-hero {
    background: #fff;
    overflow: hidden;
}

.learning-hero-top {
    background: #e67e22;
    color: #fff;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.6rem 1rem;
}

.learning-hero-visual {
    position: relative;
    min-height: 0;
    background-color: #2c3e50;
    background-image:
        linear-gradient(135deg, rgba(44, 62, 80, 0.92) 0%, rgba(52, 73, 94, 0.88) 50%, rgba(192, 57, 43, 0.3) 100%),
        url('../images/hero/hero-bg.svg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
}

.learning-hero-visual-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 520px;
}

.learning-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.85rem 0.35rem 0.65rem;
    backdrop-filter: blur(4px);
}

.learning-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    line-height: 0;
}

.learning-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.learning-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
}

.learning-banner-red {
    background: #c0392b;
    text-align: center;
    padding: 0.85rem 1rem;
}

.learning-banner-red h1 {
    color: #fff !important;
    font-size: clamp(1.25rem, 3vw, 1.85rem);
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.learning-banner-orange {
    background: #e67e22;
    color: #fff;
    text-align: center;
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
}

.learning-search-section {
    margin-top: -0.85rem;
    position: relative;
    z-index: 5;
    padding-bottom: 0.25rem;
}

.learning-filter-panel {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    padding: 1.35rem;
    border: 1px solid #e8e8e8;
}

.learning-search-bar {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
}

.learning-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    z-index: 1;
}

.learning-search-input {
    width: 100%;
    padding-left: 2.6rem;
    border-radius: 4px;
    min-height: 46px;
    border: 1px solid #ddd;
    font-size: 0.95rem;
}

.learning-search-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 0.15rem rgba(192, 57, 43, 0.15);
}

.learning-btn-primary {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
    font-weight: 600;
    border-radius: 4px;
}

.learning-btn-primary:hover,
.learning-btn-primary:focus {
    background: #a93226;
    border-color: #a93226;
    color: #fff;
}

.learning-btn-outline {
    border: 1px solid #ddd;
    color: #555;
    background: #fff;
    border-radius: 4px;
    font-weight: 600;
}

.learning-btn-outline:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fff5f5;
}

.learning-btn-ghost {
    color: #777;
    text-decoration: none;
    font-weight: 500;
}

.learning-btn-ghost:hover {
    color: #c0392b;
}

.learning-search-submit {
    min-height: 46px;
    padding-inline: 1.35rem;
    white-space: nowrap;
}

.learning-search-hint {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: #888;
}

.learning-suggestions-hub {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, #fffaf7 0%, #fff 100%);
    border: 1px solid #f0e0d6;
    border-radius: 6px;
    transition: opacity 0.2s ease;
}

.learning-suggestions-hub.is-dimmed {
    opacity: 0.55;
}

.learning-suggestions-hub-head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3ebe6;
}

.learning-suggestions-hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #c0392b;
    color: #fff;
    flex-shrink: 0;
}

.learning-suggestions-hub-head strong {
    color: #333;
    font-size: 0.95rem;
}

.learning-suggestions-hub-section + .learning-suggestions-hub-section {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #eee;
}

.learning-chip-topic {
    gap: 0.35rem;
    border-color: #c0392b;
    color: #c0392b;
    background: #fff;
}

.learning-chip-topic:hover {
    background: #c0392b;
    color: #fff;
}

.learning-suggestion-intro {
    padding: 0.45rem 0.65rem 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #c0392b;
}

.learning-suggestion-footer {
    padding: 0.35rem 0.65rem 0.15rem;
    border-top: 1px solid #f0f0f0;
    margin-top: 0.25rem;
}

.learning-suggestion-resource small {
    text-transform: capitalize;
}

.learning-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-left: 0.35rem;
    background: #c0392b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
}

.learning-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 20;
    padding: 0.5rem;
}

.learning-suggestion-group + .learning-suggestion-group {
    border-top: 1px solid #eee;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
}

.learning-suggestion-label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
}

.learning-suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0.55rem 0.65rem;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

.learning-suggestion-item:hover,
.learning-suggestion-item:focus {
    background: #fff5f5;
    color: #c0392b;
}

.learning-suggestion-item small {
    display: block;
    color: #888;
    font-size: 0.78rem;
}

.learning-quick-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.learning-quick-label,
.learning-toolbar-label,
.learning-thematiques-label {
    font-size: 0.78rem;
    color: #888;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.learning-quick-chips,
.learning-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.learning-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    border-radius: 999px;
    padding: 0.3rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.learning-chip:hover,
.learning-chip-suggestion:hover {
    border-color: #c0392b;
    color: #c0392b;
    background: #fff5f5;
}

.learning-chip-theme {
    background: #fff;
    border-color: #e67e22;
    color: #c0392b;
}

.learning-chip-theme:hover {
    background: #e67e22;
    border-color: #e67e22;
    color: #fff;
}

.learning-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.learning-type-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.learning-type-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    margin: 0;
    background: #fff;
}

.learning-type-pill.active {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

.learning-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.learning-sort-select {
    min-width: 150px;
    border-radius: 4px;
    border-color: #ddd;
    font-size: 0.85rem;
    font-weight: 500;
}

.learning-advanced-filters {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #e8e8e8;
}

.learning-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #888;
    margin-bottom: 0.65rem;
}

.learning-filter-chip {
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.learning-filter-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.learning-filter-chip span {
    display: inline-flex;
    border: 1px solid #ddd;
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    transition: all 0.15s ease;
    background: #fff;
}

.learning-filter-chip input:checked + span {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
    font-weight: 600;
}

.learning-advanced-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1.15rem;
}

.learning-results {
    padding: 2rem 0 3rem;
}

.learning-results-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.learning-highlights {
    margin-bottom: 0.5rem;
}

.learning-highlight-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 1.15rem 1.25rem;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.learning-highlight-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.learning-highlight-head h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.learning-highlight-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #c0392b;
    color: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
}

.learning-highlight-tag-alt {
    background: #e67e22;
}

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

.learning-personalized-list li + li {
    border-top: 1px solid #f0f0f0;
}

.learning-personalized-list a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    text-decoration: none;
    color: #333;
}

.learning-personalized-list a:hover {
    color: #c0392b;
}

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

.learning-highlight-list li + li {
    border-top: 1px solid #f0f0f0;
}

.learning-highlight-list a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    text-decoration: none;
    color: #333;
    transition: color 0.15s;
}

.learning-highlight-list a:hover {
    color: #c0392b;
}

.learning-highlight-type {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    min-width: 4.5rem;
}

.learning-highlight-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
}

.learning-thematiques-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 0.85rem 1.15rem;
}

.learning-grid {
    margin-top: 0.25rem;
}

.learning-resource-card.publication-card {
    border-radius: 4px;
}

.publication-card-description {
    color: #777;
    font-size: 0.78rem;
    line-height: 1.4;
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.learning-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    background: #fff;
    border: 1px dashed #ddd;
    border-radius: 6px;
}

.learning-empty-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: #bbb;
}

.learning-empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.35rem;
}

@media (max-width: 767.98px) {
    .learning-hero-visual {
        display: none;
    }

    .learning-search-bar {
        flex-direction: column;
    }

    .learning-search-submit {
        width: 100%;
    }

    .learning-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .learning-toolbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .learning-sort-select {
        flex: 1;
        min-width: 0;
    }

    .learning-stat {
        flex: 0 1 auto;
    }
}

.contributor-dashboard .contributor-sidebar {
    border-right: 1px solid #ebe9f1;
}

.contributor-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Responsive mobile & PWA ── */

html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: clip;
}

.portal-page {
    overflow-x: clip;
}

/* Protection globale : toutes les colonnes Bootstrap dans un flex ne se réduisent pas à 0 */
.row > [class*="col"] {
    min-width: 0;
}

/* Tables : défilement horizontal sur mobile plutôt que débordement */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Cards : ne jamais déborder sur mobile */
.card {
    min-width: 0;
    max-width: 100%;
}

.portal-publications-grid {
    overflow: visible;
}

.portal-publications-grid > [class*="col-"] {
    min-width: 0;
}

body.sidebar-menu-open {
    overflow: hidden;
}

@supports (padding: env(safe-area-inset-top)) {
    .portal-header,
    .contributor-topbar,
    .client-subnav,
    .header-navbar {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .portal-footer,
    .client-main,
    .admin-main-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Admin navbar compact */
@media (max-width: 991.98px) {
    .admin-dashboard .header-navbar {
        padding: 0.5rem 0.75rem;
    }

    .admin-dashboard .header-navbar .navbar-header {
        min-width: 0;
        flex: 1;
    }

    .admin-dashboard .header-navbar .brand-text {
        font-size: 1rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 42vw;
    }

    .admin-dashboard .header-navbar .navbar-container {
        flex: 0 0 auto;
    }

    .admin-dashboard .header-navbar .nav-search {
        display: none !important;
    }

    .admin-dashboard .admin-main-content.content.app-content,
    .contributor-dashboard .admin-main-content.content.app-content {
        padding: 0.5rem 0.75rem 0;
    }

    .admin-layout-wrapper .content-wrapper.container-xxl {
        padding-left: 0;
        padding-right: 0;
    }

    .card .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card .card-header .btn,
    .card .card-header .btn-group {
        flex-shrink: 0;
    }

    .admin-content-action-bar {
        flex-direction: column;
        align-items: stretch !important;
    }

    .admin-content-action-bar .btn {
        width: 100%;
    }

    .admin-row-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .admin-row-actions .btn {
        padding: 0.25rem 0.5rem;
    }

    .contributor-brand {
        max-width: 50vw;
    }
}

/* Tables scroll on small screens */
.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table {
    min-width: 640px;
}

@media (max-width: 767.98px) {
    .table-responsive > .table {
        font-size: 0.85rem;
    }

    .table-responsive > .table .btn-sm {
        padding: 0.2rem 0.45rem;
        font-size: 0.75rem;
    }
}

/* Portal marketing */
.portal-page .portal-brand,
.portal-page .portal-brand:hover,
.portal-page .navbar-brand.portal-brand {
    color: #c0392b;
}

.portal-page .portal-brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: #c0392b !important;
}

.portal-page .portal-menu .nav-link {
    color: #333 !important;
}

.portal-page .portal-menu .nav-link:hover,
.portal-page .portal-menu .nav-link.active,
.portal-page .portal-menu .nav-link.show {
    color: #c0392b !important;
    background: transparent !important;
}

.portal-page .portal-menu .dropdown-toggle::after {
    vertical-align: middle;
}

.portal-toggler {
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    border-radius: 0.375rem;
}

.portal-toggler .navbar-toggler-icon {
    width: 1.25rem;
    height: 1.25rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

@media (max-width: 991.98px) {
    .portal-header .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .portal-nav .navbar-collapse {
        padding: 0.5rem 0 1rem;
        max-height: calc(100dvh - 4rem);
        overflow-y: auto;
    }

    .portal-nav .navbar-collapse.show,
    .portal-nav .navbar-collapse.collapsing {
        display: block;
    }

    .portal-menu {
        width: 100%;
    }

    .portal-menu .nav-link {
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .portal-menu .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none;
        border: none;
        padding-left: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    .portal-hero-top {
        font-size: 0.78rem;
        padding: 0.5rem 0.75rem;
        line-height: 1.35;
    }

    .portal-banner-red {
        padding: 0.75rem 0.85rem;
    }

    .portal-banner-red h1 {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .portal-banner-orange {
        padding: 0.5rem 0.85rem;
    }

    .portal-banner-orange p {
        font-size: 0.82rem;
        line-height: 1.4;
        margin-bottom: 0;
    }

    .portal-publications {
        padding-top: 1.25rem !important;
        padding-bottom: 1.5rem !important;
    }

    .portal-publications-container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .portal-count-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }

    .publication-card-thumb {
        height: 140px;
    }

    .publication-card-body {
        padding: 0.75rem;
    }

    .publication-card-title {
        font-size: 0.88rem;
    }

    .portal-cta {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    .portal-cta .btn {
        display: block;
        width: 100%;
        margin: 0 0 0.5rem !important;
    }

    .org-tile-logo {
        height: 60px;
    }

    .org-tile-logo img,
    .org-tile-logo-img {
        max-height: 46px;
    }

    .org-preview-row {
        --bs-gutter-y: 1rem;
    }

    .org-preview-header {
        flex-direction: column;
        align-items: stretch;
    }

    .org-preview-more {
        justify-content: center;
        width: 100%;
        padding: 0.5rem 0.75rem;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        background: #fff;
        text-align: center;
    }

    .organisation-read-contact li {
        grid-template-columns: 1fr;
    }

    .portal-footer .container {
        flex-direction: column !important;
        text-align: center;
        gap: 0.75rem !important;
    }

    .portal-footer .container > span,
    .portal-footer .container > div {
        width: 100%;
        justify-content: center;
    }

    /* media-show mobile : boutons en colonne */
    .content-read-actions.doc-detail-actions {
        flex-direction: column;
    }

    .content-read-actions.doc-detail-actions .btn,
    .content-read-actions.doc-detail-actions form {
        width: 100%;
    }

    .content-read-actions.doc-detail-actions form .btn {
        width: 100%;
    }
}

/* Client catalogue */
.client-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f4f4;
    overflow-x: hidden;
}

.client-page .client-main {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    box-sizing: border-box;
}

.client-page .client-subnav {
    top: var(--portal-header-height, 3.5rem);
}

.client-header .client-toggler .navbar-toggler-icon {
    filter: invert(1);
}

.client-subnav-link {
    display: inline-block;
    padding: 0.35rem 0;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
}

.client-subnav-link:hover {
    color: #c0392b;
}

.client-subnav-link.active {
    color: #c0392b;
    border-bottom-color: #c0392b;
}

.client-subnav-scroll {
    scrollbar-width: none;
}

.client-subnav-scroll::-webkit-scrollbar {
    display: none;
}

@media (max-width: 767.98px) {
    .client-header h4 {
        font-size: 1.1rem;
    }

    .client-main {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Forms & modals */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }

    .form-control,
    .form-select,
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .dashboard-stat-card h4 {
        font-size: 1.15rem;
    }
}

/* ── Formulaires admin unifiés ── */

.admin-form-page {
    margin-bottom: 1.5rem;
}

.admin-form-card {
    border: 1px solid #ebe9f1;
    box-shadow: 0 4px 24px rgba(34, 41, 47, 0.05);
}

.admin-form-card .card-header {
    background: #fff;
}

.admin-form-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #333;
}

.admin-form-lead {
    line-height: 1.45;
}

.admin-form,
.admin-form-card form {
    margin-top: 0.25rem;
}

.admin-form-field {
    margin-bottom: 1rem;
}

.admin-form-field .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    color: #4b4b4b;
}

.admin-form-field .form-text {
    margin-top: -0.15rem;
    margin-bottom: 0.35rem;
    font-size: 0.8rem;
}

.admin-form-field .form-control,
.admin-form-field .form-select {
    min-height: 42px;
    border-color: #d8d6de;
}

.admin-form-field .form-control:focus,
.admin-form-field .form-select:focus {
    border-color: #7367f0;
    box-shadow: 0 0 0 0.2rem rgba(115, 103, 240, 0.15);
}

.admin-form-field .form-control.is-invalid,
.admin-form-field .form-select.is-invalid {
    border-color: #ea5455;
}

.admin-form-grid {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 0;
}

.admin-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #ebe9f1;
}

.admin-form-actions .btn {
    min-width: 7.5rem;
}

.admin-form-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #b9b9c3;
    margin: 0.5rem 0 0.75rem;
}

.admin-form-notice {
    background: #f8f8f8;
    border: 1px solid #ebe9f1;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
    .admin-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .admin-form-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

/* Responsive Offcanvas filters (Catalogue) — polyfill Bootstrap v5.1 */

/* Mobile (<768px) : tiroir latéral classique */
@media (max-width: 767.98px) {
    .offcanvas-md {
        position: fixed;
        bottom: 0;
        z-index: 1045;
        display: flex;
        flex-direction: column;
        max-width: 100%;
        background-color: #fff;
        background-clip: padding-box;
        outline: 0;
        transition: transform 0.3s ease-in-out;
        visibility: hidden;
    }

    .offcanvas-md.offcanvas-start {
        top: 0;
        left: 0;
        width: min(320px, 85vw);
        border-right: 1px solid #ebe9f1;
        transform: translateX(-100%);
    }

    .offcanvas-md.show {
        transform: none;
        visibility: visible;
    }

    .offcanvas-md .offcanvas-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: #f8f9fa;
        border-bottom: 1px solid #ebe9f1;
        padding: 0.75rem 1rem;
    }

    .offcanvas-md .offcanvas-body {
        flex-grow: 1;
        padding: 1.25rem;
        overflow-y: auto;
    }

    .offcanvas-md .offcanvas-body form {
        width: 100%;
    }
}

/* Desktop (>=768px) : sidebar inline, header masqué, bouton toggle masqué */
@media (min-width: 768px) {
    .offcanvas-md {
        position: static !important;
        bottom: auto !important;
        z-index: auto !important;
        display: block !important;
        visibility: visible !important;
        background: transparent !important;
        border: none !important;
        transform: none !important;
        transition: none !important;
        width: auto !important;
    }

    .offcanvas-md .offcanvas-header {
        display: none !important;
    }

    .offcanvas-md .offcanvas-body {
        display: block !important;
        flex-grow: 0 !important;
        padding: 0 !important;
        overflow-y: visible !important;
    }
}


