/**
 * DPCalendar Upcoming – Card Slider
 * Template override for joomstarter
 * Proportions mirror the existing card.php / user.css card styles.
 */

/* ============================================================
   Wrapper
   ============================================================ */
.mod-dpcalendar-card-slider {
    position: relative;
    width: 100%;
}

/* ============================================================
   Navigation arrows  – left-aligned, colour #4B5060
   ============================================================ */
.dpcal-slider-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;   /* arrows on the LEFT */
    gap: 8px;
    margin: 0 -18px 20px -18px;
    padding: 0 18px;
}

html[dir="rtl"] .dpcal-slider-nav {
    flex-direction: row;
    justify-content: flex-end;     /* visual left in RTL */
}

.dpcal-custom-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: transparent;
    border: 1px solid #4B5060;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
    padding: 0;
    flex-shrink: 0;
    overflow: visible;
}

.dpcal-custom-arrow::before {
    display: none !important;
}

.dpcal-custom-arrow img {
    display: block;
    width: 12px;
    height: 21px;
    /* tint SVG-as-img to #4B5060 */
    filter: brightness(0) saturate(100%) invert(27%) sepia(10%) saturate(600%) hue-rotate(192deg) brightness(95%) contrast(92%);
}

.dpcal-custom-arrow:hover {
    background: #00B3F0;
    border-color: #00B3F0;
}

.dpcal-custom-arrow:hover img {
    filter: brightness(0) invert(1);
}

.dpcal-custom-arrow.slick-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dpcal-custom-arrow.slick-disabled:hover {
    background: transparent;
    border-color: #4B5060;
}

.dpcal-custom-arrow.slick-disabled:hover img {
    filter: brightness(0) saturate(100%) invert(27%) sepia(10%) saturate(600%) hue-rotate(192deg) brightness(95%) contrast(92%);
}

/* ============================================================
   Slick overrides
   ============================================================ */
.dpcal-slider {
    width: 100%;
    margin: 0 -18px;
    overflow: hidden;
}

