/* =========================================================
   SALONE CALENDAR
   Shared styles for the /calendar page and the homepage
   "Upcoming Events" block.

   Everything is scoped under .salone-cal so it can never
   leak into the rest of the site.

   Breakpoints
     base            phones          agenda list
     >= 768px        tablet          month grid, condensed
     >= 1200px       desktop         month grid, full
   ========================================================= */

.salone-cal {
    /* Brand tokens - these mirror assets/css/style.css */
    --sc-primary: #2f8bee;
    --sc-primary-dark: #1e6fc4;
    --sc-primary-soft: #e8f2fd;
    --sc-ink: #27343e;
    --sc-body: #46545f;
    --sc-muted: #7d8b98;
    --sc-line: #e4e9ee;
    --sc-line-soft: #eff2f5;
    --sc-surface: #ffffff;
    --sc-tint: #f0f8ff;
    --sc-accent: #54be67;

    --sc-radius: 15px;
    --sc-radius-sm: 8px;
    --sc-radius-pill: 999px;

    --sc-gap: 16px;
    --sc-pad: 18px;

    --sc-font: 'Open Sans', 'Source Sans Pro', -apple-system,
               BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --sc-shadow: 0 1px 2px rgba(39, 52, 62, .04),
                 0 8px 24px rgba(39, 52, 62, .06);

    font-family: var(--sc-font);
    color: var(--sc-body);
    position: relative;
}

.salone-cal *,
.salone-cal *::before,
.salone-cal *::after {
    box-sizing: border-box;
}


/* =========================================================
   TOOLBAR
   One custom toolbar drives every breakpoint, so the
   controls never reflow into a different component.
   ========================================================= */

.salone-cal__toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

/* On phones the title sits on its own line above the controls -
   sharing a row with three buttons left it squeezed. */
.salone-cal__bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.salone-cal__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--sc-ink);
    margin: 0;
    letter-spacing: -.2px;
    order: 1;
    text-align: center;
    min-width: 0;
}

.salone-cal__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    order: 2;
    flex: 0 0 auto;
}

.salone-cal__arrow {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--sc-line);
    background: var(--sc-surface);
    color: var(--sc-ink);
    border-radius: var(--sc-radius-pill);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .15s ease, border-color .15s ease,
                color .15s ease;
}

.salone-cal__arrow:hover,
.salone-cal__arrow:focus-visible {
    background: var(--sc-primary-soft);
    border-color: var(--sc-primary);
    color: var(--sc-primary-dark);
}

.salone-cal__today {
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--sc-line);
    background: var(--sc-surface);
    color: var(--sc-ink);
    border-radius: var(--sc-radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease,
                color .15s ease;
}

.salone-cal__today:hover,
.salone-cal__today:focus-visible {
    background: var(--sc-primary-soft);
    border-color: var(--sc-primary);
    color: var(--sc-primary-dark);
}

/* View switcher -------------------------------------------------- */

.salone-cal__views {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--sc-line-soft);
    border-radius: var(--sc-radius-pill);
}

.salone-cal__view {
    flex: 1 1 0;
    height: 36px;
    padding: 0 14px;
    border: none;
    background: transparent;
    color: var(--sc-body);
    border-radius: var(--sc-radius-pill);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}

.salone-cal__view:hover {
    color: var(--sc-ink);
}

.salone-cal__view.is-active {
    background: var(--sc-primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(47, 139, 238, .35);
}

.salone-cal__view:focus-visible {
    outline: 2px solid var(--sc-primary);
    outline-offset: 2px;
}


/* =========================================================
   SURFACE
   ========================================================= */

.salone-cal__surface {
    position: relative;
    background: var(--sc-surface);
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    padding: 10px;
    min-height: 320px;
    overflow: hidden;
}

.salone-cal__loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, .88);
    border-radius: var(--sc-radius);
    z-index: 5;
    color: var(--sc-muted);
    font-size: 14px;
}

