/* ==========================================================================
   Festival themes and the sale ribbon (apps/promotions)

   Loaded only while a theme or the ribbon is on. A theme is chosen with
   <html data-festive="<key>">, and it recolours ONLY the sale box on the
   plans & pricing page (.sale) and the sale ribbon (.promo-ribbon): the
   accent variables are redefined inside those two boxes, so the rest of the
   site keeps its normal colours. Every accent keeps the dark text on the
   "% OFF" badge (#1A1204) at 4.5:1 or better.
   ========================================================================== */

:root {
    --ribbon-bg: var(--ink);
    --ribbon-fg: var(--porcelain);
    --ribbon-accent: var(--brass);
}

html[data-festive="christmas"] :is(.sale, .promo-ribbon) { --brass: #F2555A; --brass-deep: #B3202A;
                                      --ribbon-bg: linear-gradient(90deg, #0F5132, #1B7A4B 45%, #A61E26); --ribbon-fg: #FFFFFF; --ribbon-accent: #FFE08A; }
html[data-festive="new_year"] :is(.sale, .promo-ribbon) { --brass: #F4C95D; --brass-deep: #8A6A12;
                                      --ribbon-bg: linear-gradient(90deg, #0B1033, #2B1659 60%, #4A1F6B); --ribbon-fg: #FFFFFF; --ribbon-accent: #F4C95D; }
html[data-festive="valentines"] :is(.sale, .promo-ribbon) { --brass: #FF7AA8; --brass-deep: #B0285E;
                                      --ribbon-bg: linear-gradient(90deg, #7A1036, #C22A62); --ribbon-fg: #FFFFFF; --ribbon-accent: #FFD1E0; }
html[data-festive="st_patricks"] :is(.sale, .promo-ribbon) { --brass: #3FD68A; --brass-deep: #17774A;
                                      --ribbon-bg: linear-gradient(90deg, #0B4D2C, #138A4B); --ribbon-fg: #FFFFFF; --ribbon-accent: #C8F7DC; }
html[data-festive="easter"] :is(.sale, .promo-ribbon) { --brass: #C3A6FF; --brass-deep: #6A45C2;
                                      --ribbon-bg: linear-gradient(90deg, #FFE3F1, #E6DCFF 50%, #D7F5E6); --ribbon-fg: #2B2140; --ribbon-accent: #6A45C2; }
html[data-festive="summer"] :is(.sale, .promo-ribbon) { --brass: #FFB547; --brass-deep: #9A5B00;
                                      --ribbon-bg: linear-gradient(90deg, #FFB547, #FF7E5F); --ribbon-fg: #1A1204; --ribbon-accent: #1A1204; }
html[data-festive="usa"] :is(.sale, .promo-ribbon) { --brass: #6E9CFF; --brass-deep: #2B55C7;
                                      --ribbon-bg: linear-gradient(90deg, #B22234, #3C3B6E); --ribbon-fg: #FFFFFF; --ribbon-accent: #FFFFFF; }
html[data-festive="back_to_school"] :is(.sale, .promo-ribbon) { --brass: #FFD23F; --brass-deep: #8A6D00;
                                      --ribbon-bg: #FFD23F; --ribbon-fg: #1A1204; --ribbon-accent: #1A1204; }
html[data-festive="halloween"] :is(.sale, .promo-ribbon) { --brass: #FF8A2B; --brass-deep: #B4540A;
                                      --ribbon-bg: linear-gradient(90deg, #1E0B33, #3D1462 55%, #B4540A); --ribbon-fg: #FFFFFF; --ribbon-accent: #FFB36B; }
html[data-festive="autumn"] :is(.sale, .promo-ribbon) { --brass: #E8924A; --brass-deep: #9C4F12;
                                      --ribbon-bg: linear-gradient(90deg, #5A2A0C, #9C4F12); --ribbon-fg: #FFFFFF; --ribbon-accent: #FFD3A3; }
html[data-festive="black_friday"] :is(.sale, .promo-ribbon) { --brass: #F5C542; --brass-deep: #8C6A20;
                                      --ribbon-bg: #000000; --ribbon-fg: #FFFFFF; --ribbon-accent: #F5C542; }
html[data-festive="cyber"] :is(.sale, .promo-ribbon) { --brass: #3EE6FF; --brass-deep: #00728A;
                                      --ribbon-bg: linear-gradient(90deg, #0B1D3A, #3A1366 60%, #7A1FA2); --ribbon-fg: #FFFFFF; --ribbon-accent: #3EE6FF; }
html[data-festive="holi"] :is(.sale, .promo-ribbon) { --brass: #FF5FC1; --brass-deep: #B3197A;
                                      --ribbon-bg: linear-gradient(90deg, #FF6B9D, #FFC94D 25%, #6FE39A 50%, #6CC4FF 75%, #C18BFF); --ribbon-fg: #1A1204; --ribbon-accent: #1A1204; }
html[data-festive="diwali"] :is(.sale, .promo-ribbon) { --brass: #FFB020; --brass-deep: #9A5A00;
                                      --ribbon-bg: linear-gradient(90deg, #4A0B1A, #8A1E1E 55%, #B3400E); --ribbon-fg: #FFFFFF; --ribbon-accent: #FFD37A; }
html[data-festive="india"] :is(.sale, .promo-ribbon) { --brass: #FF9933; --brass-deep: #A85400;
                                      --ribbon-bg: linear-gradient(90deg, #FFB366, #FFFFFF 50%, #7BD389); --ribbon-fg: #1A1204; --ribbon-accent: #0B3D91; }

html[data-festive] :is(.sale, .promo-ribbon) { --brass-soft: color-mix(in srgb, var(--brass) 14%, transparent); }

/* The sale box's own tints, which the pricing page writes out in the brass rgba */
html[data-festive] .sale {
    background: linear-gradient(100deg, color-mix(in srgb, var(--brass) 18%, transparent), color-mix(in srgb, var(--brass) 5%, transparent));
    border-color: color-mix(in srgb, var(--brass) 45%, transparent);
}
html[data-festive] .sale .btn { border-color: color-mix(in srgb, var(--brass) 55%, transparent); }
html[data-festive] .sale .btn:hover { background: color-mix(in srgb, var(--brass) 12%, transparent); }

/* ---- Sale ribbon above the menu ------------------------------------------ */
.promo-ribbon {
    position: relative; z-index: 101;
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 4px 14px;
    min-height: 40px; padding: 7px 48px 7px 16px;
    background: var(--ribbon-bg); color: var(--ribbon-fg);
    font-family: var(--body); font-size: 0.88rem; line-height: 1.35; text-align: center;
}
.promo-ribbon[hidden] { display: none; }
.promo-ribbon b { font-weight: 700; }
.promo-ribbon .promo-ribbon-ends {
    font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.02em;
    color: var(--ribbon-accent); font-variant-numeric: tabular-nums;
}
.promo-ribbon a {
    color: var(--ribbon-accent); font-weight: 700; text-decoration: underline;
    text-underline-offset: 3px; white-space: nowrap;
}
.promo-ribbon-close {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: transparent; color: inherit;
    font-size: 1.15rem; line-height: 1; cursor: pointer; opacity: 0.75;
}
.promo-ribbon-close:hover, .promo-ribbon-close:focus-visible { opacity: 1; background: rgba(127, 127, 127, 0.2); }
@media (max-width: 560px) {
    .promo-ribbon { font-size: 0.8rem; padding-inline: 12px 42px; }
}

/* ---- Effect layer (static/js/festive.js) --------------------------------- */
.festive-fx {
    position: fixed; inset: 0; z-index: 90;
    width: 100%; height: 100%;
    pointer-events: none;
    opacity: 0.75;
}
@media (prefers-reduced-motion: reduce) { .festive-fx { display: none; } }
