/**
 * CoEvents Frontend Styles
 *
 * Tema-agnostisk styling med CSS Custom Properties.
 * Alla värden kan överskrivas av temat eller via inställningar.
 *
 * @package CoEvents
 */

/* ==========================================================================
   CSS Custom Properties (fallbacks för om de inte injectas via PHP)
   ========================================================================== */

:root {
    --ce-primary-color: #0d4259;
    --ce-secondary-color: #1d1d1d;
    --ce-accent-color: #0d4259;
    --ce-text-color: #0d4259;
    --ce-text-muted: #666;
    --ce-light-bg: rgba(13, 66, 89, 0.1);
    --ce-border-color: rgba(13, 66, 89, 0.2);
    --ce-border-radius: 20px;
    --ce-spacing-unit: 1rem;
    --ce-font-family: inherit;

    /* Cards - Tillväxt Motala style */
    --ce-card-bg: rgba(13, 66, 89, 0.17);
    --ce-card-shadow: none;
    --ce-card-shadow-hover: none;
    --ce-card-padding: 0.95rem;
    --ce-card-image-ratio: 56.25%; /* 16:9 */
    --ce-card-gap: 1.5rem;
    --ce-card-image-radius: 13px;

    /* Badges */
    --ce-badge-soldout-bg: #c41e3a;
    --ce-badge-soldout-color: #fff;
    --ce-badge-cancelled-bg: #666;
    --ce-badge-cancelled-color: #fff;

    /* Tags */
    --ce-tag-bg: var(--ce-light-bg);
    --ce-tag-color: var(--ce-text-color);

    /* Buttons */
    --ce-button-radius: var(--ce-border-radius);

    /* Focus */
    --ce-focus-color: var(--ce-accent-color);
    --ce-focus-offset: 2px;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */

.ce-events,
.ce-event-single,
.ce-archive {
    font-family: var(--ce-font-family);
    color: var(--ce-text-color);
    line-height: 1.6;
}

.ce-events *,
.ce-event-single *,
.ce-archive * {
    box-sizing: border-box;
}

/* Screen reader only */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link (shown on focus) */
.screen-reader-text:focus {
    position: fixed;
    top: 5px;
    left: 5px;
    z-index: 100000;
    width: auto;
    height: auto;
    padding: 15px 23px 14px;
    clip: auto;
    background: var(--ce-card-bg);
    color: var(--ce-text-color);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: var(--ce-card-shadow-hover);
}

/* ==========================================================================
   Focus Styles (Accessibility)
   ========================================================================== */

.ce-events a:focus,
.ce-event-single a:focus,
.ce-archive a:focus,
.ce-filter__btn:focus,
.ce-button:focus {
    outline: 2px solid var(--ce-focus-color);
    outline-offset: var(--ce-focus-offset);
}

.ce-events a:focus:not(:focus-visible),
.ce-event-single a:focus:not(:focus-visible),
.ce-archive a:focus:not(:focus-visible),
.ce-filter__btn:focus:not(:focus-visible),
.ce-button:focus:not(:focus-visible) {
    outline: none;
}

.ce-events a:focus-visible,
.ce-event-single a:focus-visible,
.ce-archive a:focus-visible,
.ce-filter__btn:focus-visible,
.ce-button:focus-visible {
    outline: 2px solid var(--ce-focus-color);
    outline-offset: var(--ce-focus-offset);
}

/* ==========================================================================
   Filter
   ========================================================================== */

.ce-filter {
    margin-bottom: calc(var(--ce-spacing-unit) * 2);
}

.ce-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ce-filter__btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid var(--ce-border-color);
    border-radius: var(--ce-border-radius);
    background: var(--ce-card-bg);
    color: var(--ce-text-color);
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ce-filter__btn:hover {
    border-color: var(--ce-primary-color);
    color: var(--ce-primary-color);
}

.ce-filter__btn--active {
    background: var(--ce-primary-color);
    border-color: var(--ce-primary-color);
    color: #fff;
}

.ce-filter__btn--active:hover {
    background: var(--ce-secondary-color);
    border-color: var(--ce-secondary-color);
    color: #fff;
}

/* ==========================================================================
   Toolbar
   ========================================================================== */

/* ==========================================================================
   Premium Toolbar with Enhanced Animations & Micro-interactions
   ========================================================================== */

.ce-toolbar {
    margin-bottom: 0.75rem;
    padding: 1rem 0;
    background: transparent;
    border-radius: 0;
    transition: none;
}

.ce-toolbar:hover {
    box-shadow: none;
}

.ce-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.875rem;
}

