/* ==========================================================================
   Advent Calendar 2026 – Calendar stylesheet
   Ticket     : DBUSF-1335
   Asset type : Code Resource (CSS)  ->  ID in @calendarCssPageId of the calendar page
   Used by    : Advent26_Calendar_CloudPage

   Based 1:1 on the approved design (advent-calendar-26/style.css).
   Changes compared to the design file (layout / sizes / colours untouched):
     1. Background images are CSS variables (--img-bg-desktop / --img-bg-mobile).
        The Cloud Page sets them from its configuration block, so the asset
        URLs are maintained in one place only.
     2. Hotspot tooltip text comes from data-label (translated) instead of the
        fixed English "Day ".
     3. Added styles for the door popup content (prize image, message, event
        form iframe) and the Retailer Search popup.
   ========================================================================== */

:root{--bg:#d9cfc5;--ink:#2a2622;--gold:#c9a45c;--k:#1b1b1d;--g:#9a9893;--w:#f1f0ed;--au:#c4a67f;
--serif:"Cormorant Garamond",Georgia,serif;--sans:"Jost","Segoe UI",system-ui,sans-serif;
--tex:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  /* background images – overwritten inline by the Cloud Page (@asset*Background) */
  --img-bg-desktop:none;
  --img-bg-mobile:none;

  /* real visible height (dvh = correct on mobile browsers) */
  --vh:100vh;
  --safe-t:env(safe-area-inset-top,0px);
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-l:env(safe-area-inset-left,0px);
  --safe-r:env(safe-area-inset-right,0px);

  /* logo bar sizing – change these and the scene re-fits automatically */
  --cell:60px;        /* height of one logo box */
  --lm:20px;          /* space above the logo bar */
  --gap:12px;         /* space between logo bar and scene */
  --logos-h:calc(var(--cell) + var(--lm));
  --stage-max:1500px;  /* max scene width in landscape; raised on big screens below */

  /* popup content (added for the Cloud Page) */
  --error:#b3261e;
  --form-frame-min-h:420px;
}
@supports (height:100dvh){:root{--vh:100dvh}}

