﻿.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-cell {
    min-height: 140px;
    border: 1px solid #e9ecef;
    padding: 0.5rem;
    background: #fff;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-day {
    font-weight: 600;
    font-size: 0.95rem;
}

.calendar-event {
    display: flex;
    gap: .5rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: .25rem;
    border-radius: 4px;
    transition: background .12s;
}
.calendar-event:hover {
    background: rgba(0,0,0,0.03);
}

.event-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.event-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Details page tweaks */
.tavling-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tavling-picture {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* Buttons layout for edit/delete on details page */
.tavling-actions {
    display: flex;
    gap: .5rem;
}

/* Mobile / small screens: stack calendar cells and make events touch-friendly */
@media (max-width: 767.98px) {
    .calendar {
        display: block;
    }

    .calendar-cell {
        min-height: auto;
        padding: 0.75rem;
    }

    .calendar-day {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    /* Make each event take full width and stack image above text for easier tapping */
    .calendar-event {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: .5rem;
    }

    .event-thumb {
        width: 100%;
        height: auto;
        border-radius: 6px;
    }

    .event-name {
        font-size: 1rem;
    }

    /* Make action buttons full-width on small screens and stacked */
    .tavling-actions {
        flex-direction: column;
    }

    .tavling-actions .btn {
        width: 100%;
    }
}

/* Medium screens adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .calendar-cell {
        height: 640px;
    }
}