/* BánhKemBơ.com — mùa Giáng sinh. Chỉ nạp khi tools/config.py có GIANG_SINH.
   Mọi thứ nằm 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 tông Latte như cũ (không cần dựng lại).

   Tông màu: GHI ĐÈ BIẾN, không đổi tên lớp — các trang dựng sẵn không phải sửa HTML.
   Tương phản đã đo (WCAG): chữ kem / nút đỏ 7,43:1 · xanh thông / nền kem 7,38:1 ·
   xanh thông / nền latte Noel 6,82:1 · chữ kem / chân trang xanh thông 11,24:1 ·
   chữ trắng / khối đỏ 9,27:1 · chữ nâu / nút vàng 7,81:1.

   Chuyển động: chỉ transform/opacity. Tuyết là lớp con của từng khối (không phủ cả
   trang), giang-sinh.js gắn data-nghi khi khối ra khỏi màn hình hoặc tab bị ẩn →
   hoạt ảnh tạm dừng. prefers-reduced-motion: không tạo bông tuyết, đèn đứng yên. */

html:not(.gs) .gs-mu, html:not(.gs) .gs-den, html:not(.gs) .gs-nav,
html:not(.gs) #giang-sinh, html:not(.gs) .tuyet { display: none !important; }

/* ------------------------------------------------------------------ tông màu Noel */
html.gs {
  --red: #A3191F; --red-d: #7E1217; --on-red: #FDFAF6;
  --nhan: #1E5A3A;                 /* chữ nhấn: xanh thông */
  --latte: #F4E9E1;                /* khối nền ửng hồng nhẹ, vẫn sáng ấm */
  --blush: #F6E3DE; --gold-t: #8A6230;
}
html.gs .nen-latte, html.gs .nen-bo { --nhan: #1E5A3A; }
html.gs .toi, html.gs .ft {
  --nen: #173B29; --paper: #1F4733; --cream: #25503A; --sand: #2E5C43;
  --ink-2: #DDE8DE; --ink-3: #C9D8CB; --line: #2B5540; --line-2: rgba(248,243,237,.22);
  --nhan: #ECB45F; --red: #F8F3ED; --red-d: #EADDCF; --on-red: #173B29;
}

/* ------------------------------------------------------------------ mũ Noel trên logo */
html.gs .brand { position: relative; }
.gs-mu {
  position: absolute; left: -10px; top: -9px; width: 26px; height: auto; z-index: 1;
  transform: rotate(-18deg); pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(51,33,21,.22));
}