.ce-toolbar__row--main {
    justify-content: flex-start;
}

/* ==========================================================================
   Search Field - Premium Input with Icon Animation
   ========================================================================== */

.ce-toolbar__search {
    flex: 1;
    min-width: 220px;
    max-width: 340px;
}

.ce-toolbar__search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ce-toolbar__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #0d4259;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
}

/* Icon animation on focus */
.ce-toolbar__search-input:focus ~ .ce-toolbar__search-icon,
.ce-toolbar__search-wrapper:focus-within .ce-toolbar__search-icon {
    opacity: 0.8;
}

/* Icon animation on input value */
.ce-toolbar__search-input:not(:placeholder-shown) ~ .ce-toolbar__search-icon {
    opacity: 0.75;
}

.ce-toolbar__search-input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 1px solid rgba(13, 66, 89, 0.15);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #0d4259;
    transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ce-toolbar__search-input::placeholder {
    color: #0d4259;
    opacity: 0.45;
    transition: opacity 200ms ease;
}

.ce-toolbar__search-input:hover {
    background: rgba(255, 255, 255, 0.95);
}

.ce-toolbar__search-input:focus {
    outline: none;
    background: #fff;
    border-color: rgba(13, 66, 89, 0.25);
}

.ce-toolbar__search-input:focus::placeholder {
    opacity: 0.35;
}

/* Active state indicator - subtle glow when typing */
.ce-toolbar__search-input:not(:placeholder-shown) {
    background: #fff;
    border-color: rgba(13, 66, 89, 0.12);
}

/* ==========================================================================
   Filter Dropdowns - Enhanced with Rotation Animation
   ========================================================================== */

.ce-toolbar__filter {
    flex-shrink: 0;
    position: relative;
}

/* Active filter indicator */
.ce-toolbar__filter::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 8px;
    height: 8px;
    background: #29A166;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* Show indicator when filter has non-default value */
.ce-toolbar__filter--active::after {
    opacity: 1;
    transform: scale(1);
}

.ce-toolbar__select {
    min-width: 160px;
    padding: 0.625rem 2.25rem 0.625rem 1rem;
    border: 1px solid rgba(13, 66, 89, 0.15);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    color: #0d4259;
    cursor: pointer;
    transition: all 280ms cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230d4259' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
}

.ce-toolbar__select:hover {
    background-color: rgba(255, 255, 255, 0.95);
}

.ce-toolbar__select:focus {
    outline: none;
    background-color: #fff;
    border-color: rgba(13, 66, 89, 0.25);
}

