@use '@lucas-labs/lui-micro/var' as var;
@use '@lucas-labs/lui-micro/color' as color;

@mixin segment {
    .ui.segment {
        margin: var.get('measure/1x') 0;
        padding: var.get('measure/1x');
        border-radius: var(--border-radius);
    }

    .ui.segment form >*:first-child {
        margin-top: 0;
    }

    .ui.segment form >*:last-child {
        margin-bottom: 0;
    }

    .ui.top.attached.header {
        border-radius: var(--border-radius) var(--border-radius) 0 0;
    }

    .ui.attached.segment:has(+.ui[class*="top attached"].header), .ui.attached.segment:has(+.page.buttons), .ui.attached.segment:last-child, .ui.segment:has(+.ui.segment:not(.attached)), .ui.attached.segment:has(+.ui.modal) {
        border-bottom-left-radius: var(--border-radius);
        border-bottom-right-radius: var(--border-radius);
    }

    .ui.segments:not(.horizontal)>.segment:first-child, .ui.segments.horizontal>.segment:first-child {
        border-radius: var(--border-radius);
    }

    .ui.segments:not(.horizontal)>.segment:last-child, .ui.horizontal.segments>.segment:last-child {
        border-radius: var(--border-radius);
    }
}

@mixin comments {
    .comment {
        .content {
            background-color: var(--color-box-body);

            >.comment-header, >.ui.segment {
                &:before, &:after {
                    display: none;
                }
            }

            .comment-header {
                padding: var.get('measure/.25x') var.get('measure/.25x') var.get('measure/.25x') var.get('measure/1x') !important;

                .comment-header-left {
                    .text {
                        color: color.get('subtle') !important;

                        .author {
                            color: color.get('text') !important;
                        }
                    }
                }

                .comment-header-right {
                    * {
                        color: color.get('subtle') !important;
                    }
                    
                    .label {
                        height: var.get('measure/1.25x', 1.25rem) !important;
                        padding: 0px var.get('measure/.375x') !important;
                        border-radius: var.get('measure/1x') !important;
                    }
                }
            }
        }
    }

    .comment-list .comment>.content>div:last-child {
        border-bottom-left-radius: var(--border-radius) !important;
        border-bottom-right-radius: var(--border-radius) !important;
    }

    .comment-list .comment>.content>div:first-child {
        border-top-left-radius: var(--border-radius) !important;
        border-top-right-radius: var(--border-radius) !important;
    }

    .ui.comments .comment {
        margin: var.get('measure/.25x') 0 0;
    }
}