*{box-sizing:border-box}
[hidden]{display:none!important}
html{height:100%;overflow:hidden;scroll-padding-top:var(--safe-t)}
body{
  margin:0;height:var(--vh);overflow:hidden;
  padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
  background-color:var(--bg);color:var(--ink);font-family:var(--sans);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
}
/* page background (landscape image by default, swapped in portrait) */
body::before{
  content:"";position:fixed;left:0;top:0;width:100%;height:var(--vh);z-index:-1;pointer-events:none;
  background:var(--img-bg-desktop) center/cover no-repeat;
}
/* page heading is for screen readers only */
h1{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* =========================================================
   LOGOS  (shared look, placement differs per orientation)
   ========================================================= */
.logos{
  display:grid;grid-template-columns:repeat(4,1fr);gap:14px;align-items:center;
  width:min(94%,900px);
  margin-top:var(--lm);
  flex:none;
  position:relative;z-index:6;   /* always above the scene */
}
.logos>div{
  height:var(--cell);width:100%;
  display:flex;align-items:center;justify-content:center;
}
.logos img{display:block;width:100%;max-width:130px;height:66%;object-fit:contain;object-position:center}
/* v2: logos link to the brand websites */
.logos a{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transition:opacity .2s}
.logos a:hover{opacity:.75}
.logos a:focus-visible{outline:2px solid var(--gold);outline-offset:2px}

/* =========================================================
   SCENE (shared)
   ========================================================= */
.stage{position:relative;flex:none;line-height:0}
.art{position:absolute}
.art>img{width:100%;height:100%;display:block;user-select:none;-webkit-user-drag:none}

/* door hotspots */
.hot{all:unset;box-sizing:border-box;position:absolute;cursor:pointer;border-radius:2px;transition:background .25s,box-shadow .25s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.hot:hover,.hot:focus-visible{z-index:2000!important;background:rgba(255,255,255,.14);box-shadow:0 0 28px 6px rgba(255,236,190,.55)}
.hot:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.hot:active{z-index:2000!important;background:rgba(255,255,255,.22);box-shadow:inset 0 0 0 2px rgba(201,164,92,.95),0 0 28px 6px rgba(255,236,190,.55)}
/* v2 (Jasmin 24/11): no "Day <n>" tooltip on the boxes any more */
.hot::after{content:none!important;display:none!important}
/* check mark on doors that were opened in this visit */
.hot.done::before{content:"\2713";position:absolute;top:6%;right:6%;width:clamp(14px,1.8vw,22px);aspect-ratio:1;border-radius:50%;background:var(--gold);color:#fff;font:600 clamp(9px,1.1vw,13px)/clamp(14px,1.8vw,22px) var(--sans);text-align:center}
/* box colours = brand: k = evil eye, g = NEUBAU, w = Silhouette, au = House of Silhouette / grand prize */
.k{--c:var(--k);--n:#c9a45c}.g{--c:var(--g);--n:#4a4742}.w{--c:var(--w);--n:#7b756c}.au{--c:var(--au);--n:#6b563a}

/* =========================================================
   LANDSCAPE
   logos sit in normal flow at the top, scene gets what is left
   ========================================================= */
.stage-p{display:none}

@media (orientation:landscape){
  .stage-p{display:none}
  .stage-d{
    display:block;
    aspect-ratio:1672/941;
    /* scene size is unchanged: smallest of full width, --stage-max, or the width whose height fits under the logos */
    --sw:min(100%,var(--stage-max),calc((var(--vh) - var(--safe-t) - var(--safe-b) - var(--logos-h) - var(--gap)) * 1672 / 941));
    width:var(--sw);
    /* only MOVES the scene up under the logos (box size/ratio untouched) */
    margin-top:calc(var(--sw) * -.0813 + var(--gap));
    margin-bottom:calc(var(--sw) * -.0305);
  }
  body::before{background:var(--img-bg-desktop) center/cover no-repeat}
}

/* short landscape screens (phones turned sideways, small laptops) */
@media (orientation:landscape) and (max-height:760px){
  :root{--cell:48px;--lm:10px;--gap:8px}
  .logos{gap:10px}
}
@media (orientation:landscape) and (max-height:560px){
  :root{--cell:36px;--lm:6px;--gap:4px}
  .logos{gap:8px;width:min(80%,500px)}
}
@media (orientation:landscape) and (max-height:420px){
  :root{--cell:28px;--lm:4px;--gap:2px}
  .logos{gap:6px;width:min(70%,500px)}
  .logos>div{border-radius:6px}
}

@media (max-width:1440px){
  .logos{gap:30px;max-width:500px}
}

/* =========================================================
   PORTRAIT (phones + iPad portrait)
   logos float at the top, scene is centred and sized by width
   ========================================================= */
@media (orientation:portrait){
  .stage-d{display:none}
  :root{--cell:44px;--lm:12px;--gap:8px;--logos-h:112px}   /* 2 rows of logos + top gap */

  body::before{background:var(--img-bg-mobile) center bottom/cover no-repeat}

  .logos{
    width:min(94%,720px);
    grid-template-columns:repeat(2,1fr);gap:8px;      /* 2 x 2 on phones, sits in flow right above the boxes */
  }
  .logos>div{background:none;padding:5px}   /* v2 (Jasmin 24/11): no white background behind the logos */

  /* v2 (Jasmin 24/11): bigger doors + less empty space at the bottom
     --psw = width of the scene:
       - up to 104% of the screen (the doors only use 95.6% of the box image width, so no door is cut)
       - on short screens: as big as the height allows (visible boxes = .9882 x scene width) */
  :root{
    --psw:min(104vw,calc((var(--vh) - var(--safe-t) - var(--safe-b) - var(--logos-h) - var(--gap)) / .9882));
  }
  /* v4 (Jasmin 25/11): logos + calendar together in the middle of the screen (no extra shift) */
  .logos{position:relative;top:0}
  .stage-p{
    display:block;flex:none;position:relative;line-height:0;
    aspect-ratio:941/1672;
    --sw:var(--psw);
    width:var(--sw);
    top:0;
    left:calc(var(--sw) * -.0096);   /* doors are a bit right of the image centre: keeps envelope 16 fully visible */
    /* remove the empty strip above/below the boxes so the logos sit right on top of them */
    margin-top:calc(var(--sw) * -.4411 + var(--gap));
    margin-bottom:calc(var(--sw) * -.3475);
  }
}
/* tablets / large portrait: 4 logos in one row (iPad: unchanged, approved) */
@media (orientation:portrait) and (min-width:600px){
  :root{--cell:56px;--logos-h:84px}
  .logos{grid-template-columns:repeat(4,1fr);gap:14px}
}
/* v4 (Jasmin 25/11): phones = all 4 logos in ONE line, like the desktop version */
@media (orientation:portrait){
  :root{--cell:40px;--lm:12px;--logos-h:52px}   /* one row of logos + top gap */
  .logos{grid-template-columns:repeat(4,1fr);gap:12px;width:min(92%,720px)}
  .logos img{max-width:100%;height:70%}
}
/* v8 (Jasmin 25/11): phones only = calendar stays where it is (middle), only the logo row moves up:
   the logos end just above the flame of the left candle of the background.
   On phones the background is scaled to the screen height, so that flame is at ~16% of the screen height
   -> logo row bottom at 14.5% (--logo-bottom). Smaller number = logos higher.
   --logo-natural-top = where the logos would be without moving (centred logos + calendar). */
@media (orientation:portrait) and (max-width:599px){
  :root{
    --logo-bottom:.145;
    --logo-natural-top:calc(var(--safe-t) + (var(--vh) - var(--safe-t) - var(--safe-b) - var(--lm) - var(--cell) - var(--gap) - var(--psw) * .9882) / 2 + var(--lm));
    --logo-target-top:max(calc(var(--safe-t) + 10px), calc(var(--vh) * var(--logo-bottom) - var(--cell)));
  }
  .logos{top:min(0px, calc(var(--logo-target-top) - var(--logo-natural-top)))}
}
@media (orientation:portrait) and (min-width:600px){
  :root{--cell:64px;--logos-h:92px}
  .logos{gap:24px;width:min(86%,760px)}
  .logos img{max-width:160px;height:62%}
}

/* =========================================================
   SNOW + DOOR POPUP (design)
   ========================================================= */
#snow{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:5}

.dialog{border:0;padding:0;border-radius:24px;width:min(92vw,520px);max-height:calc(var(--vh) * .92);overflow:auto;background:#f8f4ed;color:var(--ink);box-shadow:0 30px 80px rgba(30,20,10,.45)}
.dialog[open]{animation:pop .35s cubic-bezier(.2,.8,.2,1)}
.dialog::backdrop{background:rgba(25,18,12,.55);backdrop-filter:blur(4px)}
@keyframes pop{from{opacity:0;transform:translateY(18px) scale(.94)}}
.hd{height:150px;background:var(--c);color:var(--n);display:grid;place-items:center;position:relative}
.hd::before{content:"";position:absolute;inset:0;background:var(--tex);opacity:.3;mix-blend-mode:multiply}
.hd span{position:relative;font:600 84px/1 var(--serif);animation:rise .6s .1s both}
@keyframes rise{from{opacity:0;transform:translateY(14px)}}
.body{padding:clamp(20px,4vw,32px)}
.body h2{font:600 30px/1.1 var(--serif);margin:0 0 10px}
.body p{margin:0 0 24px;color:#5f574e;line-height:1.6}
.nav{display:flex;justify-content:space-between;gap:12px}
.btn{all:unset;cursor:pointer;padding:12px 22px;border-radius:999px;border:1px solid #cdbfae;font-weight:500;font-size:15px;transition:.2s}
.btn:hover{background:var(--ink);color:#fff;border-color:var(--ink)}
.btn:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.x{position:absolute;top:12px;right:12px;z-index:2;width:40px;height:40px;display:grid;place-items:center;padding:0;font-size:22px;background:rgba(255,255,255,.85);color:var(--ink);border:0}
@media(max-width:560px){.hd{height:120px}.hd span{font-size:68px}}
@media(max-height:480px){.hd{height:90px}.hd span{font-size:54px}.body{padding:16px}.body p{margin-bottom:14px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* =========================================================
   DOOR POPUP CONTENT (added for the Cloud Page)
   prize image + texts, "not available" message, event form iframe
   ========================================================= */
.dialog--with-form{width:min(94vw,760px)}                     /* more room when the form is shown */
.body .prize-headline{margin:0 0 14px;font-weight:500;color:var(--ink)}
.prize-image{display:block;width:100%;height:auto;margin:0 0 18px;border-radius:14px}
.body .prize-description{margin:0 0 20px}
.body .door-message{margin:0 0 24px;padding:14px 18px;border-radius:14px;background:#fff;border:1px solid #e3d8ca;color:var(--error);font-weight:500}
.event-form{margin:0 0 24px}
.event-form-frame{display:block;width:100%;min-height:var(--form-frame-min-h);border:0;background:transparent}

/* =========================================================
   RETAILER SEARCH POPUP (opened above the door popup)
   ========================================================= */
.retailer-dialog{border:0;padding:0;border-radius:24px;width:min(96vw,1100px);height:min(calc(var(--vh) * .9),900px);overflow:hidden;background:#fff;box-shadow:0 30px 80px rgba(30,20,10,.45)}
.retailer-dialog[open]{animation:pop .35s cubic-bezier(.2,.8,.2,1)}
.retailer-dialog::backdrop{background:rgba(25,18,12,.55);backdrop-filter:blur(4px)}
.retailer-dialog-frame{display:block;width:100%;height:100%;border:0}

/* =========================================================
   FULL-SCREEN BOXES on desktops (also when Windows/browser zoom shrinks the viewport)
   box image fills the full screen width; height limit uses the boxes only
   ========================================================= */
@media (orientation:landscape) and (min-width:1400px) and (min-height:700px){
  .stage-d{
    /* v2 (Jasmin 24/11): max 1672px = box image at its real size (1548px), so the doors are not blurry */
    --sw:min(108%,1672px,calc((var(--vh) - var(--safe-t) - var(--safe-b) - var(--logos-h) - var(--gap)) / .451));
    left:calc(var(--sw) * .0174);   /* centres the boxes (image has more empty space on the right) */
  }
}

/* =========================================================
   BIG SCREENS (landscape) – 2560x1440 and up
   ========================================================= */
@media (orientation:landscape) and (min-width:1920px) and (min-height:1000px){
  :root{--stage-max:2800px;--cell:84px;--lm:28px;--gap:16px}
  .logos{width:min(70%,1400px);gap:28px}
  .logos>div{border-radius:12px}
  .logos img{max-width:220px}
  .hot::after{font-size:20px;padding:10px 16px}
  .hot.done::before{width:30px;font-size:17px;line-height:30px}
  .dialog{width:min(40vw,720px);border-radius:32px}
  .dialog--with-form{width:min(50vw,960px)}
  .hd{height:200px}.hd span{font-size:112px}
  .body{padding:44px}
  .body h2{font-size:44px}
  .body p{font-size:21px}
  .btn{font-size:19px;padding:14px 28px}
}
/* 4K (3840x2160) */
@media (orientation:landscape) and (min-width:3000px) and (min-height:1800px){
  :root{--stage-max:4200px;--cell:120px;--lm:40px;--gap:24px}
  .logos{width:min(70%,2000px);gap:40px}
  .logos img{max-width:320px}
  .dialog{width:min(36vw,1000px)}
  .dialog--with-form{width:min(44vw,1200px)}
  .hd{height:280px}.hd span{font-size:160px}
  .body h2{font-size:62px}.body p{font-size:30px}
  .btn{font-size:27px;padding:20px 40px}
}