/* --- PLUGIN OVERRIDES: TRIBE EVENTS --- */

.tribe-events-calendar-month__calendar-event-datetime {
    display: none !important;
}

.tribe-events .tribe-events-header {
    margin: 0 !important;
    padding: 0 !important;
}

.tribe-common.tribe-events.tribe-events-widget.tribe-events-view--shortcode.tribe-events-widget-events-month {
    padding: 0 !important;
}

p.tribe-events-promo.tribe-common-b1.tribe-events-c-promo {
    display: none !important;
}



/* --- STACKABLE OVERRIDES --- */

.stk-entrance.stk-will-enter:not(.stk-entered) {
    opacity: 1 !important;
    transform: none !important;
}

:is(.stk-2896d5e, .stk-e51e702, .stk-2a1cd55, .stk-d5e78b0, .stk-9d1edb1) {
    --entrance-transform: translateY(0px) !important;
}



/* --- MEDIA LIST (Styled like "In Brief") --- */
ul:has(.media-item) {
    list-style: none !important;
    padding-inline-start: 0 !important;
    margin: 0 !important;
}

li:has(.media-item) {
    border-block-end: 1px solid var(--cmu-line);
    padding-block: 15px;
    cursor: pointer;
}

li:has(.media-item):last-child { border-block-end: none; }

.media-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; width: 100%; }
.media-item h3 { margin: 0; font-size: 1.1rem; font-weight: 500; line-height: 1.4; }

/* REST STATE: Absolute #main ID Specificity to beat Rule 1 */
#main :is(.stk-block-content .cmu-in-media-list, .entry-content .cmu-in-media-list, .cmu-in-media-list) ul li .media-item h3 a.cmu-news-link { 
    text-decoration: none !important; 
    box-shadow: none !important;
    border: none !important;
    color: var(--cmuq-black, #000) !important; 
    transition: color 0.2s ease !important; 
}

.media-item::after {
    content: ""; flex-shrink: 0; width: 20px; height: 20px;
    background-image: url('https://cmuq2025stg.wpenginepowered.com/wp-content/themes/blocksy-child/assets/images/dark-arrow.svg');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    opacity: 0.7; margin-block-start: 4px;
    transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), filter 0.3s ease, opacity 0.3s ease;
}

/* HOVER & FOCUS STATE: Tier 2 Compliant (CMU Red, NO Line) */
#main :is(.stk-block-content .cmu-in-media-list, .entry-content .cmu-in-media-list, .cmu-in-media-list) ul li .media-item h3 a.cmu-news-link:is(:hover, :focus) { 
    text-decoration: underline !important; 
    color: #C41230 !important; 
}

li:has(.media-item):hover .media-item::after {
    transform: translateX(8px); opacity: 1;
    filter: invert(13%) sepia(94%) saturate(5929%) hue-rotate(344deg) brightness(88%) contrast(98%);
}



/* --- EVENTS CALENDAR V2: NAV CHEVRON HOVER OVERRIDE --- */

/* 1. Target the V2 common utility button classes directly */
body .tribe-events button.tribe-events-c-top-bar__nav-link:hover,
body .tribe-common button.tribe-common-c-btn-icon:hover,
body ul.tribe-events-c-top-bar__nav-list li button:hover {
    background-color: var(--cmuq-red) !important;
    background: var(--cmuq-red) !important; /* Overrides any theme background images/gradients */
    border-color: var(--cmuq-red) !important;
    opacity: 1 !important;
}

/* 2. Target the SVG and Path using the exact V2 icon classes */
body .tribe-events button.tribe-events-c-top-bar__nav-link:hover svg,
body .tribe-events button.tribe-events-c-top-bar__nav-link:hover svg path,
body .tribe-common button.tribe-common-c-btn-icon:hover svg,
body .tribe-common button.tribe-common-c-btn-icon:hover svg path,
body ul.tribe-events-c-top-bar__nav-list li button:hover svg,
body ul.tribe-events-c-top-bar__nav-list li button:hover svg path {
    fill: #ffffff !important; /* Using hex directly just in case the variable fails inside the SVG */
    stroke: #ffffff !important;
    color: #ffffff !important;
}


/* --- STACKABLE BLOCKS: USERWAY ALIGNMENT FIX --- */

/* Prevent UserWay from shrinking text blocks, but EXCLUDE button groups and Stackable row/column containers */
body:has([data-userway-s6-styled="true"]) .stk-block-content .has-text-align-left:not(.stk-button-group):not(.stk-block-button):not(.stk-row):not([class*="stk-4a0c809"]),
body[data-uw-w-hl] .stk-block-content .has-text-align-left:not(.stk-button-group):not(.stk-block-button):not(.stk-row):not([class*="stk-4a0c809"]),
body .uw-hl-active .stk-block-content .has-text-align-left:not(.stk-button-group):not(.stk-block-button):not(.stk-row):not([class*="stk-4a0c809"]) {
    text-align: left !important;
    display: block !important; 
    width: 100% !important; 
    margin-left: 0 !important;
}

