/* The clickable “button” */
.theme-toggle {
    inline-size: 44px;
    block-size: 44px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--card-selection);
    cursor: pointer;
    user-select: none;
    color: var(--text-colour);
}

.theme-toggle:active {
    transform: scale(.96);
}

/* Icons */
.theme-toggle .icon {
    width: 22px;
    height: 22px;
    stroke: var(--text-colour);
    fill: none;
    stroke-width: 1.6;
    position: absolute;
    opacity: 0;
    transform: scale(.7) rotate(-10deg);
    transition: opacity .18s ease, transform .18s ease, stroke .2s ease, fill .2s ease;
}

.theme-toggle .sun circle {
    fill: currentColor;
    opacity: .7;
}

.theme-toggle .moon {
    fill: currentColor;
    stroke: none;
}

/* Show the correct icon based on the current theme */
html[data-theme="light"] .theme-toggle .sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .theme-toggle .moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Focus ring for keyboard users */
#colour-toggle:focus-visible+.theme-toggle {
    outline: 2px solid var(--primary-hover);
    outline-offset: 2px;
}

/* In dark mode, make the moon white (and sun strokes lighten too) */
html[data-theme="dark"] .theme-toggle {
    color: #fff;
}

.themeToggle-li {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.dark-mode .mode-label {
    color: #fff;
}

.icon {
    width: 32px;
    height: 32px;
}

.hidden {
    display: none;
}

.custom-line {
    height: 1.5px;
    background-color: var(--template-line-colour);
    border: 0;
    width: 100%;
    margin: 1rem 0;
}

.mobile-custom-line {
    display: none;
    height: 1px;
    background-color: var(--muted-text-colour);
    width: 100%;
    margin: 2rem 0;
}

/* Generic helper to reuse anywhere that must not split */
.no-split {
    break-inside: avoid;
    page-break-inside: avoid;
}