/**
 * Comments template 3 — carousel for root comments + compact reply rail.
 */

.ah-comments-template-3 {
    padding-top: clamp(0.35rem, 1.5vw, 1rem);
}

.ah-comments-template-3 .ah-comments-heading {
    margin-bottom: clamp(1rem, 3vw, 1.35rem);
}

.ah-comments-template-3 .comments-box-title {
    font-size: clamp(1.05rem, 2.6vw, 1.35rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid color-mix(in srgb, var(--ahura-c-text-primary, #111) 10%, transparent);
    color: var(--ahura-c-text-primary, #111);
}

.ah-comments-template-3 .ah-comments-swiper {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
    padding-bottom: 0.35rem;
}

.ah-comments-template-3 .ah-comments-swiper .comment-list {
    margin: 0;
    padding-block: clamp(0.35rem, 1.5vw, 0.85rem);
    padding-inline: clamp(0.25rem, 1.2vw, 0.65rem);
}

.ah-comments-template-3 .ah-comments-swiper .comment-list > li.comment.swiper-slide {
    list-style: none;
    margin: 0;
    height: auto;
    box-sizing: border-box;
}

.ah-comments-template-3 .comment-body {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: clamp(1.15rem, 3.2vw, 1.55rem);
    border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--ahura-c-text-primary, #111) 10%, transparent);
    background: linear-gradient(
        165deg,
        var(--ahura-c-bg-primary, #fff) 0%,
        color-mix(in srgb, var(--ahura-accent-color, #1d67e8) 5%, var(--ahura-c-bg-primary, #fff)) 100%
    );
}

.ah-comments-template-3 .comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ah-comments-template-3 .comment-author .fn,
.ah-comments-template-3 .comment-author cite {
    font-style: normal;
    font-weight: 700;
    font-size: 1rem;
    color: var(--ahura-c-text-primary, #111);
}

.ah-comments-template-3 .comment-author img.avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid color-mix(in srgb, var(--ahura-accent-color, #1d67e8) 25%, transparent);
    flex-shrink: 0;
}

.ah-comments-template-3 .comment-meta.commentmetadata {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ahura-c-text-secondary, #777);
    width: 100%;
}

.ah-comments-template-3 .comment-meta.commentmetadata a {
    color: inherit;
    text-decoration: none;
}

.ah-comments-template-3 .comment-body .comment-content,
.ah-comments-template-3 .comment-body p {
    font-size: 0.94rem;
    line-height: 1.68;
    color: var(--ahura-c-text-primary, #222);
    margin: 0;
}

.ah-comments-template-3 .reply {
    margin-top: 0.15rem;
}

.ah-comments-template-3 .comment-body .comment-reply-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0.4rem 1rem;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--ahura-accent-color, #1d67e8) 42%, var(--ahura-c-border-primary, #ccc));
    background: color-mix(in srgb, var(--ahura-accent-color, #1d67e8) 10%, transparent);
    color: var(--ahura-accent-color, #1d67e8);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    float: none;
    transition: filter 0.15s ease, transform 0.12s ease;
}

.ah-comments-template-3 .comment-body .comment-reply-link:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.ah-comments-template-3 .comment-vote.comment-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.ah-comments-template-3 .children {
    width: 100%;
    margin: 0.85rem 0 0;
    padding: 0.65rem 0 0;
    padding-inline-start: clamp(0.65rem, 2.5vw, 1rem);
    border-inline-start: 3px solid color-mix(in srgb, var(--ahura-accent-color, #1d67e8) 28%, var(--ahura-c-border-primary, #ddd));
    list-style: none;
}

.ah-comments-template-3 .children .comment-body {
    cursor: pointer;
    background: var(--ahura-c-bg-secondary, #f5f6f8);
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--ahura-c-text-primary, #111) 8%, transparent);
    box-shadow: none;
}

.ah-comments-template-3 .children .comment-body p {
    white-space: normal;
}

/* Keep reply form out of carousel slides (modal handles replies). */
.ah-comments-template-3 .ah-comments-swiper #respond,
.ah-comments-template-3 .ah-comments-swiper .comment-respond {
    display: none !important;
}

.comment-reply-modal #respond,
.comment-reply-modal .comment-respond {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    box-sizing: border-box;
}

.comment-reply-modal #respond textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-reply-modal #respond .logged-in-as,
.comment-reply-modal #respond .comment-notes {
    display: block;
    font-size: 0.85rem;
}

.ah-comments-template-3 > div#respond,
.ah-comments-template-3 .comment-respond:not(.comment .comment-respond) {
    margin-top: 1.35rem;
}

@media screen and (max-width: 767px) {
    .ah-comments-template-3 .ah-comments-swiper {
        margin-inline: -0.15rem;
    }
}

/* Modal — full comment text */
.comment-content-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.comment-content-modal .ccm-text {
    position: relative;
    cursor: default;
    width: min(92vw, 520px);
    max-height: min(72vh, 560px);
    overflow-y: auto;
    padding: 2.75rem 1.25rem 1.25rem;
    border-radius: 16px;
    background: var(--ahura-c-bg-primary, #fff);
    border: 1px solid color-mix(in srgb, var(--ahura-c-text-primary, #111) 10%, transparent);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.comment-content-modal .close-ccm {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    top: 12px;
    inset-inline-start: 12px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    background: color-mix(in srgb, var(--ahura-c-text-primary, #111) 8%, transparent);
    border-radius: 50%;
    color: var(--ahura-c-text-secondary, #555);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s ease;
}

.comment-content-modal .close-ccm:hover {
    background: color-mix(in srgb, var(--ahura-c-text-primary, #111) 14%, transparent);
}

.comment-content-modal .ccm-body {
    font-size: 0.96rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--ahura-c-text-primary, #222);
}

/* Modal — reply form */
.comment-reply-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
}

.comment-reply-modal.is-open {
    display: flex;
}

body.ah-comment-reply-modal-open {
    overflow: hidden;
}

.comment-reply-modal .crm-panel {
    position: relative;
    width: min(94vw, 560px);
    max-height: min(88vh, 720px);
    overflow-y: auto;
    padding: clamp(1.15rem, 3vw, 1.5rem);
    border-radius: 16px;
    background: var(--ahura-c-bg-primary, #fff);
    border: 1px solid color-mix(in srgb, var(--ahura-c-text-primary, #111) 10%, transparent);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.comment-reply-modal .crm-close {
    position: sticky;
    top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    float: inline-end;
    width: 38px;
    height: 38px;
    margin-bottom: 0.5rem;
    padding: 0;
    border: none;
    background: color-mix(in srgb, var(--ahura-c-text-primary, #111) 8%, transparent);
    border-radius: 50%;
    color: var(--ahura-c-text-secondary, #555);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s ease;
}

.comment-reply-modal .crm-close:hover {
    background: color-mix(in srgb, var(--ahura-c-text-primary, #111) 14%, transparent);
}

.comment-reply-modal .crm-mount {
    clear: both;
}

.comment-reply-modal .comment-reply-title {
    margin: 0 0 0.85rem;
    padding-inline-end: 2.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--ahura-c-text-primary, #111);
}

.comment-reply-modal #cancel-comment-reply-link {
    font-size: 0.85rem;
}
