/* --- EMERGENCY FIX V5: Leaf Node & Specific Override --- */

/* 1. PC View 2 Comment Layout Fix */
@media only screen and (min-width: 1024px) {

    /* Base Container Reset */
    .comment-list .comment-body {
        position: relative !important;
        padding-left: 0 !important;
        overflow: visible !important;
    }

    /* Meta Indent */
    .comment-list .comment-body .comment-meta {
        padding-left: 70px !important;
    }

    /* Avatar Kickout */
    .comment-list .comment-body .avatar {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 50px !important;
        height: 50px !important;
    }

    /* Content Indent */
    .comment-list .comment-body .comment-content {
        padding-left: 70px !important;
    }

    /* Reply Button Fix - LEAF NODE TARGETING */
    /* Target the link directly. It is the innermost element. 
       Moving it 70px is safe and won't compound. */
    .comment-list .comment-body a.comment-reply-link {
        transform: translateX(70px) !important;
        display: inline-block !important;
        position: relative !important;
    }
}

/* 2. PC View 1 Layout Restoration (Tablet) */
@media only screen and (min-width: 768px) and (max-width: 1023px) {

    .blog .type-post,
    .archive .type-post,
    .search .type-post {
        display: flex !important;
        flex-direction: column !important;
    }

    .blog .type-post .entry-body {
        display: contents !important;
    }

    .blog .type-post .entry-header {
        order: 1 !important;
        margin-bottom: 1rem !important;
    }

    .blog .type-post .post-thumbnail {
        order: 2 !important;
        margin: 0 0 1.5rem 0 !important;
        width: 100% !important;
    }

    .blog .type-post .entry-content {
        order: 3 !important;
    }

    .blog .type-post .entry-footer {
        order: 4 !important;
    }
}

/* 3. Search Bar Width (Desktop Standard & High Res) */
@media only screen and (min-width: 1024px) {

    /* General Rail for GENERIC Divs/Forms */
    div.wp-block-search:not(#block-2 .wp-block-search),
    form.wp-block-search:not(div.wp-block-search form):not(#block-2 .wp-block-search form):not(.wp-block-search__button-outside) {
        width: calc(100% - 2 * (10% + 60px)) !important;
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* [USER REQUEST] Specific Override for '.wp-block-search__button-outside' */
    /* "Here margin is unnecessarily applied" -> Reset to 100% Width, No Auto Margin */
    form.wp-block-search.wp-block-search__button-outside {
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media only screen and (min-width: 1530px) {

    div.wp-block-search:not(#block-2 .wp-block-search),
    form.wp-block-search:not(div.wp-block-search form):not(#block-2 .wp-block-search form):not(.wp-block-search__button-outside) {
        width: 1200px !important;
    }
}