/* =====================================================================
   Seasonal themes (admin → Giao diện dịp lễ). Loaded only while a theme is active, after site.css.
   Colours come from the tokens the layout overrides (--ps-accent…); decorations are keyed by
   html[data-season="<preset key>"] and shown only with html[data-season-decor].
   Everything here is static CSS + inline SVG: no image requests, no layout work while scrolling.
   ===================================================================== */

/* ---------- announcement bar (Views/Shared/Partials/_SeasonalBody.cshtml) ---------- */
.ps-season-bar { position: relative; background: linear-gradient(90deg, rgb(var(--ps-accent-rgb) / .34), rgb(var(--ps-accent-2-rgb) / .28)); border-bottom: 1px solid rgb(var(--ps-accent-rgb) / .45); color: #fff; font-size: 14px; line-height: 1.45; }
.ps-season-bar__inner { position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; padding-top: 10px; padding-bottom: 10px; padding-left: 52px; padding-right: 52px; text-align: center; }
/* the message itself: large, bold, white with a glow of the season's colour so it reads on any palette */
.ps-season-bar__text { min-width: 0; font-size: clamp(15px, .55vw + 11px, 19px); font-weight: 800; letter-spacing: .01em; color: #fff; text-shadow: 0 0 14px rgb(var(--ps-accent-rgb) / .75), 0 1px 2px rgba(0, 0, 0, .6); }
/* the garland hangs from the header over whatever comes next: keep the message clear of it */
html[data-season-decor]:not([data-season="custom"]) .ps-season-bar__inner { padding-top: 26px; }
html[data-season-decor][data-season="tet"] .ps-season-bar__inner,
html[data-season-decor][data-season="mid-autumn"] .ps-season-bar__inner { padding-top: 32px; }
html[data-season-decor]:not([data-season="custom"]) .ps-season-bar__close { top: calc(50% + 10px); }
.ps-season-bar a.ps-season-bar__text { color: #fff !important; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: rgb(var(--ps-accent-rgb) / .8); text-underline-offset: 5px; }
.ps-season-bar a.ps-season-bar__text:hover { color: var(--ps-accent-hover) !important; text-decoration-color: var(--ps-accent); }
.ps-season-bar__close { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: rgba(0, 0, 0, .2); color: rgba(255, 255, 255, .8); }
.ps-season-bar__close:hover { background: rgba(255, 255, 255, .14); color: #fff; }
@media (max-width: 760px) { .ps-season-bar__inner { padding-left: 12px; padding-right: 48px; } .ps-season-bar__close { right: 8px; } }

/* ---------- admin preview pill ---------- */
.ps-season-preview { position: fixed; right: 12px; top: calc(var(--ps-header-h) + 12px); z-index: 90; display: flex; align-items: center; gap: 10px; max-width: calc(100% - 24px); padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--ps-popover); border: 1px solid var(--ps-accent); box-shadow: var(--ps-shadow); font-size: 13px; color: var(--ps-soft); }
.ps-season-preview b { color: var(--ps-text); }
.ps-season-preview a { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--ps-accent); color: var(--ps-on-accent) !important; font-weight: 700; }

/* ---------- particles canvas + visitor's on/off switch (js/seasonal.js) ---------- */
.ps-season-fx { position: fixed; inset: 0; z-index: 55; width: 100%; height: 100%; pointer-events: none; }
.ps-season-toggle { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 56; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--ps-border); background: var(--ps-glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 18px; line-height: 1; opacity: .75; transition: opacity .15s ease, border-color .15s ease; }
.ps-season-toggle:hover { opacity: 1; border-color: var(--ps-accent); }
.ps-season-toggle[aria-pressed="false"] { filter: grayscale(1); opacity: .5; }
@media (max-width: 760px) { .ps-season-toggle { bottom: calc(92px + env(safe-area-inset-bottom)); left: 12px; width: 36px; height: 36px; font-size: 16px; } }

/* ---------- seasonal logo ---------- */
.ps-logo { position: relative; }
.ps-logo--seasonal img { height: 34px; max-width: 240px; object-fit: contain; }
/* occasion badge next to the wordmark (every preset except Christmas, which wears a hat, and custom) */
html[data-season-decor]:not([data-season="christmas"]):not([data-season="custom"]) .ps-logo:not(.ps-logo--seasonal)::after { content: var(--ps-season-icon); margin-left: 6px; font-size: 18px; line-height: 1; }

/* ---------- garland hanging under the header ---------- */
html[data-season-decor] .ps-header::after,
html[data-season-decor] .ps-header::before { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px; pointer-events: none; background-repeat: repeat-x; }
html[data-season-decor] .ps-header::after { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }

/* Christmas: wavy wire with lights; the bulbs on the peaks (::before) twinkle */
html[data-season="christmas"][data-season-decor] .ps-header::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='24'%3E%3Cpath d='M0 2Q20 10 40 2Q60 10 80 2Q100 10 120 2Q140 10 160 2' fill='none' stroke='%23334033' stroke-width='1.5'/%3E%3Cg fill='%23a3ab9f'%3E%3Crect x='18.5' y='5' width='3' height='3' rx='.8'/%3E%3Crect x='58.5' y='5' width='3' height='3' rx='.8'/%3E%3Crect x='98.5' y='5' width='3' height='3' rx='.8'/%3E%3Crect x='138.5' y='5' width='3' height='3' rx='.8'/%3E%3C/g%3E%3Cellipse cx='20' cy='12.5' rx='3.6' ry='5' fill='%23ff4d5e'/%3E%3Cellipse cx='60' cy='12.5' rx='3.6' ry='5' fill='%233ddc84'/%3E%3Cellipse cx='100' cy='12.5' rx='3.6' ry='5' fill='%23ff9f1c'/%3E%3Cellipse cx='140' cy='12.5' rx='3.6' ry='5' fill='%23c77dff'/%3E%3C/svg%3E");
}
html[data-season="christmas"][data-season-decor] .ps-header::before {
  background-position: 20px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='24'%3E%3Cg fill='%23a3ab9f'%3E%3Crect x='18.5' y='1.5' width='3' height='3' rx='.8'/%3E%3Crect x='58.5' y='1.5' width='3' height='3' rx='.8'/%3E%3Crect x='98.5' y='1.5' width='3' height='3' rx='.8'/%3E%3Crect x='138.5' y='1.5' width='3' height='3' rx='.8'/%3E%3C/g%3E%3Cellipse cx='20' cy='9' rx='3.6' ry='5' fill='%23ffd166'/%3E%3Cellipse cx='60' cy='9' rx='3.6' ry='5' fill='%235ab0ff'/%3E%3Cellipse cx='100' cy='9' rx='3.6' ry='5' fill='%23fff3c4'/%3E%3Cellipse cx='140' cy='9' rx='3.6' ry='5' fill='%23ff7ab3'/%3E%3C/svg%3E");
  animation: ps-twinkle 1.6s steps(2, jump-none) infinite alternate;
}

/* New Year: the same lights in gold / white / violet */
html[data-season="new-year"][data-season-decor] .ps-header::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='24'%3E%3Cpath d='M0 2Q20 10 40 2Q60 10 80 2Q100 10 120 2Q140 10 160 2' fill='none' stroke='%234a4636' stroke-width='1.5'/%3E%3Cg fill='%23bfb69a'%3E%3Crect x='18.5' y='5' width='3' height='3' rx='.8'/%3E%3Crect x='58.5' y='5' width='3' height='3' rx='.8'/%3E%3Crect x='98.5' y='5' width='3' height='3' rx='.8'/%3E%3Crect x='138.5' y='5' width='3' height='3' rx='.8'/%3E%3C/g%3E%3Cellipse cx='20' cy='12.5' rx='3.6' ry='5' fill='%23ffc53d'/%3E%3Cellipse cx='60' cy='12.5' rx='3.6' ry='5' fill='%23fff6d6'/%3E%3Cellipse cx='100' cy='12.5' rx='3.6' ry='5' fill='%23ffc53d'/%3E%3Cellipse cx='140' cy='12.5' rx='3.6' ry='5' fill='%238b7bff'/%3E%3C/svg%3E");
}
html[data-season="new-year"][data-season-decor] .ps-header::before {
  background-position: 20px 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='24'%3E%3Cg fill='%23bfb69a'%3E%3Crect x='18.5' y='1.5' width='3' height='3' rx='.8'/%3E%3Crect x='58.5' y='1.5' width='3' height='3' rx='.8'/%3E%3Crect x='98.5' y='1.5' width='3' height='3' rx='.8'/%3E%3Crect x='138.5' y='1.5' width='3' height='3' rx='.8'/%3E%3C/g%3E%3Cellipse cx='20' cy='9' rx='3.6' ry='5' fill='%23ffe58f'/%3E%3Cellipse cx='60' cy='9' rx='3.6' ry='5' fill='%23b9a8ff'/%3E%3Cellipse cx='100' cy='9' rx='3.6' ry='5' fill='%23ffffff'/%3E%3Cellipse cx='140' cy='9' rx='3.6' ry='5' fill='%23ffd166'/%3E%3C/svg%3E");
  animation: ps-twinkle 1.6s steps(2, jump-none) infinite alternate;
}

