/*
 * Comment cards and the two optional pre-footer panels. Every rule is scoped
 * to a module body class or module-owned element so enabling the feature does
 * not change WordPress admin, unrelated widgets, or other plugins.
 */

body.ztk-comment-cards-enabled {
    --ztk-comment-accent: #e89520;
    --ztk-comment-text: #3d4758;
    --ztk-comment-muted: #8490a3;
    --ztk-comment-blue-bg: #f3faff;
    --ztk-comment-blue-border: rgba(91, 174, 255, .48);
    --ztk-comment-blue-decor: rgba(91, 174, 255, .12);
    --ztk-comment-pink-bg: #fff5f8;
    --ztk-comment-pink-border: rgba(255, 111, 159, .48);
    --ztk-comment-pink-decor: rgba(255, 111, 159, .12);
    --ztk-comment-form-bg: rgba(255, 255, 255, .88);
    --ztk-comment-shadow: 0 14px 38px -28px rgba(52, 87, 132, .5);
}

body.ztk-comment-cards-enabled #comments {
    margin-top: 26px;
}

body.ztk-comment-cards-enabled #comments > .box-body.notop {
    padding-bottom: 12px;
}

body.ztk-comment-cards-enabled #comments .title-theme {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ztk-comment-text);
    font-size: 19px;
    font-weight: 800;
}

body.ztk-comment-cards-enabled #comments .title-theme::before {
    width: 5px;
    height: 19px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--ztk-community-accent, #5b7cfa), #ff7cab);
    box-shadow: 0 4px 12px rgba(91, 124, 250, .28);
    content: '';
}

body.ztk-comment-cards-enabled #comments .title-theme small {
    color: var(--ztk-comment-muted);
    font-size: 12px;
    font-weight: 600;
}

/* Comment composer: retain all Zibll controls and only upgrade the surface. */
body.ztk-comment-cards-enabled #comments > .no_webshot {
    overflow: visible;
    border: 1px solid rgba(113, 143, 187, .15);
    border-radius: 18px !important;
    background:
        radial-gradient(circle at 4% 0, rgba(91, 124, 250, .08), transparent 32%),
        radial-gradient(circle at 100% 100%, rgba(255, 124, 171, .08), transparent 36%),
        var(--ztk-comment-form-bg) !important;
    box-shadow: 0 18px 48px -38px rgba(37, 60, 96, .62) !important;
}

body.ztk-comment-cards-enabled #comments .virtual-input,
body.ztk-comment-cards-enabled #comments #commentform textarea.form-control {
    border: 1px solid rgba(101, 132, 177, .16);
    border-radius: 13px;
    background: rgba(255, 255, 255, .72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

body.ztk-comment-cards-enabled #comments .virtual-input {
    min-height: 48px;
    padding: 8px 10px;
}

body.ztk-comment-cards-enabled #comments #commentform textarea.form-control:focus {
    border-color: color-mix(in srgb, var(--ztk-community-accent, #5b7cfa) 45%, transparent);
    background: #fff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ztk-community-accent, #5b7cfa) 10%, transparent);
}

body.ztk-comment-cards-enabled #comments .comt-ctrl .but,
body.ztk-comment-cards-enabled #comments .comment-send {
    border-radius: 10px;
}

/* Filter tabs keep native links/Ajax behavior while matching the screenshot. */
body.ztk-comment-cards-enabled #comments .comment-filter {
    min-height: 46px;
    margin: 24px 0 10px;
    padding: 0 8px 8px;
    border-bottom: 1px solid rgba(113, 143, 187, .12);
}

body.ztk-comment-cards-enabled #comments .comment-order-box {
    display: flex;
    align-items: center;
    gap: 4px;
}

body.ztk-comment-cards-enabled #comments .comment-order-box li {
    margin: 0 !important;
}

body.ztk-comment-cards-enabled #comments .comment-order-box a {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 10px;
    color: var(--ztk-comment-text);
    font-weight: 700;
}

body.ztk-comment-cards-enabled #comments .comment-order-box li.active a {
    color: #f04e93;
}

