/**
 * KB Events Widget Styles
 *
 * @package KB_Local_Business_Schema
 * @since 3.0.0
 */

/* === List Layout === */
.kb-events-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.kb-event-item--list {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

.kb-event-item--list:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Date Badge */
.kb-event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 0.5rem;
    background: #2271b1;
    color: #fff;
    border-radius: 6px;
    text-align: center;
    flex-shrink: 0;
}

.kb-event-date-badge__day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.kb-event-date-badge__month {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kb-event-date-badge__year {
    font-size: 0.65rem;
    opacity: 0.8;
}

/* Content */
.kb-event-content {
    flex: 1;
    min-width: 0;
}

.kb-event-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    line-height: 1.3;
}

.kb-event-title a {
    color: inherit;
    text-decoration: none;
}

.kb-event-title a:hover {
    color: #2271b1;
}

.kb-event-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 0.5rem;
}

/* Single Date Line */
.kb-event-single-date {
    font-size: 0.85rem;
    color: #374151;
    margin: 0.25rem 0;
}

/* Multiple Dates List */
.kb-event-dates-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.kb-event-dates-list__item {
    font-size: 0.85rem;
    padding: 2px 0;
    color: #374151;
}

.kb-event-date-note {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Quick Fields (price, location, online) */
.kb-event-quick-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.kb-event-field {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f3f4f6;
    color: #374151;
}

.kb-event-field--online {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Variable Fields (definition list) */
.kb-event-fields {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 12px;
    margin: 0.5rem 0;
}

.kb-event-fields__label {
    font-weight: 600;
    font-size: 0.8rem;
    color: #6b7280;
}

.kb-event-fields__value {
    font-size: 0.8rem;
}

/* Read More */
.kb-event-readmore {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.kb-event-readmore:hover {
    text-decoration: underline;
}

/* Highlight Badge */
.kb-event-highlight-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    background: #fef3c7;
    color: #92400e;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* No Events */
.kb-events-none {
    text-align: center;
    color: #6b7280;
    padding: 2rem;
    font-size: 0.95rem;
}

/* === Grid Layout === */
.kb-events-grid {
    display: grid;
    gap: 1.5rem;
}

.kb-event-item--grid {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.kb-event-item--grid:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kb-event-item--grid .kb-event-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.kb-event-item--grid .kb-event-thumbnail-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 2rem;
}

.kb-event-item--grid .kb-event-content {
    padding: 1rem;
}

.kb-event-item--grid .kb-event-date-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1;
}

.kb-event-item--grid .kb-event-thumbnail-wrap {
    position: relative;
}

/* === Calendar Layout === */
.kb-events-calendar {
    font-size: 0.875rem;
}

.kb-events-calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.kb-calendar-prev,
.kb-calendar-next {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: #374151;
    transition: background 0.15s;
}

.kb-calendar-prev:hover,
.kb-calendar-next:hover {
    background: #f3f4f6;
}

.kb-calendar-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1f2937;
}

.kb-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.kb-calendar-weekday {
    text-align: center;
    font-weight: 600;
    padding: 0.5rem 0;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kb-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.kb-calendar-day {
    min-height: 70px;
    padding: 4px;
    border: 1px solid #f3f4f6;
    border-radius: 4px;
    position: relative;
    background: #fff;
}

.kb-calendar-day--today {
    border-color: #2271b1;
    background: #eff6ff;
}

.kb-calendar-day--has-events {
    background: #f0fdf4;
}

.kb-calendar-day--empty {
    background: #fafafa;
    border-color: transparent;
}

.kb-calendar-day__num {
    display: block;
    font-size: 0.8rem;
    color: #374151;
    font-weight: 500;
}

.kb-calendar-day--today .kb-calendar-day__num {
    color: #2271b1;
    font-weight: 700;
}

.kb-calendar-day__events {
    margin-top: 2px;
}

.kb-calendar-event-dot {
    display: block;
    font-size: 0.65rem;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 2px;
    padding: 1px 3px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.4;
}

.kb-calendar-event-dot:hover {
    background: #bfdbfe;
    color: #1e40af;
}

/* === Responsive === */
@media (max-width: 768px) {
    .kb-event-item--list {
        flex-direction: column;
    }

    .kb-event-date-badge {
        flex-direction: row;
        gap: 0.5rem;
        min-width: auto;
        padding: 0.25rem 0.75rem;
        align-self: flex-start;
    }

    .kb-calendar-day {
        min-height: 50px;
    }

    .kb-calendar-event-dot {
        font-size: 0.6rem;
    }

    .kb-event-fields {
        grid-template-columns: 1fr;
    }
}
