/* Cookie consent dialog (templates/js/cookieConsent.js).
   A theme sets its own colours with --cookie-consent-accent and
   --cookie-consent-accent-hover. */
.tic-cc {
    --cc-accent: var(--cookie-consent-accent, #2bb34c);
    --cc-accent-hover: var(--cookie-consent-accent-hover, #23963f);
    --cc-text: #333;
    --cc-muted: #666;
    --cc-line: #e3e3e3;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--cc-text);
}

.tic-cc[hidden] {
    display: none;
}

.tic-cc *,
.tic-cc *::before,
.tic-cc *::after {
    box-sizing: border-box;
}

.tic-cc__backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.45);
}

.tic-cc__dialog {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    outline: 0;
    text-align: left;
}

.tic-cc__title {
    margin: 0 32px 16px 0;
    padding: 0;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--cc-accent);
    text-transform: none;
}

.tic-cc__text {
    margin: 0 0 20px;
}

.tic-cc__text a {
    color: var(--cc-accent);
    text-decoration: underline;
}

.tic-cc__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--cc-muted);
    font-size: 28px;
    line-height: 36px;
    cursor: pointer;
}

.tic-cc__close:hover,
.tic-cc__close:focus-visible {
    background: #f2f2f2;
    color: var(--cc-text);
}

.tic-cc:not(.tic-cc--has-choice) .tic-cc__close {
    display: none;
}

/* ---- categories ---- */

.tic-cc__categories {
    margin: 0 0 20px;
    border-top: 1px solid var(--cc-line);
}

.tic-cc__categories[hidden] {
    display: none;
}

.tic-cc__category {
    padding: 14px 0;
    border-bottom: 1px solid var(--cc-line);
}

.tic-cc__category-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tic-cc__category-name {
    flex: 1 1 auto;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.tic-cc__always {
    font-size: 13px;
    color: var(--cc-muted);
}

.tic-cc__category-text {
    margin: 4px 60px 0 0;
    font-size: 14px;
    color: var(--cc-muted);
}

.tic-cc__switch {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 26px;
}

.tic-cc__switch input {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.tic-cc__switch input:disabled {
    cursor: not-allowed;
}

.tic-cc__switch-track {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 13px;
    background: #c4c4c4;
    transition: background-color 0.2s;
}

.tic-cc__switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.tic-cc__switch input:checked + .tic-cc__switch-track {
    background: var(--cc-accent);
}

.tic-cc__switch input:checked + .tic-cc__switch-track::after {
    transform: translateX(20px);
}

.tic-cc__switch input:disabled + .tic-cc__switch-track {
    opacity: 0.6;
}

.tic-cc__switch input:focus-visible + .tic-cc__switch-track {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

/* ---- buttons ---- */

.tic-cc__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.tic-cc__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    min-height: 42px;
    margin: 0;
    padding: 8px 20px;
    border: 2px solid var(--cc-accent);
    border-radius: 5px;
    background: #fff;
    color: var(--cc-accent);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.tic-cc__btn:hover,
.tic-cc__btn:focus-visible {
    border-color: var(--cc-accent-hover);
    color: var(--cc-accent-hover);
}

.tic-cc__btn--primary {
    background: var(--cc-accent);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tic-cc__btn--primary:hover,
.tic-cc__btn--primary:focus-visible {
    background: var(--cc-accent-hover);
    color: #fff;
}

.tic-cc__btn--link {
    min-width: 0;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
    border-color: transparent;
    background: transparent;
    text-decoration: underline;
}

.tic-cc__btn--link:hover,
.tic-cc__btn--link:focus-visible {
    border-color: transparent;
}

.tic-cc__btn:focus-visible {
    outline: 2px solid var(--cc-accent);
    outline-offset: 2px;
}

.tic-cc--settings [data-cc="settings"],
.tic-cc:not(.tic-cc--settings) [data-cc="save"] {
    display: none;
}

/* ---- the floating reopen button, on pages without a settings link ---- */

.tic-cc-reopen {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 2147482000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--cookie-consent-accent, #2bb34c);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.tic-cc-reopen:hover,
.tic-cc-reopen:focus-visible {
    color: var(--cookie-consent-accent-hover, #23963f);
}

/* footer link in the themes */
.cookie-settings-link {
    cursor: pointer;
}

@media (max-width: 600px) {
    .tic-cc {
        align-items: flex-end;
        padding: 0;
    }

    .tic-cc__dialog {
        max-height: 100vh;
        padding: 24px 16px 16px;
        border-radius: 8px 8px 0 0;
    }

    .tic-cc__title {
        font-size: 22px;
    }

    .tic-cc__category-text {
        margin-right: 0;
    }

    .tic-cc__buttons {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .tic-cc__btn {
        width: 100%;
    }

    .tic-cc__btn--link {
        margin-right: 0;
    }
}
