/* --- ACCESSIBILITY --- */

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    
    .related-news-item .link img,
    #view-past-events img,
    .tab__content__item {
        transform: none !important;
    }
}



/* --- LEGACY / SUSPECT RULES --- */

/* legacy: Verify if logo container should still be hidden in specific templates */
/* .site-logo-container { display: none; } */

.userway_buttons_wrapper {
    display: none !important;
}



/* --- ACCESSIBILITY & PROGRAMS (DEC 2025) --- */

.exe_programs_item {
    position: relative;
}

.exe_programs_item::after {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 5px);
    height: calc(100% + 5px);
    border: 2.5px solid #1e2dff;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base, 0.3s ease);
}

.exe_programs_item::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, color-mix(in srgb, black, transparent 25%), transparent);
    pointer-events: none;
}

a:focus-visible, 
button:focus-visible {
    outline: 2px solid var(--theme-palette-color-2);
    outline-offset: var(--outline-offset, 3px);
}

.exe_programs_item:is(:focus-visible, :focus-within, :focus)::after {
    opacity: 1;
}

/* PROGRAM ITEMS: TEXT ALIGNMENT & LINE HEIGHT FIX                            */

.exe_programs_item_text {
    position: absolute;
    inset-block-start: auto !important; /* Safely overrides any legacy 'top' values */
    inset-block-end: 0 !important;      /* Anchors exactly to the bottom */
    padding-block-start: 0 !important;
    padding-block-end: 20px !important; /* Reduced from 50px to visually align with the bottom */
    z-index: 3;
    width: 100%;
    display: flex;
    align-items: flex-end; /* Ensures flex-level bottom alignment */
}

.exe_programs_item_text p {
    line-height: 1.04 !important; /* Exactly 20% reduction from the original 1.3 */
}

.news_own_list_item {
    border-color: #595447 !important;
}



/* --- ACCESSIBILITY LOGOS BY THEME --- */

.header-menu-1 ul li:last-child a::after {
    background-image: url(../images/accessibility-w.svg);
}

body:not(.home) .header-menu-1 ul li:last-child a::after {
    background-image: url(../images/accessibility-b.svg);
}

body[data-header*="sticky:shrink"] .header-menu-1 ul li:last-child a::after {
    background-image: url(../images/accessibility-b.svg);
}

.header-menu-1 ul li:last-child a:hover::after {
    background-image: url(../images/accessibility-r.svg) !important;
}



/* --- RULE 1: GLOBAL BODY LINKS --- */
/* REST STATE */
:is(#main .entry-content, .stk-block-content) :is(p, ul li, ol li) a:not(.stk-button, .wp-block-button__link, .link-on-dark) {
    color: #C41230 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px !important;
    text-underline-offset: 4px !important; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
}

/* HOVER STATE */
:is(#main .entry-content, .stk-block-content) :is(p, ul li, ol li) a:not(.stk-button, .wp-block-button__link, .link-on-dark):hover {
    color: #C41230 !important;           
    text-decoration-thickness: 2px !important; 
    text-underline-offset: 2px !important; 
}

/* FOCUS STATE */
:is(#main .entry-content, .stk-block-content) :is(p, ul li, ol li) a:not(.stk-button, .wp-block-button__link, .link-on-dark):focus-visible {
    outline: 2px solid #C41230 !important;
    outline-offset: 2px;
    background-color: rgba(196, 18, 48, 0.05) !important;
}



/* --- SIDEBAR & SEARCH CLEAR BUTTONS (TEXT LINK STYLE) --- */

/* 1. Base State: Strip default styling, force red text, no underline */
.sidebar-header .clear-btn,
#search-clear-trigger.cmu-clear-btn {
    background: transparent !important; /* Removes button background */
    border: none !important; /* Removes button outline/border */
    padding: 0 !important; /* Removes default button padding */
    box-shadow: none !important; /* Kills any drop-shadows */
    font-family: inherit !important; 
    font-size: inherit !important; 
    cursor: pointer !important; /* Ensures the mouse turns into a hand */
    
    /* Apply specific CMU-Q red and remove base underline */
    color: var(--cmuq-red, #c51230) !important; 
    text-decoration: none !important; 
}

/* 2. Hover State: Add the red underline */
.sidebar-header .clear-btn:hover,
#search-clear-trigger.cmu-clear-btn:hover {
    text-decoration: underline !important; 
    text-decoration-color: var(--cmuq-red, #c51230) !important;
    text-underline-offset: 2px !important; /* Drops the line slightly for a cleaner look */
    transition: all 0.2s ease-in-out !important; 
}
/* UserWay: Restore highlight-links black background on clear buttons */
body[data-userway-s6-styled="true"] .sidebar-header .clear-btn,
body[data-userway-s6-styled="true"] #search-clear-trigger.cmu-clear-btn,
body[data-userway-s6-styled="true"] .clear-btn {
    background: unset !important;
    background-color: #000000 !important;
    color: #ffff00 !important;
    box-shadow: none !important;
    border: none !important;
}