/* Chevron rotation animation on focus/active */
.ce-toolbar__select:focus,
.ce-toolbar__select:active {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230d4259' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Enhanced select when value is changed */
.ce-toolbar__select:not([value=""]):valid,
.ce-toolbar__select.ce-toolbar__select--active {
    background-color: #fff;
    border-color: rgba(13, 66, 89, 0.12);
    font-weight: 600;
}

/* ==========================================================================
   View Toggle Buttons - Premium Button Group with Smooth Transitions
   ========================================================================== */

.ce-toolbar__views {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    padding: 0.375rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.ce-toolbar__view-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #0d4259;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Subtle ripple effect background */
.ce-toolbar__view-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(13, 66, 89, 0.08);
    transform: translate(-50%, -50%);
    transition: width 300ms ease, height 300ms ease;
}

.ce-toolbar__view-btn:hover::before {
    width: 100%;
    height: 100%;
}

.ce-toolbar__view-btn svg {
    position: relative;
    z-index: 1;
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ce-toolbar__view-btn:hover {
    background: rgba(13, 66, 89, 0.06);
    transform: translateY(-1px);
}

.ce-toolbar__view-btn:hover svg {
    transform: scale(1.1);
}

.ce-toolbar__view-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Active state */
.ce-toolbar__view-btn--active {
    background: #0d4259;
    color: #fff;
}

.ce-toolbar__view-btn--active::before {
    display: none;
}

.ce-toolbar__view-btn--active:hover {
    background: #0a3444;
}

/* Premium focus states with smooth ring animation */
.ce-toolbar__view-btn:focus {
    outline: none;
}

.ce-toolbar__view-btn:focus-visible {
    outline: 2px solid #0d4259;
    outline-offset: 2px;
    animation: focus-pulse 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes focus-pulse {
    0%, 100% {
        outline-color: rgba(13, 66, 89, 1);
    }
    50% {
        outline-color: rgba(13, 66, 89, 0.5);
    }
}

/* ==========================================================================
   Status/Count - Subtle Fade-in Animation
   ========================================================================== */

.ce-toolbar__status {
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid rgba(13, 66, 89, 0.08);
    font-size: 0.813rem;
    font-weight: 500;
    color: #0d4259;
    opacity: 0.7;
    animation: fade-in 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

.ce-toolbar__status:empty {
    display: none;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive - Mobile-Optimized with Staggered Animations
   ========================================================================== */

@media (max-width: 768px) {
    .ce-toolbar {
        padding: 0.75rem;
    }

    .ce-toolbar__row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }

    .ce-toolbar__search {
        max-width: none;
        min-width: 0;
        order: 1;
    }

    .ce-toolbar__search-input {
        font-size: 1rem;
        padding: 12px 16px 12px 42px;
    }

    .ce-toolbar__filter {
        order: 2;
    }

    .ce-toolbar__select {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px 32px 10px 12px;
    }

    .ce-toolbar__views {
        order: 3;
        margin-left: 0;
        justify-content: center;
        gap: 0.5rem;
    }

    .ce-toolbar__view-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .ce-toolbar {
        padding: 0.5rem;
    }

    .ce-toolbar__row {
        gap: 0.5rem;
    }

    .ce-toolbar__search-input {
        font-size: 0.9rem;
        padding: 10px 14px 10px 38px;
    }

    .ce-toolbar__search-icon {
        left: 10px;
        width: 14px;
        height: 14px;
    }

    .ce-toolbar__select {
        font-size: 0.85rem;
        padding: 9px 28px 9px 10px;
    }

    .ce-toolbar__filter::after {
        right: 10px;
    }

    .ce-toolbar__views {
        width: 100%;
        justify-content: space-between;
    }

    .ce-toolbar__view-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 0.75rem;
        justify-content: center;
    }

    .ce-toolbar__view-btn svg {
        width: 14px;
        height: 14px;
    }
}

/* ==========================================================================
   Reduced Motion - Accessibility Support
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ce-toolbar,
    .ce-toolbar__search-icon,
    .ce-toolbar__search-input,
    .ce-toolbar__select,
    .ce-toolbar__view-btn,
    .ce-toolbar__view-btn::before,
    .ce-toolbar__view-btn svg,
    .ce-toolbar__status,
    .ce-toolbar__filter::after {
        animation: none;
        transition: none;
    }

    .ce-toolbar__view-btn:focus-visible {
        animation: none;
    }
}

/* ==========================================================================
   Events Container
   ========================================================================== */

.ce-events {
    margin: 0;
    padding: 0;
}

.ce-events__empty {
    padding: calc(var(--ce-spacing-unit) * 2);
    text-align: center;
    color: var(--ce-text-muted);
    background: var(--ce-light-bg);
    border-radius: var(--ce-border-radius);
}

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

.ce-events__list {
    display: flex;
    flex-direction: column;
    gap: var(--ce-spacing-unit);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Event cards in list view */
.ce-events__list .ce-event-card-link {
    display: flex;
    flex-direction: row;
    border-radius: var(--ce-border-radius);
    overflow: hidden;
}

.ce-events__list .ce-event-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-height: 230px;
}

.ce-events__list .ce-event-card__image-wrapper {
    flex: 0 0 30%;
    max-width: 30%;
    height: 230px;
    padding-bottom: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin: 0.75rem;
}

.ce-events__list .ce-event-card__image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ce-events__list .ce-event-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem 1.25rem;
}

/* Excerpt - hidden in grid, visible in list */
.ce-event-card__excerpt {
    display: none;
}

.ce-events__list .ce-event-card__excerpt {
    display: block;
    margin: 0.25rem 0 0.5rem;
    font-size: 1rem;
    color: #444;
    line-height: 1.5;
}

.ce-events__list .ce-event-card__title {
    height: auto;
}

/* List view responsive */
@media (max-width: 768px) {
    .ce-events__list .ce-event-card-link {
        flex-direction: column;
    }

    .ce-events__list .ce-event-card {
        flex-direction: column;
        min-height: auto;
    }

    .ce-events__list .ce-event-card__image-wrapper {
        flex: none;
        max-width: 100%;
        width: calc(100% - 1.5rem);
        height: 180px;
        margin: 0.75rem 0.75rem 0 0.75rem;
    }

    .ce-events__list .ce-event-card__content {
        padding: 1rem;
    }

    .ce-events__list .ce-event-card__excerpt {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .ce-events__list .ce-event-card__image-wrapper {
        height: 150px;
    }

    .ce-events__list .ce-event-card__content {
        padding: 0.75rem;
    }

    .ce-events__list .ce-event-card__excerpt {
        display: none;
    }

    .ce-events__list .ce-event-card__chip {
        font-size: 0.75rem;
    }

    .ce-events__list .ce-event-card__title {
        font-size: 1rem;
    }

    .ce-events__list .ce-event-card__location {
        font-size: 0.8rem;
    }
}

.ce-event-list-item {
    position: relative;
}

.ce-event-list-item__link {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    background: var(--ce-card-bg);
    border: 1px solid var(--ce-border-color);
    border-radius: var(--ce-border-radius);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 120px;
}

.ce-event-list-item__link:hover {
    border-color: var(--ce-primary-color);
}

.ce-event-list-item__image {
    position: relative;
    flex: 0 0 30%;
    max-width: 30%;
    min-height: 120px;
    background: var(--ce-light-bg);
}

.ce-event-list-item__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ce-event-list-item__date {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px;
    text-align: center;
}

.ce-event-list-item__day {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ce-primary-color);
}

.ce-event-list-item__month {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ce-text-muted);
}

.ce-event-list-item__content {
    flex: 1;
    min-width: 0;
    padding: var(--ce-spacing-unit);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ce-event-list-item__title {
    margin: 0 0 0.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.ce-event-list-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    color: var(--ce-text-muted);
}

.ce-event-list-item__time,
.ce-event-list-item__location,
.ce-event-list-item__price {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.ce-event-list-item--past .ce-event-list-item__link {
    opacity: 0.7;
}

.ce-event-list-item--cancelled .ce-event-list-item__link {
    opacity: 0.6;
}

/* ==========================================================================
   Grid Layout
   ========================================================================== */

.ce-events__grid {
    display: grid;
    gap: var(--ce-card-gap);
}

.ce-events__grid--2-cols {
    grid-template-columns: repeat(2, 1fr);
}

.ce-events__grid--3-cols {
    grid-template-columns: repeat(3, 1fr);
}

.ce-events__grid--4-cols {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .ce-events__grid--4-cols {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ce-events__grid--3-cols,
    .ce-events__grid--4-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .ce-events__grid--2-cols,
    .ce-events__grid--3-cols,
    .ce-events__grid--4-cols {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Event Card - Identisk med Tillväxt Motala news cards (.product-card)
   ========================================================================== */

/* Link wrapper */
.ce-event-card-link,
.ce-event-card-link:hover,
.ce-event-card-link:focus,
.ce-event-card-link:active,
.ce-event-card-link:visited {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

.ce-event-card-link .ce-event-card__title,
.ce-event-card-link:hover .ce-event-card__title {
    text-decoration: none !important;
}

/* Card */
.ce-event-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: rgba(13, 66, 89, 0.17);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 100%;
    padding: 0.95rem;
    margin-top: 5px;
}

.ce-event-card:hover {
    transform: translateY(-2px);
}

/* Image wrapper */
.ce-event-card__image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: 13px;
}

.ce-event-card__image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ce-event-card:hover .ce-event-card__image-wrapper img {
    transform: scale(1.03);
}

/* Content */
.ce-event-card__content {
    padding: 0.75rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

/* Badge (date) */
.ce-event-card__chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.625rem;
    margin-bottom: 0.5rem;
    background: rgba(13, 66, 89, 0.1);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #0d4259;
}

.ce-event-card__time::before {
    content: '•';
    margin-right: 0.5rem;
}

.ce-event-card__location {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    color: #0d4259;
    opacity: 0.7;
}

.ce-event-card__location svg {
    flex-shrink: 0;
}

/* Title */
.ce-event-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: #0d4259;
    text-align: left;
    height: 47px;
}

/* Status badges (cancelled/soldout) */
.ce-event-card__status {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.688rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ce-event-card__status--cancelled {
    background: #666;
    color: #fff;
}

.ce-event-card__status--soldout {
    background: #c41e3a;
    color: #fff;
}

/* Card states */
.ce-event-card--cancelled {
    opacity: 0.7;
}

.ce-event-card--cancelled .ce-event-card__title {
    text-decoration: line-through;
}

/* Focus for accessibility */
.ce-event-card:focus-within {
    outline: 2px solid #0d4259;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .ce-event-card {
        padding: 0.625rem;
    }

    .ce-event-card__content {
        padding: 0.625rem 0 0 0;
    }

    .ce-event-card__title {
        font-size: 0.938rem;
    }
}

/* ==========================================================================
   Date Group (Grouped Layout)
   ========================================================================== */

.ce-date-group {
    margin-bottom: calc(var(--ce-spacing-unit) * 2);
}

.ce-date-group__heading {
    margin: 0 0 var(--ce-spacing-unit);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ce-primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.ce-date-group__events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--ce-card-gap);
}

/* ==========================================================================
   Compact Layout
   ========================================================================== */

.ce-events__compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ce-events__compact-item {
    position: relative;
}

.ce-events__compact-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--ce-border-color);
    transition: color 0.2s ease;
}

.ce-events__compact-link:hover {
    color: var(--ce-primary-color);
}

.ce-events__compact-date {
    flex-shrink: 0;
    width: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ce-text-muted);
}

