/* ================= ONLY SINGLE POST ================= */

/* ===== TITLE + BUTTON CHIA SẺ CÙNG HÀNG ===== */
body.single-post #comments > .ct-comments-title {
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

body.single-post #open-comment-form {
    float: right;
    background: #1E6B5C;
    color: #fff;
    border: none;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
}

body.single-post #open-comment-form:hover {
    opacity: .9;
}

body.single-post #comments::after {
    content: "";
    display: block;
    clear: both;
}

/* ===== COMMENT LIST ===== */
body.single-post .ct-comment-list {
    margin-top: 20px;
    padding-left: 0;
}

body.single-post .ct-comment-inner {
    padding: 16px 0;
    border: none;
}

body.single-post .ct-comment-content {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

/* ===== META DATA (REPLY - LIKE - DATE) ===== */
body.single-post .ct-comment-meta-data {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    font-size: 13px;
    color: #9E9E9E;
}

body.single-post .ct-comment-meta-data > a:first-child {
    margin-left: auto;
    order: 3;
    color: #BDBDBD;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
}

body.single-post time {
    color: #757575;
}

body.single-post .ct-comment-meta-data a:hover time {
    color: #757575;
}

body.single-post .comment-like-btn {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 20px;
    font-size: 14px;
    font-weight: 400;
    color: #757575;
    cursor: pointer;
    background: url("/wp-content/themes/blocksy-child/images/like-default.svg") no-repeat left center;
    background-size: 16px 16px;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

body.single-post .comment-like-btn.is-liked {
    background-image: url("/wp-content/themes/blocksy-child/images/like-active.svg");
    animation: like-pop 0.25s ease;
}

body.single-post .comment-reply-link {
    order: 1;
    margin-left: 70px;
    color: #757575;
    font-size: 14px;
    font-weight: 400;
    background: none;
    padding: 0;
    border: none;
    text-decoration: none;
    box-shadow: none;
}

/* Override hover của Blocksy */
body.single-post .ct-comment-inner:not(.ct-has-reply-form):hover .comment-reply-link,
body.single-post .comment-reply-link:hover,
body.single-post .comment-reply-link:focus,
body.single-post .comment-reply-link:active {
    color: #757575 !important;
    background: none !important;
    text-decoration: none;
    box-shadow: none;
}

@keyframes like-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* ===== ẨN FORM COMMENT MẶC ĐỊNH ===== */
body.single-post #respond,
body.single-post .comment-respond {
    display: none !important;
}

/* ===== REORDER CÁC SECTION ===== */
body.single-post article.post {
    display: flex;
    flex-direction: column;
}

body.single-post article.post > .is-width-constrained {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}

body.single-post article.post > .ct-share-box.is-width-constrained {
    order: 10;
}

body.single-post article.post > .author-box.is-width-constrained {
    order: 20;
    box-shadow: none;
    border: 1px solid #EEEEEE;
}

body.single-post article.post > .ct-comments.is-width-constrained {
    order: 90;
}

body.single-post article.post > .post-navigation.is-width-constrained {
    order: 100;
    margin-top: 20px;
}

/* Loại bỏ border & margin thừa */
body.single-post article > .ct-comments,
body.single-post article > .ct-related-posts {
    border-top: none;
    margin: 0;
    padding-top: 0;
}

body.single-post .author-box[data-type="type-1"] {
    margin: 0;
}

body.single-post .ct-share-box[data-location="bottom"] {
    margin-top: 0;
    margin-bottom: 72px;
    flex-direction: row;
    align-items: center;
}

body.single-post .ct-module-title:is(p, span):not(:empty) {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

/* ===== LOAD MORE COMMENTS ===== */
body.single-post .comment-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

body.single-post .comment-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #005249;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 12px;
    transition: all .25s ease;
}

body.single-post .comment-load-more::after {
    content: "";
    width: 16px;
    height: 16px;
    background-color: currentColor;
    mask: url("/wp-content/themes/blocksy-child/images/dropdown-icon.svg") no-repeat center;
    -webkit-mask: url("/wp-content/themes/blocksy-child/images/dropdown-icon.svg") no-repeat center;
    mask-size: contain;
    -webkit-mask-size: contain;
    transition: transform .25s ease;
}

body.single-post .comment-load-more:hover {
    opacity: 0.85;
}

body.single-post .comment-load-more:hover::after {
    transform: translateY(2px);
}

/* ===== POST NAVIGATION ===== */
body.single-post .post-navigation .item-label {
    color: #9E9E9E;
    font-size: 16px;
    text-transform: capitalize;
}

body.single-post .post-navigation .item-title {
    color: #616161;
    font-size: 16px !important;
    font-weight: 500;
}

/* ===== MODAL COMMENT FORM ===== */
body.single-post #blk-comment-modal {
    --bg: #ffffff;
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px 16px;
    box-sizing: border-box;
}

body.single-post #blk-comment-modal.blk-modal-open {
    display: flex;
}

