.simple-google-calendar-events {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: #ededed;
    border-top-left-radius: clamp(60px, 12vw, 160px);
    padding: 100px clamp(20px, 6vw, 80px) 120px;
}

@media (max-width: 1024px) {
    .simple-google-calendar-events {
        padding: clamp(20px, 4vw, 40px) var(--mobile-horizontal-padding);
    }
}

@media (max-width: 374px) {
    .sgc-upper {
        margin: 20px 0px;
    }
}

.sgc-inner-container {
    max-width: 1280px;
    width: 100%;
}

.sgc-upper {
    padding-bottom: 20px;
    align-items: center;
    margin: 0 67px;
    display: flex;
    justify-content: space-between;
}

.sgc-upper h2 {
    margin: 0px !important;
}

.sgc-title {
    font-family: "Source Serif 4", serif;
    font-weight: 400;
    font-size: clamp(24px, 5vw, 42px);
    margin: 0 0 20px 0;
    color: #010133;
}

/* Carousel Container */
.sgc-carousel-container {
    position: relative;
    display: flex;
    align-items: stretch; /* Changed from center to stretch */
    justify-content: center;
    overflow: hidden;
    margin: 0px clamp(-20px, -6vw, -72px);
}

/* Carousel Wrapper - Now has fixed height set by JavaScript */
.sgc-carousel-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: stretch; /* Ensure full height usage */
}

/* Row of events - Now uses full height of wrapper */
.sgc-events-row {
    display: flex;
    position: relative;
    transition: all 0.5s ease;
    width: 100%;
    align-items: stretch; /* Ensure all columns stretch to full height */
}

/* Navigation Arrows */
.sgc-carousel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;           /* full circle */
    background-color: white;
    border: none;
    cursor: pointer;
    z-index: 10;
    margin: 0 10px;
    padding: 0;
    align-self: center;
    border: 1px solid black;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.sgc-carousel-arrow img {
    width: 16px;
    height: 16px;
    display: block;
}

.sgc-carousel-arrow:hover {
    background-color: #FFE18D;
}

.sgc-carousel-arrow:active {
    background-color: #FFC41B;
}

/* Mobile */
@media (max-width: 767px) {
    .sgc-carousel-arrow {
        width: 36px;
        height: 36px;
        margin: 0 6px 0 0;
    }

    .sgc-carousel-arrow img {
        width: 16px;
        height: 16px;
    }
}

/* Page Indicator */
.sgc-page-indicator {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.sgc-page-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #c5c5c5;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sgc-page-dot.sgc-active {
    background-color: #004aae;
    transform: scale(1.2);
}

/* Event column - Enhanced to work with fixed height */
.sgc-event-column {
    flex: 0 0 25%;
    padding: 0 10px;
    box-sizing: border-box;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack children vertically */
    height: 100%; /* Use full height of parent */
}

.sgc-event-column.sgc-hidden {
    display: none;
}

.sgc-event-column.sgc-active {
    display: flex; /* Use flex when active */
}

/* Event card - Enhanced to fill available space properly */
.sgc-event-card {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    flex: 1; /* Take up all available space in column */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 0px 20px !important;
    justify-content: flex-start; /* Align content to top */
}