.ce-events__compact-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ce-events__compact-external {
    flex-shrink: 0;
    opacity: 0.5;
}

.ce-events__compact-item--past .ce-events__compact-link {
    opacity: 0.6;
}

.ce-events__compact-item--cancelled .ce-events__compact-title {
    text-decoration: line-through;
}

/* ==========================================================================
   Tags
   ========================================================================== */

.ce-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--ce-tag-bg);
    border-radius: calc(var(--ce-border-radius) / 2);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ce-tag-color);
    text-decoration: none;
}

.ce-tag--outline {
    background: transparent;
    border: 1px solid var(--ce-border-color);
}

a.ce-tag:hover {
    background: var(--ce-primary-color);
    color: #fff;
}

/* ==========================================================================
   Badges
   ========================================================================== */

.ce-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--ce-border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ce-badge--soldout {
    background: var(--ce-badge-soldout-bg);
    color: var(--ce-badge-soldout-color);
}

.ce-badge--cancelled {
    background: var(--ce-badge-cancelled-bg);
    color: var(--ce-badge-cancelled-color);
}

/* Badge positioning in card */
.ce-event-card > .ce-badge,
.ce-event-list-item > .ce-badge {
    position: absolute;
    top: var(--ce-spacing-unit);
    right: var(--ce-spacing-unit);
    z-index: 1;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.ce-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--ce-button-radius);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ce-button--primary {
    background: var(--ce-primary-color);
    color: #fff;
}