.salone-cal__spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--sc-line);
    border-top-color: var(--sc-primary);
    border-radius: 50%;
    animation: salone-cal-spin .7s linear infinite;
}

@keyframes salone-cal-spin {
    to { transform: rotate(360deg); }
}

/* Agenda height follows its rows; the grids keep the reserved
   minimum so the card does not jump while loading. */
.salone-cal.is-agenda .salone-cal__surface {
    min-height: 0;
}

.salone-cal__error {
    padding: 40px 20px;
    text-align: center;
    color: var(--sc-muted);
    font-size: 15px;
}

.salone-cal__error a {
    color: var(--sc-primary);
    font-weight: 600;
}


/* =========================================================
   FULLCALENDAR - SHARED CHROME
   ========================================================= */

.salone-cal .fc {
    font-family: var(--sc-font);
    --fc-border-color: var(--sc-line);
    --fc-today-bg-color: var(--sc-tint);
    --fc-page-bg-color: var(--sc-surface);
    --fc-neutral-bg-color: var(--sc-line-soft);
    --fc-event-bg-color: var(--sc-primary);
    --fc-event-border-color: var(--sc-primary);
    --fc-event-text-color: #fff;
    --fc-now-indicator-color: var(--sc-accent);
}

/* The custom toolbar replaces FullCalendar's own. */
.salone-cal .fc-header-toolbar {
    display: none !important;
}

.salone-cal .fc-scrollgrid {
    border-radius: var(--sc-radius-sm);
    overflow: hidden;
}

/* FullCalendar draws a redundant outer edge inside our card. */
.salone-cal .fc-scrollgrid {
    border-left-width: 0;
    border-top-width: 0;
}

.salone-cal .fc-scrollgrid td:last-of-type,
.salone-cal .fc-scrollgrid th:last-of-type {
    border-right-width: 0;
}

.salone-cal .fc-scrollgrid-section > td {
    border-bottom-width: 0;
}

.salone-cal .fc-scrollgrid-section > *:first-child {
    border-left-width: 0;
}

/* Column headers ------------------------------------------------- */

.salone-cal .fc-col-header-cell {
    background: var(--sc-line-soft);
    padding: 10px 4px;
    border-color: var(--sc-line);
}

