/* EventCal — public styles.
   Designed to inherit from the active theme as much as possible — no
   aggressive resets, minimal opinions about typography. */

.eventcal { margin: 1.5em 0; }

/* Filter bar */
.eventcal-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1em;
    align-items: center;
}
.eventcal-filter-bar input[type="search"],
.eventcal-filter-bar select {
    padding: 6px 10px;
}

/* Navigation header (prev / title / next) */
.eventcal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1em;
}
.eventcal-nav-title {
    margin: 0;
    font-size: 1.4em;
    text-align: center;
    flex: 1;
}
.eventcal-nav-prev, .eventcal-nav-next {
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 0.9em;
    opacity: 0.85;
}
.eventcal-nav-prev:hover, .eventcal-nav-next:hover { opacity: 1; }

/* Month grid */
.eventcal-month-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.eventcal-month-grid th {
    text-align: center;
    padding: 8px 4px;
    font-weight: 600;
    border-bottom: 2px solid currentColor;
    opacity: 0.7;
}
.eventcal-cell {
    vertical-align: top;
    border: 1px solid rgba(128, 128, 128, 0.25);
    height: 110px;
    padding: 4px;
    overflow: hidden;
}
.eventcal-cell-other-month { opacity: 0.35; }
.eventcal-cell-today {
    background: rgba(255, 220, 80, 0.15);
    outline: 2px solid rgba(255, 180, 0, 0.6);
}
.eventcal-cell-date {
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 4px;
}
.eventcal-cell-events {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8em;
}
.eventcal-cell-event {
    margin-bottom: 2px;
    line-height: 1.3;
}
.eventcal-cell-event a {
    display: block;
    padding: 2px 4px;
    border-radius: 3px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.eventcal-cell-event a:hover { background: rgba(128, 128, 128, 0.15); }
.eventcal-cell-event.eventcal-featured a {
    background: rgba(220, 80, 80, 0.12);
    border-left: 3px solid rgba(220, 80, 80, 0.8);
}
.eventcal-cell-time { font-weight: 600; margin-right: 4px; opacity: 0.8; }
.eventcal-cell-more a {
    font-size: 0.85em;
    opacity: 0.75;
    text-decoration: underline;
    padding: 2px 4px;
}

/* List view */
.eventcal-list-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.eventcal-list-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
.eventcal-list-item.eventcal-featured {
    background: rgba(220, 80, 80, 0.05);
    border-left: 4px solid rgba(220, 80, 80, 0.7);
    padding-left: 12px;
}
.eventcal-list-thumb {
    flex-shrink: 0;
    width: 140px;
    max-width: 140px;
}
.eventcal-list-thumb img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}
.eventcal-list-body { flex: 1; min-width: 0; }
.eventcal-list-title {
    margin: 0 0 4px;
    font-size: 1.15em;
}
.eventcal-list-meta {
    margin: 0 0 6px;
    font-size: 0.9em;
    opacity: 0.85;
}
.eventcal-list-excerpt {
    margin: 6px 0;
    font-size: 0.95em;
}
.eventcal-badge {
    display: inline-block;
    background: rgba(220, 80, 80, 0.85);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    margin-left: 6px;
    vertical-align: middle;
}

/* Day view */
.eventcal-day-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.eventcal-day-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}
.eventcal-day-time {
    flex-shrink: 0;
    width: 130px;
}
.eventcal-day-time strong { display: block; }
.eventcal-day-time span { font-size: 0.85em; opacity: 0.7; }
.eventcal-day-body h3 { margin: 0 0 4px; }
.eventcal-day-venue { margin: 0; font-size: 0.9em; opacity: 0.8; }

/* Map view */
.eventcal-map {
    width: 100%;
    border-radius: 4px;
    border: 1px solid rgba(128, 128, 128, 0.3);
}
.eventcal-map-popup-title {
    font-weight: 600;
    margin-bottom: 6px;
}
.eventcal-map-popup-event {
    margin: 4px 0;
    padding: 4px 0;
    border-top: 1px solid rgba(128, 128, 128, 0.2);
    font-size: 0.85em;
}

/* Photo grid */
.eventcal-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.eventcal-photo-card {
    display: block;
    text-decoration: none;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(128, 128, 128, 0.2);
    transition: transform 0.15s, box-shadow 0.15s;
}
.eventcal-photo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.eventcal-photo-img {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: rgba(128, 128, 128, 0.1);
}
.eventcal-photo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.eventcal-photo-meta {
    padding: 10px 12px;
}
.eventcal-photo-meta h3 {
    margin: 0 0 4px;
    font-size: 1em;
}
.eventcal-photo-meta p {
    margin: 0;
    font-size: 0.85em;
    opacity: 0.8;
}
.eventcal-photo-venue { opacity: 0.65; }

