/* Event Calendar - inspired by 3-pane layout */
:root {
    --sgm-accent: #036d6c;
    --sgm-bg: #f3f1fb;
    --sgm-card: #f9f7ee;
    --sgm-text: #2f2f2f;
    --sgm-muted: #6b6b6b;
}

.sgm-cal {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 320px;
    gap: 0;
    background: var(--sgm-bg);
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(88, 72, 140, 0.12);
}

.sgm-cal__left {
    background: var(--sgm-accent);
    box-shadow: 5px 0 18px -3px var(--sgm-accent);
    color: #ffffff;
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sgm-cal__year-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.5rem;
}

.sgm-cal__year-btn {
    border: none;
    background: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

.sgm-cal__year-btn:focus,
.sgm-cal__months button:focus,
.sgm-cal__drawer-toggle:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.sgm-cal__months {
    display: flex;
    flex-direction: column;
}

.sgm-cal__months button {
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    text-align: left;
    cursor: pointer;
}

.sgm-cal__months button.is-active,
.sgm-cal__months button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sgm-cal__drawer-toggle {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    display: none;
}

.sgm-cal__archive-link {
    margin-top: auto;
    color: #ffffff!important;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.sgm-cal__archive-link:hover,
.sgm-cal__archive-link:focus {
    background: rgba(255, 255, 255, 0.2);
}

.sgm-cal__center {
    background: var(--sgm-card);
    padding: 1.5rem;
    position: relative;
}

.sgm-cal__title {
    margin: 0 0 1rem;
    font-size: 1.6rem;
    color: var(--sgm-text);
    text-align: center;
}

.fc-theme-standard .fc-scrollgrid {
    border: none !important;
}

.sgm-cal__calendar table th,
.sgm-cal__calendar table tr,
.sgm-cal__calendar table td {
    padding: 0.5rem;
    border: none !important;
}

.sgm-cal__calendar table th {
    background: transparent !important;
}

.fc .fc-day-disabled {
    background: transparent !important;
}

.fc .fc-col-header-cell-cushion {
    font-size: 1.5em;
    font-weight:900;
    color: var(--sgm-text);
}

.fc .fc-daygrid-day.fc-day-today {
    background: none !important;
}

.fc .fc-daygrid-day.fc-day-today a {
    background-color : rgb(4 109 108) !important;
    border-radius: 50%;
    padding: 0.5rem 0.8rem;
    color: white !important;
}

 .fc .fc-daygrid-day-number {
    color: var(--sgm-text);
     font-weight: 700;
}

.fc-daygrid-day-events::before {

}

.sgm-cal__calendar .fc {
    background: var(--sgm-card);
}

.sgm-cal__calendar .fc .fc-toolbar {
    display: none;
}

.sgm-cal__calendar .fc .fc-daygrid-day-number {
    color: var(--sgm-text);
    font-weight: 600;
}

.sgm-cal__calendar .fc .fc-col-header-cell-cushion {
    color: var(--sgm-muted);
}

.sgm-cal__dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sgm-accent);
}

.fc-event-main {
    text-align: right;
}

.sgm-cal__calendar .fc-event {
    background: transparent;
    border: none;
    padding: 0;
}

.sgm-cal__calendar .fc-event.is-active .sgm-cal__dot {
    box-shadow: 0 0 0 4px rgba(123, 107, 183, 0.25);
}

.sgm-cal__loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
    z-index: 3;
}

.sgm-cal__spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(123, 107, 183, 0.25);
    border-top-color: var(--sgm-accent);
    animation: sgmCalSpin 0.8s linear infinite;
}

.sgm-cal.is-loading .sgm-cal__loading {
    opacity: 1;
    visibility: visible;
}

.sgm-cal.is-loading .sgm-cal__calendar {
    filter: blur(2px);
}

@keyframes sgmCalSpin {
    to { transform: rotate(360deg); }
}
.sgm-cal__right {
    background: #f9f8fe;
    padding: 1.5rem;
    border-left: 1px solid #ece8f8;
}

.sgm-cal__detail-title {
    margin: 0.4rem 0 1rem;
    font-size: 1.4rem;
    color: var(--sgm-text);
}

.sgm-cal__detail-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.sgm-cal__detail-meta,
.sgm-cal__detail-recurring,
.sgm-cal__detail-location {
    margin-top: 0.6rem;
    font-weight: 600;
    color: var(--sgm-muted);
}

.sgm-cal__detail-desc {
    margin-top: 1rem;
    color: var(--sgm-muted);
    line-height: 1.6;
}

.sgm-cal__detail-actions {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sgm-cal__detail-secondary {
    display: none;
    align-items: center;
    padding: 0.6rem 1rem;
    border: 1px solid var(--sgm-accent);
    border-radius: 999px;
    color: var(--sgm-accent);
    text-decoration: none;
}

@media (max-width: 1024px) {
    .sgm-cal {
        grid-template-columns: 1fr;
    }

    .sgm-cal__left {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sgm-cal--drawer-open .sgm-cal__left {
        transform: translateX(0);
    }

    .sgm-cal__drawer-toggle {
        display: inline-flex;
    }

    .sgm-cal__center,
    .sgm-cal__right {
        padding: 1.25rem;
    }
}

@media (max-width: 640px) {
    .sgm-cal__right {
        border-left: none;
        border-top: 1px solid #ece8f8;
    }
}