/* Tết: red and gold lanterns */
html[data-season="tet"][data-season-decor] .ps-header::after { height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='30'%3E%3Cpath d='M0 2Q30 8 60 2Q90 8 120 2' fill='none' stroke='%23523a1c' stroke-width='1.3'/%3E%3Cg stroke='%23ffc53d' stroke-width='1'%3E%3Cpath d='M30 5v3M30 23.5v5M90 5v3M90 23.5v5'/%3E%3C/g%3E%3Cellipse cx='30' cy='15.7' rx='8' ry='6.5' fill='%23e5322d'/%3E%3Cellipse cx='30' cy='15.7' rx='3.4' ry='6.5' fill='none' stroke='%23ff8a65' stroke-width='.8'/%3E%3Cellipse cx='90' cy='15.7' rx='8' ry='6.5' fill='%23ffb703'/%3E%3Cellipse cx='90' cy='15.7' rx='3.4' ry='6.5' fill='none' stroke='%23fff1b8' stroke-width='.8'/%3E%3Cg fill='%23ffc53d'%3E%3Crect x='26' y='8' width='8' height='2' rx='.6'/%3E%3Crect x='26' y='21.5' width='8' height='2' rx='.6'/%3E%3C/g%3E%3Cg fill='%23e5322d'%3E%3Crect x='86' y='8' width='8' height='2' rx='.6'/%3E%3Crect x='86' y='21.5' width='8' height='2' rx='.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* Trung thu: orange / yellow lanterns */
html[data-season="mid-autumn"][data-season-decor] .ps-header::after { height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='30'%3E%3Cpath d='M0 2Q30 8 60 2Q90 8 120 2' fill='none' stroke='%23463624' stroke-width='1.3'/%3E%3Cg stroke='%23ffd23f' stroke-width='1'%3E%3Cpath d='M30 5v3M30 23.5v5M90 5v3M90 23.5v5'/%3E%3C/g%3E%3Cellipse cx='30' cy='15.7' rx='8' ry='6.5' fill='%23ff8c1a'/%3E%3Cellipse cx='30' cy='15.7' rx='3.4' ry='6.5' fill='none' stroke='%23ffd23f' stroke-width='.8'/%3E%3Cellipse cx='90' cy='15.7' rx='8' ry='6.5' fill='%23ff5a36'/%3E%3Cellipse cx='90' cy='15.7' rx='3.4' ry='6.5' fill='none' stroke='%23ffb020' stroke-width='.8'/%3E%3Cg fill='%23b4321e'%3E%3Crect x='26' y='8' width='8' height='2' rx='.6'/%3E%3Crect x='26' y='21.5' width='8' height='2' rx='.6'/%3E%3Crect x='86' y='8' width='8' height='2' rx='.6'/%3E%3Crect x='86' y='21.5' width='8' height='2' rx='.6'/%3E%3C/g%3E%3C/svg%3E");
}

/* Valentine: hearts on a string */
html[data-season="valentine"][data-season-decor] .ps-header::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='24'%3E%3Cpath d='M0 2Q20 8 40 2Q60 8 80 2' fill='none' stroke='%235a2a3c' stroke-width='1.2'/%3E%3Cpath d='M20 5v4M60 5v4' stroke='%235a2a3c' stroke-width='1'/%3E%3Cpath transform='translate(14 6) scale(.5)' d='M12 21s-7-4.5-9.5-9A5 5 0 0 1 12 6a5 5 0 0 1 9.5 6c-2.5 4.5-9.5 9-9.5 9z' fill='%23ff4f8b'/%3E%3Cpath transform='translate(54 6) scale(.5)' d='M12 21s-7-4.5-9.5-9A5 5 0 0 1 12 6a5 5 0 0 1 9.5 6c-2.5 4.5-9.5 9-9.5 9z' fill='%23ff9ec4'/%3E%3C/svg%3E");
}