/* Forms */
.eventcal-form { max-width: 640px; }
.eventcal-form p { margin: 0 0 14px; }
.eventcal-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.eventcal-form input[type="text"],
.eventcal-form input[type="email"],
.eventcal-form input[type="url"],
.eventcal-form input[type="date"],
.eventcal-form input[type="time"],
.eventcal-form input[type="file"],
.eventcal-form select,
.eventcal-form textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(128, 128, 128, 0.4);
    border-radius: 4px;
    font: inherit;
}
.eventcal-form-row { display: flex; gap: 12px; }
.eventcal-form-row p { flex: 1; }
.eventcal-form button {
    padding: 10px 18px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid rgba(128, 128, 128, 0.4);
    background: rgba(50, 100, 200, 0.9);
    color: #fff;
}
.eventcal-form button:hover { background: rgba(50, 100, 200, 1); }
.eventcal-required { color: #c0392b; }
.eventcal-help { display: block; font-size: 0.85em; opacity: 0.7; margin-top: 2px; }

.eventcal-fieldset {
    border: 1px dashed rgba(128, 128, 128, 0.35);
    padding: 10px 14px;
    margin: 0 0 14px;
}
.eventcal-fieldset legend {
    padding: 0 6px;
    font-weight: 600;
}

/* Notices */
.eventcal-notice {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
}
.eventcal-notice-success { background: rgba(70, 180, 90, 0.15); border-left: 4px solid rgba(70, 180, 90, 0.8); }
.eventcal-notice-error { background: rgba(220, 80, 80, 0.15); border-left: 4px solid rgba(220, 80, 80, 0.8); }

/* My events */
.eventcal-my-events ul { list-style: none; padding: 0; margin: 0; }
.eventcal-my-events li { padding: 8px 0; border-bottom: 1px solid rgba(128, 128, 128, 0.2); }
.eventcal-meta { opacity: 0.7; margin-left: 6px; }
.eventcal-status { opacity: 0.6; font-size: 0.85em; margin-left: 4px; }

/* Empty state */
.eventcal-empty {
    padding: 30px;
    text-align: center;
    background: rgba(128, 128, 128, 0.07);
    border-radius: 6px;
    opacity: 0.85;
}

.eventcal-intro {
    background: rgba(128, 128, 128, 0.07);
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* Buy tickets button */
.eventcal-buy-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #c0392b;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}
.eventcal-buy-btn:hover { background: #a93226; }

/* On product pages */
.eventcal-product-event {
    margin: 18px 0;
    padding: 14px 16px;
    background: rgba(128, 128, 128, 0.08);
    border-radius: 4px;
}
.eventcal-product-event h3 { margin-top: 0; font-size: 1em; opacity: 0.8; }
.eventcal-product-event p { margin: 4px 0; }

/* Responsive */
@media (max-width: 640px) {
    .eventcal-cell { height: 80px; font-size: 0.85em; }
    .eventcal-list-item { flex-direction: column; gap: 8px; }
    .eventcal-list-thumb { width: 100%; max-width: 100%; }
    .eventcal-day-item { flex-direction: column; gap: 4px; }
    .eventcal-day-time { width: auto; }
    .eventcal-form-row { flex-direction: column; gap: 0; }
    .eventcal-nav-title { font-size: 1.1em; }
}

/* Geographic + radius filter additions */
.eventcal-radius-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.eventcal-locate-btn {
    padding: 6px 12px;
    border: 1px solid rgba(128, 128, 128, 0.4);
    border-radius: 4px;
    background: rgba(128, 128, 128, 0.08);
    cursor: pointer;
    font-size: 0.9em;
}
.eventcal-locate-btn:hover { background: rgba(128, 128, 128, 0.18); }
.eventcal-locate-btn:disabled { opacity: 0.6; cursor: default; }
.eventcal-list-loc { opacity: 0.7; }
.eventcal-list-distance {
    display: inline-block;
    background: rgba(50, 100, 200, 0.85);
    color: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    margin-left: 6px;
}
.eventcal-browse-note {
    background: rgba(50, 100, 200, 0.08);
    padding: 8px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 0.95em;
}
.eventcal-feed-link { margin-top: 14px; }
.eventcal-organizer-events { margin-top: 28px; }

/* Artists performing section on single event pages */
.eventcal-lineup {
    margin: 24px 0;
}
.eventcal-lineup-heading {
    font-size: 1.3em;
    margin: 0 0 12px;
}
.eventcal-lineup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    column-count: 3;
    column-gap: 24px;
}
.eventcal-lineup-item {
    margin: 0 0 6px;
    /* Prevent a performer name from splitting across two columns. */
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}
.eventcal-lineup-item a,
.eventcal-lineup-item {
    text-decoration: none;
    font-size: 0.95em;
    line-height: 1.4;
}
.eventcal-lineup-item a:hover {
    text-decoration: underline;
}

/* Collapse to fewer columns on narrow screens */
@media (max-width: 600px) {
    .eventcal-lineup-list { column-count: 1; }
}
@media (min-width: 601px) and (max-width: 900px) {
    .eventcal-lineup-list { column-count: 2; }
}