/* ------------------------------------------------------------------ dây đèn dưới thanh menu */
.gs-den {
  position: absolute; left: 0; right: 0; top: 100%; height: 16px; z-index: 1;
  display: flex; justify-content: space-around; overflow: hidden; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='16'%3E%3Cpath d='M0 1Q20 9 40 1' fill='none' stroke='%23332115' stroke-opacity='.45' stroke-width='1.2'/%3E%3C/svg%3E") 0 0 / 40px 16px repeat-x;
}
.gs-den i { position: relative; flex: 0 0 40px; --b: #D62A30; --t: 0s; }
.gs-den i::before {
  content: ""; position: absolute; left: 50%; top: 5px; 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 6px 1px var(--b);
  animation: gs-nhay 2.6s ease-in-out var(--t) infinite;
}
.gs-den i:nth-child(4n+2) { --b: #F2B53C; --t: -.65s; }
.gs-den i:nth-child(4n+3) { --b: #2E9A62; --t: -1.3s; }
.gs-den i:nth-child(4n+4) { --b: #F8F3ED; --t: -1.95s; }
@keyframes gs-nhay { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (max-width: 640px) { .gs-den i:nth-child(n+10) { display: none; } }
html[data-gs-nghi] .gs-den i::before { animation-play-state: paused; }

/* ------------------------------------------------------------------ mục "Giáng sinh" trên menu */
.nav a.gs-nav, .mnu-p a.gs-nav { color: var(--red); font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.gs-cay { width: 17px; height: 17px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ tuyết rơi (lớp con của khối) */
.tuyet { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.tuyet i {
  position: absolute; top: -12px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  background: #fff; opacity: var(--o);
  animation: gs-roi var(--d) linear var(--t) infinite;
}
.tuyet-sang i { box-shadow: 0 0 0 1px rgba(51,33,21,.07), 0 1px 3px rgba(51,33,21,.28); }
@keyframes gs-roi {
  0%   { transform: translate3d(0, 0, 0); }
  50%  { transform: translate3d(var(--dx), 260px, 0); }
  100% { transform: translate3d(0, 540px, 0); }
}
[data-nghi] > .tuyet i, [data-nghi] > .gs-den i::before,
html[data-gs-nghi] .tuyet i { animation-play-state: paused; }
.lh { position: relative; }

/* ------------------------------------------------------------------ trang chủ: khối "Bánh kem Giáng sinh" */
.gs-s { padding: 34px 0 12px; }
.gs-khoi {
  position: relative; overflow: clip; border-radius: var(--r-lg); padding: 30px 18px 20px; color: #fff;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.18) 0 1.6px, rgba(255,255,255,0) 2.4px) 0 0 / 44px 44px,
    radial-gradient(circle at 70% 75%, rgba(255,255,255,.12) 0 1.2px, rgba(255,255,255,0) 2px) 0 0 / 31px 31px,
    linear-gradient(140deg, #A3191F 0%, #8E1419 55%, #6A0E12 100%);
  box-shadow: 0 30px 60px -38px rgba(107,8,10,.8);
}
.gs-khoi > .gs-den { top: 0; left: 22px; right: 22px; }
/* Điện thoại XẾP DỌC (grid), máy tính mới thành hàng ngang — bẫy 27: flex hàng ngang
   có con flex-1 + min-w-0 thì không bao giờ xuống dòng, chỉ bị bóp hẹp. */
.gs-dau { position: relative; z-index: 3; display: grid; gap: 14px; justify-items: start; }
@media (min-width: 760px) {
  .gs-dau { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .gs-khoi { padding: 38px 32px 26px; }
}
.gs-nhan {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 7px; border-radius: 999px;
  background: rgba(255,255,255,.14); font: 700 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: #FCEBC9;
}
.gs-khoi h2 { margin: 12px 0 0; color: #fff; font-size: clamp(1.55rem, 5vw, 2.2rem); line-height: 1.2; }
.gs-khoi h2 em { color: #F6D58E; font-style: normal; }
.gs-khoi .gs-loi { margin: 8px 0 0; max-width: 40rem; font-size: 15px; line-height: 1.65; color: #F6DFCB; }
.gs-xem {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px;
  background: #ECB45F; color: #3A2414; font: 700 14.5px var(--serif); text-decoration: none; white-space: nowrap;
  transition: background-color .25s;
}
.gs-xem:hover { background: #F6D58E; }
.gs-xem .i { width: 16px; height: 16px; }
.gs-ray {
  position: relative; z-index: 3; margin-top: 20px;
  display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  padding-bottom: 8px; scrollbar-color: rgba(255,255,255,.45) transparent;
}
.gs-ray > .card { scroll-snap-align: start; box-shadow: 0 14px 30px -18px rgba(0,0,0,.55); }
@media (min-width: 760px) {
  .gs-ray { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-auto-columns: auto; overflow: visible; }
}
.gs-chan { position: relative; z-index: 3; margin: 14px 0 0; font-size: 13.5px; color: #F6DFCB; }
.gs-chan a { color: #fff; font-weight: 700; }

/* ------------------------------------------------------------------ giảm chuyển động */
@media (prefers-reduced-motion: reduce) {
  .gs-den i::before, .tuyet i { animation: none !important; }
  .tuyet { display: none; }
}