.salone-cal .fc-col-header-cell-cushion {
    color: var(--sc-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 0;
}

/* Day cells ------------------------------------------------------ */

.salone-cal .fc-daygrid-day-number {
    color: var(--sc-ink);
    font-size: 14px;
    font-weight: 600;
    padding: 8px 10px;
    text-decoration: none !important;
}

.salone-cal .fc-day-other .fc-daygrid-day-number {
    color: #bcc6cf;
    font-weight: 400;
}

.salone-cal .fc-day-today {
    background: var(--sc-tint) !important;
}

.salone-cal .fc-day-today .fc-daygrid-day-number {
    background: var(--sc-primary);
    color: #fff;
    border-radius: var(--sc-radius-pill);
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    margin: 6px 8px 0 0;
}

/* Events --------------------------------------------------------- */

.salone-cal .fc-daygrid-event {
    border-radius: var(--sc-radius-sm);
    border: none;
    background: var(--sc-primary);
    color: #fff;
    padding: 3px 8px;
    margin: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    transition: background .15s ease;
}

.salone-cal .fc-daygrid-event:hover {
    background: var(--sc-primary-dark);
}

.salone-cal .fc-daygrid-event .fc-event-time {
    font-weight: 700;
    opacity: .85;
    margin-right: 4px;
}

.salone-cal .fc-daygrid-event .fc-event-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Timed events in Week / Day keep a dot rather than a solid block */
.salone-cal .fc-daygrid-dot-event {
    background: transparent;
    color: var(--sc-ink);
}

.salone-cal .fc-daygrid-dot-event:hover {
    background: var(--sc-primary-soft);
}

.salone-cal .fc-daygrid-event-dot {
    border-color: var(--sc-primary);
}

.salone-cal .fc-timegrid-event {
    border-radius: var(--sc-radius-sm);
    border: none;
    background: var(--sc-primary);
    padding: 2px 6px;
    font-size: 12px;
}

.salone-cal .fc-more-link {
    color: var(--sc-primary);
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    text-decoration: none !important;
}

.salone-cal .fc-timegrid-slot-label-cushion,
.salone-cal .fc-timegrid-axis-cushion {
    color: var(--sc-muted);
    font-size: 12px;
    font-weight: 600;
}

.salone-cal .fc-popover {
    border-radius: var(--sc-radius-sm);
    border: 1px solid var(--sc-line);
    box-shadow: var(--sc-shadow);
    overflow: hidden;
}

.salone-cal .fc-popover-header {
    background: var(--sc-line-soft);
    color: var(--sc-ink);
    font-weight: 700;
    padding: 8px 12px;
}


/* =========================================================
   AGENDA / LIST VIEW
   The mobile default, and the homepage block at every size.
   ========================================================= */

.salone-cal .fc-list {
    border: none;
    border-radius: 0;
}

/* Each row carries its own date chip, so FullCalendar's day
   headings would just repeat it. */
.salone-cal .fc-list-day {
    display: none;
}

/* Remove FullCalendar's table chrome - rows are cards instead.
   table-layout:fixed plus max-width:0 on the cell is what lets
   long titles and addresses ellipsis instead of pushing the
   table wider than its container. */
.salone-cal .fc-list-table {
    width: 100%;
    table-layout: fixed;
}

.salone-cal .fc-list-table,
.salone-cal .fc-list-table td,
.salone-cal .fc-list-table th {
    border: none;
}

.salone-cal .fc-list-table td {
    max-width: 0;
}

.salone-cal .fc-list-event {
    cursor: pointer;
}

.salone-cal .fc-list-event:hover td {
    background: transparent;
}

.salone-cal .fc-list-event > td {
    padding: 0;
}

.salone-cal .fc-list-event-graphic,
.salone-cal .fc-list-event-time {
    display: none;
}

.salone-cal .fc-list-event-title {
    padding: 0 !important;
}

.salone-cal .fc-list-event-title a {
    text-decoration: none !important;
    color: inherit;
}

/* Our own row markup, supplied via eventContent ------------------- */

.salone-cal__row {
    display: flex;
    align-items: stretch;
    gap: 14px;
    padding: 14px;
    margin-bottom: 10px;
    background: var(--sc-surface);
    border: 1px solid var(--sc-line);
    border-radius: var(--sc-radius);
    transition: border-color .15s ease, box-shadow .15s ease,
                transform .15s ease;
}

.salone-cal__row:hover {
    border-color: var(--sc-primary);
    box-shadow: var(--sc-shadow);
}

.salone-cal__date {
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    background: var(--sc-tint);
    border-radius: var(--sc-radius-sm);
    text-align: center;
}

.salone-cal__date-month {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--sc-primary-dark);
}

.salone-cal__date-day {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    color: var(--sc-ink);
}

.salone-cal__date-weekday {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--sc-muted);
}

.salone-cal__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.salone-cal__event-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sc-ink);
    /* Long event names must not blow out the row on narrow screens. */
    overflow-wrap: anywhere;
}

.salone-cal__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 12px;
    font-size: 13px;
    color: var(--sc-muted);
}

.salone-cal__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
}

.salone-cal__meta-item svg {
    flex: 0 0 auto;
    width: 13px;
    height: 13px;
    opacity: .8;
}

.salone-cal__meta-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Descriptions here range from one line to a full multi-day itinerary,
   so they are clamped. The whole row links to the Google event page,
   where the full text lives. */
.salone-cal__desc {
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--sc-body);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Fallback for browsers without line-clamp: cap the height instead. */
    max-height: 3.9em;
}