.ce-button--primary:hover {
    background: var(--ce-secondary-color);
    color: #fff;
}

.ce-button--primary:link,
.ce-button--primary:visited,
.ce-button--primary:hover,
.ce-button--primary:active {
    color: #fff !important;
}

.ce-button--secondary {
    background: transparent;
    border: 1px solid var(--ce-border-color);
    color: var(--ce-text-color);
}

.ce-button--secondary:hover {
    border-color: var(--ce-primary-color);
    color: var(--ce-primary-color);
}

.ce-button--small {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
}

.ce-button--icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ce-button--icon svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Icons
   ========================================================================== */

.ce-icon {
    flex-shrink: 0;
}

/* ==========================================================================
   Single Event
   ========================================================================== */

.ce-event-single {
    max-width: 100%;
}

.ce-event-single__image {
    margin: 0 0 calc(var(--ce-spacing-unit) * 2);
}

.ce-event-single__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--ce-border-radius);
}

.ce-event-single__container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: calc(var(--ce-spacing-unit) * 2);
    align-items: start;
}

@media (max-width: 900px) {
    .ce-event-single__container {
        grid-template-columns: 1fr;
    }

    .ce-event-single__sidebar {
        order: -1;
    }
}

.ce-event-single__header {
    margin-bottom: calc(var(--ce-spacing-unit) * 1.5);
}