body.ztk-comment-cards-enabled #comments .comment-order-box li.active a::after {
    position: absolute;
    right: 9px;
    bottom: -9px;
    left: 9px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff64a3, #ff8bbb);
    content: '';
}

body.ztk-comment-cards-enabled #comments .btn-only-author {
    border: 0;
    border-radius: 9px;
    color: var(--ztk-comment-muted);
    background: rgba(112, 126, 148, .08);
    font-weight: 700;
}

body.ztk-comment-cards-enabled #comments #postcomments > .commentlist,
body.ztk-comment-cards-enabled #comments .commentlist {
    margin: 0;
    padding: 0 !important;
}

/*
 * Zibll outputs one root <li>, an inner <ul>, and nested <ul class="children">.
 * Styling those existing nodes keeps reply, like, moderation and Ajax logic.
 */
body.ztk-comment-cards-enabled #comments .commentlist li.comment {
    --ztk-comment-card-bg: var(--ztk-comment-blue-bg);
    --ztk-comment-card-border: var(--ztk-comment-blue-border);
    --ztk-comment-card-decor: var(--ztk-comment-blue-decor);
    position: relative;
    display: flow-root;
    isolation: isolate;
    overflow: visible;
    margin: 0 0 18px;
    padding: 0;
    border: 1px solid var(--ztk-comment-card-border);
    border-radius: 17px;
    background-color: var(--ztk-comment-card-bg);
    background-image:
        radial-gradient(circle at 10% 18%, var(--ztk-comment-card-decor) 0 4px, transparent 5px),
        radial-gradient(circle at 82% 64%, var(--ztk-comment-card-decor) 0 5px, transparent 6px),
        linear-gradient(135deg, rgba(255, 255, 255, .64), transparent 46%);
    box-shadow: var(--ztk-comment-shadow);
    background-clip: padding-box;
    list-style: none;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

body.ztk-comment-cards-enabled #comments .commentlist > li.comment:nth-of-type(even),
body.ztk-comment-cards-enabled #comments .commentlist li.comment.depth-3,
body.ztk-comment-cards-enabled #comments .commentlist li.comment.depth-5 {
    --ztk-comment-card-bg: var(--ztk-comment-pink-bg);
    --ztk-comment-card-border: var(--ztk-comment-pink-border);
    --ztk-comment-card-decor: var(--ztk-comment-pink-decor);
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment::before,
body.ztk-comment-cards-enabled #comments .commentlist li.comment::after {
    position: absolute;
    z-index: 0;
    color: var(--ztk-comment-card-decor);
    font-family: Arial, sans-serif;
    line-height: 1;
    pointer-events: none;
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment::before {
    top: -31px;
    left: 23%;
    font-size: 104px;
    content: '☆';
    transform: rotate(-12deg);
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment::after {
    right: 16%;
    bottom: -38px;
    font-size: 82px;
    content: '★';
    transform: rotate(18deg);
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.list-inline,
body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.children {
    position: relative;
    z-index: 1;
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.list-inline {
    display: block;
    margin: 0 !important;
    padding: 17px 20px !important;
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment .comt-main {
    display: block !important;
    width: 100%;
    padding: 0 !important;
}

body.ztk-comment-cards-enabled #comments .commentlist .comment-header {
    margin-bottom: 7px !important;
}

body.ztk-comment-cards-enabled #comments .commentlist .author-box {
    min-height: 48px;
}

body.ztk-comment-cards-enabled #comments .commentlist .comt-avatar,
body.ztk-comment-cards-enabled #comments .commentlist .comt-avatar > img.avatar {
    width: 48px;
    height: 48px;
}

body.ztk-comment-cards-enabled #comments .commentlist .comt-avatar > img.avatar {
    border: 3px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    box-shadow: 0 8px 18px -12px rgba(37, 52, 76, .7);
}

body.ztk-comment-cards-enabled #comments .commentlist .author-box name {
    min-width: 0;
    margin-left: 11px;
}

body.ztk-comment-cards-enabled #comments .commentlist .author-box name > a {
    color: var(--ztk-comment-text);
    font-size: 15px;
    font-weight: 800;
}

