/* =========================================================
   IM Professional Academy — Christmas layer
   Loaded after each page's own stylesheet. Adds festive
   decoration and motion only; layout, colours, typography
   and content of the existing design are left as they are.
   ========================================================= */

.xmas-deco,
.xmas-deco * {
    pointer-events: none;
    user-select: none;
}

.xmas-deco svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Keep page content above the floating decorations */
.courses-container,
.courses-grid,
.gallery-section,
.course-detail-inner,
.about-container {
    position: relative;
    z-index: 1;
}

/* ---------- Falling snow + glowing particles (canvas) ---------- */
.xmas-snow {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 30;
}

/* ---------- Twinkling light strings ---------- */
.navbar,
.contacts-section {
    position: relative;
}

.xmas-lights {
    position: absolute;
    left: 0;
    right: 0;
    height: 34px;
    z-index: 3;
    overflow: hidden;
}

.xmas-lights svg {
    width: auto;
    max-width: none;
}

.xmas-lights--nav { top: 100%; margin-top: -3px; }
.xmas-lights--top { top: 0; }

.xmas-bulb {
    animation: xmas-twinkle 3s ease-in-out infinite;
}

@keyframes xmas-twinkle {
    0%, 100% { opacity: 1; }
    45%      { opacity: 0.42; }
    60%      { opacity: 0.9; }
}

/* ---------- Evergreen garlands in hero corners ---------- */
.xmas-garland {
    position: absolute;
    top: 0;
    width: clamp(140px, 24vw, 330px);
    z-index: 1;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.xmas-garland--left  { left: 0; }
.xmas-garland--right { right: 0; transform: scaleX(-1); }
.xmas-garland--sm    { width: clamp(120px, 18vw, 240px); }

.xmas-swing {
    animation: xmas-swing 5.5s ease-in-out infinite;
}

@keyframes xmas-swing {
    0%, 100% { transform: rotate(-5deg); }
    50%      { transform: rotate(5deg); }
}

.xmas-spark {
    transform-box: fill-box;
    transform-origin: center;
    animation: xmas-spark 3.2s ease-in-out infinite;
}

@keyframes xmas-spark {
    0%, 100% { opacity: 0.35; transform: scale(0.7); }
    50%      { opacity: 1;    transform: scale(1.1); }
}

/* ---------- Festive barber instruments ---------- */
.xmas-instrument {
    position: absolute;
    z-index: 2;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
    animation: xmas-bob 6s ease-in-out infinite;
}

.xmas-instrument--about {
    top: -40px;
    right: -26px;
    width: 128px;
}

.xmas-instrument--box {
    top: -30px;
    right: -18px;
    width: 76px;
    filter: drop-shadow(0 6px 10px rgba(43, 33, 23, 0.25));
}

.xmas-instrument--facts {
    top: -48px;
    right: -26px;
    width: 128px;
}

@keyframes xmas-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-7px) rotate(2deg); }
}

/* Gold-rimmed badge on course photos */
.xmas-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 62px;
    height: 62px;
    padding: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(52, 42, 31, 0.92), rgba(20, 17, 13, 0.92));
    border: 1.5px solid rgba(216, 190, 167, 0.75);
    box-shadow: 0 0 0 3px rgba(20, 17, 13, 0.25), 0 0 18px rgba(232, 200, 140, 0.35);
    animation: xmas-bob 6.5s ease-in-out infinite, xmas-badge-glow 4s ease-in-out infinite;
}

@keyframes xmas-badge-glow {
    0%, 100% { box-shadow: 0 0 0 3px rgba(20, 17, 13, 0.25), 0 0 12px rgba(232, 200, 140, 0.25); }
    50%      { box-shadow: 0 0 0 3px rgba(20, 17, 13, 0.25), 0 0 24px rgba(232, 200, 140, 0.55); }
}

/* Evergreen sprig on the founder photo */
.xmas-photo-sprig {
    position: absolute;
    top: -14px;
    left: -16px;
    width: 120px;
    z-index: 2;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

/* Holly on review cards */
.xmas-holly {
    position: absolute;
    top: -14px;
    left: -14px;
    width: 50px;
    z-index: 2;
    filter: drop-shadow(0 3px 5px rgba(43, 33, 23, 0.2));
}

/* Ornament above section titles */
.xmas-title-orn {
    position: absolute;
    left: 50%;
    top: -46px;
    width: 120px;
    margin-left: -60px;
    display: block;
    z-index: 1;
}

.gallery-title,
.courses-title {
    position: relative;
}

/* ---------- Gentle floating decorations ---------- */
.xmas-float {
    position: absolute;
    z-index: 0;
    width: 30px;
    opacity: 0.6;
    animation: xmas-float 8s ease-in-out infinite;
}

.xmas-float--gold,
.xmas-float--red { width: 24px; }

@keyframes xmas-float {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50%      { transform: translateY(-16px) rotate(8deg); }
}

/* ---------- Glow on selected buttons and decorative elements ---------- */
.hero-btn {
    animation: xmas-btn-glow 3.8s ease-in-out infinite;
}

@keyframes xmas-btn-glow {
    0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 0 0 rgba(216, 190, 167, 0); }
    50%      { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(216, 190, 167, 0.14), 0 0 30px rgba(240, 214, 170, 0.55); }
}

.contact-btn {
    animation: xmas-outline-glow 4.2s ease-in-out infinite;
}

@keyframes xmas-outline-glow {
    0%, 100% { box-shadow: 0 0 0 rgba(216, 190, 167, 0); }
    50%      { box-shadow: 0 0 18px rgba(216, 190, 167, 0.35); }
}