body.single-post #blk-comment-modal .blk-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

body.single-post #blk-comment-modal .blk-modal-panel {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: var(--bg);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

body.single-post #blk-comment-modal.blk-modal-open .blk-modal-panel {
    transform: none;
    opacity: 1;
}

body.single-post #blk-comment-modal .blk-modal-close {
    position: absolute;
    right: 12px;
    top: 10px;
    border: 0;
    background: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
}

body.single-post #blk-comment-modal .blk-modal-title {
    font-size: 18px;
    margin: 0 0 16px 0;
    font-weight: 600;
    color: #222;
    padding-right: 30px;
}

body.single-post #blk-comment-modal .comment-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

body.single-post #blk-comment-modal textarea#comment {
    min-height: 140px;
    resize: vertical;
}

body.single-post #blk-comment-modal .blk-modal-panel .comment-form-field-input-url {
    display: none;
}

body.single-post .blk-modal-body .comment-form label {
    display: block;
    margin-bottom: 6px;
    color: #444;
    font-weight: 500;
}

body.single-post .blk-modal-body .comment-form input[type="text"],
body.single-post .blk-modal-body .comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 14px;
}

body.single-post .blk-modal-body .comment-form .form-submit {
    margin-top: 6px;
}

/* Mobile modal */
@media (max-height: 760px) {
    body.single-post #blk-comment-modal {
        align-items: flex-start;
        padding-top: 5vh;
    }

    body.single-post #blk-comment-modal .blk-modal-panel {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===== ENTRY META - ÉP 1 DÒNG MỌI THIẾT BỊ ===== */
body.single-post .entry-meta[data-type="simple:none"] {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: #757575;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

body.single-post .entry-meta[data-type="simple:none"] li {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

body.single-post .entry-meta[data-type="simple:none"] li:not(:last-child)::after {
    content: none;
}

/* Author */
body.single-post .meta-author {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.single-post .meta-author img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

/* Date & Categories icon */
body.single-post .meta-date::before,
body.single-post .meta-categories::before {
    content: "";
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 5px;
    background-color: #757575;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    vertical-align: -2px;
}

body.single-post .meta-date::before {
    mask-image: url("/wp-content/themes/blocksy-child/images/calender.svg");
    -webkit-mask-image: url("/wp-content/themes/blocksy-child/images/calender.svg");
}

body.single-post .meta-categories::before {
    mask-image: url("/wp-content/themes/blocksy-child/images/lucide_tag.svg");
    -webkit-mask-image: url("/wp-content/themes/blocksy-child/images/lucide_tag.svg");
}

/* View count */
body.single-post .meta-view {
    margin-left: auto;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

body.single-post .meta-view .view-icon {
    width: 15px;
    height: 15px;
}

/* Responsive - thu nhỏ dần để vừa */
@media (max-width: 768px) {
    body.single-post .entry-meta[data-type="simple:none"] {
        font-size: 12.5px;
        gap: 12px;
    }
    body.single-post .meta-author img { width: 20px; height: 20px; }
    body.single-post .meta-date::before,
    body.single-post .meta-categories::before { width: 14px; height: 14px; }
    body.single-post .meta-view .view-icon { width: 14px; height: 14px; }
}

@media (max-width: 480px) {
    body.single-post .entry-meta[data-type="simple:none"] {
        font-size: 11px;
        gap: 0px;
    }
    body.single-post .meta-author img { width: 18px; height: 18px; }
    body.single-post .meta-date::before,
    body.single-post .meta-categories::before { width: 13px; height: 13px; }
    body.single-post .meta-view .view-icon { width: 13px; height: 13px; }
}

/* ===== TAGS ===== */
body.single-post .entry-tags-items {
    margin-bottom: 32px;
}

body.single-post .entry-tags-items a {
    box-shadow: inset 0 0 0 1px #F5F5F5 !important;
    color: #616161 !important;
    background: transparent;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s ease;
}

body.single-post .entry-tags-items a span {
    color: #9E9E9E;
    margin-right: 4px;
}

body.single-post .entry-tags-items a:hover {
    box-shadow: inset 0 0 0 1px var(--theme-palette-color-5);
    color: var(--theme-palette-color-5);
}