/*
 * Anlässe: Dekoration je Anlass. Alles hängt an Attributen des <html>-Elements (serverseitig gesetzt):
 *   data-umf-occasion="advent"           Kennung des Anlasses
 *   data-umf-occasion-motif="winter"     winter | party | love | spring | autumn
 *   data-umf-occasion-deco="garland …"   eingeschaltete Bausteine (particles garland corner logo accent)
 *   data-umf-occasion-off                Besucher hat die Dekoration ausgeblendet (Skript, localStorage)
 * Themes können jede Regel überschreiben oder die Bausteine per Filter occasions.decorations abwählen.
 */

.umf-occasions-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 900;
}

html[data-umf-occasion-off] .umf-occasions-canvas {
    display: none;
}

.umf-occasions-toggle {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* Akzentfarbe (Wert aus der Einstellung des Anlasses) */
html[data-umf-occasion-deco~="accent"]:not([data-umf-occasion-off]) {
    --umf-accent: var(--umf-occasion-accent);
}

html[data-umf-occasion-deco~="accent"]:not([data-umf-occasion-off]) .umf-header {
    border-top: 4px solid var(--umf-occasion-accent);
}

/* Girlande am unteren Rand der Kopfzeile */
html[data-umf-occasion-deco~="garland"]:not([data-umf-occasion-off]) .umf-header {
    position: relative;
}

html[data-umf-occasion-deco~="garland"]:not([data-umf-occasion-off]) .umf-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -20px;
    height: 24px;
    pointer-events: none;
    z-index: 5;
    background-repeat: repeat-x;
    background-size: auto 24px;
}

html[data-umf-occasion-motif="winter"] .umf-header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='24'%3E%3Cpath d='M0 3Q30 17 60 3T120 3' fill='none' stroke='%23667' stroke-width='1.5'/%3E%3Cg stroke='%23445' stroke-width='.8'%3E%3Cellipse cx='15' cy='14' rx='3.5' ry='5' fill='%23e53935'/%3E%3Cellipse cx='30' cy='15.5' rx='3.5' ry='5' fill='%23fbc02d'/%3E%3Cellipse cx='45' cy='14' rx='3.5' ry='5' fill='%2343a047'/%3E%3Cellipse cx='75' cy='14' rx='3.5' ry='5' fill='%231e88e5'/%3E%3Cellipse cx='90' cy='15.5' rx='3.5' ry='5' fill='%23e53935'/%3E%3Cellipse cx='105' cy='14' rx='3.5' ry='5' fill='%23fbc02d'/%3E%3C/g%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="party"] .umf-header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='24'%3E%3Cpath d='M0 2Q40 8 80 2' fill='none' stroke='%23667' stroke-width='1.2'/%3E%3Cpolygon points='3,3 19,5 11,21' fill='%23e53935'/%3E%3Cpolygon points='23,5 39,5.5 31,22' fill='%23fbc02d'/%3E%3Cpolygon points='43,5.5 59,5 51,22' fill='%231e88e5'/%3E%3Cpolygon points='63,5 77,3 70,20' fill='%2343a047'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="love"] .umf-header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='24'%3E%3Cpath d='M0 2Q30 8 60 2' fill='none' stroke='%23a67' stroke-width='1'/%3E%3Cpath d='M15 21C15 21 7 15 7 10.5A3.8 3.8 0 0 1 15 8.5A3.8 3.8 0 0 1 23 10.5C23 15 15 21 15 21Z' fill='%23d81b60'/%3E%3Cpath d='M45 19C45 19 39 14.5 39 11A3 3 0 0 1 45 9.5A3 3 0 0 1 51 11C51 14.5 45 19 45 19Z' fill='%23f06292'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="spring"] .umf-header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='24'%3E%3Cpath d='M0 2Q45 8 90 2' fill='none' stroke='%23786' stroke-width='1'/%3E%3Cellipse cx='15' cy='14' rx='5' ry='7' fill='%23ffb74d'/%3E%3Cpath d='M10.5 13h9' stroke='%23fff' stroke-width='1.5'/%3E%3Cellipse cx='45' cy='15' rx='5' ry='7' fill='%2381c784'/%3E%3Cpath d='M40.5 14h9M41 17h8' stroke='%23fff' stroke-width='1.2'/%3E%3Cellipse cx='75' cy='14' rx='5' ry='7' fill='%2364b5f6'/%3E%3Ccircle cx='73' cy='12' r='1.2' fill='%23fff'/%3E%3Ccircle cx='77' cy='16' r='1.2' fill='%23fff'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="autumn"] .umf-header::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='24'%3E%3Cpath d='M0 2Q45 8 90 2' fill='none' stroke='%23765' stroke-width='1'/%3E%3Cellipse cx='15' cy='13' rx='4' ry='8' transform='rotate(-25 15 13)' fill='%23ef6c00'/%3E%3Cellipse cx='45' cy='14' rx='4' ry='8' transform='rotate(20 45 14)' fill='%23c62828'/%3E%3Cellipse cx='75' cy='13' rx='4' ry='8' transform='rotate(-10 75 13)' fill='%23f9a825'/%3E%3C/svg%3E");
}

/* Eckschmuck unten rechts */
html[data-umf-occasion-deco~="corner"]:not([data-umf-occasion-off]) body::after {
    content: "";
    position: fixed;
    right: 0;
    bottom: 0;
    width: 96px;
    height: 96px;
    pointer-events: none;
    z-index: 800;
    opacity: .92;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: right bottom;
}

