/* Grand Castella — trang trí mùa Giáng sinh.
   Chỉ nạp khi tools/config.py có GIANG_SINH. Mọi thứ hiện dưới html.gs: quá ngày
   "den", đoạn kiểm ngày trong <head> bỏ lớp gs là trang trở lại như cũ.
   Hoạt ảnh chỉ đổi transform/opacity; hoạt ảnh vô hạn tạm dừng khi ra khỏi màn hình
   (motion.js gắn data-nghi) và tắt hẳn khi máy bật giảm chuyển động. */

html:not(.gs) .gs-phu, html:not(.gs) .gs-den, html:not(.gs) .gs-mu, html:not(.gs) .gs-nhac,
html:not(.gs) .gs-the, html:not(.gs) .gs-chau, html:not(.gs) .gs-keo,
html:not(.gs) #giang-sinh { display: none !important; }
/* ------------------------------------------------ thanh menu: tuyết phủ mép trên */
.gs-phu {
  position: absolute; left: 20px; right: 20px; top: -6px; height: 12px; z-index: 1;
  pointer-events: none; border-radius: 7px 7px 0 0;
  background:
    radial-gradient(circle at 50% 0, #fff 0 5.5px, rgba(255,255,255,0) 6.2px) 0 3px / 23px 10px repeat-x,
    radial-gradient(circle at 50% 0, #fff 0 3.6px, rgba(255,255,255,0) 4.3px) 9px 4px / 31px 8px repeat-x,
    linear-gradient(#fff, #fff) 0 0 / 100% 5px no-repeat;
  -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
          mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  filter: drop-shadow(0 1px 1px rgba(74,55,40,.22));
}
/* ------------------------------------------------ dây đèn treo mép dưới */
.gs-den {
  position: absolute; left: 30px; right: 30px; bottom: -13px; height: 17px; z-index: 1;
  display: flex; overflow: hidden; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='17'%3E%3Cpath d='M0 1.5Q20 10 40 1.5' fill='none' stroke='%234A3728' stroke-opacity='.5' stroke-width='1.2'/%3E%3C/svg%3E") 0 0 / 40px 17px repeat-x;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
          mask: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.gs-den i { position: relative; flex: 0 0 40px; --b: #E0262D; --t: 0s; }
.gs-den i::after {             /* đui đèn */
  content: ""; position: absolute; left: 50%; top: 4px; width: 4px; height: 3px; margin-left: -2px;
  border-radius: 1px; background: #6B5545;
}
.gs-den i::before {            /* bóng đèn */
  content: ""; position: absolute; left: 50%; top: 6px; width: 7px; height: 10px; margin-left: -3.5px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--b); box-shadow: 0 0 7px 1px var(--b);
  animation: gs-nhay 2.6s ease-in-out var(--t) infinite;
}
.gs-den i:nth-child(4n+2) { --b: #F4C04E; --t: -.65s; }
.gs-den i:nth-child(4n+3) { --b: #2FA36B; --t: -1.3s; }
.gs-den i:nth-child(4n+4) { --b: #5BB8F0; --t: -1.95s; }
@keyframes gs-nhay { 0%, 100% { opacity: 1; } 50% { opacity: .28; } }
#site-header.is-hidden .gs-den i::before { animation-play-state: paused; }
@media (max-width: 640px) { .gs-den i:nth-child(n+11) { display: none; } }
/* ------------------------------------------------ mũ Noel trên logo */
.gs-mu {
  position: absolute; left: -9px; top: -11px; width: 24px; height: auto;
  transform: rotate(-20deg); pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(74,55,40,.25));
}
@media (min-width: 640px) { .gs-mu { width: 29px; left: -11px; top: -13px; } }
/* ------------------------------------------------ nút nhạc trên thanh menu */
.gs-nhac {
  position: relative; display: grid; place-items: center; flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 999px; color: #A00B0F;
  background: rgba(255,255,255,.78); box-shadow: inset 0 0 0 1.5px rgba(221,160,68,.75);
  transition: background-color .3s, color .3s;
}
.gs-nhac:hover { background: #FBF2E0; }
.gs-nhac:focus-visible { outline: 2px solid #A00B0F; outline-offset: 2px; }
.gs-nhac-not { width: 19px; height: 19px; }
.gs-song { display: none; align-items: flex-end; gap: 2.5px; height: 15px; }
.gs-song i { width: 3px; height: 15px; border-radius: 2px; background: currentColor; transform-origin: 50% 100%;
             animation: gs-song .8s ease-in-out infinite alternate; }
.gs-song i:nth-child(2) { animation-delay: -.27s; }
.gs-song i:nth-child(3) { animation-delay: -.54s; }
@keyframes gs-song { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.gs-nhac[aria-pressed="true"] { background: #A00B0F; color: #fff; box-shadow: 0 8px 18px -8px rgba(160,11,15,.8); }
.gs-nhac[aria-pressed="true"] .gs-nhac-not { display: none; }
.gs-nhac[aria-pressed="true"] .gs-song { display: flex; }
.gs-nhac::after {              /* vòng mời bấm: lan ra vài lần lúc mới vào trang rồi thôi */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(221,160,68,.9); opacity: 0;
  animation: gs-moi 1.8s ease-out 1.2s 3;
}
.gs-nhac.gs-cho::after { animation: gs-moi 1.8s ease-out 0s 6; }
.gs-nhac[aria-pressed="true"]::after { animation: none; }
@keyframes gs-moi { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
/* ------------------------------------------------ thẻ Giáng sinh trong bảng menu */
.gs-the {
  margin-top: 1rem; border-radius: 1.5rem; padding: 1.1rem 1.15rem; color: #fff;
  background: linear-gradient(135deg, rgba(181,18,26,.62), rgba(94,7,9,.62));
  border: 1px solid rgba(236,180,95,.38);
}
.gs-the-link { display: flex; align-items: center; gap: .9rem; color: #fff; }
.gs-the-link:hover { color: #F0CE90; }
.gs-the-mu { width: 44px; flex: 0 0 44px; height: auto; transform: rotate(-12deg); }
.gs-cong-tac { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.gs-cong-tac button {
  display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; padding: 0 .45rem 0 1rem;
  border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; font-size: 13.5px;
  transition: background-color .3s;
}
.gs-cong-tac button:hover { background: rgba(255,255,255,.2); }
.gs-cong-tac button:focus-visible { outline: 2px solid #F0CE90; outline-offset: 2px; }
.gs-cong-nut { position: relative; width: 40px; height: 24px; border-radius: 999px;
               background: rgba(255,255,255,.28); transition: background-color .3s; }
.gs-cong-nut::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
                      border-radius: 50%; background: #fff; transition: transform .35s cubic-bezier(.16,1,.3,1); }
[aria-checked="true"] > .gs-cong-nut { background: #23845A; }
[aria-checked="true"] > .gs-cong-nut::after { transform: translateX(16px); }
@keyframes gs-roi {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(var(--dx), 55vh, 0); }
  100% { transform: translate3d(0, calc(100vh + 56px), 0); }
}
@keyframes gs-roi-xoay {
  0%   { transform: translate3d(0, 0, 0) rotate(0); }
  50%  { transform: translate3d(var(--dx), 55vh, 0) rotate(calc(var(--r) / 2)); }
  100% { transform: translate3d(0, calc(100vh + 56px), 0) rotate(var(--r)); }
}
/* ------------------------------------------------ trang chủ: nhãn mời + quả châu */
.gs-keo {
  display: inline-flex; align-items: center; gap: .45rem; margin: .6rem .35rem 0; min-height: 40px;
  padding: .3rem 1rem .3rem .55rem; border-radius: 999px; font-size: 13px;
  color: #fff; background: linear-gradient(135deg, #B5121A, #8A0A0D);
  box-shadow: 0 10px 22px -12px rgba(138,10,13,.85);
  transition: transform .4s cubic-bezier(.16,1,.3,1);
}
.gs-keo:hover { transform: translateY(-2px); }
.gs-cay { width: 22px; height: 22px; flex: 0 0 auto; }
.gs-chau { position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 3; pointer-events: none; }
.gs-chau span {
  position: absolute; left: var(--l); top: -18px; width: 1.5px; height: var(--h);
  background: linear-gradient(rgba(74,55,40,0), rgba(74,55,40,.5));
  transform-origin: 50% 0; animation: gs-dua 3.8s ease-in-out var(--t) infinite alternate;
}
.gs-chau i {
  position: absolute; left: 50%; top: 100%; width: 26px; height: 26px; margin: 3px 0 0 -13px;
  border-radius: 50%; background-color: var(--c);
  background-image: radial-gradient(circle at 34% 30%, rgba(255,255,255,.95) 0 2.5px, rgba(255,255,255,.35) 5px, rgba(255,255,255,0) 11px);
  box-shadow: inset -4px -5px 8px rgba(0,0,0,.22), 0 8px 12px -8px rgba(74,55,40,.7);
}
.gs-chau i.to { width: 34px; height: 34px; margin-left: -17px; }
.gs-chau i::before {           /* móc treo */
  content: ""; position: absolute; left: 50%; top: -4px; width: 9px; height: 6px; margin-left: -4.5px;
  border-radius: 2px; background: linear-gradient(#F0CE90, #BC8434);
}
@keyframes gs-dua { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
/* ------------------------------------------------ trang chủ: khối "Bánh Giáng sinh" */
.gs-khoi {
  position: relative; overflow: clip; border-radius: 1.75rem; padding: 1.6rem 1.05rem .9rem; color: #fff;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.2) 0 1.6px, rgba(255,255,255,0) 2.4px) 0 0 / 44px 44px,
    radial-gradient(circle at 70% 75%, rgba(255,255,255,.14) 0 1.2px, rgba(255,255,255,0) 2px) 0 0 / 31px 31px,
    linear-gradient(135deg, #B5121A 0%, #8A0A0D 55%, #5E0709 100%);
  box-shadow: 0 30px 60px -38px rgba(107,8,10,.85);
}
@media (min-width: 640px) { .gs-khoi { padding: 2rem 1.75rem 1.1rem; } }
.gs-den-khoi { top: 0; bottom: auto; left: 26px; right: 26px; }
/* Điện thoại XẾP DỌC, máy tính mới thành hàng ngang.
   Bản cũ để flex hàng ngang ngay từ 375px: cột chữ có flex-1 + min-w-0 nên
   KHÔNG BAO GIỜ xuống dòng, chỉ bị bóp còn ~60% bề ngang — badge vỡ ba dòng,
   đoạn mô tả ngắt giữa số điện thoại, nút dính lệch bên phải. */
.gs-khoi-dau { display: grid; gap: 1rem; justify-items: start; }
.gs-khoi-dau > .gs-xem { justify-self: start; }
@media (min-width: 640px) {
  .gs-khoi-dau { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1.25rem; }
}
.gs-nhan {
  display: inline-flex; align-items: center; gap: .4rem; line-height: 1.4; padding: .3rem .85rem .3rem .45rem;
  border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12.5px; color: #FCEBC9;
}
.gs-tieu-de { margin-top: .65rem; font-size: clamp(1.45rem, 4.8vw, 2.05rem); line-height: 1.22; color: #fff; }
.gs-mo-ta { margin-top: .45rem; max-width: 38rem; font-size: 13.5px; line-height: 1.65; color: rgba(255,255,255,.86); }
.gs-xem {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1.3rem; border-radius: 999px;
  background: #ECB45F; color: #4A3728; font-size: 13.5px; transition: background-color .3s;
}
.gs-xem:hover { background: #F6E1B9; }
.gs-ray { margin-top: 1.1rem; scrollbar-color: rgba(255,255,255,.45) transparent; }
.gs-ray .kem-the { box-shadow: 0 14px 30px -18px rgba(0,0,0,.6); }
  .gs-den i::before, .gs-chau span, .gs-song i, .gs-nhac::after { animation: none !important; }
  .gs-nhac::after { opacity: 0; }
}
