:root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.4;
    color: #111827;
    background-color: #f3f4f6;
}

body {
    margin: 0;
    padding: 0 1rem 2rem;
}

.page-header {
    max-width: 960px;
    margin: 1.5rem auto 0.5rem;
}

.page-header h1 {
    margin: 0 0 0.25rem;
    font-size: 1.6rem;
    font-weight: 600;
}

.page-subtitle {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.calendar-wrapper {
    max-width: 80vw;
    margin: 1.5rem auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1.2fr;
    gap: 1.5rem;
}

.calendar-panel,
.event-list-panel {
    min-width: 0;
}
.calendar-panel {
    grid-column: 1;
}
.event-list-panel {
    grid-column: 2;
}

.calendar-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.calendar-nav-row {
    display: flex;
    gap: 0.5rem;
}

.calendar-controls button {
    border: 1px solid #d1d5db;
    background: #f9fafb;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1vw;
    color: #f58f1d;
}

.calendar-controls button:hover {
    background: #e5e7eb;
}

#month-label {
    font-weight: 500;
    font-size: 1.5vw;
    color: #111827;
}

.calendar-feed-name {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
}

.weekday-header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1vw;
    font-weight: 400;
    text-transform: uppercase;
    padding: 0.3rem 0;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
}

#calendar-cells {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 9.2vh;
}

.calendar-cell {
    border-top: 1px solid #f3f4f6;
    border-right: 1px solid #f3f4f6;
    padding: 0.35rem;
    font-size: 0.8vw;
    position: relative;
    cursor: pointer;
    background: #ffffff;
}

.calendar-cell:nth-child(7n) {
    border-right: none;
}

.calendar-cell.outside-month {
    background: #f9fafb;
    color: #9ca3af;
}

.calendar-cell .day-number {
    font-weight: 400;
}

.calendar-cell .event-dot {
    width: 1vw;
    height: 1vw;
    border-radius: 999px;
    background: #f58f1d;
    position: absolute;
    bottom: 6px;
    left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8vw;
    font-weight: 700;
}

.calendar-cell.selected {
    outline: 2px solid #f58f1d;
    outline-offset: -2px;
    background: rgba(245, 143, 29, 0.1);
}

.event-list-panel h2,
.event-list-panel h3 {
    font-size: 1.5vw;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 1.5vw;
    color: #111827;
}

#event-list {
    list-style: disc;
    list-style-position: outside;
    padding-left: 1.2rem;
    margin: 0;
    max-height: none;
    overflow: visible;
}

.event-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.4rem 0;
    font-size: 1vw;
    cursor: pointer;
    list-style: disc;
    list-style-position: outside;
}

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

.event-title {
    font-size: 1vw;
    font-weight: 400;
}

.event-time {
    color: #6b7280;
    font-size: 1vw;
}

.event-marker {
    display: none;
}

.event-item a {
    color: #f58f1d;
    text-decoration: underline;
    word-break: break-all;
}

.event-modal.hidden {
    display: none;
}

.event-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.event-modal__dialog {
    position: relative;
    background: #000000;
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 75vw;
    width: min(60vw);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 1;
    color: #ffffff;
}

.event-modal__title {
    margin: 0 0 0.35rem;
    font-size: 2.2vw;
    color: #ffffff;
}

.event-modal__time,
.event-modal__location {
    color: #d1d5db;
    font-size: 0.95rem;
}

.event-modal__location {
    margin-bottom: 0.65rem;
}

.event-modal__body {
    font-size: 1rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.event-body__lead {
    color: #f58f1d;
    font-size: 1.5vw;
    font-weight: 300;
    margin-bottom: 0.35rem;
}

.event-body__rest {
    font-size: 1vw;
    font-weight: 300;
}

.event-modal__body a {
    color: #f58f1d;
    text-decoration: underline;
    word-break: break-all;
}

.event-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.calendar-subscribe-note {
    font-size: 0.95vw;
    color: #ffffff;
    margin: 1rem 0 0.75rem;
}
.calendar-subscribe-note img {
    width: 0.95vw;
    height: 0.95vw;
    vertical-align: middle;
}

.subscribe-actions {
    margin-top: 1rem;
}

.subscribe-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.95vw;
    height: 0.95vw;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

.calendar-disclaimer {
    margin-top: 0.75rem;
    font-size: 0.9vw;
    color: #e5e7eb;
    line-height: 1.5;
}

.subscribe-icon-link:hover img {
    box-shadow: 0vw 0vw 1.2vw #f58f1d;
}

.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 2.5rem;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 24, 39, 0.95);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    z-index: 9999;
    font-size: 0.95rem;
}

.copy-toast.copy-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.subscribe-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #111827;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.subscribe-btn img {
    width: 16px;
    height: 16px;
}

.subscribe-btn.primary {
    border-color: #f58f1d;
    color: #f58f1d;
}

.subscribe-btn:hover {
    background: #e5e7eb;
}

@media (max-width: 800px) {
    .calendar-panel,
    .event-list-panel {
        grid-column: 1 / -1;
    }

    .calendar-wrapper {
        grid-template-columns: 1fr;
    }

    #month-label {
        font-size: 5vw !important;
    }

    .event-list-panel h2,
    .event-list-panel h3 {
        font-size: 5vw !important;
    }

    .weekday-header {
        font-size: 3vw !important;
    }

    .calendar-cell {
        font-size: 2.5vw;
    }

    #calendar-cells {
        grid-auto-rows: 6vh;
    }

    .calendar-cell .event-dot {
        width: 2.4vw;
        height: 2.4vw;
        font-size: 2.2vw;
    }

    .event-title {
        font-size: 5vw;
        font-weight: 400;
    }

    .event-modal__title {
        font-size: 5vw;
    }

    .event-body__lead {
        font-size: 4vw;
    }

    .event-body__rest {
        font-size: 3vw;
    }

    .event-item {
        font-size: 4vw;
    }
    .event-time {
        font-size: 4vw;
    }

    .calendar-subscribe-note {
        font-size: 3vw;
    }

    .calendar-subscribe-note img {
        width: 3vw;
        height: 3vw;
    }

    .subscribe-icon-link {
        width: 3vw;
        height: 3vw;
    }

    .copy-toast {
        font-size: 3vw;
        padding: 0.9rem 1.4rem;
    }

    .calendar-disclaimer {
        font-size: 3vw;
    }

    .calendar-controls button {
        font-size: 3vw;
    }
}