.sgc-event-date-column::after {
    content: "";
    position: absolute;
    top: 0;
    width: 1px;
    right: 5px;
    height: 200px;
    background: black;
    opacity: 0.7;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

/* Date column */
.sgc-event-date-column {
    flex: 0 0 auto; /* Don't grow or shrink, use natural height */
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease;
    margin-bottom: 10px; /* Add some space before details */
    color: #010133;
    position: relative;
}

.sgc-event-month {
    font-size: 24px;
    text-transform: uppercase;
    font-family: "Source Serif 4", serif;
    font-weight: 400;
}

.sgc-event-day {
    font-size: 42px;
    font-weight: 600;
    line-height: 0.8;
}

/* Details column - Enhanced to handle variable content height */
.sgc-event-details-column {
    flex: 1; /* Take remaining space */
    padding-top: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content from breaking out */
}

/* Enhanced separator that follows title height more closely */
.sgc-event-column.sgc-active .sgc-event-title::after {
    content: "";
    position: absolute;
    top: 0;
    width: 1px;
    right: -15px;
    height: calc(100% + 40px);
    background: black;
    opacity: 0.7;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.sgc-event-title {
    margin: 0 20px 10px 0;
    font-size: 21px;
    line-height: 1.3;
    position: relative;
    flex: 0 0 auto; /* Don't grow */
    overflow-wrap: break-word; /* Handle long titles gracefully */
    word-wrap: break-word;
    hyphens: auto;
}

.sgc-event-title a {
    color: #004aae;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    display: inline;
    background-image: linear-gradient(to right, #004aae 0%, #004aae 100%);
    background-size: 0% 1.5px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        color 0.3s ease;
}

.sgc-more-link {
    font-size: clamp(14px, 2vw, 16px);
    color: black;
    font-family: "Source Serif 4", serif;
    font-weight: 400;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
    display: inline;
    background-image: linear-gradient(to right, black 0%, black 100%);
    background-size: 0% 1px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        color 0.3s ease;
}
.sgc-more-link:hover {
    color: black;
    background-size: 100% 1px;
}
.sgc-more-events::after {
    content: "";
    background-image: url("../icons/arrow.svg");
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 5px;
    vertical-align: middle;
    background-size: contain;
    background-repeat: no-repeat;
    margin-bottom: 1px;
}

.sgc-event-title a:hover {
    color: #004aae;
    background-size: 100% 1.5px;
}

.sgc-event-title a:hover::after {
    width: 100%;
}

.sgc-event-time {
    font-size: 16px;
    color: #010133;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    flex: 0 0 auto; /* Don't grow */
}

.sgc-event-location {
    font-size: 16px;
    color: #010133;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex: 0 0 auto; /* Don't grow */
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.sgc-event-actions {
    flex: 0 0 auto; /* Don't grow */
}

.sgc-event-day-of-week {
    font-size: 16px;
    color: #010133;
    flex: 0 0 auto; /* Don't grow */
    letter-spacing: 0.3px;
}

/* Responsive adjustments for day of the week */
@media (max-width: 480px) {
}

@media (min-width: 1920px) {
    .sgc-event-day-of-week {
        margin-bottom: 10px;
    }
}

.sgc-add-calendar-btn {
    cursor: pointer;
}

.sgc-calendar-icon:hover {
    color: white;
    fill: white;
}

/* Calendar icon - This can be replaced with your custom icon */
.sgc-calendar-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-image: url("../icons/google-calendar-icon.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease;
    margin-left: -3px;
}

.sgc-calendar-icon:hover {
    background-image: url("../icons/google-calendar-icon--hover.svg");
}

/* Fallback icon until you add your custom icon */
.sgc-calendar-icon:before {
    content: "Cal";
    font-size: 10px;
    font-weight: bold;
    color: black;
}

/* More events link */
.sgc-more-events {
    text-align: center;
}

/* No events message */
.sgc-no-events {
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    color: #666;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Animation for carousel */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sgc-event-column.sgc-active {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .sgc-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .sgc-more-link {
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    .sgc-event-column {
        flex: 0 0 100%;
        padding: 0 0;
    }

    .sgc-event-card {
        padding: 5px !important;
    }

    .sgc-event-title {
        margin: 0 0 10px 0;
    }
    .sgc-carousel-arrow {
        width: 25px;
        height: 25px;
    }

    .sgc-event-details-column {
        padding-top: 0px;
    }

    .sgc-upper {
        margin: 20px 10px 20px;
    }

    .sgc-carousel-container {
        flex-direction: row;
    }

    /* Hide separators on mobile since only 1 card is visible */
    .sgc-event-column.sgc-active .sgc-event-details-column::after,
    .sgc-event-column.sgc-active .sgc-event-title::after,
    .sgc-event-column.sgc-active .sgc-event-date-column::after {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .sgc-event-column {
        flex: 0 0 50%;
        padding: 0 12px;
    }

    /* Hide separator on every 2nd card (last in each row of 2) */
    .sgc-event-column.sgc-active:nth-child(2n) .sgc-event-details-column::after,
    .sgc-event-column.sgc-active:nth-child(2n) .sgc-event-title::after,
    .sgc-event-column.sgc-active:nth-child(2n) .sgc-event-date-column::after {
        display: none;
    }
}

@media (min-width: 1025px) and (max-width: 1439px) {
    .sgc-event-column {
        flex: 0 0 33.333%;
        padding: 0 12px;
    }

    .sgc-event-column.sgc-active:nth-child(3n) .sgc-event-details-column::after,
    .sgc-event-column.sgc-active:nth-child(3n) .sgc-event-title::after,
    .sgc-event-column.sgc-active:nth-child(3n) .sgc-event-date-column::after {
        display: none;
    }
}

@media (min-width: 1440px) {
    /* Hide separator on every 4th card (last in each row of 4) */
    .sgc-event-column.sgc-active:nth-child(4n) .sgc-event-details-column::after,
    .sgc-event-column.sgc-active:nth-child(4n) .sgc-event-title::after,
    .sgc-event-column.sgc-active:nth-child(4n) .sgc-event-date-column::after {
        display: none;
    }
}

@media (min-width: 1920px) {
    .sgc-title {
        font-size: 48px;
    }
}

.is-layout-constrained
    > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: 100% !important;
}


/* Root wrapper — strip the grey section treatment entirely */
.template-sidebar .simple-google-calendar-events {
    background-color: transparent;
    border-top-left-radius: 0;
    padding: 0;
}

/* Inner container — fill the content column at full width */
.template-sidebar .sgc-inner-container {
    max-width: 100%;
}

/* Upper row — remove the front-page fixed margin; align with content flow */
.template-sidebar .sgc-upper {
    margin: 0 0 var(--space-m) 0;
}

/* Title — match page-content h2 exactly (mirrors page-layout.css) */
.template-sidebar .sgc-title {
    font-family: var(--font-family-primary);
    font-size: clamp(30px, 2vw + 14px, 38px);
    font-weight: var(--fw-semibold);
    color: var(--color-black);
    margin-top: var(--space-xl);
    margin-bottom: 0;
}

/* Carousel — retain a modest negative margin for visual dynamism.
   Reduced from the front-page value (up to -72px) since the content
   column has no compensating padding to bleed through. */
.template-sidebar .sgc-carousel-container {
    margin-inline: clamp(-10px, -2vw, -28px);
}

/* ── Tablet (≤ 1024px) ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Mirror page-layout.css h2 tablet scaling */
    .template-sidebar .sgc-title {
        font-size: clamp(26px, 2.5vw + 10px, 32px);
        margin-top: var(--space-l);
    }

    /* Scale back the negative bleed proportionally */
    .template-sidebar .sgc-carousel-container {
        margin-inline: clamp(-6px, -1.5vw, -14px);
    }
}

/* ── Mobile (≤ 767px) ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Mirror page-layout.css h2 mobile scaling */
    .template-sidebar .sgc-title {
        font-size: clamp(24px, 2vw + 14px, 30px);
        margin-top: var(--space-m);
    }

    /* Flush carousel — no room for negative bleed on mobile */
    .template-sidebar .sgc-carousel-container {
        margin-inline: 0;
    }

    /* Tighten upper row gap on mobile */
    .template-sidebar .sgc-upper {
        margin: 0 0 var(--space-s) 0;
    }
}

/* ==========================================================================
   Standard / Landing Template Overrides
   ─────────────────────────────────────────────────────────────────────────
   Scoped to .template-sidebar, which is the shared <main> class on all 5
   interior templates:
     · page-default-full
     · page-default-sidebar
     · page-default-photo-sidebar
     · page-landing-full
     · page-landing-sidebar
   The front page uses a different layout and is intentionally unaffected.
   ========================================================================== */

/* Root wrapper — strip the grey section treatment entirely */
.template-sidebar .simple-google-calendar-events {
    background-color: transparent;
    border-top-left-radius: 0;
    padding: 0;
}

/* Inner container — fill the content column at full width */
.template-sidebar .sgc-inner-container {
    max-width: 100%;
}

/* Upper row — remove the front-page fixed margin; align with content flow */
.template-sidebar .sgc-upper {
    margin: 0 0 var(--space-m) 0;
}

/* Restore original link styling — overrides .page-content a bleed-in */
.template-sidebar .sgc-more-link {
    color: black;
    text-decoration: none;
}

/* Title — match page-content h2 exactly (mirrors page-layout.css) */
.template-sidebar .sgc-title {
    font-family: var(--font-family-primary);
    font-size: clamp(30px, 2vw + 14px, 38px);
    font-weight: var(--fw-semibold);
    color: var(--color-black);
    margin-top: var(--space-xl);
    margin-bottom: 0;
}

/* Carousel — retain a modest negative margin for visual dynamism.
   Reduced from the front-page value (up to -72px) since the content
   column has no compensating padding to bleed through. */
.template-sidebar .sgc-carousel-container {
    margin-inline: clamp(-10px, -2vw, -28px);
}

/* ── Tablet (≤ 1024px) ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Mirror page-layout.css h2 tablet scaling */
    .template-sidebar .sgc-title {
        font-size: clamp(26px, 2.5vw + 10px, 32px);
        margin-top: var(--space-l);
    }

    /* Scale back the negative bleed proportionally */
    .template-sidebar .sgc-carousel-container {
        margin-inline: clamp(-6px, -1.5vw, -14px);
    }
}

/* ── Large desktop (≥ 1440px): cap at 3 events per slide ───────────────── */
/* Matches the JS cap in getItemsPerPage(). Separator hides on 3rd card.   */
@media (min-width: 1440px) {
    .template-sidebar .sgc-event-column {
        flex: 0 0 33.333%;
    }

    /* Suppress the global 4n hide rule and apply 3n instead */
    .template-sidebar .sgc-event-column.sgc-active:nth-child(4n) .sgc-event-details-column::after,
    .template-sidebar .sgc-event-column.sgc-active:nth-child(4n) .sgc-event-title::after,
    .template-sidebar .sgc-event-column.sgc-active:nth-child(4n) .sgc-event-date-column::after {
        display: block;
    }

    .template-sidebar .sgc-event-column.sgc-active:nth-child(3n) .sgc-event-details-column::after,
    .template-sidebar .sgc-event-column.sgc-active:nth-child(3n) .sgc-event-title::after,
    .template-sidebar .sgc-event-column.sgc-active:nth-child(3n) .sgc-event-date-column::after {
        display: none;
    }
}

/* Event title — reduced for the narrower interior column context */
.template-sidebar .sgc-event-title {
    font-size: 22px;
    margin-top: 0px !important;
}

/* ── Mobile (≤ 767px) ───────────────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Mirror page-layout.css h2 mobile scaling */
    .template-sidebar .sgc-title {
        font-size: clamp(24px, 2vw + 14px, 30px);
        margin-top: var(--space-m);
    }

    /* Flush carousel — no room for negative bleed on mobile */
    .template-sidebar .sgc-carousel-container {
        margin-inline: 0;
    }

    /* Tighten upper row gap on mobile */
    .template-sidebar .sgc-upper {
        margin: 0 0 var(--space-s) 0;
    }
}

/* When no heading is provided, push "View all events" to the right */
.sgc-upper.sgc-no-heading {
    justify-content: flex-end;
}