/*
 * Themes set the colours with custom properties (defaults in brackets):
 * --ohc-consent-bg (#1d2327), --ohc-consent-text (#fff),
 * --ohc-consent-button (#fff), --ohc-consent-button-text (the background colour).
 */
.ohc-consent {
    position: fixed;
    z-index: 99999;
    right: 0;
    bottom: 0;
    left: 0;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--ohc-consent-bg, #1d2327);
    color: var(--ohc-consent-text, #fff);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    line-height: 1.5;
}

.ohc-consent[hidden] {
    display: none !important;
}

.ohc-consent--bottom-left,
.ohc-consent--bottom-right {
    right: auto;
    bottom: 1rem;
    left: auto;
    flex-direction: column;
    align-items: stretch;
    max-width: min(24rem, calc(100% - 2rem));
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.ohc-consent--bottom-left {
    left: 1rem;
}

.ohc-consent--bottom-right {
    right: 1rem;
}

.ohc-consent__text {
    max-width: 60rem;
}

.ohc-consent__text p {
    margin: 0;
}

.ohc-consent__text p + p {
    margin-top: 0.5rem;
}

.ohc-consent__text a {
    color: inherit;
    text-decoration: underline;
}

.ohc-consent__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Accept and Reject share every style, so neither is more prominent */
.ohc-consent__button {
    flex: 1 1 0;
    min-width: 7rem;
    margin: 0;
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--ohc-consent-button, #fff);
    border-radius: 0.25rem;
    background: var(--ohc-consent-button, #fff);
    color: var(--ohc-consent-button-text, var(--ohc-consent-bg, #1d2327));
    font: inherit;
    font-weight: 600;
    line-height: 1.5;
    text-transform: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.ohc-consent--bottom-left .ohc-consent__actions,
.ohc-consent--bottom-right .ohc-consent__actions {
    gap: 1rem;
}

.ohc-consent--bottom-left .ohc-consent__button,
.ohc-consent--bottom-right .ohc-consent__button {
    padding: 0.75rem 1.5rem;
}

.ohc-consent__button:hover {
    opacity: 0.85;
}

.ohc-consent :focus-visible,
.ohc-consent:focus-visible {
    outline: 3px solid var(--ohc-consent-text, #fff);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
    .ohc-consent {
        animation: ohc-consent-in 0.2s ease-out;
    }

    @keyframes ohc-consent-in {
        from {
            opacity: 0;
            transform: translateY(0.5rem);
        }
    }
}
