/* Consent to external content: the card with a plain link, the frame that replaces it, the banner and the switch (js/consent.js).
   Colors follow the page; --consent-accent, --consent-accent-contrast and --consent-radius adjust them. */

/* Third-party content: a card with a plain link, replaced by the interactive version once the visitor agrees (js/embeds.js) */
.embed-slot { margin: 1.5rem 0; }
.embed-card { position: relative; display: grid; place-items: center; min-height: 12rem; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--consent-radius, 0.5rem); text-decoration: none; background: rgba(127, 127, 127, 0.15); }
.embed-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.embed-card-text { position: relative; padding: 0.75rem 1rem; font-weight: 700; text-align: center; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }
.embed-card:not(:has(img)) .embed-card-text { color: inherit; text-shadow: none; }
.embed-card-text::after { content: " \2192"; }
.embed-frame { display: block; width: 100%; margin: 1.5rem 0; border: 0; aspect-ratio: 16 / 9; border-radius: var(--consent-radius, 0.5rem); }
.embed-frame.tall { aspect-ratio: 4 / 3; min-height: 24rem; }

.consent-toast { position: fixed; z-index: 20; left: 1rem; right: 1rem; bottom: 1rem; max-width: 34rem; margin: 0 auto; padding: 0.9rem 1.1rem; border-radius: var(--consent-radius, 0.5rem); font-size: 0.95rem; color: CanvasText; background: Canvas; border: 1px solid rgba(127, 127, 127, 0.4); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }
.consent-toast[hidden] { display: none; }
.consent-toast p { margin: 0 0 0.5rem; }
.consent-actions { display: flex; align-items: center; gap: 1rem; margin: 0; }
.consent-toast .button { padding: 0.4rem 0.9rem; border: 0; border-radius: var(--consent-radius, 0.5rem); font: inherit; font-weight: 600; cursor: pointer; background: var(--consent-accent, var(--q2-accent, var(--brand, currentColor))); color: var(--consent-accent-contrast, var(--q2-accent-contrast, Canvas)); }
.link-button { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* On-off switch (consent to the external content, in a privacy policy). Drawn like Pico's switch (the knob is ::before, the border
   is the gap around it) and in a cascade layer: a theme that styles [role=switch] itself wins, property by property. */
@layer oli-gentle-consent {
    .switch { display: inline-flex; align-items: center; gap: 0.75rem; cursor: pointer; font-weight: 600; }
    .switch [role=switch] { appearance: none; flex: none; box-sizing: border-box; width: 2.75rem; height: 1.5rem; margin: 0; padding: 0; border: 0.2rem solid #9aa3b5; border-radius: 1.5rem; background: #9aa3b5; cursor: pointer; transition: background-color 0.2s, border-color 0.2s; }
    .switch [role=switch]::before { content: ''; display: block; height: 100%; aspect-ratio: 1; border-radius: 50%; background: #fff; transition: margin 0.2s; }
    .switch [role=switch]:checked { background: #1d7a46; border-color: #1d7a46; }
    .switch [role=switch]:checked::before { margin-inline-start: calc(2.75rem - 1.5rem); }
    .switch [role=switch]:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
}
