/*
 * Consent banner: layout only. Every colour, font size and space comes from
 * the theme contract's presets (design D1) through a --ee-consent-* custom
 * property, so a child theme restyles the banner by setting those properties
 * (or by its own CSS on the ee-consent-* classes) and never edits this file.
 *
 * Properties a child may set: --ee-consent-bg, --ee-consent-fg,
 * --ee-consent-muted, --ee-consent-border, --ee-consent-accent,
 * --ee-consent-on-accent, --ee-consent-font, --ee-consent-size,
 * --ee-consent-size-title, --ee-consent-space, --ee-consent-gap,
 * --ee-consent-max-width, --ee-consent-z.
 */

.ee-consent {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 1px solid var(--ee-consent-border, var(--wp--preset--color--muted));
    background: var(--ee-consent-bg, var(--wp--preset--color--base));
    color: var(--ee-consent-fg, var(--wp--preset--color--contrast));
    font-family: var(--ee-consent-font, var(--wp--preset--font-family--body));
    font-size: var(--ee-consent-size, var(--wp--preset--font-size--small));
    line-height: 1.5;
}

.ee-consent[open] {
    display: flex;
    flex-direction: column;
}

/* Bar: fixed over the foot of the viewport, non-modal. */
.ee-consent-bar {
    position: fixed;
    inset: auto 0 0;
    z-index: var(--ee-consent-z, 100000);
    width: auto;
    max-width: none;
    max-height: 85dvh;
    border-width: 1px 0 0;
}

/* Modal: centred in front of the inert page. */
.ee-consent-modal {
    width: min(100% - 2 * var(--ee-consent-space, var(--wp--preset--spacing--30)), 40rem);
    max-height: 85dvh;
}

.ee-consent-modal::backdrop {
    background: var(--ee-consent-backdrop, color-mix(in srgb, var(--wp--preset--color--contrast) 50%, transparent));
}

.ee-consent-panel {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: var(--ee-consent-gap, var(--wp--preset--spacing--20));
    width: 100%;
    max-width: var(--ee-consent-max-width, var(--wp--style--global--wide-size, 80rem));
    min-height: 0;
    margin: 0 auto;
    padding: var(--ee-consent-space, var(--wp--preset--spacing--30));
}

.ee-consent-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ee-consent-title {
    margin: 0 0 var(--ee-consent-gap, var(--wp--preset--spacing--20));
    font-size: var(--ee-consent-size-title, var(--wp--preset--font-size--medium));
}

/* Focus lands on the title for screen readers; the first Tab moves on. */
.ee-consent-title:focus {
    outline: none;
}

.ee-consent-intro,
.ee-consent-more,
.ee-consent-category-description {
    margin: 0;
}

.ee-consent-more {
    margin-top: var(--ee-consent-gap, var(--wp--preset--spacing--20));
}

.ee-consent-more a {
    color: inherit;
}

.ee-consent-settings {
    margin-top: var(--ee-consent-space, var(--wp--preset--spacing--30));
}

.ee-consent-settings-title {
    margin: 0 0 var(--ee-consent-gap, var(--wp--preset--spacing--20));
    font-size: inherit;
}

.ee-consent-list {
    display: grid;
    gap: var(--ee-consent-gap, var(--wp--preset--spacing--20));
    margin: 0;
    padding: 0;
    list-style: none;
}

.ee-consent-category {
    padding: var(--ee-consent-gap, var(--wp--preset--spacing--20));
    border: 1px solid var(--ee-consent-border, var(--wp--preset--color--muted));
}

.ee-consent-category-head {
    display: flex;
    align-items: center;
    gap: var(--ee-consent-gap, var(--wp--preset--spacing--20));
    font-weight: 600;
}

.ee-consent-switch {
    width: 1.25em;
    height: 1.25em;
    margin: 0;
    accent-color: var(--ee-consent-accent, var(--wp--preset--color--primary));
}

.ee-consent-always {
    margin-left: auto;
    font-weight: 400;
    color: var(--ee-consent-muted, inherit);
}

.ee-consent-category-description {
    margin-top: 0.25em;
    color: var(--ee-consent-muted, inherit);
}

.ee-consent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ee-consent-gap, var(--wp--preset--spacing--20));
}

/* Accept and refuse carry the same weight; only the child may change that. */
.ee-consent-button {
    padding: 0.6em 1.2em;
    border: 1px solid var(--ee-consent-accent, var(--wp--preset--color--primary));
    background: var(--ee-consent-accent, var(--wp--preset--color--primary));
    color: var(--ee-consent-on-accent, var(--wp--preset--color--on-primary));
    font: inherit;
    cursor: pointer;
}

.ee-consent-toggle {
    background: transparent;
    color: inherit;
}

.ee-consent-button:focus-visible,
.ee-consent-switch:focus-visible,
.ee-consent-more a:focus-visible {
    outline: 2px solid currentcolor;
    outline-offset: 2px;
}

.ee-consent [hidden] {
    display: none;
}