@media (max-width: 600px) {
    html[data-umf-occasion-deco~="corner"]:not([data-umf-occasion-off]) body::after {
        width: 56px;
        height: 56px;
    }
}

html[data-umf-occasion-motif="winter"] body::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg stroke='%232e7d32' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M96 30L40 96'/%3E%3Cpath d='M82 47l-14-6M82 47l2-15M70 61l-15-5M70 61l2-16M58 75l-15-4M58 75l3-16M46 89l-14-3M46 89l3-14'/%3E%3C/g%3E%3Ccircle cx='66' cy='66' r='6' fill='%23e53935'/%3E%3Ccircle cx='54' cy='80' r='5' fill='%23fbc02d'/%3E%3Cpath d='M80 6l3.5 7.5 8 1-6 5.5 1.5 8-7-4-7 4 1.5-8-6-5.5 8-1z' fill='%23fbc02d'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="party"] body::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23778' stroke-width='1.2'%3E%3Cpath d='M58 46Q54 70 66 96M78 34Q82 64 76 96M40 58Q44 78 56 96'/%3E%3C/g%3E%3Cellipse cx='58' cy='32' rx='11' ry='14' fill='%23e53935'/%3E%3Cellipse cx='78' cy='20' rx='11' ry='14' fill='%231e88e5'/%3E%3Cellipse cx='40' cy='46' rx='10' ry='13' fill='%23fbc02d'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="love"] body::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cpath d='M64 90C64 90 34 70 34 50A14 14 0 0 1 64 42A14 14 0 0 1 94 50C94 70 64 90 64 90Z' fill='%23d81b60'/%3E%3Cpath d='M30 52C30 52 14 41 14 30A8 8 0 0 1 30 26A8 8 0 0 1 46 30C46 41 30 52 30 52Z' fill='%23f06292'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="spring"] body::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cellipse cx='66' cy='66' rx='20' ry='26' fill='%2364b5f6'/%3E%3Cpath d='M47 60q10-6 19 0t19 0' fill='none' stroke='%23fff' stroke-width='3'/%3E%3Cpath d='M47 72q10 6 19 0t19 0' fill='none' stroke='%23fff176' stroke-width='3'/%3E%3Cg fill='%23f48fb1'%3E%3Ccircle cx='26' cy='74' r='6'/%3E%3Ccircle cx='36' cy='80' r='6'/%3E%3Ccircle cx='32' cy='91' r='6'/%3E%3Ccircle cx='20' cy='91' r='6'/%3E%3Ccircle cx='16' cy='80' r='6'/%3E%3C/g%3E%3Ccircle cx='26' cy='84' r='5' fill='%23fdd835'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="autumn"] body::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'%3E%3Cpath d='M62 40q2-10 10-12' fill='none' stroke='%235d4037' stroke-width='4' stroke-linecap='round'/%3E%3Cellipse cx='48' cy='68' rx='16' ry='22' fill='%23ef6c00'/%3E%3Cellipse cx='80' cy='68' rx='16' ry='22' fill='%23ef6c00'/%3E%3Cellipse cx='64' cy='68' rx='16' ry='24' fill='%23fb8c00'/%3E%3Cpath d='M20 50q8-14 20-10-4 14-20 10z' fill='%23c62828'/%3E%3C/svg%3E");
}

/* Aufsatz am Logo */
html[data-umf-occasion-deco~="logo"]:not([data-umf-occasion-off]) .umf-brand {
    position: relative;
}

html[data-umf-occasion-deco~="logo"]:not([data-umf-occasion-off]) .umf-brand::before {
    content: "";
    position: absolute;
    left: -10px;
    top: -12px;
    width: 26px;
    height: 26px;
    pointer-events: none;
    transform: rotate(-18deg);
    background-repeat: no-repeat;
    background-size: contain;
}

html[data-umf-occasion-motif="winter"] .umf-brand::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M3 20Q8 4 20 6L22 18Z' fill='%23d32f2f'/%3E%3Crect x='1' y='18' width='23' height='5' rx='2.5' fill='%23fff' stroke='%23ccc'/%3E%3Ccircle cx='21' cy='5' r='3' fill='%23fff' stroke='%23ccc'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="party"] .umf-brand::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpolygon points='13,2 22,24 4,24' fill='%231e88e5'/%3E%3Cpath d='M9 14l8 3M7 19l12 3' stroke='%23fbc02d' stroke-width='2'/%3E%3Ccircle cx='13' cy='3' r='2.5' fill='%23e53935'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="love"] .umf-brand::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M13 23C13 23 2 16 2 9A5.5 5.5 0 0 1 13 6.5A5.5 5.5 0 0 1 24 9C24 16 13 23 13 23Z' fill='%23d81b60'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="spring"] .umf-brand::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cg fill='%23f48fb1'%3E%3Ccircle cx='13' cy='6' r='5'/%3E%3Ccircle cx='20' cy='12' r='5'/%3E%3Ccircle cx='17' cy='20' r='5'/%3E%3Ccircle cx='9' cy='20' r='5'/%3E%3Ccircle cx='6' cy='12' r='5'/%3E%3C/g%3E%3Ccircle cx='13' cy='14' r='4' fill='%23fdd835'/%3E%3C/svg%3E");
}

html[data-umf-occasion-motif="autumn"] .umf-brand::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M4 22Q4 6 22 4Q22 22 4 22Z' fill='%23ef6c00'/%3E%3Cpath d='M4 22L18 8' stroke='%235d4037' stroke-width='1.5'/%3E%3C/svg%3E");
}