/* Halloween: orange / violet bunting */
html[data-season="halloween"][data-season-decor] .ps-header::after { height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='20'%3E%3Cpath d='M0 2.5H60' stroke='%23463a52' stroke-width='1.2'/%3E%3Cpolygon points='4,3 18,3 11,16' fill='%23ff7a1a'/%3E%3Cpolygon points='24,3 38,3 31,16' fill='%23a855f7'/%3E%3Cpolygon points='44,3 58,3 51,16' fill='%23c2410c'/%3E%3C/svg%3E");
}

/* National day: red flags with a yellow star, yellow flags */
html[data-season="national-day"][data-season-decor] .ps-header::after { height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M0 2.5H40' stroke='%235a3a2a' stroke-width='1.2'/%3E%3Cpolygon points='4,3 18,3 11,17' fill='%23e0201b'/%3E%3Cpolygon points='11,4.8 11.76,6.95 14.04,7.01 12.24,8.4 12.88,10.59 11,9.3 9.12,10.59 9.76,8.4 7.96,7.01 10.24,6.95' fill='%23ffd400'/%3E%3Cpolygon points='24,3 38,3 31,17' fill='%23ffd400'/%3E%3C/svg%3E");
}

/* Christmas: Santa hat on the wordmark */
html[data-season="christmas"][data-season-decor] .ps-logo:not(.ps-logo--seasonal)::before {
  content: ""; position: absolute; left: -11px; top: -14px; width: 30px; height: 26px; transform: rotate(-16deg); pointer-events: none; z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 34'%3E%3Cpath d='M6 26C8 14 16 4 28 5c5 .4 8 4 9 9-3-2-6-2-8 1-3 4-4 8-4 11z' fill='%23e3263a'/%3E%3Ccircle cx='36' cy='16' r='4' fill='%23ffffff'/%3E%3Crect x='3' y='24' width='26' height='8' rx='4' fill='%23f3f6fa'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* hero: a soft glow of the season's colours along the bottom edge */
html[data-season-decor] .ps-hero { box-shadow: 0 30px 60px -40px rgb(var(--ps-accent-rgb) / .55), 0 0 0 1px rgb(var(--ps-accent-rgb) / .12); }

@keyframes ps-twinkle { from { opacity: 1; } to { opacity: .25; } }

@media (prefers-reduced-motion: reduce) {
  html[data-season] .ps-header::before { animation: none; }
}
