/* =================================================================
   ADVENTNÍ OKNA (/advent.php) — pohádková noční scéna
   Načítá se jen na adventní stránce (přes $dodatecneStyly v hlavičce).

   Jednotky: uvnitř domečku `cqw` = procenta šířky domečku (.dum),
   uvnitř okýnka `cqw` = procenta šířky okýnka (.dum-okno__ram).
   Celý obrázek se tak škáluje s displejem, ale rozvržení oken se
   na mobilu opravdu mění (3 → 4 → 6 sloupců), aby okýnka měla
   dotykovou plochu aspoň 44 px.

   Stavy okýnka:  .je-budouci  — zavřené okenice, tmavší, jen číslo
                  .je-dostupne — odemčené: okenice rozevřené, sklo svítí
                  .je-otevrene — už přečtené (pamatuje si prohlížeč): navíc
                                 ilustrace ve skle (číslo zůstává na místě)
   Postupné rozsvěcování: --zare (0–1) a třídy .svetlo-* na .advent-scena.
   ================================================================= */

.advent {
    --pergamen:  #f7ecd3;
    --inkoust:   #3b2a1a;
    --jehlici:   #2f5d2a;
    --vanocni:   #9e1f1a;
    --zlata:     #e9c77b;
    --svetlo:    #ffcf6e;
    font-family: 'EB Garamond', Georgia, serif;
    color: var(--inkoust);
    background: #fff;
}

/* =================================================================
   SCÉNA — noční obloha, Beskydy, vesnice s kostelíkem, sníh
   ================================================================= */
