@use "../../../jkl/index";

@layer jokul.components {
    .jkl-calendar {
        &__labels {
            margin-block-end: var(--jkl-unit-20);
        }

        &__navigation {
            margin-bottom: var(--jkl-unit-20);
        }

        .jkl-button--calendar {
            aspect-ratio: 1;
            box-sizing: border-box;
            display: flex;
            place-items: center;
            place-content: center;
            padding: 0;
            border-radius: 50%;
            position: relative;

            span {
                z-index: 2;
            }

            &::after {
                content: "";
                display: block;
                border-radius: 50%;
                width: 4ch;
                aspect-ratio: 1;
                position: absolute;
                box-sizing: border-box;
            }

            &:has(.day:not(:disabled)) {
                &, * {
                    cursor: pointer;
                }

                &:has(.day:not(:checked)):hover {
                    &::after {
                        background-color: color-mix(in srgb,
                        currentColor 15%,
                        transparent);
                    }
                }
            }

            &:has(.day:disabled) {
                opacity: 0.5;

                &, * {
                    cursor: not-allowed;
                }
            }

            &:has(.day:checked) {
                color: var(--jkl-color-text-on-contrast);

                &::after {
                    background-color: var(--jkl-color-background-contrast);
                }
            }

            &:has(.day:focus-visible, .day:focus) {
                outline: 3px solid var(--jkl-color-border-strong);
            }

            .day  {
                position: absolute;
                opacity: 0;
                width: 100%;
                height: 100%;
            }
        }
    }
}