@supports (-webkit-line-clamp: 2) {
    .salone-cal__desc {
        max-height: none;
    }
}

.salone-cal__empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--sc-muted);
}

.salone-cal__empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sc-ink);
    margin-bottom: 6px;
}

.salone-cal .fc-list-empty {
    background: transparent;
    padding: 40px 20px;
    color: var(--sc-muted);
}


/* =========================================================
   TABLET  >= 768px
   Month grid returns; toolbar collapses onto one line.
   ========================================================= */

@media (min-width: 768px) {

    .salone-cal {
        --sc-pad: 22px;
    }

    .salone-cal__toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 24px;
    }

    .salone-cal__bar {
        flex: 0 1 auto;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 16px;
    }

    .salone-cal__title {
        text-align: left;
        font-size: 26px;
        order: 2;
        white-space: nowrap;
    }

    .salone-cal__nav {
        order: 1;
    }

    .salone-cal__views {
        flex: 0 0 auto;
    }

    .salone-cal__view {
        flex: 0 0 auto;
    }

    .salone-cal__surface {
        padding: 16px;
        min-height: 560px;
    }

    .salone-cal .fc-col-header-cell {
        padding: 12px 6px;
    }

    .salone-cal .fc-daygrid-day-frame {
        min-height: 96px;
    }

    .salone-cal .fc-daygrid-event {
        font-size: 12.5px;
        padding: 4px 9px;
    }

    /* Agenda rows get more room for the meta line. */
    .salone-cal__row {
        gap: 18px;
        padding: 16px 18px;
    }

    .salone-cal__date {
        flex-basis: 66px;
    }

    .salone-cal__event-title {
        font-size: 17px;
    }

    .salone-cal__desc {
        font-size: 13.5px;
        -webkit-line-clamp: 3;
    }
}


/* =========================================================
   DESKTOP  >= 1200px
   ========================================================= */

@media (min-width: 1200px) {

    .salone-cal__title {
        font-size: 32px;
    }

    .salone-cal__surface {
        padding: 22px;
        min-height: 680px;
    }

    .salone-cal .fc-daygrid-day-frame {
        min-height: 124px;
    }

    .salone-cal .fc-daygrid-day-number {
        font-size: 15px;
    }

    .salone-cal .fc-daygrid-event {
        font-size: 13px;
        margin: 3px 7px;
    }

    .salone-cal__row {
        padding: 18px 20px;
    }

    .salone-cal__event-title {
        font-size: 18px;
    }

    .salone-cal__meta {
        font-size: 14px;
    }
}


/* =========================================================
   COMPACT VARIANT  (homepage "Upcoming Events")
   Agenda list at every width, no view switcher, no card
   border - the homepage section already provides one.
   ========================================================= */

.salone-cal--compact .salone-cal__views {
    display: none;
}

.salone-cal--compact .salone-cal__surface {
    border: none;
    padding: 0;
    min-height: 0;
    background: transparent;
    overflow: visible;
}

.salone-cal--compact .salone-cal__loader {
    background: transparent;
    position: static;
    padding: 48px 0;
}

.salone-cal--compact .salone-cal__toolbar {
    margin-bottom: 16px;
}

@media (min-width: 768px) {

    .salone-cal--compact .salone-cal__surface {
        min-height: 0;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .salone-cal *,
    .salone-cal *::before,
    .salone-cal *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* =========================================================
   "Add an event" link
   Shared by the calendar page and the homepage section.
   ========================================================= */

.add-event-calendar-link {
    display: inline-block;
    margin-top: 8px;
    color: #2f8bee;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none !important;
}

.add-event-calendar-link:hover,
.add-event-calendar-link:focus {
    color: #1e6fc4;
    text-decoration: underline !important;
}

@media (min-width: 768px) {
    .add-event-calendar-link {
        font-size: 20px;
    }
}
