/**
 * JSL Events - Frontend Styles
 */

/* Marquee Widget */
.jsl-events-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    margin: 20px auto;
}

/* Header Row */
.jsl-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.jsl-events-heading {
    margin: 0;
    color: #ffffff !important;
    font-size: 1.2em;
    font-weight: 700;
    flex: 1;
    text-align: center;
    padding-left: 36px;
    /* Balance for button on right */
}

/* Footer Row */
.jsl-events-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.jsl-events-view-all {
    flex: 1;
    text-align: center;
    padding-left: 36px;
    /* Balance for button on right */
    color: #ffffff;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.jsl-events-view-all:hover {
    opacity: 0.8;
    color: #ffffff;
}

.jsl-events-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.jsl-events-nav-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.7);
    transform: scale(1.1);
}

.jsl-events-nav-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.8);
}

.jsl-events-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.jsl-events-track {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jsl-event-item {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid #0059b4;
}

.jsl-event-item:hover {
    background: #ffffff;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Event title takes full width after date */
.jsl-event-item .jsl-event-title {
    width: 100%;
    flex: none;
}

/* Meta row containing date and tags - bottom row */
.jsl-event-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

/* Category tags in marquee - inline with date */
.jsl-event-item .jsl-event-categories {
    margin: 0;
}

.jsl-event-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 4px 8px;
    background: #0059b4;
    color: #ffffff;
    font-size: 0.75em;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}

.jsl-event-title {
    color: #1e3a5f;
    font-size: 0.95em;
    font-weight: 600;
    line-height: 1.3;
}

/* Events List Page */
.jsl-events-page {
    padding: 40px 0;
}

.jsl-events-page-header {
    margin-bottom: 40px;
    text-align: center;
}

.jsl-events-page-header h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: #1e3a5f;
    margin: 0;
}

.jsl-events-list {
    display: grid;
    gap: 30px;
}

.jsl-events-list-item {
    display: grid;
    gap: 20px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.jsl-events-list-item.has-image {
    grid-template-columns: 200px 1fr;
}

.jsl-events-list-item:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.jsl-events-list-image {
    overflow: hidden;
}

.jsl-events-list-image img {
    width: 100%;
    height: 235px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.jsl-events-list-item:hover .jsl-events-list-image img {
    transform: scale(1.05);
}

.jsl-events-list-content {
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.jsl-events-list-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0059b4;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 8px;
}

.jsl-events-list-title {
    margin: 0 0 12px 0;
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1.3;
}

.jsl-events-list-title a {
    color: #1e3a5f;
    text-decoration: none;
    transition: color 0.3s ease;
}

.jsl-events-list-title a:hover {
    color: #0059b4;
}

.jsl-events-list-excerpt {
    color: #555;
    font-size: 0.95em;
    line-height: 1.6;
    margin-bottom: 15px;
}

.jsl-events-list-link {
    color: #0059b4;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.jsl-events-list-link:hover {
    color: #003d7a;
}

/* Single Event Page */
.jsl-event-single {
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.jsl-event-single-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

.jsl-event-single-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jsl-event-single-header {
    padding: 30px 40px 0;
}

.jsl-event-single-title {
    margin: 0 0 15px 0;
    font-size: 2em;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.3;
}

.jsl-event-single-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0059b4;
    font-size: 1em;
    font-weight: 600;
}

.jsl-event-single-date svg {
    color: #0059b4;
}

.jsl-event-single-content {
    padding: 30px 40px;
    font-size: 1.05em;
    line-height: 1.8;
    color: #333;
}

.jsl-event-single-content p {
    margin-bottom: 1.5em;
}

.jsl-event-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.jsl-event-single-footer {
    padding: 20px 40px 30px;
    border-top: 1px solid #eee;
}

.jsl-events-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0059b4;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.jsl-events-back-link:hover {
    color: #003d7a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .jsl-events-wrapper {
        padding: 8px;
        margin: 15px 10px;
    }

    .jsl-events-nav-btn {
        width: 32px;
        height: 32px;
    }

    .jsl-event-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .jsl-event-date {
        min-width: 45px;
        font-size: 0.7em;
    }

    .jsl-event-title {
        font-size: 0.85em;
    }

    .jsl-events-list-item {
        grid-template-columns: 1fr;
    }

    .jsl-events-list-image img {
        height: 200px;
    }

    .jsl-events-list-content {
        padding: 20px;
    }

    .jsl-events-page-header h1 {
        font-size: 1.8em;
    }

    .jsl-event-single-header,
    .jsl-event-single-content,
    .jsl-event-single-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .jsl-event-single-title {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .jsl-events-wrapper {
        padding: 6px;
        margin: 10px 5px;
    }

    .jsl-event-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .jsl-events-list-title {
        font-size: 1.2em;
    }

    .jsl-event-single-title {
        font-size: 1.3em;
    }

    .jsl-event-single-content {
        font-size: 0.95em;
    }
}

/* Event Category Tags */
.jsl-event-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.jsl-event-tag {
    display: inline-flex;
    align-items: center;
    position: relative;
    padding: 5px 12px 5px 18px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    border-radius: 0 4px 4px 0;
    margin-left: 8px;
}

/* Triangle shape on left */
.jsl-event-tag::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-top: 12.5px solid transparent;
    border-bottom: 12.5px solid transparent;
    border-right: 8px solid currentColor;
}

/* Bullet point */
.jsl-tag-bullet {
    margin-right: 5px;
    font-size: 1.2em;
    line-height: 1;
}

/* RCJK - Orange tag */
.jsl-tag-rcjk {
    background-color: #e67e22;
}

.jsl-tag-rcjk::before {
    border-right-color: #e67e22;
}

/* RCJPS - Blue tag */
.jsl-tag-rcjps {
    background-color: #3498db;
}

.jsl-tag-rcjps::before {
    border-right-color: #3498db;
}

/* Responsive adjustments for tags */
@media (max-width: 768px) {
    .jsl-event-categories {
        gap: 6px;
        margin: 8px 0;
    }

    .jsl-event-tag {
        padding: 4px 10px 4px 15px;
        font-size: 0.7em;
    }

    .jsl-event-tag::before {
        left: -7px;
        border-top-width: 11px;
        border-bottom-width: 11px;
        border-right-width: 7px;
    }
}