/* ================================================
   CORRECTIONS AFFICHAGE MOBILE - PAGE RECETTE
   ================================================ */

/* Mobile : moins de 768px */
@media (max-width: 767px) {
    
    /* TITLE BAR - Mobile */
    #titlebar {
        padding: 15px 0;
    }
    
    #titlebar h2 {
        font-size: 20px;
        margin-bottom: 10px;
        line-height: 1.3;
    }
    
    #breadcrumbs {
        margin-top: 10px;
    }
    
    #breadcrumbs ul li {
        font-size: 12px;
        padding: 0 5px;
    }
    
    /* RECIPE CONTENT - Mobile */
    .recipe-content {
        padding: 15px 0;
    }
    
    /* Header recette */
    .recipe-header h2 {
        font-size: 22px;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    .recipe-cat {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 12px;
        align-items: center;
        line-height: 1.4;
    }
    
    .recipe-cat span,
    .recipe-cat a {
        font-size: 11px;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        margin: 0;
        white-space: nowrap;
        padding: 4px 8px;
        background: #f5f5f5;
        border-radius: 4px;
        border-left: 2px solid var(--zahra-dore-clair);
    }
    
    .recipe-cat i {
        font-size: 12px;
        color: var(--zahra-vert-moyen);
    }
    
    .recipe-cat a {
        background: linear-gradient(135deg, rgba(0, 92, 71, 0.05), rgba(0, 92, 71, 0.1));
        color: var(--zahra-vert-fonce);
        font-weight: 600;
    }
    
    /* SLIDER RECETTE - Mobile */
    .recipeSlider {
        margin: 15px 0;
        height: 250px !important;
    }
    
    .recipeSlider img {
        width: 100%;
        height: 250px;
        object-fit: cover;
    }
    
    /* VIDEO YOUTUBE - Mobile */
    .recipe-video {
        position: relative;
        padding-bottom: 56.25%; /* Ratio 16:9 */
        height: 0;
        overflow: hidden;
        margin: 20px 0;
    }
    
    .recipe-video iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    /* DETAILS RECETTE - Mobile (une seule ligne compacte) */
    .recipe-details ul {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 12px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    
    .recipe-details ul::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }
    
    .recipe-details ul li {
        font-size: 11px;
        padding: 8px 10px;
        background: #f5f5f5;
        border-radius: 5px;
        margin: 0;
        flex-shrink: 0;
        min-width: fit-content;
        white-space: nowrap;
        border-left: 3px solid var(--zahra-dore-clair);
        line-height: 1.3;
    }
    
    .recipe-details ul li strong {
        display: inline;
        margin: 0 0 0 5px;
        color: var(--zahra-vert-fonce);
        font-size: 12px;
        font-weight: 700;
    }
    
    /* Bouton imprimer */
    .recipe-details .print {
        font-size: 14px;
        padding: 10px 20px;
        margin: 15px 0;
        display: inline-block;
    }
    
    /* DESCRIPTION - Mobile */
    .recipe-content > p {
        font-size: 15px;
        line-height: 1.7;
        padding: 15px 10px;
        text-align: justify;
    }
    
    /* TITRES H3 - Mobile */
    .recipe-content h3 {
        font-size: 20px;
        margin: 25px 0 15px;
        padding: 10px 15px;
        background: linear-gradient(135deg, var(--zahra-vert-moyen), var(--zahra-vert-fonce));
        color: white;
        border-radius: 5px;
    }
    
    /* INGREDIENTS - Mobile (RESET COMPLET + FIX) */
    .ingredients {
        padding: 0 10px;
        list-style: none;
    }
    
    .ingredients li {
        font-size: 14px !important;
        padding: 12px 50px 12px 15px !important;
        margin: 8px 0;
        background: #f9f9f9;
        border-left: 4px solid var(--zahra-dore-clair);
        border-radius: 3px;
        display: block !important;
        position: relative !important;
        list-style: none;
        min-height: 50px;
    }
    
    /* RESET checkbox customisée desktop */
    .ingredients li input[type="checkbox"] {
        display: block !important;
        position: absolute !important;
        right: 15px !important;
        top: 15px !important;
        transform: scale(1.4) !important;
        margin: 0 !important;
        opacity: 1 !important;
        z-index: 10;
        width: 18px !important;
        height: 18px !important;
    }
    
    /* RESET label customisé desktop */
    .ingredients li label {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        font-size: 14px !important;
        line-height: 1.6 !important;
        text-align: right !important;
        cursor: pointer;
        width: 100%;
        position: static !important;
        text-decoration: none !important;
    }
    
    /* ANNULER le before customisé sur mobile */
    .ingredients li label:before {
        display: none !important;
        content: none !important;
    }
    
    /* ANNULER le text-decoration du checked */
    .ingredients input[type=checkbox]:checked + label {
        text-decoration: none !important;
        opacity: 0.7;
    }
    
    /* DIRECTIONS - Mobile */
    .directions {
        padding: 0 10px 0 30px;
    }
    
    .directions li {
        font-size: 14px;
        line-height: 1.7;
        padding: 15px 10px;
        margin: 12px 0;
        background: #f9f9f9;
        border-radius: 5px;
        position: relative;
    }
    
    .directions li:before {
        position: absolute;
        right: -25px;
        top: 15px;
        background: var(--zahra-dore-clair);
        color: var(--zahra-vert-fonce);
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 13px;
    }
    
    /* BOUTONS PARTAGE - Mobile */
    .share-post {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 20px 10px;
        justify-content: center;
    }
    
    .share-post li {
        flex: 0 0 calc(33.333% - 8px);
        margin: 0;
    }
    
    .share-post li a {
        font-size: 13px;
        padding: 10px 5px;
        display: block;
        text-align: center;
        border-radius: 5px;
    }
    
    /* RECETTES LIÉES - Mobile */
    .related-posts .row {
        margin: 0 -5px;
    }
    
    .related-posts .col-md-4,
    .related-posts .col-sm-6,
    .related-posts .col-xs-12 {
        padding: 0 5px;
        margin-bottom: 15px;
    }
    
    .related-posts .recipe-block {
        margin-bottom: 0;
    }
    
    .related-posts .recipe-block-img {
        height: 180px;
    }
    
    .related-posts .recipe-block-img img {
        height: 180px;
        object-fit: cover;
    }
    
    .related-posts .recipe-block-content h3 {
        font-size: 15px;
        margin: 10px 0 5px;
        padding: 0;
        background: none;
        color: inherit;
    }
    
    .related-posts .recipe-block-content h3 a {
        line-height: 1.4;
    }
    
    .related-posts .recipe-category,
    .related-posts .recipe-type {
        font-size: 12px;
    }
    
    /* SIDEBAR - Mobile (devient pleine largeur) */
    .col-md-3 {
        margin-top: 30px;
    }
    
    .widget {
        margin-bottom: 25px;
    }
    
    .widget .titleWithline {
        font-size: 18px;
    }
    
    /* Formulaire recherche */
    .search-form input {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .search-form button {
        width: 45px;
        height: 45px;
    }
    
    /* Author box - Mobile corrigé */
    .author-box {
        text-align: center;
        padding: 20px 15px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .author-box a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    .author-box img {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
        margin: 15px auto;
        display: block;
        position: relative;
        left: 0;
        right: 0;
    }
    
    .author-box .title,
    .author-box .name,
    .author-box .contact {
        display: block;
        text-align: center;
        width: 100%;
        margin: 5px 0;
    }
    
    .author-box .title {
        font-size: 14px;
        color: var(--zahra-vert-moyen);
        font-weight: 600;
    }
    
    .author-box .name {
        font-size: 18px;
        color: var(--zahra-vert-fonce);
        font-weight: bold;
    }
    
    .author-box .contact {
        font-size: 13px;
        color: #666;
    }
    
    .author-box p {
        font-size: 14px;
        line-height: 1.6;
        text-align: center;
        margin-top: 15px;
        width: 100%;
    }
    
    /* CATÉGORIES SIDEBAR - Mobile (2 colonnes) */
    .home-cats.categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .home-cats a {
        font-size: 12px;
        padding: 12px 8px;
    }
    
    .home-cats a i {
        font-size: 28px;
        margin-bottom: 5px;
    }
    
    /* RECETTES POPULAIRES - Mobile */
    .featured-recipe {
        margin-bottom: 15px;
        display: flex;
        gap: 12px;
        align-items: flex-start;
    }
    
    .featured-recipe img {
        width: 80px;
        height: 80px;
        object-fit: cover;
        border-radius: 5px;
        flex-shrink: 0;
    }
    
    .featured-recipe-content {
        flex: 1;
    }
    
    .featured-recipe-content h4 {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 8px;
    }
    
    .featured-recipe-content a {
        font-size: 12px;
    }
    
    /* RÉSEAUX SOCIAUX - Mobile */
    #social_counts {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    #social_counts .item {
        min-height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #social_counts .item i {
        font-size: 28px;
    }
    
    /* PUBLICITÉS - Mobile */
    .footer-ads,
    .side-ads {
        text-align: center;
        margin: 20px 0;
    }
    
    .footer-ads img,
    .side-ads img {
        max-width: 100%;
        height: auto;
    }
    
    /* COMMENTAIRES DISQUS - Mobile */
    #disqus_thread {
        padding: 15px 10px;
    }
    
    /* FIX DÉPASSEMENTS */
    .recipe-content img {
        max-width: 100%;
        height: auto;
    }
    
    .recipe-content iframe {
        max-width: 100%;
    }
    
    .recipe-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Très petit mobile : moins de 480px */
@media (max-width: 479px) {
    
    #titlebar h2 {
        font-size: 18px;
    }
    
    .recipe-header h2 {
        font-size: 20px;
    }
    
    .recipe-content h3 {
        font-size: 18px;
        padding: 8px 12px;
    }
    
    .recipeSlider {
        height: 200px !important;
    }
    
    .recipeSlider img {
        height: 200px;
    }
    
    /* Details encore plus compacts sur très petit écran */
    .recipe-details ul li {
        font-size: 10px;
        padding: 6px 8px;
    }
    
    .recipe-details ul li strong {
        font-size: 11px;
    }
    
    /* Categorie encore plus petite */
    .recipe-cat span,
    .recipe-cat a {
        font-size: 10px;
        padding: 3px 6px;
        gap: 3px;
    }
    
    .recipe-cat i {
        font-size: 11px;
    }
    
    .related-posts .recipe-block-img {
        height: 150px;
    }
    
    .related-posts .recipe-block-img img {
        height: 150px;
    }
    
    .share-post li {
        flex: 0 0 calc(50% - 8px);
    }
    
    #social_counts {
        grid-template-columns: repeat(3, 1fr);
    }
}

