/**
 * Keren Events - Frontend Styles
 */

/* ── Container ── */
.keren-events-container {
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

/* ── Responsive grid: 1 col mobile → 2 col tablet → 3 col desktop ── */
@media (min-width: 600px) {
    .keren-events-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .keren-events-container .keren-events-year-title {
        grid-column: 1 / -1;
    }
    .keren-events-container .keren-event-box {
        margin-bottom: 0;
    }
}

@media (min-width: 900px) {
    .keren-events-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Year title ── */
.keren-events-year-title {
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

/* ── Card wrapper ── */
.keren-event-box {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.keren-event-box:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* ── Image + overlay + title on image ── */
.keren-event-img-wrap {
    position: relative;
    height: 130px;
    overflow: hidden;
}
.keren-event-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.keren-event-img-overlay {
    position: absolute;
    inset: 0;
    /* default gradient — JS overrides based on actual image brightness */
    background: linear-gradient(transparent, rgba(0,0,0,0.65));
}
.keren-event-img-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 16px 11px;
}
.keren-event-img-title h3 {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    /* default white — JS overrides based on actual image brightness */
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Body below image ── */
.keren-event-body {
    padding: 14px 16px 16px;
    text-align: right;
}

/* Title when no image */
.keren-event-title-plain {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.keren-event-info {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
    line-height: 1.5;
}
.keren-event-location {
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
    line-height: 1.5;
}
.keren-event-teachers {
    font-size: 13px;
    color: #666;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Button ── */
.keren-event-btn-wrap {
    text-align: center;
}
.keren-event-button {
    display: inline-block;
    background: var(--keren-accent, #3199d6);
    color: #fff;
    padding: 7px 22px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--keren-accent, #3199d6) 50%, transparent);
    transition: opacity 0.2s, transform 0.15s;
}
.keren-event-button:hover {
    opacity: 0.88;
    transform: scale(1.03);
    color: #fff;
    text-decoration: none;
}

/* ── Empty state ── */
.keren-events-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}
.keren-events-empty p {
    margin: 0;
    font-size: 16px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .keren-events-container {
        padding: 0 10px;
    }
    .keren-event-img-wrap {
        height: 100px;
    }
    .keren-event-img-title h3 {
        font-size: 15px;
    }
    .keren-event-body {
        padding: 12px 14px 14px;
    }
    .keren-event-info {
        font-size: 13px;
    }
    .keren-event-location {
        font-size: 12px;
    }
    .keren-event-teachers {
        font-size: 12px;
    }
    .keren-event-button {
        font-size: 13px;
        padding: 6px 18px;
    }
}

/* ── Print ── */
@media print {
    .keren-event-box {
        box-shadow: none !important;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    .keren-event-button {
        display: none !important;
    }
}