.advent-scena {
    container: scena / inline-size;
    position: relative;
    overflow: hidden;
    padding-top: clamp(1.8rem, 5vw, 3.2rem);
    background: linear-gradient(180deg, #081631 0%, #10264b 32%, #1f3f72 65%, #35588e 100%);
}
.advent-scena__hvezdy {
    position: absolute;
    inset: 0 0 40% 0;
    pointer-events: none;
    background:
        radial-gradient(1.6px 1.6px at 8% 14%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 21% 32%, #fff, transparent 70%),
        radial-gradient(1.8px 1.8px at 37% 9%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 55% 24%, #fff, transparent 70%),
        radial-gradient(1.6px 1.6px at 68% 7%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 83% 28%, #fff, transparent 70%),
        radial-gradient(1.8px 1.8px at 93% 12%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 4% 44%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 96% 48%, #fff, transparent 70%);
    animation: advent-trpyt 7s ease-in-out infinite alternate;
}
.advent-scena__hvezdy--2 {
    background:
        radial-gradient(1.2px 1.2px at 14% 6%, #fff, transparent 70%),
        radial-gradient(1.6px 1.6px at 29% 20%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 46% 36%, #fff, transparent 70%),
        radial-gradient(1.4px 1.4px at 61% 15%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 76% 40%, #fff, transparent 70%),
        radial-gradient(1.6px 1.6px at 89% 4%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 12% 58%, #fff, transparent 70%),
        radial-gradient(1.2px 1.2px at 88% 62%, #fff, transparent 70%);
    animation-delay: -3.5s;
    animation-duration: 9s;
}
@keyframes advent-trpyt {
    from { opacity: .45; }
    to   { opacity: 1; }
}
.advent-scena__vesnice {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3%;
    aspect-ratio: 1200 / 420;
    min-height: 170px;
    background: url('/assets/img/advent/vesnice.svg') no-repeat center bottom / cover;
    pointer-events: none;
}
.advent-scena__snih {
    position: absolute;
    inset: 0;
    z-index: 7;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.63) 1.6px, transparent 2.4px),
        radial-gradient(circle, rgba(255,255,255,0.64) 1.7px, transparent 2.5px),
        radial-gradient(circle, rgba(255,255,255,0.66) 1.7px, transparent 2.5px),
        radial-gradient(circle, rgba(255,255,255,0.42) 1.6px, transparent 2.4px),
        radial-gradient(circle, rgba(255,255,255,0.55) 1.8px, transparent 2.6px),
        radial-gradient(circle, rgba(255,255,255,0.66) 1.8px, transparent 2.6px),
        radial-gradient(circle, rgba(255,255,255,0.45) 1.1px, transparent 1.9px),
        radial-gradient(circle, rgba(255,255,255,0.58) 1.0px, transparent 1.8px),
        radial-gradient(circle, rgba(255,255,255,0.61) 2.1px, transparent 2.9px);
    background-size: 173px 173px, 211px 211px, 257px 257px, 293px 293px, 331px 331px, 379px 379px, 419px 419px, 467px 467px, 523px 523px;
    background-position: 119px 115px, 47px 205px, 95px 48px, 275px 21px, 231px 315px, 270px 32px, 123px 307px, 225px 302px, 301px 511px;
    animation: advent-snezi 60s linear infinite;
}
@keyframes advent-snezi {
    to { background-position: 119px 634px, 258px 838px, 95px 819px, 568px 900px, 231px 1308px, 649px 1169px, 123px 1564px, 692px 1703px, 301px 2080px; }
}

.advent-scena__stromek {
    position: absolute;
    z-index: 1;
    bottom: 2.5%;
    width: 13%;
    max-width: 150px;
    aspect-ratio: 3 / 5;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 100'%3E%3Crect x='26' y='84' width='8' height='14' fill='%235b3a1e'/%3E%3Cpath d='M30 2 L48 34 H12 Z M30 22 L54 60 H6 Z M30 44 L60 88 H0 Z' fill='%231f4a2b'/%3E%3Cpath d='M30 2 L37 15 Q30 19 23 15 Z M30 22 L40 38 Q30 43 20 38 Z M30 44 L42 62 Q30 67 18 62 Z' fill='%23f4f8fd'/%3E%3C/svg%3E") no-repeat bottom / contain;
}
.advent-scena__stromek--l { left: -4%; }
.advent-scena__stromek--p { right: -3%; width: 11%; }
@container scena (min-width: 700px) {
    .advent-scena__stromek { z-index: 3; }
    .advent-scena__stromek--l { left: 5%; }
    .advent-scena__stromek--p { right: 6%; }
}
/* světýlka na stromcích (rozsvítí se ke konci adventu) */
.advent-scena__stromek::after {
    content: '';
    position: absolute;
    inset: 12% 10% 18%;
    opacity: 0;
    transition: opacity 2s;
    background:
        radial-gradient(circle at 50% 18%, #ffe08a 0 2.5%, transparent 4%),
        radial-gradient(circle at 38% 40%, #ffd27a 0 2.5%, transparent 4%),
        radial-gradient(circle at 64% 46%, #ffe08a 0 2.5%, transparent 4%),
        radial-gradient(circle at 28% 68%, #ffd27a 0 2.5%, transparent 4%),
        radial-gradient(circle at 54% 72%, #ffe08a 0 2.5%, transparent 4%),
        radial-gradient(circle at 78% 76%, #ffd27a 0 2.5%, transparent 4%);
    filter: drop-shadow(0 0 3px rgba(255, 210, 120, .9));
}
.svetlo-stromky .advent-scena__stromek::after { opacity: 1; }

.advent-scena__popredi {
    position: relative;
    z-index: 4;
    display: block;
    width: 100%;
    aspect-ratio: 1200 / 140;
    min-height: 44px;
    margin-top: -4%;
    background: url('/assets/img/advent/popredi.svg') no-repeat center bottom / cover;
    pointer-events: none;
}

/* --- Záhlaví na noční obloze --- */
.advent__uvod {
    position: relative;
    z-index: 5;
    max-width: 700px;
    margin: 0 auto clamp(1.4rem, 4vw, 2.4rem);
    padding: 0 1rem;
    text-align: center;
    color: #f4ead6;
}
.advent__h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    margin: 0 0 0.35em;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 800;
    font-size: clamp(2rem, 7vw, 3.6rem);
    line-height: 1.05;
    color: #fff4dc;
    text-shadow: 0 0 22px rgba(255, 210, 130, .45), 0 2px 0 rgba(0, 0, 0, .35);
}
.advent__h1::before,
.advent__h1::after {
    content: '';
    flex: 0 0 auto;
    width: 0.9em;
    height: 0.9em;
    background: url('/assets/img/advent/vetvicka-zlata.svg') no-repeat center / contain;
}
.advent__h1::before { transform: scaleX(-1); }
.advent__lead {
    font-size: clamp(1.1rem, 2.6vw, 1.25rem);
    line-height: 1.5;
    color: rgba(255, 244, 220, .9);
    margin: 0 0 1.2rem;
}
.advent__stav {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.55rem 1.25rem;
    border-radius: 999px;
    background: #fbf0d9;
    color: var(--inkoust);
    font-size: clamp(1rem, 2.4vw, 1.12rem);
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 0 0 3px rgba(233, 199, 123, .35), 0 8px 22px rgba(0, 0, 0, .35);
}
.advent__stav strong { color: var(--jehlici); }
.advent__stav-ikona { flex: 0 0 auto; width: 1.25em; height: 1.25em; color: var(--vanocni); }
.advent__stav--nahled { background: #ffe2a8; }
.advent__pozn {
    max-width: 62ch;
    margin: 0 auto;
    padding: 1.4rem 1.2rem 2.4rem;
    text-align: center;
    font-style: italic;
    font-size: 1.08rem;
    color: #4a3b2c;
}

/* =================================================================
   DOMEČEK
   ================================================================= */
.dum {
    container: dum / inline-size;
    position: relative;
    z-index: 2;
    width: 94%;
    max-width: 760px;
    margin: 0 auto;
}
@container scena (min-width: 700px)  { .dum { width: 68%; max-width: 600px; } }
@container scena (min-width: 1000px) { .dum { width: 50%; max-width: 620px; } }

/* --- Střecha --- */
.dum__strecha {
    position: relative;
    z-index: 2;
    width: 110%;
    margin-left: -5%;
    aspect-ratio: 2.2 / 1;
}
.dum__snih-strecha,
.dum__taska {
    position: absolute;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.dum__snih-strecha {
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, #ffffff, #dbe5f2);
}
.dum__taska {
    inset: 7% 4% 0;
    z-index: 2;
    background:
        repeating-linear-gradient(180deg, transparent 0 2cqw, rgba(0,0,0,.3) 2cqw 2.3cqw),
        linear-gradient(180deg, #7b3322, #561e12);
}
.dum__strecha::after {                      /* sněhová převis pod střechou */
    content: '';
    position: absolute;
    z-index: 4;
    left: 1%;
    right: 1%;
    bottom: -1.6cqw;
    height: 3cqw;
    border-radius: 2cqw;
    background:
        radial-gradient(circle at 12% 100%, #e9f0f9 0 1cqw, transparent 1.1cqw),
        radial-gradient(circle at 47% 100%, #e9f0f9 0 1.2cqw, transparent 1.3cqw),
        radial-gradient(circle at 81% 100%, #e9f0f9 0 1cqw, transparent 1.1cqw),
        linear-gradient(180deg, #ffffff, #e3ebf6);
    box-shadow: 0 0.8cqw 1.2cqw rgba(0, 0, 0, .3);
}
.dum__stit {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 0;
    width: 74%;
    height: 78%;
    transform: translateX(-50%);
}
.dum__stit::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background:
        repeating-linear-gradient(90deg, transparent 0 3.2cqw, rgba(50,25,8,.45) 3.2cqw 3.5cqw),
        linear-gradient(180deg, #a87442, #8a5a31);
}
.dum__komin {
    position: absolute;
    z-index: 0;
    right: 20%;
    top: 14%;
    width: 7%;
    height: 34%;
    background:
        repeating-linear-gradient(180deg, transparent 0 1.6cqw, rgba(0,0,0,.28) 1.6cqw 1.8cqw),
        #85382a;
}
.dum__komin::before {
    content: '';
    position: absolute;
    left: -14%;
    right: -14%;
    top: -1.3cqw;
    height: 2.2cqw;
    border-radius: 1.2cqw 1.2cqw 0.4cqw 0.4cqw;
    background: #fbfdff;
}
.dum__kour {
    display: none;
    position: absolute;
    left: 0;
    bottom: 100%;
    width: 140%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(225, 232, 245, .5), transparent 70%);
    animation: dum-kour 7s ease-out infinite;
}
.dum__kour--2 { animation-delay: -3.5s; }
.svetlo-kour .dum__kour { display: block; }
@keyframes dum-kour {
    0%   { transform: translate(0, 0) scale(.6); opacity: 0; }
    20%  { opacity: .9; }
    100% { transform: translate(70%, -280%) scale(2.6); opacity: 0; }
}
.dum__hvezda {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: -1%;
    transform: translate(-50%, -55%);
    font-size: 8cqw;
    line-height: 1;
    color: #5b5446;
    transition: color 2s, text-shadow 2s;
}
.svetlo-stedry .dum__hvezda {
    color: #ffe08a;
    text-shadow: 0 0 2cqw rgba(255, 220, 130, .95), 0 0 6cqw rgba(255, 200, 100, .6);
    animation: dum-hvezda 3.5s ease-in-out infinite;
}
@keyframes dum-hvezda {
    0%, 100% { text-shadow: 0 0 2cqw rgba(255,220,130,.9), 0 0 5cqw rgba(255,200,100,.5); }
    50%      { text-shadow: 0 0 3cqw rgba(255,230,150,1), 0 0 8cqw rgba(255,210,110,.75); }
}

/* --- Žárovičky na střeše --- */
.dum__svetylka {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}
.dum__svetylka i {
    position: absolute;
    width: 1.5cqw;
    aspect-ratio: 1;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(.6);
    background: rgba(40, 32, 24, .45);
    transition: background 1.5s, box-shadow 1.5s, transform 1.5s;
}
.dum__svetylka i.sviti {
    transform: translate(-50%, -50%);
    background: #ffe3a0;
    box-shadow: 0 0 1cqw 0.4cqw rgba(255, 205, 110, .85);
    animation: dum-zarovka 3.2s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * -0.41s);
}
@keyframes dum-zarovka {
    from { opacity: .75; }
    to   { opacity: 1; }
}

/* --- Roubená stěna --- */
.dum__stena {
    position: relative;
    z-index: 1;
    padding: 6% 4% 0;
    background: repeating-linear-gradient(180deg, #8a5a34 0, #73472a 3.2cqw, #472913 3.2cqw, #472913 3.6cqw);
    border-left: 2.2cqw solid #553219;
    border-right: 2.2cqw solid #553219;
}
/* čím víc dní, tím víc tepla na stěně; na začátku je dům skoro temný */
.dum__stena::before,
.dum__zare {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: opacity 2s;
}
.dum__stena::before {
    background: rgba(8, 18, 40, .5);
    opacity: calc(1 - var(--zare, 0));
}
.dum__zare {
    background: radial-gradient(ellipse at 50% 70%, rgba(255, 185, 90, .4), transparent 70%);
    opacity: var(--zare, 0);
}

.dum__okna {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 5cqw;
}
@container scena (min-width: 480px) {
    .dum__okna { grid-template-columns: repeat(4, 1fr); row-gap: 4cqw; }
}
@container scena (min-width: 700px) {
    .dum__okna { grid-template-columns: repeat(6, 1fr); row-gap: 3cqw; }
}

/* ozdobné pole na stěně — dřevěná cedulka */
.dum-ozdoba {
    display: flex;
    align-items: center;
    justify-content: center;
}
.dum-ozdoba span {
    padding: 0.35em 0.7em;
    border: 0.15em solid #4a2b14;
    border-radius: 0.3em;
    background: linear-gradient(180deg, #b07a45, #7f522b);
    color: #f8ead0;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 3.6cqw;
    transform: rotate(-4deg);
    box-shadow: 0 0.5cqw 1cqw rgba(0, 0, 0, .4);
}
@container scena (min-width: 700px) { .dum-ozdoba span { font-size: 1.9cqw; } }

/* --- Vchod: dveře (Štědrý den), lucerny a ozdobná okna --- */
.dum__vstup {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 3.5cqw;
    padding-top: 5cqw;
}
.dum__lucerna {
    align-self: center;
    width: 4.5cqw;
    aspect-ratio: 24 / 32;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0v4' stroke='%23222' stroke-width='1.6'/%3E%3Cpath d='M7 5h10l-1.5 3.5h-7z' fill='%23222'/%3E%3Crect x='7' y='8.5' width='10' height='15' rx='1.5' fill='%23ffcf6e' stroke='%23222' stroke-width='1.6'/%3E%3Cpath d='M12 12.5c-1.8 2.2-1.8 4.3 0 6.5c1.8-2.2 1.8-4.3 0-6.5z' fill='%23e8742e'/%3E%3Cpath d='M6 23.5h12l1 3.5H5z' fill='%23222'/%3E%3C/svg%3E") no-repeat center / contain;
    filter: grayscale(1) brightness(.45);
    transition: filter 2s;
}
.svetlo-lucerna-l .dum__lucerna--l,
.svetlo-lucerna-p .dum__lucerna--p {
    filter: drop-shadow(0 0 1.2cqw rgba(255, 200, 100, .95));
}
@container scena (min-width: 700px) { .dum__lucerna { width: 2.8cqw; } }

/* ozdobná (neklikací) okénka — rozsvěcují se postupně */
.dum-ozdobne-okno {
    display: block;
    width: 9cqw;
    aspect-ratio: 3 / 4;
    border: 0.8cqw solid #efe3c8;
    border-radius: 50% 50% 0 0 / 30% 30% 0 0;
    background:
        linear-gradient(90deg, transparent calc(50% - 0.4cqw), #efe3c8 calc(50% - 0.4cqw) calc(50% + 0.4cqw), transparent calc(50% + 0.4cqw)),
        linear-gradient(180deg, transparent 45%, #efe3c8 45% calc(45% + 0.8cqw), transparent calc(45% + 0.8cqw)),
        #141f35;
    transition: background-color 2s, box-shadow 2s;
}
.dum-ozdobne-okno--vstup-l,
.dum-ozdobne-okno--vstup-p { align-self: center; }
@container scena (min-width: 700px) { .dum-ozdobne-okno { width: 5.5cqw; } }
.dum__stit .dum-ozdobne-okno {
    position: absolute;
    top: 72%;
    width: 7cqw;
    transform: translate(-50%, -50%);
}
.dum-ozdobne-okno--stit-l { left: 28%; }
.dum-ozdobne-okno--stit-p { left: 72%; }
@container scena (min-width: 700px) { .dum__stit .dum-ozdobne-okno { width: 4.5cqw; } }
.svetlo-stit-l  .dum-ozdobne-okno--stit-l,
.svetlo-stit-p  .dum-ozdobne-okno--stit-p,
.svetlo-vstup-l .dum-ozdobne-okno--vstup-l,
.svetlo-vstup-p .dum-ozdobne-okno--vstup-p {
    background-color: #f7b955;
    box-shadow: 0 0 2.5cqw 0.6cqw rgba(255, 190, 90, .55), inset 0 0 1.5cqw rgba(255, 245, 210, .8);
}

/* =================================================================
   OKÝNKA
   ================================================================= */
.dum-okno {
    display: flex;
    justify-content: center;
    padding-bottom: 2.6cqw;               /* místo na parapet */
    --k1: #8a5a33;                        /* barva okenic: dřevo */
    --k2: #5e3a1d;
}
.dum-okno.barva-zelena  { --k1: #4a8a3c; --k2: #2c5a27; }
.dum-okno.barva-cervena { --k1: #a83a2e; --k2: #721f18; }

.dum-okno__ram {
    container: okno / inline-size;
    position: relative;
    display: block;
    width: 60%;
    aspect-ratio: 3 / 4;
    border: 1.1cqw solid #efe3c8;
    background: #efe3c8;
    color: inherit;
    box-shadow: 0 0.6cqw 1cqw rgba(0, 0, 0, .45);
    transition: box-shadow .8s, transform .3s;
}
@container scena (min-width: 700px) {
    .dum-okno__ram { width: 56%; border-width: 0.8cqw; }
}
.tvar-oblouk .dum-okno__ram { border-radius: 50% 50% 0 0 / 30% 30% 0 0; }

/* sníh nad oknem a zasněžený parapet (jen okna na stěně) */
.dum__okna .dum-okno__ram::before,
.dum__okna .dum-okno__ram::after {
    content: '';
    position: absolute;
    z-index: 7;
    pointer-events: none;
}
.dum__okna .dum-okno__ram::before {
    left: -16%;
    right: -16%;
    top: -12%;
    height: 11%;
    border-radius: 50% 50% 35% 35%;
    background: linear-gradient(180deg, #ffffff, #e2eaf5);
}
.dum__okna .dum-okno__ram::after {
    left: -20%;
    right: -20%;
    bottom: -12%;
    height: 9%;
    border-radius: 0.6cqw;
    background: linear-gradient(180deg, #fbfdff 0 50%, #c3a57a 50%);
    box-shadow: 0 0.4cqw 0.6cqw rgba(0, 0, 0, .35);
}

/* sklo — za okenicemi svítí, jakmile je okýnko odemčené */
.dum-okno__sklo {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    background: radial-gradient(circle at 50% 60%, #2a3954, #121b2e);
    transition: background 1.5s;
}
.je-dostupne .dum-okno__sklo {
    background: radial-gradient(circle at 50% 55%, #fff7da 0%, #ffcf6e 50%, #e58b2c 100%);
}
.dum-okno__sklo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s .4s;
}
.je-otevrene .dum-okno__sklo img { opacity: .95; }
.je-dostupne .dum-okno__ram {
    box-shadow: 0 0 4.5cqw 1.2cqw rgba(255, 200, 100, .6), 0 0.6cqw 1cqw rgba(0, 0, 0, .45);
}
a.dum-okno__ram:hover {
    box-shadow: 0 0 6cqw 2cqw rgba(255, 215, 120, .8), 0 0.6cqw 1cqw rgba(0, 0, 0, .45);
}
/* příčle */
.dum-okno__pricle::before,
.dum-okno__pricle::after {
    content: '';
    position: absolute;
    z-index: 2;
    background: #efe3c8;
}
.dum-okno__pricle::before { left: 50%; top: 0; bottom: 0; width: 5cqw; transform: translateX(-50%); }
.dum-okno__pricle::after  { top: 44%; left: 0; right: 0; height: 5cqw; }

/* číslo — vždy dobře čitelné */
.dum-okno__cislo {
    position: absolute;
    z-index: 6;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    min-width: 52cqw;
    aspect-ratio: 1;
    padding: 0 4cqw;
    border-radius: 50%;
    border: 3cqw solid #c9a66b;
    background: #fbf3e0;
    color: #7e1c16;
    font-family: 'Source Serif 4', Georgia, serif;   /* stojaté písmo: 1 a 4 se nepletou */
    font-style: normal;
    font-weight: 700;
    font-variant-numeric: lining-nums;
    font-size: 30cqw;
    line-height: 1;
    text-align: center;
    box-shadow: 0 1.5cqw 3cqw rgba(0, 0, 0, .5);
}
.je-budouci .dum-okno__cislo { background: #ebe0c9; color: #4e3220; }

/* --- Okenice: budoucí zavřené, dostupné pootevřené, otevřené u zdi --- */
.dum-okno__kridlo {
    position: absolute;
    z-index: 4;
    top: 0;
    bottom: 0;
    width: 50%;
    background:
        repeating-linear-gradient(180deg, rgba(0,0,0,.22) 0 1.6cqw, transparent 1.6cqw 8cqw),
        linear-gradient(180deg, var(--k1), var(--k2));
    border: 1.5cqw solid rgba(0, 0, 0, .28);
    transition: transform 1.1s cubic-bezier(.3,.7,.3,1), filter 1.5s;
}
.dum-okno__kridlo--l { left: 0;  transform-origin: left center; }
.dum-okno__kridlo--p { right: 0; transform-origin: right center; }
.tvar-oblouk .dum-okno__kridlo--l { border-top-left-radius: 100% 60%; }
.tvar-oblouk .dum-okno__kridlo--p { border-top-right-radius: 100% 60%; }
.je-budouci .dum-okno__kridlo { filter: brightness(.7); }
/* otevřené okenice překlopené ke zdi — jen 2D zrcadlení, bez 3D (Safari
   na iPhonu s 3D otáčením okýnka náhodně nevykresloval) */
.je-dostupne .dum-okno__kridlo--l { transform: scaleX(-0.5); }
.je-dostupne .dum-okno__kridlo--p { transform: scaleX(-0.5); }
/* vyřezané srdíčko — u odemčených jím prosvítá světlo */
.kryt-srdicko .dum-okno__kridlo::after {
    content: '♥';
    position: absolute;
    top: 16%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 22cqw;
    line-height: 1;
    color: #24140a;
}
.kryt-srdicko.je-dostupne .dum-okno__kridlo::after {
    color: #ffd27a;
    text-shadow: 0 0 4cqw rgba(255, 200, 90, .9);
}

/* --- Záclonky --- */
.dum-okno__zaclonka {
    position: absolute;
    z-index: 1;
    top: 0;
    bottom: 0;
    width: 52%;
    background: repeating-linear-gradient(90deg, #fdfaf2 0 6cqw, #e3d9c4 6cqw 9cqw);
    transition: transform 1.1s cubic-bezier(.3,.7,.3,1), filter 1.5s;
}
.barva-cervena .dum-okno__zaclonka {
    background:
        repeating-linear-gradient(0deg,  rgba(255,255,255,.4) 0 3cqw, transparent 3cqw 9cqw),
        repeating-linear-gradient(90deg, rgba(255,255,255,.4) 0 3cqw, transparent 3cqw 9cqw),
        #b3302a;
}
.barva-zelena .dum-okno__zaclonka {
    background:
        repeating-linear-gradient(0deg,  rgba(255,255,255,.35) 0 3cqw, transparent 3cqw 9cqw),
        repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 3cqw, transparent 3cqw 9cqw),
        #3d7a34;
}
.dum-okno__zaclonka--l { left: 0;  transform-origin: left center; }
.dum-okno__zaclonka--p { right: 0; transform-origin: right center; }
.je-budouci .dum-okno__zaclonka { filter: brightness(.5); }
.je-dostupne .dum-okno__zaclonka { transform: scaleX(.3); }

/* --- Zamrzlé sklo --- */
.dum-okno__mraz {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 25% 28%, rgba(255,255,255,.9) 0 7%, transparent 8%),
        radial-gradient(circle at 72% 66%, rgba(255,255,255,.75) 0 6%, transparent 7%),
        radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(205,224,243,.92) 60%, rgba(160,192,225,.95));
    transition: opacity 1.4s ease, filter 1.5s;
}
.je-budouci .dum-okno__mraz { filter: brightness(.55); }
.je-dostupne .dum-okno__mraz { opacity: 0; }

/* --- Úvodní okno ve štítu (29. 11.) s věncem --- */
.tvar-uvodni {
    position: absolute;
    left: 50%;
    top: 66%;
    transform: translate(-50%, -50%);
    width: 19cqw;
    padding: 0;
}
@container scena (min-width: 700px) { .tvar-uvodni { width: 12cqw; } }
.tvar-uvodni .dum-okno__ram {
    width: 100%;
    border-width: 0.9cqw;
    border-radius: 50% 50% 0 0 / 34% 34% 0 0;
}
.tvar-uvodni .dum-okno__kridlo--l { border-top-left-radius: 100% 66%; }
.tvar-uvodni .dum-okno__kridlo--p { border-top-right-radius: 100% 66%; }
.tvar-uvodni .dum-okno__ram::after {        /* věnec kolem okna */
    content: '';
    position: absolute;
    z-index: 7;
    inset: -12% -14% -8%;
    border-radius: 50% 50% 14% 14% / 38% 38% 10% 10%;
    border: 7cqw dotted #2f6b2c;
    box-shadow: inset 0 0 0 3cqw #24502a, 0 0 0 2cqw #24502a;
    pointer-events: none;
}
.tvar-uvodni .dum-okno__cislo { font-size: 19cqw; min-width: 56cqw; line-height: 0.95; }

/* --- Dveře = Štědrý den --- */
.tvar-dvere { padding: 0; }
.tvar-dvere .dum-okno__ram {
    width: 22cqw;
    aspect-ratio: 3 / 5;
    border: 1.2cqw solid #3f2410;
    border-bottom: 0;
    border-radius: 50% 50% 0 0 / 24% 24% 0 0;
    background: #3f2410;
}
@container scena (min-width: 700px) {
    .tvar-dvere .dum-okno__ram { width: 12cqw; border-width: 0.8cqw; }
}
.dum-okno__dvere {
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: inherit;
    background:
        repeating-linear-gradient(90deg, transparent 0 18cqw, rgba(0,0,0,.35) 18cqw 20cqw),
        linear-gradient(180deg, #7a4a26, #57321a);
    transform-origin: left center;
    transition: transform 1.3s cubic-bezier(.3,.7,.3,1), filter 1.5s;
}
.dum-okno__dvere::after {                   /* klika */
    content: '';
    position: absolute;
    right: 9%;
    top: 58%;
    width: 8cqw;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #e0b553;
}
.dum-okno__venec {
    position: absolute;
    left: 50%;
    top: 34%;
    width: 62cqw;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 10cqw dotted #2f6b2c;
    box-shadow: inset 0 0 0 4cqw #24502a, 0 0 0 3cqw #24502a;
}
.dum-okno__venec::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -16cqw;
    width: 24cqw;
    height: 13cqw;
    transform: translateX(-50%);
    background: #b3261e;
    clip-path: polygon(0 0, 50% 45%, 100% 0, 100% 100%, 50% 55%, 0 100%);
}
.je-budouci .dum-okno__dvere { filter: brightness(.75); }
.je-dostupne .dum-okno__dvere { transform: scaleX(0.14); }
.kryt-dvere .dum-okno__cislo { top: 34%; min-width: 40cqw; font-size: 24cqw; border-width: 2cqw; }

/* --- Ovládání, dnešní okýnko, „Nové“ --- */
a.dum-okno__ram { cursor: pointer; }
a.dum-okno__ram:hover { transform: translateY(-0.4cqw); }
a.dum-okno__ram:focus-visible {
    outline: 3px solid #ffe08a;
    outline-offset: 4px;
}
.je-dnesni .dum-okno__ram { animation: dum-zare 3.4s ease-in-out infinite; }
.je-dnesni .dum-okno__sklo { animation: dum-rozsvit 2.5s ease-out both; }
.je-dnesni .dum-okno__kridlo--l { animation: dum-kridlo-l 1.6s .5s cubic-bezier(.3,.7,.3,1) both; }
.je-dnesni .dum-okno__kridlo--p { animation: dum-kridlo-p 1.6s .5s cubic-bezier(.3,.7,.3,1) both; }
.je-dnesni .dum-okno__zaclonka  { animation: dum-zaclonka 1.6s .5s cubic-bezier(.3,.7,.3,1) both; }
.je-dnesni .dum-okno__mraz      { animation: dum-mraz 2s .5s ease both; }
.je-dnesni .dum-okno__dvere     { animation: dum-dvere 1.8s .5s cubic-bezier(.3,.7,.3,1) both; }
@keyframes dum-kridlo-l { from { transform: none; } to { transform: scaleX(-0.5); } }
@keyframes dum-kridlo-p { from { transform: none; } to { transform: scaleX(-0.5); } }
@keyframes dum-zaclonka { from { transform: none; } to { transform: scaleX(.3); } }
@keyframes dum-mraz     { from { opacity: 1; } to { opacity: 0; } }
@keyframes dum-dvere    { from { transform: none; } to { transform: scaleX(0.14); } }
@keyframes dum-zare {
    0%, 100% { box-shadow: 0 0 3cqw 0.6cqw rgba(255, 196, 90, .45), 0 0.6cqw 1cqw rgba(0,0,0,.45); }
    50%      { box-shadow: 0 0 5.5cqw 1.6cqw rgba(255, 210, 110, .75), 0 0.6cqw 1cqw rgba(0,0,0,.45); }
}
@keyframes dum-rozsvit {
    from { filter: brightness(.25); }
    to   { filter: none; }
}
.dum-okno__nove {
    position: absolute;
    z-index: 8;
    top: -16%;
    right: -34%;
    padding: 2cqw 7cqw;
    border-radius: 999px;
    background: #b3261e;
    color: #fff;
    font-family: 'Source Sans 3', system-ui, sans-serif;
    font-size: max(10px, 15cqw);
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    box-shadow: 0 1cqw 2cqw rgba(0, 0, 0, .45);
}
.je-otevrene .dum-okno__nove { display: none; }

@media (prefers-reduced-motion: reduce) {
    .advent-scena__hvezdy, .advent-scena__snih, .dum__kour, .dum__svetylka i.sviti,
    .svetlo-stedry .dum__hvezda, .je-dnesni .dum-okno__ram, .je-dnesni .dum-okno__sklo,
    .je-dnesni .dum-okno__kridlo--l, .je-dnesni .dum-okno__kridlo--p, .je-dnesni .dum-okno__zaclonka,
    .je-dnesni .dum-okno__mraz, .je-dnesni .dum-okno__dvere {
        animation: none;
    }
    .advent-scena__snih { display: none; }
    .dum-okno__kridlo, .dum-okno__zaclonka, .dum-okno__mraz, .dum-okno__dvere,
    .dum-okno__cislo, .dum-okno__sklo, .dum-okno__sklo img, .dum-okno__ram { transition: none; }
    .advent-dialog[open] { animation: none; }
}

/* =================================================================
   LÍSTEČEK S PŘÍBĚHEM — stránka z pohádkové knihy
   ================================================================= */
.advent-listek {
    position: relative;
    color: #3b2a1a;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: clamp(1.1rem, 2.8vw, 1.22rem);
    line-height: 1.6;
    padding: clamp(2.6rem, 7vw, 3.4rem) clamp(1.1rem, 5vw, 2.8rem) clamp(1.4rem, 4vw, 2rem);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .12 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(150, 100, 40, .28) 100%),
        #f7ecd3;
    box-shadow: inset 0 0 0 6px #f7ecd3, inset 0 0 0 7px #cfae73;
}
.advent-listek--stranka {
    position: relative;
    z-index: 5;
    width: calc(100% - 1.5rem);
    max-width: 720px;
    margin: 0 auto clamp(2rem, 5vw, 3rem);
    box-shadow: inset 0 0 0 6px #f7ecd3, inset 0 0 0 7px #cfae73, 0 14px 40px rgba(0, 0, 0, .5);
}
.advent-listek__vetev {
    position: absolute;
    top: -0.5rem;
    width: clamp(80px, 26%, 190px);
    aspect-ratio: 220 / 140;
    background: url('/assets/img/advent/vetvicka.svg') no-repeat center / contain;
    pointer-events: none;
}
.advent-listek__vetev--l { left: -0.3rem; }
.advent-listek__vetev--p { right: -0.3rem; transform: scaleX(-1); }
.advent-listek__stuha {
    text-align: center;
    filter: drop-shadow(0 2px 2px rgba(80, 30, 10, .35));
}
.advent-listek__stuha span {
    display: inline-block;
    padding: 0.3em 1.7em 0.35em;
    background: linear-gradient(180deg, #b8312a, #851a15);
    color: #fbeed5;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    clip-path: polygon(0 0, 100% 0, calc(100% - 0.7em) 50%, 100% 100%, 0 100%, 0.7em 50%);
}
.advent-listek__nadpis {
    text-align: center;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 800;
    color: #2f5d2a;
    font-size: clamp(2rem, 7vw, 3rem);
    line-height: 1.05;
    margin: 0.35em 0 0;
}
.advent-srdicko {
    display: block;
    width: 150px;
    height: 20px;
    margin: 0.4rem auto 1.2rem;
    color: #9e1f1a;
}
.advent-listek__telo { display: flow-root; }
.advent-listek__obrazek {
    width: 100%;
    margin: 0 0 1rem;
    border-radius: 4px;
    box-shadow: 0 4px 14px rgba(70, 40, 10, .3);
}
@media (min-width: 600px) {
    .advent-listek__obrazek {
        float: right;
        width: 46%;
        margin: 0.3rem 0 0.8rem 1.3rem;
    }
}
.advent-listek__pribeh p { margin: 0 0 0.7em; }
.advent-listek__pribeh p + p { text-indent: 1.2em; }
.advent-listek__pribeh > p:first-child::first-letter {
    float: left;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 800;
    font-size: 3.5em;
    line-height: 0.8;
    color: #9e1f1a;
    margin: 0.08em 0.12em 0 0;
}
.advent-listek__pribeh a { color: #9e1f1a; text-decoration: underline; }
.advent-listek__motto {
    clear: both;
    max-width: 34rem;
    margin: 1.6rem auto 1.3rem;
    text-align: center;
    filter: drop-shadow(0 2px 3px rgba(80, 50, 20, .35));
}
.advent-listek__motto span {
    display: block;
    padding: 0.85em 2.4em;
    background: linear-gradient(180deg, #faefd6, #ead3a4);
    color: #9e1f1a;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.15rem, 3.4vw, 1.45rem);
    line-height: 1.3;
    clip-path: polygon(0 12%, 5% 0, 95% 0, 100% 12%, 96.5% 50%, 100% 88%, 95% 100%, 5% 100%, 0 88%, 3.5% 50%);
}
.advent-listek__zdroj {
    clear: both;
    margin: -0.4rem 0 1.2rem;
    text-align: center;
    font-size: 0.92em;
    opacity: .85;
}
.advent-listek__napoveda {
    clear: both;
    position: relative;
    margin: 1.3rem 0;
    padding: 1rem 1.1rem 1rem 3.5rem;
    background: rgba(255, 251, 238, .75);
    border: 1.5px dashed #b98d4e;
    border-radius: 8px;
}
.advent-listek__napoveda::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 1.8rem;
    height: 2.4rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 32'%3E%3Cpath d='M12 0v4' stroke='%235b3a1e' stroke-width='1.6'/%3E%3Cpath d='M7 5h10l-1.5 3.5h-7z' fill='%233b2a1a'/%3E%3Crect x='7' y='8.5' width='10' height='15' rx='1.5' fill='%23ffcf6e' stroke='%233b2a1a' stroke-width='1.6'/%3E%3Cpath d='M12 12.5c-1.8 2.2-1.8 4.3 0 6.5c1.8-2.2 1.8-4.3 0-6.5z' fill='%23e8742e'/%3E%3Cpath d='M6 23.5h12l1 3.5H5z' fill='%233b2a1a'/%3E%3C/svg%3E") no-repeat center / contain;
}
.advent-listek__napoveda h3 {
    margin: 0 0 0.25rem;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.25rem;
    color: #2f5d2a;
}
.advent-listek__napoveda p { margin: 0; }
.advent-listek__zaver {
    clear: both;
    text-align: center;
    margin: 1.4rem 0 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.1rem, 3vw, 1.3rem);
    color: #2f5d2a;
}
.advent-listek__zaver + .advent-srdicko { margin: 0.3rem auto 0; }
.advent-listek__zpet { text-align: center; margin: 1.2rem 0 0; }
.advent-listek__zpet a { color: #9e1f1a; }

/* --- Dialog --- */
.advent-dialog {
    width: min(720px, calc(100vw - 1rem));
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    padding: 0;
    border: none;
    background: transparent;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.advent-dialog[open] { animation: advent-listek-in .45s ease-out; }
@keyframes advent-listek-in {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.advent-dialog::backdrop { background: rgba(6, 16, 36, .82); }
.advent-dialog__zavrit {
    position: sticky;
    top: 0.5rem;
    z-index: 5;
    display: block;
    margin: 0.5rem 0.5rem -2.9rem auto;
    width: 2.75rem;
    height: 2.75rem;
    border: 2px solid #f7ecd3;
    border-radius: 50%;
    background: #9e1f1a;
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.advent-dialog__zavrit:hover { background: #7e1c16; }
.advent-dialog__zavrit:focus-visible { outline: 3px solid #ffe08a; outline-offset: 2px; }
body.advent-dialog-otevreny { overflow: hidden; }