/* -----------------------------------------------------------------------
   UserWay: Highlight Links — #clear-filters button fix
   Uses confirmed trigger: data-userway-s6-styled="true"
   ----------------------------------------------------------------------- */

body[data-userway-s6-styled="true"] #clear-filters,
body:has([data-userway-s6-styled="true"]) #clear-filters {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: 2px solid #ffff00 !important;
    box-shadow: none !important;
}


/* --- HEADER: TOP NAV MENU HOVER COLOR (FINAL IMMUNITY FIX) --- */

/* 1. Normal State: CMU Red Text & Underline (Only when Highlight Links is OFF) */
html body:not([data-uw-w-hl]) #header-menu-1 .menu-item a.ct-menu-link:not([data-userway-s6-styled="true"]):hover,
html body:not([data-uw-w-hl]) #header-menu-1 .menu-item a.ct-menu-link:not([data-userway-s6-styled="true"]):focus {
    color: #c51230 !important; 
    -webkit-text-fill-color: #c51230 !important; 
    text-decoration: underline !important;
}

/* Ensure any internal spans/icons also turn Red */
html body:not([data-uw-w-hl]) #header-menu-1 .menu-item a.ct-menu-link:not([data-userway-s6-styled="true"]):hover *,
html body:not([data-uw-w-hl]) #header-menu-1 .menu-item a.ct-menu-link:not([data-userway-s6-styled="true"]):focus * {
    color: #c51230 !important; 
    -webkit-text-fill-color: #c51230 !important;
}

/* 2. UserWay State: Yellow Text on Black Background (Only when Highlight Links is ON) */
html body[data-uw-w-hl] #header-menu-1 .menu-item a.ct-menu-link:hover,
html body[data-uw-w-hl] #header-menu-1 .menu-item a.ct-menu-link:focus,
#header-menu-1 .menu-item a.ct-menu-link[data-userway-s6-styled="true"]:hover,
#header-menu-1 .menu-item a.ct-menu-link[data-userway-s6-styled="true"]:focus {
    color: #ffff00 !important; 
    -webkit-text-fill-color: #ffff00 !important; 
    background-color: #000000 !important; 
    text-decoration: underline !important;
}

/* Ensure inner text wrappers turn Yellow but do NOT stack black backgrounds */
html body[data-uw-w-hl] #header-menu-1 .menu-item a.ct-menu-link:hover *,
#header-menu-1 .menu-item a.ct-menu-link[data-userway-s6-styled="true"]:hover * {
    color: #ffff00 !important; 
    -webkit-text-fill-color: #ffff00 !important; 
    background-color: transparent !important; 
}

/* 3. ICON IMMUNITY: Force the FontAwesome pseudo-element to stay Yellow */
/* This defeats inline !important styles injected by UserWay's Javascript */
html body[data-uw-w-hl] #header-menu-1 li#menu-item-30517 a:hover i.fa::before,
html body[data-uw-w-hl] #header-menu-1 li#menu-item-30517 a:focus i.fa::before,
#header-menu-1 li#menu-item-30517 a[data-userway-s6-styled="true"]:hover i.fa::before,
#header-menu-1 li#menu-item-30517 a[data-userway-s6-styled="true"]:focus i.fa::before {
    color: #ffff00 !important;
    -webkit-text-fill-color: #ffff00 !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-shadow: none !important;
}


/* -----------------------------------------------------------------------
   UserWay: Highlight Links — Accessibility icon (.fa-universal-access)
   Keeps the icon yellow on hover, overriding the global hover-flip rule
   ----------------------------------------------------------------------- */

html body[data-uw-w-hl] #header-menu-1 li#menu-item-30517 a:hover .fa-universal-access,
html body[data-uw-w-hl] #header-menu-1 li#menu-item-30517 a:focus .fa-universal-access,
html body:has([data-userway-s6-styled="true"]) #header-menu-1 li#menu-item-30517 a:hover .fa-universal-access,
html body:has([data-userway-s6-styled="true"]) #header-menu-1 li#menu-item-30517 a:focus .fa-universal-access {
    background-color: #ffff00 !important; /* Keeps the SVG mask yellow */
    color: #ffff00 !important;
    -webkit-text-fill-color: #ffff00 !important;
    -webkit-mask-image: var(--fa-universal-access-mask, none);
    opacity: 1 !important;
}