.contact-btn:hover,
.course-btn:hover,
.course-cta:hover,
.read-more-btn:hover {
    box-shadow: 0 0 20px rgba(216, 190, 167, 0.55);
}

.hero-logo {
    animation: xmas-text-glow 5s ease-in-out infinite;
}

@keyframes xmas-text-glow {
    0%, 100% { text-shadow: 0 0 10px rgba(216, 190, 167, 0.15); }
    50%      { text-shadow: 0 0 26px rgba(240, 214, 170, 0.5); }
}

/* ---------- Elegant hover on cards and images ---------- */
.course-image {
    overflow: hidden;
}

.course-image img {
    transition: transform 0.9s cubic-bezier(.2, .7, .2, 1), filter 0.6s ease;
}

.course-image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 240, 210, 0.28) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 1.1s ease;
    pointer-events: none;
}

.course-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.course-card:hover {
    border-color: rgba(216, 190, 167, 0.55);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5), 0 0 26px rgba(216, 190, 167, 0.22);
}

.course-box:hover,
.review-card:hover {
    box-shadow: 0 12px 28px rgba(43, 33, 23, 0.14), 0 0 22px rgba(216, 190, 167, 0.35);
}

.gallery-item {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-item img {
    transition: transform 0.9s cubic-bezier(.2, .7, .2, 1);
}

.about-image img {
    transition: box-shadow 0.5s ease;
}

@media (hover: hover) {
    .course-card:hover .course-image img { transform: scale(1.06); filter: saturate(1.02); }
    .course-card:hover .course-image::before { transform: translateX(120%); }

    .gallery-item:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 30px rgba(43, 33, 23, 0.18), 0 0 22px rgba(216, 190, 167, 0.4);
    }
    .gallery-item:hover img { transform: scale(1.05); }

    .about-image:hover img {
        box-shadow: 0 0 0 1px rgba(216, 190, 167, 0.6), 0 14px 32px rgba(216, 190, 167, 0.22);
    }
}

/* ---------- Smooth appearance on scroll ---------- */
.xmas-js .xmas-reveal {
    opacity: 0;
    translate: 0 28px;
    transition: opacity 0.9s ease, translate 0.9s cubic-bezier(.2, .7, .2, 1),
                transform 0.35s ease, box-shadow 0.35s ease;
}

.xmas-js .xmas-reveal.is-visible {
    opacity: 1;
    translate: 0 0;
}

/* ---------- Tablet / mobile ---------- */
@media (max-width: 900px) {
    .xmas-instrument--about { width: 104px; top: -34px; right: -14px; }
    .xmas-float--red { width: 20px; }
}

@media (max-width: 600px) {
    .xmas-garland { width: 128px; }
    .xmas-garland--sm { width: 110px; }
    .xmas-instrument--about { width: 82px; top: -30px; right: -6px; }
    .xmas-instrument--box { width: 62px; top: -24px; right: -8px; }
    .xmas-instrument--facts { width: 80px; top: -30px; right: -6px; }
    .xmas-badge { width: 52px; height: 52px; padding: 5px; top: 10px; right: 10px; }
    .xmas-photo-sprig { width: 90px; top: -10px; left: -10px; }
    .xmas-holly { width: 42px; }
    .xmas-title-orn { width: 96px; margin-left: -48px; top: -38px; }
    .xmas-float { width: 20px; opacity: 0.5; }
    .xmas-float--gold,
    .xmas-float--red { width: 17px; }
}

/* ---------- Respect reduced-motion settings ---------- */
@media (prefers-reduced-motion: reduce) {
    .xmas-snow { display: none; }
    .xmas-deco,
    .xmas-deco *,
    .hero-btn,
    .contact-btn,
    .hero-logo {
        animation: none !important;
    }
    .xmas-js .xmas-reveal { opacity: 1; translate: none; }
    .course-image::before { display: none; }
    .course-card:hover .course-image img,
    .gallery-item:hover img { transform: none; }
}

.xmas-reduce .xmas-deco,
.xmas-reduce .xmas-deco *,
.xmas-reduce .hero-btn,
.xmas-reduce .contact-btn,
.xmas-reduce .hero-logo {
    animation: none !important;
}

/* ---------- Mobile refinements (layout-safe, phones only) ---------- */
@media (max-width: 600px) {
    /* hero: fill the real visible screen and give the title presence */
    .hero { min-height: 100vh; min-height: 100svh; }
    .hero .hero-logo  { font-size: clamp(46px, 15vw, 70px) !important; letter-spacing: 3px; }
    .hero .hero-title { font-size: clamp(21px, 6.8vw, 30px) !important; letter-spacing: 1.5px; line-height: 1.25; }
    .hero .hero-text  { font-size: clamp(14px, 4.2vw, 17px) !important; line-height: 1.45; padding: 0 6px; }

    /* social handles must never break mid-word */
    .social-box a { font-size: clamp(16px, 5vw, 20px); overflow-wrap: anywhere; word-break: normal; }
    .social-box img { width: 34px; height: 34px; }

    /* breathing room between the hanging lights and the first title */
    .gallery-page, .courses-page { padding-top: 78px; }
}

@media (max-width: 360px) {
    .about-container { padding: 22px; }
    .course-content { padding: 24px 20px 26px; }
    .review-card { padding: 34px 24px; }
}

/* Tablet: keep the founder portrait at a natural size when the panel stacks */
@media (min-width: 601px) and (max-width: 900px) {
    .about-image { max-width: 440px; margin: 0 auto; }
}
