/* =========================================================
   THE EVENTS CALENDAR — BRAND COLOR OVERRIDES
   Primary:   --rw-primary
   Hover:     --rw-secondary
   ========================================================= */

.post-type-archive-tribe_events .fl-page {
    overflow: hidden;
}

section.tribe-common-l-container.tribe-events-l-container {
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

/*
 * Map The Events Calendar variables to the theme variables.
 * This handles most plugin buttons, selected states, loaders,
 * active controls, and other accent elements.
 */
.tribe-events,
.tribe-common {
    --tec-color-accent-primary: var(--rw-primary);
    --tec-color-accent-primary-hover: var(--rw-secondary);
    --tec-color-accent-primary-active: var(--rw-secondary);

    --tec-color-background-events-bar-submit-button: var(--rw-primary);
    --tec-color-background-events-bar-submit-button-hover: var(--rw-secondary);

    --tec-color-link-accent: var(--rw-primary);
}


/* =========================================================
   FIND EVENTS BUTTON
   ========================================================= */

.tribe-events .tribe-events-c-search__button, .tribe-events .tribe-common-c-btn.tribe-events-c-search__button {
    background-color: var(--rw-primary) !important;
    border-color: var(--rw-primary) !important;
    color: #fff !important;
    box-shadow: none;
    outline: none;
    border-radius: 60px;
}

.tribe-events .tribe-events-c-search__button:hover,
.tribe-events .tribe-events-c-search__button:focus,
.tribe-events .tribe-common-c-btn.tribe-events-c-search__button:hover,
.tribe-events .tribe-common-c-btn.tribe-events-c-search__button:focus {
    background-color: var(--rw-secondary) !important;
    border-color: var(--rw-secondary) !important;
    color: #fff !important;
    box-shadow: none;
    outline: none;
    border-radius: 60px;
}

.tribe-common--breakpoint-medium.tribe-events .tribe-common-c-btn.tribe-events-c-search__button {
    margin-bottom: 0;
}


/* =========================================================
   CUSTOM "GO TO EVENT" LINK
   Only targets your custom CTA.
   It will not affect normal plugin links.
   ========================================================= */

.tribe-events .hm-event-registration-link {
    margin-top: 15px;
}

.tribe-events .hm-event-registration-link a,
.tribe-events .hm-event-registration-link a:visited {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    color: var(--rw-primary) !important;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none !important;

    border: 0 !important;
    box-shadow: none !important;
    outline: none;
}

.tribe-events .hm-event-registration-link a:hover,
.tribe-events .hm-event-registration-link a:focus-visible {
    color: var(--rw-secondary) !important;
    text-decoration: none !important;

    border: 0 !important;
    box-shadow: none !important;
    outline: none;
}

.tribe-events .hm-event-registration-link .rw-event__arrow {
    transition: transform 0.2s ease;
}

.tribe-events .hm-event-registration-link a:hover .rw-event__arrow,
.tribe-events .hm-event-registration-link a:focus-visible .rw-event__arrow {
    transform: translateX(3px);
}


/* =========================================================
   ACTIVE VIEW UNDERLINE
   List / Month / Day
   ========================================================= */

.tribe-events
.tribe-events-c-view-selector__list-item--active
.tribe-events-c-view-selector__list-item-link::after {
    background-color: var(--rw-primary) !important;
}


/* =========================================================
   CALENDAR ACCENT ELEMENTS
   ========================================================= */

.tribe-events .tribe-common-c-loader__dot {
    background-color: var(--rw-primary) !important;
}

.tribe-events .tribe-events-calendar-month__day-cell--selected,
.tribe-events .tribe-events-calendar-month__day-cell--selected:hover,
.tribe-events .tribe-events-calendar-month__day-cell--selected:focus {
    background-color: var(--rw-primary) !important;
}


/* =========================================================
   FILTER BAR ACCENTS
   Avoids globally recoloring every link.
   ========================================================= */

.tribe-events .tribe-filter-bar button:hover,
.tribe-events .tribe-filter-bar button:focus-visible,
.tribe-events .tribe-filter-bar .tribe-filter-bar-c-filter__toggle:hover,
.tribe-events .tribe-filter-bar .tribe-filter-bar-c-filter__toggle:focus-visible {
    color: var(--rw-primary);
}


/* =========================================================
   OPTIONAL ACCESSIBLE FOCUS STYLE
   Keeps keyboard focus visible without adding a border.
   ========================================================= */

.tribe-events .hm-event-registration-link a:focus-visible,
.tribe-events .tribe-events-c-search__button:focus-visible {
    outline: 2px solid var(--rw-secondary) !important;
    outline-offset: 3px;
}

/* =========================================================
   SUBSCRIBE TO CALENDAR BUTTON
   ========================================================= */

.tribe-events .tribe-events-c-subscribe-dropdown__button {
    border-color: var(--rw-primary) !important;
    color: var(--rw-primary) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button:hover,
.tribe-events .tribe-events-c-subscribe-dropdown__button:focus-visible,
.tribe-events .tribe-events-c-subscribe-dropdown__button[aria-expanded="true"] {
    border-color: var(--rw-secondary) !important;
    color: var(--rw-secondary) !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* Button text */
.tribe-events .tribe-events-c-subscribe-dropdown__button-text {
    color: inherit !important;
}

/* Dropdown arrow */
.tribe-events .tribe-events-c-subscribe-dropdown__button-icon {
    color: inherit !important;
    fill: currentColor !important;
}

/* Dropdown panel */
.tribe-events .tribe-events-c-subscribe-dropdown__content {
    border-color: var(--rw-primary);
}

/* Links inside the opened dropdown */
.tribe-events .tribe-events-c-subscribe-dropdown__list-item-link {
    color: var(--rw-primary) !important;
}

.tribe-events .tribe-events-c-subscribe-dropdown__list-item-link:hover,
.tribe-events .tribe-events-c-subscribe-dropdown__list-item-link:focus-visible {
    color: var(--rw-secondary) !important;
}

/* Shared button styling */
.tribe-events .tribe-common-c-btn,
.tribe-events .tribe-events-c-search__button,
.tribe-events .tribe-events-c-subscribe-dropdown__button {
    border-radius: 9999px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    transition: all .2s ease;
}

.tribe-events .tribe-events-c-subscribe-dropdown__button {
    background: var(--rw-primary);
    color: #fff;
    border: 2px solid var(--rw-primary);
}

.tribe-events .tribe-events-c-subscribe-dropdown__button:hover,
.tribe-events .tribe-events-c-subscribe-dropdown__button:focus-visible {
    background: var(--rw-secondary);
    border-color: var(--rw-secondary);
    color: #fff;
}

/* ==========================================
   Events Search Bar
   ========================================== */

.tribe-events .tribe-events-c-events-bar {
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid #ddd;
}

/* Search input */
.tribe-events .tribe-events-c-search__input-control {
    border-radius: 999px 0 0 999px;
}

/* Find Events button */
.tribe-events .tribe-events-c-search__button {
    border-radius: 999px;
    margin: 6px;
    min-height: 48px;
    padding: 0 28px;
}

/* View selector (List / Month / Day) */
.tribe-events .tribe-events-c-view-selector {
    border-radius: 0 999px 999px 0;
}