/* Themes customise the look by overriding these properties on .acc, .acc-embed */
.acc,
.acc-embed {
    --acc-bg: #fff;
    --acc-fg: #1c1c1e;
    --acc-muted: #5b5b61;
    --acc-accent: #1c1c1e;
    --acc-accent-fg: #fff;
    --acc-switch-off: #c7c7cc;
    --acc-border: rgb(0 0 0 / 0.1);
    --acc-radius: 16px;
    --acc-btn-radius: 999px;
    --acc-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
    --acc-font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --acc-z: 100000;
    font-family: var(--acc-font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--acc-fg);
}

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

.acc [hidden] {
    display: none !important;
}

.acc-banner {
    position: fixed;
    z-index: var(--acc-z);
    inset: auto 1em 1em;
    max-width: 30em;
    padding: 1.5em;
    background: var(--acc-bg);
    border: 1px solid var(--acc-border);
    border-radius: var(--acc-radius);
    box-shadow: var(--acc-shadow);
    animation: acc-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 640px) {
    .acc-banner {
        right: auto;
        left: 1.5em;
        bottom: 1.5em;
    }
}

.acc-title {
    margin: 0 0 0.5em;
    font-family: inherit;
    font-size: 1.125em;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    color: inherit;
    text-wrap: balance;
}

.acc-text {
    margin: 0 0 1.25em;
    font-size: 0.9375em;
    color: var(--acc-muted);
}

.acc-text a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.acc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
}

.acc-btn {
    flex: 1 1 auto;
    min-height: 2.75em;
    padding: 0.625em 1.25em;
    font: inherit;
    font-size: 0.9375em;
    font-weight: 600;
    color: var(--acc-accent-fg);
    background: var(--acc-accent);
    border: 2px solid var(--acc-accent);
    border-radius: var(--acc-btn-radius);
    cursor: pointer;
    transition: opacity 0.2s;
}

.acc-btn:hover {
    opacity: 0.85;
}

.acc-btn-secondary {
    color: var(--acc-accent);
    background: transparent;
}

.acc-link {
    flex: 1 0 100%;
    padding: 0.25em;
    font: inherit;
    font-size: 0.875em;
    color: var(--acc-fg);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    background: none;
    border: 0;
    cursor: pointer;
}

.acc :focus-visible,
.acc-embed :focus-visible {
    outline: 3px solid var(--acc-accent);
    outline-offset: 2px;
}

.acc-dialog {
    width: min(36em, calc(100% - 2em));
    max-height: calc(100dvh - 2em);
    padding: 0;
    color: var(--acc-fg);
    background: var(--acc-bg);
    border: 0;
    border-radius: var(--acc-radius);
    box-shadow: var(--acc-shadow);
}

.acc-dialog[open] {
    animation: acc-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.acc-dialog::backdrop {
    background: rgb(0 0 0 / 0.45);
}

.acc-dialog-inner {
    position: relative;
    padding: 2em 1.5em 1.5em;
}

.acc-dialog .acc-title {
    padding-right: 2.5em;
    font-size: 1.375em;
}

.acc-close {
    position: absolute;
    top: 1em;
    right: 1em;
    display: grid;
    place-items: center;
    width: 2.5em;
    height: 2.5em;
    padding: 0;
    color: inherit;
    background: none;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.acc-close:hover {
    background: var(--acc-border);
}

.acc-close svg {
    width: 1.25em;
    height: 1.25em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.acc-categories {
    margin: 0 0 1.5em;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--acc-border);
}

.acc-category {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    margin: 0;
    padding: 1em 0;
    border-bottom: 1px solid var(--acc-border);
}

.acc-category-text {
    flex: 1;
}

.acc-category-label {
    margin: 0 0 0.25em;
    font-family: inherit;
    font-size: 1em;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: normal;
    color: inherit;
}

.acc-category-desc {
    margin: 0;
    font-size: 0.875em;
    color: var(--acc-muted);
}

.acc-switch {
    position: relative;
    flex-shrink: 0;
    width: 3em;
    height: 1.75em;
    margin: 0;
    appearance: none;
    background: var(--acc-switch-off);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}

.acc-switch::before {
    content: "";
    position: absolute;
    top: 0.1875em;
    left: 0.1875em;
    width: 1.375em;
    height: 1.375em;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
    transition: transform 0.2s;
}

.acc-switch:checked {
    background: var(--acc-accent);
}

.acc-switch:checked::before {
    transform: translateX(1.25em);
}

.acc-switch:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.acc-fab {
    position: fixed;
    z-index: calc(var(--acc-z) - 1);
    left: 1em;
    bottom: 1em;
    display: grid;
    place-items: center;
    width: 2.75em;
    height: 2.75em;
    padding: 0;
    color: var(--acc-fg);
    background: var(--acc-bg);
    border: 1px solid var(--acc-border);
    border-radius: 50%;
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.15);
    cursor: pointer;
    transition: transform 0.2s;
}

.acc-fab:hover {
    transform: scale(1.08);
}

.acc-fab svg {
    width: 1.5em;
    height: 1.5em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.acc-fab svg circle {
    fill: currentColor;
    stroke: none;
}

.acc-open {
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    background: none;
    border: 0;
    cursor: pointer;
}

.acc-embed {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1em;
    width: 100%;
    min-height: 12em;
    aspect-ratio: 16 / 9;
    padding: 1.5em;
    text-align: center;
    background: var(--acc-placeholder-bg, #f2f2f4);
    border-radius: var(--acc-radius);
}

.acc-embed-text {
    max-width: 32em;
    margin: 0;
    font-size: 0.9375em;
}

.acc-embed-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75em;
}

.acc-embed .acc-btn,
.acc-embed .acc-link {
    flex: 0 0 auto;
}

/* The placeholder keeps its own ratio: drop the core embed padding trick, whether or not block styles are loaded */
.wp-block-embed__wrapper:has(> .acc-embed)::before {
    display: none !important;
}

@keyframes acc-in {
    from {
        opacity: 0;
        transform: translateY(1em);
    }
}

@media (prefers-reduced-motion: reduce) {
    .acc *,
    .acc-dialog {
        animation: none !important;
        transition: none !important;
    }
}