.ce-event-single__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ce-event-single__title {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.ce-event-single__date {
    margin: 0;
    font-size: 1.125rem;
    color: var(--ce-text-muted);
}

.ce-event-single__content {
    margin-bottom: calc(var(--ce-spacing-unit) * 2);
}

.ce-event-single__content > *:first-child {
    margin-top: 0;
}

.ce-event-single__content > *:last-child {
    margin-bottom: 0;
}

.ce-event-single__footer {
    padding-top: var(--ce-spacing-unit);
    border-top: 1px solid var(--ce-border-color);
}

.ce-event-single__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ==========================================================================
   Event Meta (Sidebar)
   ========================================================================== */

.ce-event-meta {
    position: sticky;
    top: calc(var(--ce-spacing-unit) * 2);
    padding: var(--ce-spacing-unit);
    background: var(--ce-light-bg);
    border-radius: var(--ce-border-radius);
}

.ce-event-meta__alert {
    margin: calc(var(--ce-spacing-unit) * -1);
    margin-bottom: var(--ce-spacing-unit);
    padding: var(--ce-spacing-unit);
    text-align: center;
    border-radius: var(--ce-border-radius) var(--ce-border-radius) 0 0;
}

.ce-event-meta__alert--cancelled {
    background: var(--ce-badge-cancelled-bg);
    color: var(--ce-badge-cancelled-color);
}

.ce-event-meta__alert--soldout {
    background: var(--ce-badge-soldout-bg);
    color: var(--ce-badge-soldout-color);
}

.ce-event-meta__list {
    margin: 0;
}

.ce-event-meta__item {
    padding: var(--ce-spacing-unit) 0;
    border-bottom: 1px solid var(--ce-border-color);
}

.ce-event-meta__item:first-child {
    padding-top: 0;
}

.ce-event-meta__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.ce-event-meta__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ce-primary-color, #0d4259);
}

.ce-event-meta__value {
    margin: 0;
    font-size: 0.9375rem;
}

