/* ── Julegave-hero (2026): shared by the homepage carousel and /firmagaver-virksomheder ──
   Markup: templates/cbrm/shared/_julegave_hero.html.twig · JS: /js/cbrm-julegave-hero.js
   The JS toggles .jg-on to play the entrance + animations; html.jg-js hides the
   copy until then, so the hero is fully visible without JS. */

.jg-hero {
    --jg-bg: #f1eee6;
    --jg-gold: #b08d57;
    --jg-green: var(--green, #214545);
    --jg-green-light: var(--green-light, #2d5c5c);
    --jg-mid: var(--mid, #6b7280);
    --jg-serif: var(--serif, 'Playfair Display', Georgia, serif);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(32px, 5vw, 88px);
    background: var(--jg-bg);
    overflow: hidden;
}

/* Variants: carousel slide (homepage, fixed nav overlays it) and standalone page hero */
.jg-hero--slide { padding: 72px 64px 64px; }
.jg-hero--page  { min-height: calc(100svh - 72px); min-height: max(620px, calc(100svh - 72px)); padding: 48px 64px; }

.jg-sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.jg-sparkle {
    position: absolute;
    top: -12px;
    width: var(--s, 4px);
    height: var(--s, 4px);
    border-radius: 50%;
    background: var(--jg-gold);
    opacity: 0;
    animation: jgFall var(--d, 14s) linear var(--delay, 0s) infinite;
    animation-play-state: paused;
}
.jg-hero.jg-on .jg-sparkle { animation-play-state: running; }
@keyframes jgFall {
    0%   { transform: translate3d(0, 0, 0); opacity: 0; }
    10%  { opacity: var(--o, 0.35); }
    85%  { opacity: var(--o, 0.35); }
    100% { transform: translate3d(var(--x, 40px), 105svh, 0); opacity: 0; }
}

.jg-copy {
    position: relative;
    z-index: 2;
    flex: 0 1 520px;
    min-width: 0;
}

/* Staggered entrance each time .jg-on is set */
.jg-reveal { transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.jg-js .jg-hero:not(.jg-on) .jg-reveal { opacity: 0; transform: translateY(18px); }
.jg-hero.jg-on .jg-reveal:nth-child(1) { transition-delay: 0.25s; }
.jg-hero.jg-on .jg-reveal:nth-child(2) { transition-delay: 0.4s; }
.jg-hero.jg-on .jg-reveal:nth-child(3) { transition-delay: 0.6s; }
.jg-hero.jg-on .jg-reveal:nth-child(4) { transition-delay: 0.75s; }
.jg-hero.jg-on .jg-reveal:nth-child(5) { transition-delay: 0.9s; }
.jg-hero.jg-on .jg-reveal:nth-child(6) { transition-delay: 1.05s; }

.jg-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--jg-gold);
    margin: 0 0 22px;
}
.jg-eyebrow::before {
    content: '';
    width: 36px;
    height: 1px;
    background: var(--jg-gold);
    transition: width 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s;
}
.jg-js .jg-hero:not(.jg-on) .jg-eyebrow::before { width: 0; }

.jg-title {
    font-family: var(--jg-serif);
    font-weight: 400;
    font-size: clamp(38px, 4.6vw, 66px);
    line-height: 1.06;
    letter-spacing: -0.01em;
    color: var(--jg-green);
    margin: 0 0 22px;
}
.jg-title em { font-style: italic; color: var(--jg-green-light); white-space: nowrap; }

.jg-sub {
    font-size: 15px;
    line-height: 1.65;
    color: #4b5250;
    max-width: 440px;
    margin: 0 0 22px;
}

.jg-brands {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    color: var(--jg-mid);
    margin: 0 0 32px;
}
.jg-brand-rotator {
    position: relative;
    display: inline-block;
    height: 1.5em;
    min-width: 190px;
    overflow: hidden;
    vertical-align: bottom;
}
.jg-brand {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    font-family: var(--jg-serif);
    font-style: italic;
    font-size: 16px;
    color: var(--jg-green);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.jg-brand.is-in  { opacity: 1; transform: translateY(0); }
.jg-brand.is-out { opacity: 0; transform: translateY(-100%); }

.jg-ctas { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.jg-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 28px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s, border-color 0.2s;
}
.jg-btn--primary { background: var(--jg-green); color: #f8f5f0; }
.jg-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(33,69,69,0.25); }
.jg-btn--primary svg { transition: transform 0.2s; }
.jg-btn--primary:hover svg { transform: translateX(3px); }
.jg-btn--ghost { color: var(--jg-green); border: 1.5px solid rgba(33,69,69,0.25); }
.jg-btn--ghost:hover { border-color: var(--jg-green); background: rgba(33,69,69,0.04); }
.jg-note { width: 100%; margin: 6px 0 0; font-size: 12px; color: var(--jg-mid); }

.jg-usps { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 0; padding: 0; list-style: none; }
.jg-usps li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #4b5250; }
.jg-usps li::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--jg-gold); }

/* Flat-lay stage: crossfading product sets with a slow push-in */
.jg-stage {
    position: relative;
    z-index: 1;
    flex: 0 1 640px;
    aspect-ratio: 832 / 656;
    transition: opacity 1s ease 0.1s, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s;
}
.jg-js .jg-hero:not(.jg-on) .jg-stage { opacity: 0; transform: translateY(24px) scale(0.98); }
.jg-shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(1.06);
    transition: opacity 1.2s ease, transform 5s cubic-bezier(0.25, 0.1, 0.25, 1);
    /* Feather all four edges so the photo's vignette melts into the background */
    -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
                        linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
    -webkit-mask-composite: source-in;
            mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent),
                        linear-gradient(to bottom, transparent, #000 9%, #000 91%, transparent);
            mask-composite: intersect;
}
.jg-shot.is-on { opacity: 1; transform: scale(1); }

