/* ============================================================
   Enym WPBakery Timetable – Frontend Styles
   ============================================================ */

/* ── Container ──────────────────────────────────────────────── */
.enym-timetable {
    width: 100%;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ── Info strip (global date / time / type) ──────────────────── */
.enym-timetable__strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    padding: 10px 18px;
    margin-bottom: 4px;
    background: currentColor;
    background: var(--wpex-accent, #0073aa);
    color: #fff;
    border-radius: 6px 6px 0 0;
}

.enym-timetable__strip-title {
    font-weight: 700;
    font-size: 1rem;
    flex: 1 1 100%;
}

.enym-timetable__strip-label {
    font-weight: 600;
    opacity: 0.8;
}

.enym-timetable__strip-type {
    margin-left: auto;
    background: rgba(255,255,255,.18);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: .3px;
}

/* ── Table ───────────────────────────────────────────────────── */
.enym-timetable__table {
    width: 100%;
    border-collapse: collapse;
}

/* ── Column layout (CSS grid) ────────────────────────────────── */
.enym-timetable__header,
.enym-timetable__event-summary {
    display: grid;
    grid-template-columns: 90px 1fr 120px 130px;
    align-items: start;
    gap: 0;
}

/* Extra column for accordion toggle button */
.enym-timetable--accordion .enym-timetable__header,
.enym-timetable--accordion .enym-timetable__event-summary {
    grid-template-columns: 90px 1fr 120px 130px 40px;
}

/* ── Header row ──────────────────────────────────────────────── */
.enym-timetable__header {
    background: #f1f5f9;
    border-bottom: 2px solid #cbd5e1;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #475569;
}

/* ── Column cells ─────────────────────────────────────────────── */
.enym-timetable__col {
    padding: 12px 14px;
    box-sizing: border-box;
}

.enym-timetable__col--time {
    text-align: center;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
}

/* ── Event row ───────────────────────────────────────────────── */
.enym-timetable__event {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.15s ease;
}

.enym-timetable__event:last-child {
    border-bottom: none;
}

.enym-timetable__event:hover > .enym-timetable__event-summary {
    background: #f8fafc;
}

/* ── Time column ─────────────────────────────────────────────── */
.enym-timetable__time {
    display: block;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--wpex-accent, #0073aa);
    white-space: nowrap;
}

.enym-timetable__time-end {
    display: block;
    font-weight: 400;
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* ── Event title column ──────────────────────────────────────── */
.enym-timetable__event-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.enym-timetable__event-title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.enym-timetable__event-title-link:hover {
    color: var(--wpex-accent, #0073aa);
    text-decoration: underline;
}

.enym-timetable__event-desc {
    margin: 4px 0 6px;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.55;
}

/* ── Date column ─────────────────────────────────────────────── */
.enym-timetable__date {
    font-size: 0.875rem;
    color: #475569;
}

/* ── Type badge ──────────────────────────────────────────────── */
.enym-timetable__type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e0f2fe;
    color: #0369a1;
    white-space: nowrap;
}

/* ── Person chips (inline preview) ──────────────────────────── */
.enym-timetable__persons-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.enym-timetable__person-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 3px 10px 3px 5px;
    font-size: 0.8125rem;
    color: #334155;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

a.enym-timetable__person-chip {
    cursor: pointer;
}

a.enym-timetable__person-chip:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: var(--wpex-accent, #0073aa);
    text-decoration: none;
}

.enym-timetable__person-chip-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.enym-timetable__person-chip-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--wpex-accent, #0073aa);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── Accordion toggle ────────────────────────────────────────── */
.enym-timetable__toggle {
    display: none; /* shown only in accordion mode via JS */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: auto;
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.enym-timetable--accordion .enym-timetable__toggle {
    display: inline-flex;
}

.enym-timetable__toggle:hover {
    background: var(--wpex-accent, #0073aa);
    border-color: var(--wpex-accent, #0073aa);
    color: #fff;
}

.enym-timetable__toggle-icon {
    display: block;
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.2s ease;
}

.enym-timetable__toggle[aria-expanded="true"] .enym-timetable__toggle-icon {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* ── Event details panel (persons) ──────────────────────────── */
.enym-timetable__event-details {
    padding: 16px 18px 20px 104px; /* align with title column */
    background: #f8fafc;
    border-top: 1px dashed #e2e8f0;
    animation: enym-tt-fade-in 0.2s ease;
}

.enym-timetable__event-details[hidden] {
    display: none;
}

@keyframes enym-tt-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* In regular row mode – details always visible ─────────────── */
.enym-timetable--row .enym-timetable__event-details {
    display: block !important;
}

.enym-timetable__persons {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* ── Single person card ──────────────────────────────────────── */
.enym-timetable__person {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex: 0 1 calc(50% - 10px);
    min-width: 220px;
}

.enym-timetable__person-avatar {
    flex-shrink: 0;
}

.enym-timetable__person-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.enym-timetable__person-initials {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wpex-accent, #0073aa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.enym-timetable__person-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.enym-timetable__person-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
}

.enym-timetable__person-role {
    font-size: 0.8125rem;
    color: #64748b;
}

.enym-timetable__person-topic {
    font-size: 0.8125rem;
    color: var(--wpex-accent, #0073aa);
    font-style: italic;
}

.enym-timetable__person-desc {
    margin-top: 6px;
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}

.enym-timetable__person-desc p:last-child {
    margin-bottom: 0;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 767px) {
    .enym-timetable__header,
    .enym-timetable__event-summary,
    .enym-timetable--accordion .enym-timetable__header,
    .enym-timetable--accordion .enym-timetable__event-summary {
        grid-template-columns: 70px 1fr;
        grid-template-rows: auto auto auto;
    }

    .enym-timetable__col--date,
    .enym-timetable__col--type,
    .enym-timetable__header .enym-timetable__col--date,
    .enym-timetable__header .enym-timetable__col--type {
        display: none;
    }

    .enym-timetable__toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        margin: 12px 14px 0 0;
    }

    .enym-timetable__event-details {
        padding: 14px 14px 16px;
    }

    .enym-timetable__person {
        flex: 0 1 100%;
    }

    .enym-timetable__strip {
        border-radius: 0;
    }
}