.ce-event-meta__value > * {
    display: block;
}

.ce-event-meta__value > * + * {
    margin-top: 0.25rem;
}

.ce-event-meta__location-name,
.ce-event-meta__organizer-name {
    font-weight: 600;
}

.ce-event-meta__map-link,
.ce-event-meta__location-link,
.ce-event-meta__contact-link {
    color: var(--ce-primary-color);
    text-decoration: none;
}

.ce-event-meta__map-link:hover,
.ce-event-meta__location-link:hover,
.ce-event-meta__contact-link:hover {
    text-decoration: underline;
}

.ce-event-meta__price-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.ce-event-meta__price-note {
    font-size: 0.875rem;
    color: var(--ce-text-muted);
}

.ce-event-meta__ticket-btn {
    margin-top: 0.75rem;
    width: 100%;
}

.ce-event-meta__value--warning {
    color: #b45309;
    font-weight: 500;
}

.ce-event-meta__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: var(--ce-spacing-unit);
    padding-top: var(--ce-spacing-unit);
    border-top: 1px solid var(--ce-border-color);
}

.ce-event-meta__actions .ce-button {
    width: 100%;
    justify-content: center;
}

.ce-event-meta__actions .ce-button--external {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ce-event-meta__actions .ce-icon--external {
    flex-shrink: 0;
}

/* ==========================================================================
   Related Events
   ========================================================================== */

.ce-related {
    margin-top: calc(var(--ce-spacing-unit) * 3);
    padding-top: calc(var(--ce-spacing-unit) * 2);
    border-top: 1px solid var(--ce-border-color);
}

.ce-related__title {
    margin: 0 0 calc(var(--ce-spacing-unit) * 1.5);
    font-size: 1.5rem;
    font-weight: 600;
}

/* ==========================================================================
   Archive
   ========================================================================== */

.ce-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--ce-spacing-unit) * 2);
}

.ce-archive__header {
    margin-bottom: calc(var(--ce-spacing-unit) * 2);
}

.ce-archive__title {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: 700;
}

.ce-archive__description {
    color: var(--ce-text-muted);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.ce-pagination {
    margin-top: calc(var(--ce-spacing-unit) * 2);
    padding-top: calc(var(--ce-spacing-unit) * 2);
    border-top: 1px solid var(--ce-border-color);
}

.ce-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.ce-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border: 1px solid var(--ce-border-color);
    border-radius: var(--ce-border-radius);
    background: var(--ce-card-bg);
    color: var(--ce-text-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ce-pagination .page-numbers:hover {
    border-color: var(--ce-primary-color);
    color: var(--ce-primary-color);
}

.ce-pagination .page-numbers.current {
    background: var(--ce-primary-color);
    border-color: var(--ce-primary-color);
    color: #fff;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .ce-event-card,
    .ce-event-card__img,
    .ce-event-list-item__link,
    .ce-filter__btn,
    .ce-button,
    .ce-events__compact-link {
        transition: none;
    }

    .ce-event-card:hover {
        transform: none;
    }

    .ce-event-card:hover .ce-event-card__img {
        transform: none;
    }
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: more) {
    .ce-event-card,
    .ce-event-list-item__link,
    .ce-filter__btn {
        border: 2px solid var(--ce-text-color);
    }

    .ce-badge {
        border: 2px solid currentColor;
    }

    .ce-event-card__meta-item::before {
        background: var(--ce-text-color);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ce-filter,
    .ce-pagination,
    .ce-event-meta__ticket-btn,
    .ce-event-meta__map-link {
        display: none;
    }

    .ce-event-card,
    .ce-event-list-item__link {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }

    .ce-event-single__container {
        display: block;
    }

    .ce-event-meta {
        position: static;
        background: none;
        border: 1px solid #000;
        margin-top: 1rem;
    }
}

/* ==========================================================================
   Widget Styles
   ========================================================================== */

.widget_coevents_upcoming {
    font-family: var(--ce-font-family);
}

.ce-widget-events {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ce-widget-event {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--ce-border-color);
}

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

.ce-widget-event--cancelled {
    opacity: 0.7;
}

.ce-widget-event__thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: var(--ce-border-radius);
    overflow: hidden;
}

.ce-widget-event__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ce-widget-event__content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.ce-widget-event__title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--ce-text-color);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ce-widget-event__title:hover,
.ce-widget-event__title:focus {
    color: var(--ce-primary-color);
}

.ce-widget-event__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--ce-text-muted);
}