.jg-tag {
    position: absolute;
    right: 2%;
    bottom: 6%;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 14px;
    background: #fffdf8;
    border: 1px solid rgba(176,141,87,0.35);
    border-radius: 4px 999px 999px 4px;
    box-shadow: 0 10px 30px rgba(33,69,69,0.12);
    font-family: var(--jg-serif);
    font-style: italic;
    font-size: 16px;
    color: var(--jg-green);
    transform-origin: 0 50%;
    transition: opacity 0.8s ease 1.1s;
}
.jg-js .jg-hero:not(.jg-on) .jg-tag { opacity: 0; }
.jg-hero.jg-on .jg-tag { animation: jgSwing 5s ease-in-out 1.1s infinite; }
.jg-tag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid var(--jg-gold);
    flex: none;
}
@keyframes jgSwing {
    0%, 100% { transform: rotate(-3deg); }
    50%      { transform: rotate(2deg); }
}

/* ── Dark variant (landing page): green field, flat-lay on a cream card to the left ── */
.jg-hero--dark {
    --jg-gold: #d2b27c;
    flex-direction: row-reverse;
    background: radial-gradient(ellipse 70% 80% at 28% 50%, #2d5c5c 0%, var(--jg-green) 62%, #183535 100%);
}
.jg-hero--dark .jg-eyebrow { color: var(--jg-gold); }
.jg-hero--dark .jg-title { color: #f8f5f0; }
.jg-hero--dark .jg-title em { color: var(--jg-gold); }
.jg-hero--dark .jg-sub { color: rgba(248,245,240,0.74); }
.jg-hero--dark .jg-brands { color: rgba(248,245,240,0.55); }
.jg-hero--dark .jg-brand { color: #f8f5f0; }
.jg-hero--dark .jg-btn--primary { background: #f8f5f0; color: var(--jg-green); }
.jg-hero--dark .jg-btn--primary:hover { box-shadow: 0 12px 28px rgba(0,0,0,0.3); }
.jg-hero--dark .jg-btn--ghost { color: #f8f5f0; border-color: rgba(248,245,240,0.35); }
.jg-hero--dark .jg-btn--ghost:hover { border-color: #f8f5f0; background: rgba(248,245,240,0.08); }
.jg-hero--dark .jg-note,
.jg-hero--dark .jg-usps li { color: rgba(248,245,240,0.7); }
.jg-hero--dark .jg-stage {
    background: #f1eee6;
    border-radius: 22px;
    box-shadow: 0 40px 90px rgba(0,0,0,0.35), 0 0 0 1px rgba(210,178,124,0.25);
}
.jg-hero--dark .jg-tag { right: -22px; }

@media (max-width: 900px) {
    .jg-hero { flex-direction: column-reverse; justify-content: center; gap: 8px; }
    .jg-hero--slide { padding: 84px 24px 72px; }
    .jg-hero--page  { min-height: 0; padding: 24px 24px 56px; }
    .jg-stage { flex: none; width: min(100%, 520px); }
    .jg-copy { flex: none; width: 100%; max-width: 520px; }
    .jg-hero--dark { flex-direction: column-reverse; gap: 32px; }
    .jg-hero--dark .jg-tag { right: -10px; }
    .jg-sub { margin-bottom: 16px; }
    .jg-brands { margin-bottom: 22px; }
}
@media (max-width: 640px) {
    .jg-hero--slide { justify-content: flex-end; padding: 64px 20px 64px; }
    .jg-hero--page  { padding: 12px 20px 44px; }
    .jg-stage { width: 100%; max-height: 38svh; }
    .jg-eyebrow { margin-bottom: 12px; }
    .jg-title { font-size: clamp(30px, 8.6vw, 40px); margin-bottom: 12px; }
    .jg-sub { font-size: 14px; line-height: 1.55; }
    .jg-brands { font-size: 12px; margin-bottom: 18px; }
    .jg-brand { font-size: 15px; }
    .jg-btn { height: 50px; padding: 0 22px; font-size: 13.5px; flex: 1 1 100%; justify-content: center; }
    .jg-note { text-align: center; }
    .jg-tag { font-size: 13px; padding: 7px 14px 7px 10px; right: 0; bottom: 2%; }
    .jg-hero--dark { gap: 24px; padding-top: 20px; }
    .jg-hero--dark .jg-stage { border-radius: 16px; }
    .jg-hero--dark .jg-tag { right: -6px; }
}
@media (max-width: 640px) and (max-height: 720px) {
    .jg-hero--slide .jg-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .jg-sparkles { display: none; }
    .jg-shot { transform: none !important; transition: opacity 1.2s ease; }
    .jg-hero.jg-on .jg-tag { animation: none; }
    .jg-js .jg-hero:not(.jg-on) .jg-reveal,
    .jg-js .jg-hero:not(.jg-on) .jg-stage { transform: none; }
}
