/* catalog/view/theme/mahardhi/template/article_manager/article.css */

/* ========= PAGE ARTICLE GLOBALE ========= */

.article-page .article-container {
    background: #ffffff;
    padding: 15px;
    margin-bottom: 30px;
    border-radius: 6px;
    border: 1px solid #e5e5e5;
}

/* Header / meta */
.article-header {
    margin-bottom: 20px;
    background-color: #000;
    color: #fff;
    padding: 15px;
    border-radius: 6px 6px 0 0;
}

.article-container h1{
    margin-top: 0;
    margin-bottom: 5px;
    color: #fff;
    text-align: center;
}

.article-subtitle {
    font-size: 18px;
     color: #fff;
    margin-top: 5px;
}

.article-meta {
    margin-top: 10px;
    font-size: 12px;
}

/* LAYOUT SOMMAIRE + CONTENU */
.article-layout {
    margin-top: 15px;
}

.article-toc-col {
    margin-bottom: 20px;
}

.article-content-col {
    margin-bottom: 20px;
}

/* Sommaire */
.article-toc {
    margin-bottom: 25px;
}

.article-toc-list li {
    margin-bottom: 5px;
}

.article-toc-list a {
    text-decoration: none;
}

.article-toc-list a:hover {
    text-decoration: underline;
}

/* ===== Sommaire "fixed" ===== */
@media (min-width: 992px) {
    .article-toc-fixed {
        position: fixed;
        top: 20px;
        z-index: 10;
    }
}

/* Scroll interne du sommaire */
.article-toc-fixed .panel-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Sections */
.article-section {
    margin-bottom: 30px;
}

.article-section-title {
    margin-top: 20px;
    margin-bottom: 15px;
}

/* ========= IMAGES DE SECTION ========= */

.section-images {
    margin-top: 15px;
}

.section-image {
    margin-bottom: 20px;
}

.section-image-card {
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    background: #fff;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
}

.section-image-card:hover {
    border-color: #00a651;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.section-image-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px 0;
}

.section-image-wrapper {
    width: 100%;
    overflow: hidden;
    background: #fafafa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.section-image-img {
    max-height: 220px;
    object-fit: fill;
    display: block;
}

.section-image-caption {
    margin-top: 4px;
}

/* ========= VIDEOS YOUTUBE ========= */

.article-section-videos {
    margin-top: 15px;
}

.youtube-player {
    margin-bottom: 15px;
}

/* ========= VIDEOS LOCALES ========= */

.article-section-local-videos {
    margin-top: 25px;
}

.article-local-videos-row {
    display: flex;
    flex-wrap: wrap;
}

.article-local-video-col {
    margin-bottom: 25px;
}

.article-local-video-card {
    height: 100%;
}

.article-local-video-title {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.4;
}

.article-local-video-meta {
    margin-top: 8px;
    font-size: 12px;
}

.article-local-video-description {
    margin-top: 12px;
}

/* Player HTML5 local dans les articles */
.article-section-local-videos .html5-player {
    background: #000;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
}

.article-section-local-videos .player-container {
    position: relative;
    background: #000;
}

.article-section-local-videos .html5-video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

.article-section-local-videos .loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.article-section-local-videos .loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.article-section-local-videos .loading-spinner {
    text-align: center;
    color: #fff;
}

.article-section-local-videos .loading-spinner i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* ========= DIVERS ========= */

.article-section-separator {
    margin: 30px 0;
}

.article-back {
    margin-top: 10px;
}

/* ========= RESPONSIVE ========= */

/* Mobile */
@media (max-width: 767px) {
    .article-page .article-container {
        padding: 10px;
    }

    .article-title {
        font-size: 22px;
    }

    .article-subtitle {
        font-size: 16px;
    }

    .article-section-title {
        font-size: 18px;
    }

    .section-image-wrapper {
        height: 160px;
    }

    .article-local-video-title {
        font-size: 16px;
    }

    .article-toc-fixed {
        position: static;
        top: auto;
    }

    .article-toc-fixed .panel-body {
        max-height: none;
        overflow: visible;
    }
}

