/**
 * Zamseed Events Widget
 *
 * @package Zamseed
 * @since 1.0.0
 */

/* ==========================================================================
   Section Header
   ========================================================================== */

.zs-events__header {
    display: flex;
    flex-direction: column;
    align-items: var(--zs-header-items, center);
    gap: 16px;
    max-width: 740px;
    margin-left: var(--zs-header-margin-left, auto);
    margin-right: var(--zs-header-margin-right, auto);
    margin-bottom: 60px;
    text-align: var(--zs-header-text-align, center);
}

.zs-events__eyebrow {
    display: block;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    /* Same gold, stated as the token so a palette change reaches it. */
    color: var(--zs-accent, #c48c33);
}

.zs-events__header-title {
    margin: 0;
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--zs-primary, #2d5a27);
}

.zs-events__header-desc {
    margin: 0;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.6;
    color: #555555;
}

/* ==========================================================================
   View All Button
   ========================================================================== */

.zs-events__view-all-wrap {
    display: flex;
    justify-content: center;
    margin-top: 60px;
}

/* Outlined pill, per Figma 11140:10866: 1.6px green rule, no fill, no shadow,
   50px tall. It read as a solid primary button here, which gave the section two
   competing filled CTAs against the frame's single quiet one. The fill is kept
   for hover/focus so the affordance still reads on interaction. */
.zs-events__view-all {
    --zs-events-view-all-hover-y: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 2px 18px;
    border: 1.6px solid var(--zs-primary, #2d5a27);
    border-radius: 999px;
    background-color: transparent;
    color: var(--zs-primary, #2d5a27);
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition:
        transform var(--zs-motion-fast, 220ms) var(--zs-ease-hover, cubic-bezier(0.2, 0.8, 0.2, 1)),
        background-color var(--zs-motion-fast, 220ms) var(--zs-ease-hover, cubic-bezier(0.2, 0.8, 0.2, 1)),
        border-color var(--zs-motion-fast, 220ms) var(--zs-ease-hover, cubic-bezier(0.2, 0.8, 0.2, 1)),
        color var(--zs-motion-fast, 220ms) var(--zs-ease-hover, cubic-bezier(0.2, 0.8, 0.2, 1)),
        box-shadow var(--zs-motion-fast, 220ms) var(--zs-ease-hover, cubic-bezier(0.2, 0.8, 0.2, 1));
}

.zs-events__view-all:hover,
.zs-events__view-all:focus-visible {
    transform: translateY(var(--zs-events-view-all-hover-y));
    border-color: var(--zs-primary-dark, #1f3f1d);
    background-color: var(--zs-primary-dark, #1f3f1d);
    color: #ffffff;
    box-shadow: 0 14px 28px rgba(45, 90, 39, 0.22);
}

.zs-events__view-all:focus-visible {
    outline: 3px solid rgba(196, 140, 51, 0.45);
    outline-offset: 3px;
}

.zs-events__view-all-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 0;
}

.zs-events__view-all-icon svg,
.zs-events__view-all-icon i,
.zs-events__view-all-icon img {
    width: 1em;
    height: 1em;
    font-size: 1em;
    object-fit: contain;
}

/* ==========================================================================
   List
   ========================================================================== */

/* A real <ul>. The reset is needed because Elementor pages inherit the theme's
   list styling, which would otherwise add bullets and an indent. */
/* 1040, not the 1200 the wider sections use — the frame gives this section its
   own narrower container (Figma 11096:35830, x=200 w=1040). The measure lives
   on the content rather than on a percentage width on the widget. */
.zs-events__list,
.zs-events__view-all-wrap {
    width: min(var(--zs-events-content-max, 1040px), calc(100% - var(--zs-container-padding, 20px) * 2));
    margin-inline: auto;
}

.zs-events__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    /*
     * margin-block, not the margin shorthand.
     *
     * The reset exists to drop the browser's default list margin, which is
     * vertical. Written as `margin: 0` it also reset the inline auto margins
     * the measure rule above sets — same specificity, later in the file — so
     * the list took its 1040px measure but stayed hard against the left edge
     * of the 1152px widget: 144px of gutter on the left, 256px on the right.
     *
     * .zs-events__view-all-wrap shares that measure rule and has no reset of
     * its own, which is why the CTA was landing at the correct x=200 while the
     * cards under it sat 56px to the left.
     */
    margin-block: 0;
    padding: 0;
    list-style: none;
}

.zs-events__item {
    display: flex;
    width: 100%;
    margin: 0;
}

/* ==========================================================================
   Card
   ========================================================================== */

.zs-events__card {
    display: flex;
    align-items: center;
    gap: 60px;
    padding: 29px 33px;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease;
    width: 100%;
}

a.zs-events__card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

/* ==========================================================================
   Date Column
   ========================================================================== */

.zs-events__date-col {
    flex: 0 0 154px;
    width: 154px;
    border-right: 1px solid rgba(0, 0, 0, 0.12);
    border-right-style: solid;
    display: flex;
    align-items: center;
    align-self: stretch;
    padding-right: 40px;
}

/* Single date or same-month range */
.zs-events__date-single {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    width: 100%;
}

/* Cross-month range */
.zs-events__date-range {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.zs-events__date-part {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    flex: 1;
}

.zs-events__date-sep {
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: #555555;
    padding-top: 10px;
    flex-shrink: 0;
}

/* Day number */
.zs-events__day {
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: 44px;
    font-weight: 700;
    line-height: 1;
    color: var(--zs-primary, #2d5a27);
}

/* Month label */
.zs-events__month {
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.053em;
    text-transform: uppercase;
    color: #555555;
}

/* ==========================================================================
   Content Column
   ========================================================================== */

.zs-events__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 0 0;
    min-width: 0;
}

/* Now a real heading element (h2–h5) by default, so the margins WordPress
   gives headings have to be reset here. */
.zs-events__title {
    margin: 0;
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--zs-primary, #2d5a27);
}

.zs-events__desc {
    margin: 0;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #555555;
}

/* ==========================================================================
   Location / Meta Column
   ========================================================================== */

.zs-events__meta-col {
    flex: 0 0 160px;
    width: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.zs-events__location {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zs-events__location-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #555555;
}

.zs-events__location-text {
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: #555555;
    white-space: nowrap;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

/* Deliberate, not a blank band: this is what the section publishes whenever
   the repeater is empty or the Events CPT returns nothing. */
.zs-events__empty {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 40px;
    background-color: var(--zs-warm, #fdfcf9);
    border: 1px solid var(--zs-border, rgba(0, 0, 0, 0.08));
    border-radius: 12px;
    text-align: center;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    color: #555555;
}

.zs-events__empty-message {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--zs-text, #1c1c1c);
}

.zs-events__empty-note {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #555555;
}

/* Editor-only diagnostic — never reaches a visitor. */
.zs-events__empty-hint {
    margin: 8px 0 0;
    padding-top: 12px;
    border-top: 1px dashed var(--zs-accent, #c48c33);
    font-size: 13px;
    line-height: 1.5;
    color: var(--zs-accent-text, #9a6c1f);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .zs-events__header-title {
        font-size: 32px;
    }

    .zs-events__card {
        gap: 32px;
    }

    .zs-events__date-col {
        flex: 0 0 110px;
        width: 110px;
        padding-right: 24px;
    }

    .zs-events__day {
        font-size: 36px;
    }

    .zs-events__month {
        font-size: 14px;
    }

    .zs-events__meta-col {
        flex: 0 0 120px;
        width: 120px;
    }
}

@media (max-width: 680px) {
    .zs-events__header {
        margin-bottom: 40px;
    }

    .zs-events__header-title {
        font-size: 26px;
    }

    .zs-events__view-all-wrap {
        margin-top: 40px;
    }

    .zs-events__view-all {
        width: 100%;
        max-width: 320px;
        text-align: center;
    }

    .zs-events__card {
        flex-wrap: wrap;
        gap: 20px;
        padding: 20px;
    }

    .zs-events__date-col {
        flex: 0 0 auto;
        width: auto;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        padding-right: 0;
        padding-bottom: 16px;
        width: 100%;
        align-self: auto;
    }

    .zs-events__date-single,
    .zs-events__date-range {
        flex-direction: row;
        align-items: baseline;
        gap: 12px;
    }

    .zs-events__date-part {
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
    }

    .zs-events__day {
        font-size: 30px;
    }

    .zs-events__month {
        font-size: 14px;
    }

    .zs-events__content {
        flex: 1 1 100%;
    }

    .zs-events__meta-col {
        flex: 1 1 100%;
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zs-events__view-all {
        transition: none !important;
    }

    .zs-events__view-all:hover,
    .zs-events__view-all:focus-visible {
        transform: none !important;
    }
}