.dpcal-slider .slick-list {
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.dpcal-slider .slick-track {
    display: flex;
    align-items: stretch;
}

.dpcal-slider .slick-slide {
    height: auto;
    float: none;
    display: block;
}

/* ============================================================
   Slide item wrapper
   ============================================================ */
.dpcal-slide-item {
    padding: 0 18px;
    box-sizing: border-box;
}

/* ============================================================
   Event card  – no background, no border-radius, no shadow
   (matches the commented-out card.php / user.css card style)
   ============================================================ */
.dpcal-event-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Image area --- */
.dpcal-event-card__image-wrap {
    position: relative;
    width: 100%;
    height: 172px;
    overflow: hidden;
    background: #eee;
    flex-shrink: 0;
}

.dpcal-event-card__image-wrap a {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Image link: kill ALL dark overlays from DPCalendar / template ─────────
   The overlay may come as: direct background on a:hover, ::before, or ::after.
   We neutralise all three, then add our own teal overlay via the image-wrap.
   ─────────────────────────────────────────────────────────────────────────── */

/* 1. Reset any direct background the link itself gains on hover */
.mod-dpcalendar-card-slider .dpcal-event-card__image-wrap a,
.mod-dpcalendar-card-slider .dpcal-event-card__image-wrap a:hover,
.mod-dpcalendar-card-slider .dpcal-event-card__image-wrap a:focus {
    background: transparent !important;
    background-color: transparent !important;
}

/* 2. Neutralise ::before and ::after pseudo-elements on the link */
.mod-dpcalendar-card-slider .dpcal-event-card__image-wrap a::before,
.mod-dpcalendar-card-slider .dpcal-event-card__image-wrap a::after {
    background: transparent !important;
    background-color: transparent !important;
    opacity: 0 !important;
}

/* 3. Our teal overlay lives on the image-wrap itself (not the link),
      so it is completely independent of DPCalendar's link styles */
.mod-dpcalendar-card-slider .dpcal-event-card__image-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 179, 240, 0.38);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.mod-dpcalendar-card-slider .dpcal-event-card:hover .dpcal-event-card__image-wrap::after {
    opacity: 1;
}

.dpcal-event-card__image-wrap .dp-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.mod-dpcalendar-card-slider .dpcal-event-card:hover .dpcal-event-card__image-wrap .dp-image {
    transform: scale(1.08);
}

/* No-image placeholder */
.dpcal-event-card__no-image {
    background: #d8e4ef;
    height: 100%;
    display: block;
}

/* --- Location badge – below image; DPCalendar location colour via --dpcal-location-badge-bg (per card), else site facility colour --- */
.dpcal-event-card__location-badge {
    display: inline-block;
    padding: 0px 7px;
    max-width: 74%;
    background-color: var(--dpcal-location-badge-bg, var(--facility-color, #3dcbff));
    color: #fff;
    font-size: 0.9em;
    font-weight: 500;
    line-height: 1.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Text content area – no background, no padding --- */
.dpcal-event-card__content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dpcal-event-card__title {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    line-height: 1.4;
    font-weight: 600;
}

.dpcal-event-card__title a {
    color: inherit;
    text-decoration: none;
    padding: unset;
    transition: color 0.2s ease;
}

.dpcal-event-card__title a:hover {
    color: #00B3F0;
}

.dpcal-event-card__date {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.95rem;
}

/* Read-more link – matches card.php arrow-holder circle */
.dpcal-event-card__readmore {
    margin-top: auto;
    padding-left: 0;
    padding-right: 0;
    color: var(--primary-color, #0066cc);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.dpcal-event-card__readmore:hover {
    color: #00B3F0;
    text-decoration: none;
}

/* Arrow holder: 30×30 gray circle – matches readmore-arrow-holder in card.php */
.dpcal-readmore-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    aspect-ratio: 1 / 1;
    border-radius: 30px;    /* intentional circle for the arrow indicator */
    background: #fff;
    flex-shrink: 0;
    color: #000;
    transition: background 0.2s ease, color 0.2s ease;
}

.dpcal-event-card__readmore:hover .dpcal-readmore-arrow {
    background: #00B3F0;
    color: #fff;
}

/* ============================================================
   "All events" – pill ghost button, RTL fill (same pattern as discover-more-btn / programs-all-btn)
   Aligned to the right; fill uses facility color where set (--facility-color).
   ============================================================ */
.dpcal-all-events {
    text-align: right;
    margin-top: 28px;
    direction: rtl;
}

.dpcal-all-events__link {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
    padding: 10px 26px;
    font-size: 21px;
    font-style: normal;
    font-weight: 600;
    line-height: 23px;
    letter-spacing: 0.525px;
    color: #4b5060;
    text-decoration: none;
    background: transparent;
    border: 1px solid #4b5060;
    border-radius: 999px;
    transition: color 0.4s ease, border-color 0.4s ease;
}

/* Hover fill – right to left (Hebrew RTL standard: ::before starts at left: 100%) */
.dpcal-all-events__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    background-color: var(--facility-color, #00b3f0);
    border-radius: inherit;
    transition: left 0.4s ease;
    z-index: -1;
}

.dpcal-all-events__link:hover,
.dpcal-all-events__link:focus {
    color: #1e2438; /* השימוש בכחול הכהה הקבוע */
    border-color: #1e2438;
    text-decoration: none;
}

.dpcal-all-events__link:hover::before,
.dpcal-all-events__link:focus::before {
    left: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .dpcal-slider-nav {
        justify-content: center;
    }

    html[dir="rtl"] .dpcal-slider-nav {
        justify-content: center;
    }
}

/* ============================================================
   RTL – slick track direction
   ============================================================ */
html[dir="rtl"] .dpcal-slider .slick-list {
    direction: rtl;
}
