/* Automaize Event Calendar – Frontend Styles */

/* =========================================================
   Grid layout
   ========================================================= */

.aec-events-grid {
    display: grid;
    gap: var(--amzec-grid-gap, 1.5rem);
    margin: 1.5rem 0;
    /* Default: 3 columns. Overridden by .aec-cols-* classes. */
    grid-template-columns: repeat(3, 1fr);
}

.aec-events-grid.aec-cols-1 { grid-template-columns: 1fr; }
.aec-events-grid.aec-cols-2 { grid-template-columns: repeat(2, 1fr); }
.aec-events-grid.aec-cols-3 { grid-template-columns: repeat(3, 1fr); }
.aec-events-grid.aec-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Tablet: max 2 columns */
@media (max-width: 900px) {
    .aec-events-grid.aec-cols-3,
    .aec-events-grid.aec-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: single column */
@media (max-width: 540px) {
    .aec-events-grid,
    .aec-events-grid.aec-cols-1,
    .aec-events-grid.aec-cols-2,
    .aec-events-grid.aec-cols-3,
    .aec-events-grid.aec-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Event tile
   ========================================================= */

.aec-event-tile {
    background: #ffffff;
    border-radius: var(--amzec-tile-radius, 8px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.aec-event-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13);
}

/* Image */
.aec-event-tile__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.aec-event-tile__image a {
    display: block;
    height: 100%;
}

.aec-event-tile__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.aec-event-tile:hover .aec-event-tile__image img {
    transform: scale(1.04);
}

/* Body — flex-grow so footer sticks to bottom */
.aec-event-tile__body {
    padding: 1.1rem 1.25rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title */
.aec-event-tile__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 0.4rem;
}

.aec-event-tile__title a {
    color: inherit;
    text-decoration: none;
}

.aec-event-tile__title a:hover {
    color: var(--aec-primary, #0073aa);
}

/* Subtitle */
.aec-event-tile__subtitle {
    font-size: 0.875rem;
    color: #666;
    margin: 0 0 0.6rem;
    line-height: 1.4;
}

/* Date — pushed to the bottom of the body area */
.aec-event-tile__date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: #888;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.aec-event-tile__date-icon {
    font-size: 0.85em;
    line-height: 1;
}

/* Footer */
.aec-event-tile__footer {
    padding: 0.75rem 1.25rem 1.1rem;
}

/* Button */
.aec-event-tile__button {
    display: block;
    text-align: center;
    padding: 0.55rem 1rem;
    background: var(--aec-primary, #0073aa);
    color: #ffffff !important;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s ease, opacity 0.2s ease;
    cursor: pointer;
}

.aec-event-tile__button:hover {
    opacity: 0.88;
    color: #ffffff !important;
    text-decoration: none;
}

/* Empty state */
.aec-no-events {
    color: #888;
    font-style: italic;
    margin: 1rem 0;
}

/* =========================================================
   Single event page
   ========================================================= */

/* Full-width page wrapper — sits between get_header() / get_footer() */
.aec-single-event-page {
    width: 100%;
    padding: 2.5rem 1.25rem 4rem;
    box-sizing: border-box;
}

/* Centered content container */
.aec-single-event-container {
    max-width: 880px;
    margin: 0 auto;
}

/* Hero image */
.aec-single-event__hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 10px;
    background: #f0f0f0;
    margin-bottom: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

.aec-single-event__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Meta info bar (date / time / recurrence) */
.aec-single-event__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.75rem;
    padding: 0.9rem 1.25rem;
    background: #f6f6f6;
    border-radius: 8px;
    border-left: 4px solid var(--aec-primary, #0073aa);
    margin-bottom: 1.5rem;
}

.aec-single-event__meta-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.92rem;
    color: #444;
    font-weight: 500;
}

.aec-single-event__meta-icon {
    font-size: 1em;
    flex-shrink: 0;
    line-height: 1;
}

/* Header */
.aec-single-event__header {
    margin-bottom: 1.75rem;
}

.aec-single-event__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 0.5rem;
}

.aec-single-event__subtitle {
    font-size: 1.1rem;
    color: #555;
    margin: 0 0 0;
    font-style: italic;
    line-height: 1.5;
}

/* Content */
.aec-single-event__content {
    line-height: 1.75;
    margin-bottom: 2.5rem;
    font-size: 1rem;
}

/* WooCommerce section */
.aec-single-event__shop {
    background: #f6f6f6;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2.5rem;
    border-top: 3px solid var(--aec-primary, #0073aa);
}

/* Back link */
.aec-single-event__back {
    padding-top: 1.25rem;
    border-top: 1px solid #eee;
}

.aec-single-event__back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.aec-single-event__back-link:hover {
    color: var(--aec-primary, #0073aa);
    text-decoration: none;
}

/* Mobile adjustments */
@media (max-width: 620px) {
    .aec-single-event-page {
        padding: 1.25rem 1rem 3rem;
    }

    .aec-single-event__hero {
        border-radius: 6px;
        margin-bottom: 1.25rem;
    }

    .aec-single-event__meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