.ce-widget-event__date,
.ce-widget-event__time,
.ce-widget-event__venue {
    display: inline-flex;
    align-items: center;
}

.ce-widget-event__time::before {
    content: "•";
    margin-right: 0.5rem;
}

.ce-widget-event__venue {
    display: block;
    width: 100%;
    font-size: 0.75rem;
    color: var(--ce-text-muted);
}

.ce-widget-event__badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.125rem 0.375rem;
    border-radius: 2px;
}

.ce-widget-event__badge--cancelled {
    background: var(--ce-badge-cancelled-bg);
    color: var(--ce-badge-cancelled-color);
}

.ce-widget-events__more {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ce-primary-color);
    text-decoration: none;
}

.ce-widget-events__more:hover,
.ce-widget-events__more:focus {
    text-decoration: underline;
}

.ce-widget-events__empty {
    color: var(--ce-text-muted);
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
}

/* ==========================================================================
   Meta Box (shortcode)
   ========================================================================== */

.ce-meta-box {
    background: var(--ce-card-bg, rgba(13, 66, 89, 0.08));
    border-radius: 20px;
    padding: 1.25rem;
}

/* Sticky variant */
.ce-meta-box--sticky {
    position: -webkit-sticky;
    position: sticky;
    top: 2rem;
    align-self: flex-start;
    height: fit-content;
}

/* BB Themer / Beaver Builder sticky support */
.fl-col:has(.ce-meta-box--sticky) {
    align-self: flex-start;
}

.fl-col-content:has(.ce-meta-box--sticky) {
    height: 100%;
}

/* Elementor sticky support */
.elementor-column:has(.ce-meta-box--sticky) {
    align-self: flex-start;
}

/* Generic flex parent support */
.ce-meta-box--sticky-wrapper {
    align-self: flex-start;
    height: 100%;
}

.ce-meta-box__alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.ce-meta-box__alert--cancelled {
    background: var(--ce-badge-cancelled-bg, #666);
    color: var(--ce-badge-cancelled-color, #fff);
}

.ce-meta-box__alert--soldout {
    background: var(--ce-badge-soldout-bg, #c41e3a);
    color: var(--ce-badge-soldout-color, #fff);
}

.ce-meta-box__list {
    margin: 0;
    padding: 0;
}

.ce-meta-box__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(13, 66, 89, 0.1);
}

.ce-meta-box__item:last-child {
    border-bottom: none;
}

.ce-meta-box__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ce-primary-color, #0d4259);
    margin: 0;
}

.ce-meta-box__label svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.ce-meta-box__value {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ce-primary-color, #0d4259);
}

.ce-meta-box__value a {
    color: var(--ce-primary-color, #0d4259);
    text-decoration: none;
}

.ce-meta-box__value a:hover {
    text-decoration: underline;
}

.ce-meta-box__value strong {
    font-weight: 600;
}

.ce-meta-box__value small {
    font-size: 0.85rem;
    color: var(--ce-text-muted, #666);
}

.ce-meta-box__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(13, 66, 89, 0.1);
}

.ce-meta-box__actions .ce-button {
    width: 100%;
    justify-content: center;
}

.ce-meta-box__actions .ce-button--external {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ce-meta-box__actions .ce-icon--external {
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .ce-meta-box {
        padding: 1rem;
    }

    .ce-meta-box__value {
        font-size: 0.9rem;
    }
}
