/* ── Calendar styles ─────────────────────────────────────────────────────── */

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 4px;
}

.cal-title {
    font-size: 1.4rem;
    font-weight: 600;
    cursor: default;
}

.cal-nav-btn {
    background: none;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 4px 14px;
    font-size: 1.3rem;
    cursor: pointer;
    color: #334155;
    transition: background 0.15s;
}

.cal-nav-btn:hover {
    background: #f1f5f9;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.cal-day-label {
    background: #f8fafc;
    padding: 8px 4px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.cal-day {
    background: #fff;
    min-height: 90px;
    padding: 4px 6px;
    vertical-align: top;
    cursor: default;
}

.cal-day-blank {
    background: #f8fafc;
}

.cal-day-today {
    background: #eff6ff;
}

.cal-day-today .cal-day-num {
    color: #2563eb;
    font-weight: 700;
}

.cal-day-num {
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Add event button (edit mode only) ──────────────────────────────────── */

.cal-add-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.cal-day:hover .cal-add-btn {
    opacity: 1;
}

/* ── Event tile ─────────────────────────────────────────────────────────── */

.cal-event {
    background: #f0f4ff;
    border-left: 3px solid #2563eb;
    border-radius: 3px;
    padding: 2px 6px;
    margin-bottom: 2px;
    font-size: 0.75rem;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background 0.15s;
}

.cal-event:hover {
    background: #dbeafe;
}

.cal-event-time {
    color: #64748b;
    font-weight: 500;
}

.cal-event-title {
    color: #1e293b;
}

.cal-event-tag {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
}

/* ── Responsive: stack on mobile ────────────────────────────────────────── */

@media (max-width: 640px) {
    .cal-day {
        min-height: 60px;
        padding: 2px 3px;
    }

    .cal-day-num {
        font-size: 0.75rem;
    }

    .cal-event {
        font-size: 0.65rem;
        padding: 1px 3px;
    }

    .cal-day-label {
        font-size: 0.65rem;
        padding: 4px 2px;
    }
}

/* ── WYSIWYG description editor ──────────────────────────────────────────── */

.cal-wysiwyg-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}

.cal-wysiwyg-toolbar button {
    background: none;
    border: none;
    padding: 3px 7px;
    border-radius: 3px;
    color: #475569;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
}

.cal-wysiwyg-toolbar button:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.cal-wysiwyg-sep {
    width: 1px;
    height: 16px;
    background: #cbd5e1;
    margin: 0 3px;
}

.cal-wysiwyg {
    border: 1px solid #dee2e6;
    border-radius: 0 0 6px 6px;
    padding: 10px 12px;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    font-size: 0.875rem;
    line-height: 1.5;
    outline: none;
}

.cal-wysiwyg:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Day cell cursor in edit mode */
.cal-day { cursor: default; }
.cal-day:hover { background: #f0f4ff; }

/* ── Camera icon on events with photos ─────────────────────────────────── */

.cal-event-photos {
    color: #64748b;
    font-size: 0.65rem;
    cursor: pointer;
    vertical-align: middle;
}

.cal-event-photos:hover {
    color: #2563eb;
}

/* "Default" variant: event has no photos of its own, only inherits one
   from its series. Lighter colour signals "this is just the series
   default — nothing custom set on this event." Hover still goes blue. */
.cal-event-photos--default {
    color: #cbd5e1;
}
.cal-event-photos--default:hover {
    color: #60a5fa;
}

/* ── Photo lightbox ────────────────────────────────────────────────────── */

.cal-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.cal-lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10001;
}

.cal-lightbox-close:hover { color: #cbd5e1; }

.cal-lightbox-img-wrap {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}

.cal-lightbox-caption {
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
    max-width: 600px;
}

.cal-lightbox-prev,
.cal-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    padding: 0 16px;
    user-select: none;
    line-height: 1;
    z-index: 10001;
}

.cal-lightbox-prev { left: 8px; }
.cal-lightbox-next { right: 8px; }
.cal-lightbox-prev:hover,
.cal-lightbox-next:hover { color: #cbd5e1; }

.cal-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #94a3b8;
    font-size: 0.85rem;
}
