/* ==========================================================================
   SCHOOL NEWS EMOTICONS - STYLESHEET
   ========================================= ================================= */

/* 1. Container Wrapper
   -------------------------------------------------------------------------- */
div.sne-badge-wrapper {
    display: block !important;
    width: auto !important;
    max-width: max-content !important;
    margin-top: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 8px !important; /* Spaced close to the title below */
    margin-left: 0 !important;
    padding: 0 !important;
    clear: both !important;
}

/* Link Wrapper Reset (Prevents theme focus/hover boxes) */
a.sne-badge-link,
a.sne-badge-link:hover,
a.sne-badge-link:focus,
a.sne-badge-link:active {
    display: inline-block !important;
    text-decoration: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

/* Focus indicator for accessibility via keyboard navigation */
a.sne-badge-link:focus-visible {
    outline: 3px solid var(--wp--preset--color--primary, #2271b1) !important;
    outline-offset: 4px !important;
    border-radius: 4px !important;
}

/* 2. Post Card Container Interaction Setup
   -------------------------------------------------------------------------- */
.wp-block-post > .wp-block-group.has-border-color {
    overflow: hidden !important;
    transition: background 0.3s ease-in-out, transform 0.2s ease, box-shadow 0.2s ease !important;
    cursor: pointer !important; /* Signals the entire card is interactive */
}

/* 3. Emoticon Badge Base Rules
   -------------------------------------------------------------------------- */
.sne-emoticon-badge,
.sne-emoticon-badge:hover,
.sne-emoticon-badge:focus,
.sne-emoticon-badge:active {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Completely transparent floating icon */
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 0.5rem !important;
    margin: 0 !important;
    
    /* Sizing */
    font-size: 5.5rem !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-indent: 0 !important;
    
    /* Mouse passthrough prevents odd direct-target hover artifacts */
    pointer-events: none !important;
    user-select: none !important;
    flex-shrink: 0 !important;

    /* Native OS Emoji Stack (Prevents font flicker across devices) */
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Android Emoji", EmojiSymbols, sans-serif !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;

    /* Smooth scale transformation */
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    will-change: transform;
}

/* 4. Unified Card Animations (Triggers when hovering/clicking ANYWHERE on card)
   -------------------------------------------------------------------------- */

/* Hover over post card -> Playful pop & subtle tilt */
.wp-block-post > .wp-block-group.has-border-color:hover .sne-emoticon-badge {
    transform: scale(1.06) rotate(-1.5deg) !important;
}

/* Click/Active on post card -> Tap press reaction */
.wp-block-post > .wp-block-group.has-border-color:active .sne-emoticon-badge {
    transform: scale(1.05) rotate(0deg) !important;
}

/* Editor preview helper indicator in Gutenberg */
.sne-editor-preview .sne-emoticon-badge {
    outline: 2px dashed var(--wp--preset--color--primary, #2271b1) !important;
    outline-offset: 3px !important;
}

/* 5. Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet & Smaller Screens (Under 1024px) */
@media screen and (max-width: 1024px) {
    div.sne-badge-wrapper {
        margin-bottom: 6px !important;
    }

    .sne-emoticon-badge {
        font-size: 3.25rem !important;
    }
}

/* Mobile Phones (Under 767px) */
@media screen and (max-width: 767px) {
    div.sne-badge-wrapper {
        margin-bottom: 4px !important;
    }

    .sne-emoticon-badge {
        font-size: 2.75rem !important;
    }
}

/* 1. Establish positioning context on the main badge */
.sne-emoticon-badge {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1 !important;
}

/* 2. Create the blurred duplicate stacked underneath */
.sne-emoticon-badge::before {
    /* Pulls the exact same emoji character from the data-emoji attribute */
    content: attr(data-emoji);
    
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    
    /* Layer underneath the main sharp emoji */
    z-index: -1 !important;
    
    /* 10px Blur & subtle ambient offset */
    filter: blur(10px) saturate(140%) !important;
    opacity: 0.125 !important;
    transform: scale(2.15) translateY(2px) !important;
    
    /* Ensure smooth scaling during card hover animations */
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease !important;
    pointer-events: none !important;
}

/* 3. Scale both layers smoothly when card is hovered */
.wp-block-post > .wp-block-group.has-border-color:hover .sne-emoticon-badge::before {
}