/* Tablette */
@media (min-width: 768px) and (max-width: 991px) {
    .section-image-wrapper {
        height: 200px;
    }

    .article-local-video-col {
        width: 100%;
    }
}

/* Desktop */
@media (min-width: 992px) {
    .section-image-wrapper {
        height: 220px;
    }

    .article-section-local-videos.video-count-1 .article-local-video-col {
        width: 100%;
    }

    .article-section-local-videos.video-count-2 .article-local-video-col,
    .article-section-local-videos.video-count-3 .article-local-video-col,
    .article-section-local-videos.video-count-4 .article-local-video-col {
        width: 50%;
    }

    .article-section-local-videos.video-count-1 .html5-player {
        max-width: 820px;
    }
}

/* Mobile + tablette : 1 vidéo par ligne */
@media (max-width: 991px) {
    .article-local-video-col {
        width: 100%;
    }
}


.article-toc-list li {
    margin-bottom: 10px;
}

.article-toc-list a {
    display: block;
    padding: 4 10px;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-toc-list a:hover {
    background: #f5f5f5;
    color: #f6af08;
    text-decoration: none;
}

.article-toc-list a.is-active {
    background: #f6af08;
    color: #fff;
    font-weight: 600;
}

html {
    scroll-behavior: smooth;
}

.article-section {
    scroll-margin-top: 20px;
}


/* ===== TITRES ARTICLE ===== */


.article-container h2,
.article-container h3,
.article-container h4 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.3;
}


/* H2 : sous-titre article */
.article-container h2 {
    font-size: 24px;
    border-bottom: 2px solid #ea9412;
    color: #222;
    font-weight: 600;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* H3 : titres de section */
.article-container h3 {
    font-size: 18px;
    margin-top: 35px;
    margin-bottom: 15px;
    padding-bottom: 6px;

    border-bottom: 1px solid #ea9412;
    color: #222;

    text-transform:none;
}

/* H4 : titres secondaires */
.article-container h4 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;

    font-weight: 600;
    color: #444;
}

.article-container h3:first-letter {
    text-transform: uppercase;
}

.article-section:target {
    animation: sectionHighlight 1.5s ease;
}

@keyframes sectionHighlight {
    0% {
        background: #fff9d7;
    }
    100% {
        background: transparent;
    }
}


.article-section-content {
    background: #fff;
    border-left: 5px solid #afaeae;
    padding-left: 16px;
}

.sub-section {
    margin-bottom: 20px;
}

.materiaux-grid .thumbnail {
    min-height: 220px;
}

.materiaux-grid .thumbnail img {
    max-height: 120px;
    width: auto;
}

.materiaux-grid .caption p {
    margin: 10px 0 0;
    font-weight: 600;
}

.materiaux-grid-custom {
    margin-left: -5px;
    margin-right: -5px;
    font-size: 0;
}

.materiaux-grid-custom .materiau-item {
    display: inline-block;
    vertical-align: top;
    padding-left: 5px;
    padding-right: 5px;
    margin-bottom: 10px;
    font-size: 14px;
    width: 25%;
}

.materiaux-grid-custom .thumbnail {
    margin-bottom: 0;
    min-height: 170px;
    padding: 8px;
}

.materiaux-grid-custom .thumbnail img {
    max-height: 80px;
    width: auto;
    margin: 0 auto;
}

.materiaux-grid-custom .caption {
    padding: 8px 0 0;
}

.materiaux-grid-custom .caption p {
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;
}

/* Tablette : 6 par ligne */
@media (min-width: 768px) {
    .materiaux-grid-custom .materiau-item {
        width: 16.66666667%;
    }
}

/* PC : 8 par ligne */
@media (min-width: 1200px) {
    .materiaux-grid-custom .materiau-item {
        width: 12.5%;
    }
}