/* Calendar template — grid layout */

.romence-schedule.romence-template-calendar {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f7f8fb;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid #d4d7e0;
}

.romence-schedule.romence-template-calendar .cal-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #d4d7e0;
}

.romence-schedule.romence-template-calendar .cal-head-day {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7b8794;
    text-align: center;
}

.romence-schedule.romence-template-calendar .cal-grid-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.romence-schedule.romence-template-calendar .cal-grid-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    min-height: 100px;
}

.romence-schedule.romence-template-calendar .cal-cell {
    background: #ffffff;
    border: 1px solid #e1e4ec;
    border-radius: 8px;
    padding: 6px 8px;
    min-height: 100px;
    min-width: 0;
    overflow: hidden;
}

.romence-schedule.romence-template-calendar .cal-cell-today {
    background: #eef2ff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.romence-schedule.romence-template-calendar .cal-cell-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: #102a43;
    margin-bottom: 6px;
}

.romence-schedule.romence-template-calendar .mnth {
    font-weight: normal;
    font-size: 0.75em;
}

.romence-schedule.romence-template-calendar .cal-cell-today .cal-cell-date {
    color: #4f46e5;
}

.romence-schedule.romence-template-calendar .cal-cell-empty {
    background: #f1f3f6;
    opacity: 0.75;
}

.romence-schedule.romence-template-calendar .cal-cell-empty .cal-cell-date {
    color: #9fb3c8;
}

.romence-schedule.romence-template-calendar .cal-cell-events {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.romence-schedule.romence-template-calendar .cal-event {
    position: relative;
    min-width: 0;
}

.romence-schedule.romence-template-calendar .cal-event-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #e5e9f4;
    color: #102a43;
    font-size: 0.8rem;
}

.romence-schedule.romence-template-calendar .cal-event-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.romence-schedule.romence-template-calendar .cal-event-time {
    font-size: 0.72rem;
    color: #52606d;
    flex-shrink: 0;
}

.romence-schedule.romence-template-calendar .cal-event-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
    padding: 0 0 2px;
    font-size: 0.72rem;
    color: #52606d;
}

.romence-schedule.romence-template-calendar .cal-event-link {
    padding: 0 6px;
    border-radius: 4px;
    border: 1px solid #4f46e5;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.7rem;
    display: inline-block;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.romence-schedule.romence-template-calendar .cal-event-link:hover {
    background: #4f46e5;
    color: #ffffff;
}

.romence-schedule.romence-template-calendar .cal-event-location {
    margin-top: 2px;
    padding: 0 0 2px;
    font-size: 0.65rem;
    line-height: 1.3;
    color: #9fb3c8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.romence-schedule.romence-template-calendar .cal-event.cal-event-cancelled {
    text-decoration: line-through;
}

.romence-schedule.romence-template-calendar .cal-event.cal-event-cancelled a {
    pointer-events: none;
    cursor: default;
    /* text-decoration: none */
    opacity: 0.5;
}

.romence-schedule.romence-template-calendar .cal-event.cal-event-cancelled .cal-event-bar {
    background: #fde2e1;
    color: #b82c2c;
}

.romence-schedule.romence-template-calendar .cal-event.cal-event-cancelled .cal-event-link {
    border-color: #b82c2c;
    color: #b82c2c;
}

.romence-schedule.romence-template-calendar .cal-event.cal-event-cancelled .cal-event-link:hover {
    background: #b82c2c;
    color: #ffffff;
}

@media (max-width: 768px) {
    .romence-schedule.romence-template-calendar {
        padding: 12px 10px;
    }

    .romence-schedule.romence-template-calendar .cal-head-day {
        font-size: 0.65rem;
    }

    .romence-schedule.romence-template-calendar .cal-grid-row {
        min-height: 80px;
    }

    .romence-schedule.romence-template-calendar .cal-cell {
        min-height: 80px;
        padding: 4px 6px;
    }

    .romence-schedule.romence-template-calendar .cal-event-bar {
        padding: 3px 6px;
        font-size: 0.72rem;
    }

    .romence-schedule.romence-template-calendar .cal-event-location {
        font-size: 0.6rem;
    }
}

@media (max-width: 767px) {
    .romence-schedule.romence-template-calendar .cal-grid-header {
        display: none;
    }

    .romence-schedule.romence-template-calendar .cal-cell-empty {
        display: none;
    }

    .romence-schedule.romence-template-calendar .cal-grid-row {
        display: flex;
        flex-direction: column;
    }
}