body.ztk-comment-cards-enabled #comments .commentlist .action-comment-like {
    min-width: 36px;
    padding: 6px 8px;
    border-radius: 999px;
    color: var(--ztk-comment-muted) !important;
    background: rgba(255, 255, 255, .42);
    text-align: center;
}

body.ztk-comment-cards-enabled #comments .commentlist .action-comment-like:hover {
    color: #f05b6f !important;
    background: rgba(255, 255, 255, .72);
}

body.ztk-comment-cards-enabled #comments .commentlist .comment-footer {
    padding-left: 59px;
    text-align: center;
}

body.ztk-comment-cards-enabled #comments .commentlist .comment-content {
    width: min(100%, 760px);
    margin: 2px auto 10px !important;
    color: var(--ztk-comment-text) !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

body.ztk-comment-cards-enabled #comments .commentlist .bypostauthor > ul.list-inline .comment-content {
    color: var(--ztk-comment-accent) !important;
}

body.ztk-comment-cards-enabled #comments .commentlist .comt-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px 10px;
    color: var(--ztk-comment-muted) !important;
    font-size: 12px;
    font-weight: 650;
}

body.ztk-comment-cards-enabled #comments .commentlist .comt-meta > span {
    margin: 0 !important;
}

body.ztk-comment-cards-enabled #comments .commentlist .comt-meta a {
    color: inherit;
}

body.ztk-comment-cards-enabled #comments .commentlist .comt-meta .reply-link a {
    padding: 3px 7px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .36);
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.children {
    display: block;
    margin: 0 14px 14px clamp(28px, 8vw, 92px) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    list-style: none;
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.children > li.comment {
    margin-bottom: 12px;
    box-shadow: 0 10px 28px -24px rgba(37, 64, 103, .5);
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.children > li.comment:last-child {
    margin-bottom: 0;
}

body.ztk-comment-cards-enabled #comments .commentlist li.comment.depth-2,
body.ztk-comment-cards-enabled #comments .commentlist li.comment.depth-4,
body.ztk-comment-cards-enabled #comments .commentlist li.comment.depth-6 {
    --ztk-comment-card-bg: var(--ztk-comment-blue-bg);
    --ztk-comment-card-border: var(--ztk-comment-blue-border);
    --ztk-comment-card-decor: var(--ztk-comment-blue-decor);
}

@media (hover: hover) {
    body.ztk-comment-cards-enabled #comments .commentlist li.comment:hover {
        border-color: color-mix(in srgb, var(--ztk-comment-card-border) 80%, #6987ff 20%);
        box-shadow: 0 18px 44px -30px rgba(45, 79, 126, .58);
        transform: translateY(-2px);
    }

    body.ztk-comment-cards-enabled #comments .commentlist li.comment li.comment:hover {
        transform: translateY(-1px);
    }
}

/* Page-boundary and site-profile blocks. */
.ztk-pre-footer {
    --ztk-footer-text: #344054;
    --ztk-footer-muted: #728096;
    --ztk-footer-line: rgba(86, 101, 126, .16);
    --ztk-footer-surface: #f5f8fc;
    position: relative;
    z-index: 1;
    display: block;
    clear: both;
    width: 100%;
    max-width: none;
    margin: 0;
    color: var(--ztk-footer-text);
}

.ztk-boundary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: min(100% - 32px, var(--mian-max-width, 1200px));
    min-height: 62px;
    margin: 0 auto;
    padding: 6px 0 0;
}

.ztk-boundary__line {
    flex: 1 1 140px;
    max-width: 190px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ztk-footer-line));
}

.ztk-boundary__line:last-child {
    background: linear-gradient(90deg, var(--ztk-footer-line), transparent);
}

.ztk-boundary__mascot {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    width: 52px;
    height: 46px;
    flex: 0 0 52px;
    filter: drop-shadow(0 6px 10px rgba(49, 70, 111, .1));
}

.ztk-boundary__mascot svg {
    display: block;
    width: 52px;
    height: 41px;
}

