/* ==========================================================================
   Giao diện Giáng Sinh - chỉ được nạp khi SeasonalTheme.IsChristmas() = true.
   Mọi selector đều nằm dưới body.theme-noel hoặc [data-noel-root] nên khi hết
   mùa (server tắt, hoặc christmas.js tự gỡ) giao diện trở về như cũ.
   ========================================================================== */

:root {
  --noel-red: #d62828;
  --noel-red-deep: #a4161a;
  --noel-green: #1f7a4d;
  --noel-gold: #ffd166;
  --noel-header-h: 5rem;
}

@media (min-width: 1024px) {
  :root {
    --noel-header-h: 5.5rem;
  }
}

/* ---------- Logo có mũ ông già Noel (header / menu mobile / footer) ---------- */
img.noel-logo {
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.38));
  transform-origin: 50% 88%;
  animation: noel-sway 5s ease-in-out infinite;
}

.site-header img.noel-logo {
  width: 5.25rem;
  height: 5.25rem;
  margin: -0.125rem 0;
}

.mobile-drawer img.noel-logo {
  width: 4.5rem;
  height: 4.5rem;
}

@keyframes noel-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.8deg); }
}

/* Viền đỏ - xanh mảnh dưới header như dải ruy băng kẹo */
body.theme-noel .site-header {
  border-bottom: 0;
  box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.25);
}

body.theme-noel .site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: repeating-linear-gradient(
    -45deg,
    var(--noel-red) 0 10px,
    #ffffff 10px 20px,
    var(--noel-green) 20px 30px,
    #ffffff 30px 40px
  );
  pointer-events: none;
}

/* ---------- Tuyết ---------- */
.noel-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 55; /* trên header (50) để tuyết bám được lên nút/link, dưới menu mobile (60) */
  pointer-events: none;
}

/* ---------- Footer: tuyết phủ + lời chúc ---------- */

.noel-footer-greeting {
  margin: 0 auto 2.25rem;
  text-align: center;
  font-family: "Mountains of Christmas", "Be Vietnam Pro", cursive;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--noel-gold);
  text-shadow: 0 2px 14px rgba(214, 40, 40, 0.55);
}

.noel-footer-greeting span { color: #fff; }

/* ---------- Hai cây thông nhỏ ở hai bên ---------- */
.noel-tree {
  position: fixed;
  bottom: 0;
  z-index: 41;
  width: 96px;
  pointer-events: none;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.35));
}

.noel-tree svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* trái: nằm dưới nút "lên đầu trang"; phải: chừa chỗ cho cụm nút liên hệ nổi */
.noel-tree--left { left: 0.4rem; }
.noel-tree--right { right: 6rem; }

.noel-tree .l {
  animation: noel-tree-twinkle 2.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.31s - var(--d, 0s));
}

.noel-tree-star {
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 3px rgba(255, 209, 102, 0.95));
  animation: noel-tree-star 3s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes noel-tree-twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

@keyframes noel-tree-star {
  0%, 100% { opacity: 0.8; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 639px) {
  .noel-tree { display: none; }
}

/* ---------- Người dùng muốn giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  img.noel-logo,
  .noel-tree .l,
  .noel-tree-star { animation: none !important; }
  .noel-snow { display: none !important; }
}


/* ---------- Linh vật hổ: mũ Noel + chớp mắt ---------- */
.noel-mascot-overlay {
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

.noel-mascot-overlay .noel-lid {
    transform-box: fill-box;
    transform-origin: 50% 0;
    transform: scaleY(0.02);
    opacity: 0;
    animation: noel-blink 4.8s infinite;
}

.noel-mascot-overlay .noel-lid--r {
    animation-delay: 0.06s;
}

.noel-mascot-overlay .noel-hat {
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.35));
}

.noel-mascot-overlay .noel-pom {
    transform-box: fill-box;
    transform-origin: 20% 20%;
    animation: noel-pom-sway 3.6s ease-in-out infinite;
}

@keyframes noel-blink {
    0%, 90%, 100% { transform: scaleY(0.02); opacity: 0; }
    93%, 95.5% { transform: scaleY(1); opacity: 1; }
}

@keyframes noel-pom-sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(7deg); }
}

/* ---------- Ông già Noel đu dây leo lên ---------- */
.noel-climber {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 54;
    transition: opacity 0.4s ease;
}

.noel-climber__pivot {
    position: absolute;
    top: 0;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.noel-climber__rope {
    position: absolute;
    left: -2px;
    top: -4px;
    width: 4px;
    border-radius: 2px;
    background: repeating-linear-gradient(180deg, #e8d3a2 0 5px, #b08a4a 5px 9px);
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.35);
}

.noel-climber__santa {
    position: absolute;
    left: 0;
    top: 0;
    width: 78px;
    height: 120px;
    transform-origin: 74px 65px;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
    will-change: transform;
}

.noel-santa-bust {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}

.noel-santa-legs {
    position: absolute;
    left: 0;
    top: 72px;
    overflow: visible;
}

.noel-sleigh {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}

.noel-climber__santa svg {
    display: block;
    overflow: visible;
}

.noel-santa-eye {
    transform-box: fill-box;
    transform-origin: center;
    animation: noel-santa-blink 4.2s infinite;
}

.noel-santa-sack {
    transform-box: fill-box;
    transform-origin: 50% 0;
    animation: noel-pom-sway 2.4s ease-in-out infinite;
}

@keyframes noel-santa-blink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@media (max-width: 759px) {
    .noel-climber { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .noel-mascot-overlay .noel-lid,
    .noel-mascot-overlay .noel-pom,
    .noel-santa-eye,
    .noel-santa-sack { animation: none; }
}

.noel-deer {
    position: absolute;
    left: 0;
    top: 0;
    width: 190px;
    height: 173px;
    transform-origin: 0 0;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4));
    will-change: transform;
}

.noel-deer svg {
    display: block;
}

.noel-deer-nose {
    animation: noel-nose 1.6s ease-in-out infinite;
    filter: drop-shadow(0 0 4px #ff3b3b);
}

@keyframes noel-nose {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    .noel-deer-nose { animation: none; }
}

.noel-heading-santa {
    position: fixed;
    left: 0;
    top: 0;
    width: 68px;
    height: 100px;
    transform-origin: 34px 0;
    opacity: 0;
    pointer-events: none;
    z-index: 42;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
    will-change: transform, opacity;
}

.noel-heading-santa svg {
    display: block;
    overflow: visible;
}

@media (max-width: 759px) {
    .noel-heading-santa { display: none; }
}
