/* FeWo-Belegungskalender (Einzelmonat + Slider-Shortcode) */

.cmsp-fewo-occupancy,
.fewo-occupancy-calendar,
.cmsp-fewo-calendar-slider {
    --fewo-cal-primary: var(--color-primary, #3d6b4f);
    --fewo-cal-text: var(--color-text, #2c3e2d);
    --fewo-cal-text-light: var(--color-text-light, #5c6b5e);
    --fewo-cal-border: var(--color-border, #d8e3d9);
    --fewo-cal-neutral: var(--color-neutral, #f4f8f4);
}

.fewo-occupancy-calendar__hint {
    font-size: 0.85rem;
    color: var(--fewo-cal-text-light);
    margin-bottom: 1rem;
}

.fewo-occupancy-calendar__nav,
.cmsp-fewo-calendar-slider__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.fewo-occupancy-calendar__title,
.cmsp-fewo-calendar-slider__range-title {
    flex: 1;
    text-align: center;
    font-family: var(--font-heading, inherit);
    font-weight: 700;
    color: var(--fewo-cal-primary);
    font-size: 1rem;
    line-height: 1.3;
}

.fewo-occupancy-calendar__btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--fewo-cal-border);
    border-radius: 50%;
    background: #fff;
    color: var(--fewo-cal-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.fewo-occupancy-calendar__chevron {
    font-size: 1.35rem;
    line-height: 1;
    font-weight: 700;
    margin-top: -2px;
}

.fewo-occupancy-calendar__btn:hover,
.fewo-occupancy-calendar__btn:focus-visible {
    background: var(--fewo-cal-neutral);
    border-color: var(--fewo-cal-primary);
    outline: none;
}

.fewo-occupancy-calendar__weekdays,
.fewo-occupancy-calendar__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.fewo-occupancy-calendar__weekdays {
    margin-bottom: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--fewo-cal-text-light);
    text-align: center;
}

.fewo-occupancy-calendar__day {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    display: block;
    font-size: 0.82rem;
    border-radius: 6px;
    background: #edf7ef;
    color: var(--fewo-cal-text);
    border: 1px solid transparent;
}

.fewo-occupancy-calendar__day-num {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 0.82rem;
    line-height: 1;
    font-weight: 600;
    z-index: 2;
}

.fewo-occupancy-calendar__day-label {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    font-size: 0.52rem;
    font-weight: 700;
    color: #333;
    z-index: 3;
    line-height: 1.1;
    background: rgba(255, 255, 255, 0.88);
    padding: 1px 2px;
    border-radius: 2px;
    text-align: left;
}

.fewo-occupancy-calendar__day-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 141.42%;
    height: 2px;
    background: #222;
    transform: rotate(45deg);
    transform-origin: bottom left;
    z-index: 2;
    pointer-events: none;
}

.fewo-occupancy-calendar__discount {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f44336;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.fewo-occupancy-calendar__day--empty {
    background: transparent;
    border: none;
}

.fewo-occupancy-calendar__day--free {
    background: #edf7ef;
    color: var(--fewo-cal-text);
}

.fewo-occupancy-calendar__day--booked,
.fewo-occupancy-calendar__day--unavailable {
    background: #f8d7da;
    color: #842029;
}

.fewo-occupancy-calendar__day--reserved {
    background: #fff3cd;
    color: #856404;
}

/* Anreisetag: unten links frei, oben rechts belegt */
.fewo-occupancy-calendar__day--arrival.fewo-occupancy-calendar__day--booked,
.fewo-occupancy-calendar__day--arrival.fewo-occupancy-calendar__day--unavailable {
    background: linear-gradient(135deg, #edf7ef 0%, #edf7ef 50%, #f8d7da 50%, #f8d7da 100%);
}

.fewo-occupancy-calendar__day--arrival.fewo-occupancy-calendar__day--reserved {
    background: linear-gradient(135deg, #edf7ef 0%, #edf7ef 50%, #fff3cd 50%, #fff3cd 100%);
}

/* Abreisetag: oben links belegt, unten rechts frei */
.fewo-occupancy-calendar__day--departure.fewo-occupancy-calendar__day--booked,
.fewo-occupancy-calendar__day--departure.fewo-occupancy-calendar__day--unavailable {
    background: linear-gradient(to bottom right, #f8d7da 0%, #f8d7da 50%, #edf7ef 50%, #edf7ef 100%);
}

.fewo-occupancy-calendar__day--departure.fewo-occupancy-calendar__day--reserved {
    background: linear-gradient(to bottom right, #fff3cd 0%, #fff3cd 50%, #edf7ef 50%, #edf7ef 100%);
}

.fewo-occupancy-calendar__day--booked .fewo-occupancy-calendar__day-num,
.fewo-occupancy-calendar__day--unavailable .fewo-occupancy-calendar__day-num,
.fewo-occupancy-calendar__day--reserved .fewo-occupancy-calendar__day-num {
    font-weight: 700;
}

.fewo-occupancy-calendar__day.is-today {
    border-color: var(--fewo-cal-primary);
    box-shadow: inset 0 0 0 1px var(--fewo-cal-primary);
}

.fewo-occupancy-calendar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-top: 0.9rem;
    font-size: 0.78rem;
    color: var(--fewo-cal-text-light);
}

.fewo-occupancy-calendar__legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.fewo-occupancy-calendar__dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.06);
    font-style: normal;
}

.fewo-occupancy-calendar__dot--free { background: #edf7ef; }
.fewo-occupancy-calendar__dot--booked { background: #f8d7da; }
.fewo-occupancy-calendar__dot--reserved { background: #fff3cd; }

.fewo-occupancy-calendar__discount-badge,
.fewo-occupancy-calendar__dot--discount {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f44336;
    border: 2px solid #fff;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Slider-Shortcode: drei Monate nebeneinander */
.cmsp-fewo-calendar-slider {
    margin: 1.5rem 0;
}

.cmsp-fewo-calendar-slider__heading {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--fewo-cal-primary);
}

.cmsp-fewo-calendar-slider__track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.cmsp-fewo-calendar-slider__month {
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--fewo-cal-border);
    border-radius: 10px;
    background: #fff;
}

.cmsp-fewo-calendar-slider__month-title {
    text-align: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--fewo-cal-primary);
    margin-bottom: 0.6rem;
}

@media (max-width: 991.98px) {
    .cmsp-fewo-calendar-slider__track {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .cmsp-fewo-calendar-slider__track {
        gap: 0.65rem;
    }

    .cmsp-fewo-calendar-slider__month {
        padding: 0.5rem;
    }

    .fewo-occupancy-calendar__day {
        font-size: 0.75rem;
    }
}