.ztk-boundary__text {
    color: var(--ztk-footer-text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.ztk-site-profile {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 176px;
    border-top: 1px solid rgba(86, 117, 139, .1);
    border-bottom: 1px solid rgba(86, 117, 139, .08);
    background: linear-gradient(180deg, #f7fafc, #edf7f5);
}

.ztk-site-profile__glow {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(115deg, rgba(91, 124, 250, .045), transparent 42%, rgba(59, 192, 160, .055));
    pointer-events: none;
}

.ztk-site-profile__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px minmax(240px, .72fr);
    align-items: center;
    gap: 32px;
    width: min(100% - 40px, 1120px);
    min-height: 176px;
    margin: 0 auto;
    padding: 20px 0;
}

.ztk-site-profile__copy,
.ztk-site-profile__admin {
    min-width: 0;
}

.ztk-site-profile__copy h2 {
    margin: 0 0 8px;
    color: var(--ztk-footer-text);
    font-size: 27px;
    font-weight: 760;
    line-height: 1.3;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.ztk-site-profile__copy p {
    max-width: 520px;
    margin: 0;
    color: var(--ztk-footer-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.7;
    white-space: pre-line;
}

.ztk-site-profile__visual {
    align-self: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 148px;
    margin: 0;
    overflow: visible;
    pointer-events: none;
}

.ztk-site-profile__visual img,
.ztk-site-profile__visual svg {
    display: block;
    width: min(100%, 150px);
    height: 148px;
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 10px 16px rgba(38, 58, 95, .1));
}

.ztk-site-profile__admin {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
}

.ztk-site-profile__eyebrow {
    color: var(--ztk-community-accent, #5b7cfa);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
}

.ztk-site-profile__admin strong {
    color: var(--ztk-footer-text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.ztk-site-profile__favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    margin-top: 5px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--ztk-community-accent, #5b7cfa), #6b64ec);
    box-shadow: 0 8px 20px -14px rgba(59, 70, 210, .72);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.ztk-site-profile__favorite:hover,
.ztk-site-profile__favorite:focus-visible,
.ztk-site-profile__favorite.is-active {
    color: #fff;
    filter: brightness(1.06);
    box-shadow: 0 15px 32px -15px rgba(59, 70, 210, .9);
    transform: translateY(-2px);
}

.ztk-site-profile__favorite-status {
    min-height: 18px;
    color: var(--ztk-footer-muted);
    font-size: 12px;
    line-height: 1.5;
}

.ztk-site-profile__favorite-status:empty {
    display: none;
}

.ztk-site-profile__favorite:focus-visible {
    outline: 3px solid rgba(91, 124, 250, .25);
    outline-offset: 3px;
}

body.dark-theme.ztk-comment-cards-enabled,
body.dark-mode.ztk-comment-cards-enabled,
body.night-theme.ztk-comment-cards-enabled,
body.theme-dark.ztk-comment-cards-enabled,
html.dark-theme body.ztk-comment-cards-enabled,
[data-theme="dark"] body.ztk-comment-cards-enabled {
    --ztk-comment-text: #edf2fb;
    --ztk-comment-muted: #9daabe;
    --ztk-comment-blue-bg: #172433;
    --ztk-comment-blue-border: rgba(91, 174, 255, .32);
    --ztk-comment-blue-decor: rgba(91, 174, 255, .09);
    --ztk-comment-pink-bg: #2b1d29;
    --ztk-comment-pink-border: rgba(255, 111, 159, .3);
    --ztk-comment-pink-decor: rgba(255, 111, 159, .08);
    --ztk-comment-form-bg: rgba(25, 31, 43, .92);
    --ztk-comment-shadow: 0 18px 42px -25px rgba(0, 0, 0, .72);
}

body.dark-theme.ztk-comment-cards-enabled #comments .virtual-input,
body.dark-theme.ztk-comment-cards-enabled #comments #commentform textarea.form-control,
body.dark-mode.ztk-comment-cards-enabled #comments .virtual-input,
body.dark-mode.ztk-comment-cards-enabled #comments #commentform textarea.form-control,
html.dark-theme body.ztk-comment-cards-enabled #comments .virtual-input,
html.dark-theme body.ztk-comment-cards-enabled #comments #commentform textarea.form-control,
[data-theme="dark"] body.ztk-comment-cards-enabled #comments .virtual-input,
[data-theme="dark"] body.ztk-comment-cards-enabled #comments #commentform textarea.form-control {
    border-color: rgba(255, 255, 255, .09);
    color: var(--ztk-comment-text);
    background: rgba(255, 255, 255, .045);
    box-shadow: none;
}

body.dark-theme .ztk-pre-footer,
body.dark-mode .ztk-pre-footer,
body.night-theme .ztk-pre-footer,
body.theme-dark .ztk-pre-footer,
html.dark-theme .ztk-pre-footer,
[data-theme="dark"] .ztk-pre-footer {
    --ztk-footer-text: #edf3fb;
    --ztk-footer-muted: #a7b2c2;
    --ztk-footer-line: rgba(222, 231, 244, .13);
}

body.dark-theme .ztk-site-profile,
body.dark-mode .ztk-site-profile,
body.night-theme .ztk-site-profile,
body.theme-dark .ztk-site-profile,
html.dark-theme .ztk-site-profile,
[data-theme="dark"] .ztk-site-profile {
    border-top-color: rgba(255, 255, 255, .06);
    background: linear-gradient(180deg, #1c222c, #172b2a);
}

@media (max-width: 900px) {
    .ztk-site-profile__inner {
        grid-template-columns: minmax(0, 1fr) 120px minmax(210px, .8fr);
        gap: 18px;
    }

    .ztk-site-profile__visual {
        height: 132px;
    }

    .ztk-site-profile__visual img,
    .ztk-site-profile__visual svg {
        height: 132px;
    }
}

@media (max-width: 700px) {
    body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.list-inline {
        padding: 14px !important;
    }

    body.ztk-comment-cards-enabled #comments .commentlist .comment-footer {
        padding-left: 0;
        text-align: left;
    }

    body.ztk-comment-cards-enabled #comments .commentlist .comment-content {
        margin-top: 8px !important;
        font-size: 14px;
        text-align: left;
    }

    body.ztk-comment-cards-enabled #comments .commentlist .comt-meta {
        justify-content: flex-start;
    }

    body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.children {
        margin: 0 9px 9px 0 !important;
    }

    body.ztk-comment-cards-enabled #comments .commentlist li.comment > ul.children ul.children {
        margin-left: 12px !important;
    }

    body.ztk-comment-cards-enabled #comments .commentlist .comt-avatar,
    body.ztk-comment-cards-enabled #comments .commentlist .comt-avatar > img.avatar {
        width: 38px;
        height: 38px;
    }

    .ztk-site-profile__inner {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: 0;
        padding: 24px 0;
        text-align: center;
    }

    .ztk-site-profile__copy p {
        margin-right: auto;
        margin-left: auto;
    }

    .ztk-site-profile__visual {
        display: none;
    }

    .ztk-site-profile__admin {
        order: 2;
        align-items: center;
    }
}

@media (max-width: 460px) {
    .ztk-boundary {
        gap: 8px;
        min-height: 56px;
    }

    .ztk-boundary__mascot {
        width: 44px;
        height: 40px;
        flex-basis: 44px;
    }

    .ztk-boundary__mascot svg {
        width: 44px;
        height: 35px;
    }

    .ztk-boundary__text {
        font-size: 13px;
    }

    .ztk-site-profile__inner {
        width: min(100% - 28px, var(--mian-max-width, 1200px));
    }

    .ztk-site-profile__copy h2 {
        font-size: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.ztk-comment-cards-enabled #comments .commentlist li.comment,
    .ztk-site-profile__favorite {
        transition: none !important;
    }

    body.ztk-comment-cards-enabled #comments .commentlist li.comment:hover,
    .ztk-site-profile__favorite:hover,
    .ztk-site-profile__favorite:focus-visible {
        transform: none !important;
    }
}
