/**
 * Silver Calendar – Frontend shortcode styles (responsive)
 */

/* Month view */
.sc-shortcode.sc-calendar-month {
    max-width: 100%;
    /* margin: 1.5em 0; */
    font-size: 1rem;
}

.sc-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    /* gap: 0.5em; */
    margin-bottom: 1em;
}

.sc-month-nav-buttons {
    display: flex;
    align-items: flex-end;
    gap: 0.5em;
}

.sc-month-nav-prev,
.sc-month-nav-next,
.sc-month-nav-today {
    padding: 0.35em 0.75em;
    background: #f0f0f1;
    color: #1a73e8;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.95em;
}

.sc-month-nav-prev:hover,
.sc-month-nav-next:hover,
.sc-month-nav-today:hover {
    background: #e8e8e9;
    color: #0d5bb5;
}

.sc-month-nav-current {
    font-weight: 600;
    font-size: 1.1em;
}

.sc-month-title {
    margin: 0 0 0.75em;
    font-size: 1.25em;
    font-weight: 600;
}

.sc-month-grid-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sc-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1px;
    width: 100%;
    min-width: 280px;
    background: #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    overflow: hidden;
}

.sc-month-grid-hd {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.85em;
    text-align: center;
    padding: 0.35em 0.25em;
}

.sc-day {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 7em;
    background: #fff;
    overflow: hidden;
}

.sc-day-num {
    flex-shrink: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #e5e5e5;
    padding: 0.25em 0.35em;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 0.25em;
}

.sc-day--other {
    background: #fafafa;
}

.sc-day--other .sc-day-num {
    background: transparent;
    padding: 0;
    margin: 0;
}

.sc-day--today {
    background: #e8f4fc;
}

.sc-day--today .sc-day-num {
    background: #c5e0f5;
    font-weight: 700;
    color: #1a73e8;
}

.sc-day-events {
    list-style: none;
    margin: 0;
    padding: 0.25em 0.35em 0;
    font-size: 0.7em;
    text-align: left;
    flex: 1 1 auto;
    min-height: 0;
    display: contents;
}

.sc-event-item {
    background: #1a73e8;
    color: #fff;
    padding: 0.15em 0.35em;
    margin-bottom: 0.15em;
    border-radius: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-event-item .sc-event-time {
    opacity: 0.9;
    margin-right: 0.25em;
}

.sc-event-more {
    color: #666;
    font-style: italic;
    padding: 0 0.25em;
}

.sc-event-item--clickable {
    cursor: pointer;
}

/* Event detail modal */
.sc-event-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sc-event-modal--open {
    opacity: 1;
    visibility: visible;
}

.sc-event-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.sc-event-modal-content {
    position: relative;
    width: 100%;
    max-width: 28rem;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 1.5rem 2rem 1.5rem 1.5rem;
}

.sc-event-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.sc-event-modal-close:hover,
.sc-event-modal-close:focus {
    color: #1a1a1a;
    background: #f0f0f1;
}

.sc-event-modal-title {
    margin: 0 2rem 0.5rem 0;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a1a;
}

.sc-event-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.95em;
    color: #555;
}

.sc-event-modal-date {
    font-weight: 500;
}

.sc-event-modal-time::before {
    content: "kl ";
}

.sc-event-modal-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Responsive: smaller cells on narrow screens */
@media (max-width: 600px) {
    .sc-month-grid-hd {
        padding: 0.25em 0.15em;
        font-size: 0.8em;
    }

    .sc-day {
        height: 5em;
    }

    .sc-day-events {
        font-size: 0.65em;
    }

    .sc-event-item {
        padding: 0.1em 0.2em;
    }
}

@media (max-width: 400px) {
    .sc-month-grid {
        min-width: 260px;
    }

    .sc-month-grid-hd {
        font-size: 0.75em;
    }

    .sc-day-num {
        font-size: 0.85em;
    }
}

/* List view */
.sc-shortcode.sc-event-list {
    max-width: 100%;
    margin: 1.5em 0;
}

.sc-list-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sc-list-title {
    margin: 0;
    padding: 1rem 1.25rem 0.75rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a1a;
}

.sc-list-empty {
    margin: 0;
    padding: 1rem 1.25rem;
    color: #666;
}

.sc-event-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sc-list-event {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    /* border-bottom: 1px solid #eee; */
}

.sc-list-event:nth-child(even) {
    /* background: #f5f8fa; */
}

.sc-list-event:last-child {
    border-bottom: none;
}

.sc-list-event-date-badge {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    min-height: 3.5rem;
    padding: 0.5rem 0;
    background: #4b9cd7;
    color: #fff;
    border-radius: 8px;
}

.sc-list-event-day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.sc-list-event-month {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: lowercase;
    opacity: 0.95;
}

.sc-list-event-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sc-list-event-time {
    font-size: 0.9rem;
    color: #555;
}

.sc-list-event-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.sc-list-footer {
    margin: 0;
    padding: 1.25rem 1.25rem 1.5rem;
    text-align: center;
}

.sc-list-calendar-link {
    display: inline-block;
    padding: 0.6rem 1.75rem;
    background: #e87d33;
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    border-radius: 999px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.sc-list-calendar-link:hover {
    background: #d96c22;
    color: #fff !important;
}

.sc-list-calendar-link:focus {
    outline: 2px solid #e87d33;
    outline-offset: 2px;
}

/* List responsive */
@media (max-width: 479px) {
    .sc-list-title {
        font-size: 1.5rem;
        padding: 0.875rem 1rem 0.5rem;
    }

    .sc-list-event {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .sc-list-event-date-badge {
        width: 3rem;
        min-height: 3rem;
    }

    .sc-list-event-day {
        font-size: 1.25rem;
    }

    .sc-list-event-month {
        font-size: 0.7rem;
    }

    .sc-list-footer {
        padding: 1rem 1rem 1.25rem;
    }

    .sc-list-calendar-link {
        padding: 0.5rem 1.5rem;
        font-size: 0.95rem;
    }
}