/* Ensure any injected UserWay wrapper tags inside those text blocks also align left */
body:has([data-userway-s6-styled="true"]) .stk-block-content .has-text-align-left:not(.stk-button-group):not(.stk-block-button):not(.stk-row):not([class*="stk-4a0c809"]) * {
    text-align: left !important;
}



/* --- EVENTS CALENDAR: LINK HOVER STATE (DOUBLE UNDERLINE FIX & DATE UNDERLINE) --- */

/* 1. The Date Number: Turn red and apply standard underline */
.tribe-events-calendar-month__day-cell .tribe-events-calendar-month__day-date-link:hover {
    color: var(--cmuq-red, #c51230) !important;
    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 */
    box-shadow: none !important; /* Prevents any plugin shadow conflicts */
    transition: color 0.2s ease-in-out;
}

/* 2. The Event Title: Turn red, kill the plugin's fake shadow lines, and force ONE real underline */
.tribe-events-calendar-month__day-cell .tribe-events-calendar-month__calendar-event-title-link:hover {
    color: var(--cmuq-red, #c51230) !important;
    
    /* Kill all of the plugin's "fake" underline methods */
    box-shadow: none !important; 
    border-bottom: none !important;
    background-image: none !important;
    
    /* Force one, clean, standard underline */
    text-decoration: underline !important; 
    text-decoration-color: var(--cmuq-red, #c51230) !important;
    text-underline-offset: 2px !important; 
    
    transition: color 0.2s ease-in-out;
}


/* --- EVENTS CALENDAR: POPUP / TOOLTIP LINK HOVER STATE --- */

/* Target hyperlinks inside the dynamically generated event popups */
.tribe-events-tooltip a:hover,
.tribe-tooltip a:hover,
[id^="tribe-events-tooltip-content"] a:hover {
    color: var(--cmuq-red, #c51230) !important;
    
    /* Apply the exact same clean underline styling as the calendar links */
    text-decoration: underline !important; 
    text-decoration-color: var(--cmuq-red, #c51230) !important;
    text-underline-offset: 2px !important; 
    
    /* Override any default plugin hover effects */
    box-shadow: none !important; 
    border-bottom: none !important;
    background-image: none !important;
    
    transition: color 0.2s ease-in-out;
}


/* -----------------------------------------------------------------------
   UserWay: Highlight Links — Tribe Events prev/next nav buttons
   Prevents red hover bleed from Tribe's own hover styles
   ----------------------------------------------------------------------- */

body[data-userway-s6-styled="true"] .tribe-events-c-top-bar__nav-link,
body[data-userway-s6-styled="true"] .tribe-events-c-top-bar__nav-link:hover,
body[data-userway-s6-styled="true"] .tribe-events-c-top-bar__nav-link:focus,
body[data-userway-s6-styled="true"] .tribe-events-c-top-bar__nav-link:active,
body:has([data-userway-s6-styled="true"]) .tribe-events-c-top-bar__nav-link,
body:has([data-userway-s6-styled="true"]) .tribe-events-c-top-bar__nav-link:hover,
body:has([data-userway-s6-styled="true"]) .tribe-events-c-top-bar__nav-link:focus,
body:has([data-userway-s6-styled="true"]) .tribe-events-c-top-bar__nav-link:active {
    background: #000000 !important;
    background-color: #000000 !important;
    color: #ffff00 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Lock the SVG chevron fill to yellow — Tribe targets the path directly */
body[data-userway-s6-styled="true"] .tribe-events-c-top-bar__nav-link svg path,
body[data-userway-s6-styled="true"] .tribe-events-c-top-bar__nav-link:hover svg path,
body:has([data-userway-s6-styled="true"]) .tribe-events-c-top-bar__nav-link svg path,
body:has([data-userway-s6-styled="true"]) .tribe-events-c-top-bar__nav-link:hover svg path {
    fill: #ffff00 !important;
}


/* --- STACKABLE BLOCKS: STAY CONNECTED RTL FIX (WPML SAFE) --- */

/* Force the 'Stay Connected' block to use English layout ONLY on LTR (English) pages */
html[dir="ltr"] #stay-connected .stk-block-text__text,
body:not(.rtl) #stay-connected .stk-block-text__text {
    text-align: left !important;
    direction: ltr !important;
}

/* Ensure the Arabic translation explicitly remains RTL (just in case UserWay strips it) */
html[dir="rtl"] #stay-connected .stk-block-text__text,
body.rtl #stay-connected .stk-block-text__text {
    text-align: right !important;
    direction: rtl !important;
}


/* --- STACKABLE CAROUSEL: REMOVE USERWAY/FOCUS OUTLINES --- */

/* Suppress the red focus outline on carousel wrappers and navigation arrows */
body[data-uw-w-hl] .stk-block-carousel__slider:focus,
body[data-uw-w-hl] .stk-block-carousel__button:focus,
.stk-block-carousel__slider:focus,
.stk-block-carousel__slider:focus-visible,
.stk-block-carousel__button:focus,
.stk-block-carousel__button:focus-visible {
    outline: none !important;
    box-shadow: none !important; /* Prevents UserWay from falling back to a shadow */
}


/* --- EVENTS CALENDAR: TOP NAV ARROWS (USERWAY BLACK/YELLOW HOVER FIX) --- */

/* 1. Force the background to stay solid black on hover when UserWay is active */
body:has([data-userway-s6-styled]) .tribe-events button.tribe-events-c-top-bar__nav-link:hover,
body:has([data-userway-s6-styled]) .tribe-common button.tribe-common-c-btn-icon:hover,
body:has([data-userway-s6-styled]) ul.tribe-events-c-top-bar__nav-list li button:hover,
body[data-uw-w-hl] .tribe-events button.tribe-events-c-top-bar__nav-link:hover,
body[data-uw-w-hl] .tribe-common button.tribe-common-c-btn-icon:hover {
    background-color: #000000 !important;
    background: #000000 !important;
    border-color: #000000 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 2. Force the SVG arrow icon and its internal path to stay yellow on hover */
body:has([data-userway-s6-styled]) .tribe-events button.tribe-events-c-top-bar__nav-link:hover svg,
body:has([data-userway-s6-styled]) .tribe-events button.tribe-events-c-top-bar__nav-link:hover svg path,
body:has([data-userway-s6-styled]) .tribe-common button.tribe-common-c-btn-icon:hover svg,
body:has([data-userway-s6-styled]) .tribe-common button.tribe-common-c-btn-icon:hover svg path,
body[data-uw-w-hl] .tribe-events button.tribe-events-c-top-bar__nav-link:hover svg,
body[data-uw-w-hl] .tribe-events button.tribe-events-c-top-bar__nav-link:hover svg path {
    fill: #ffff00 !important; 
    stroke: #ffff00 !important;
    color: #ffff00 !important;
}


/* --- EVENTS CALENDAR: NOTICE MESSAGES (USERWAY TEXT COLOR FIX) --- */

/* 1. Force the notice container to keep a light background and black text */
body:has([data-userway-s6-styled]) .tribe-events-c-messages__message--notice,
body[data-uw-w-hl] .tribe-events-c-messages__message--notice {
    background-color: var(--cmuq-gray-100) !important; /* Force light gray background */
    color: #000000 !important; /* Force non-linked text to black */
    border: 1px solid var(--cmuq-gray-300) !important;
}

/* 2. Target the specific text wrapper inside the notice */
body:has([data-userway-s6-styled]) .tribe-events-c-messages__message--notice div[data-key],
body[data-uw-w-hl] .tribe-events-c-messages__message--notice div[data-key] {
    color: #000000 !important; /* Ensure inner text node is explicitly black */
}

/* 3. Ensure the icon/SVG inside the notice doesn't turn yellow/disappear */
body:has([data-userway-s6-styled]) .tribe-events-c-messages__message--notice svg path,
body[data-uw-w-hl] .tribe-events-c-messages__message--notice svg path {
    fill: #444444 !important; /* Keep the icon a visible dark gray */
    stroke: #444444 !important;
}

/* 4. PROTECTION: Ensure the link itself retains the High-Contrast UserWay style */
body:has([data-userway-s6-styled]) .tribe-events-c-messages__message--notice a.tribe-events-c-messages__message-list-item-link,
body[data-uw-w-hl] .tribe-events-c-messages__message--notice a.tribe-events-c-messages__message-list-item-link {
    color: #ffff00 !important; /* Force Yellow for the link text */
    background-color: #000000 !important; /* Force Black background for the link */
    padding: 2px 4px !important; /* Give the black background box a little breathing room */
    text-decoration: underline !important;
    font-weight: bold !important;
}

/* 5. Ensure the link doesn't lose contrast on hover */
body:has([data-userway-s6-styled]) .tribe-events-c-messages__message--notice a.tribe-events-c-messages__message-list-item-link:hover,
body[data-uw-w-hl] .tribe-events-c-messages__message--notice a.tribe-events-c-messages__message-list-item-link:hover {
    color: #000000 !important; /* Invert on hover: Black text */
    background-color: #ffff00 !important; /* Invert on hover: Yellow background */
}
