/*
 * Event page (themes/_base/sections/event/*). Token-only (--z-*), no mode selectors.
 *
 * Two layers:
 *   1. The page's own blocks (hero, about, vendor spaces): zt-ev-* classes.
 *   2. The reused event components (views/events/components/*.php, Tailwind markup + their own
 *      <style> blocks written for a white page). Every wrapper carries .zt-ev-kit, which maps their
 *      light-only colours onto the tokens so Light and Dark both read well, and hides each
 *      component's own heading (the section prints the market's wording instead). Component <style>
 *      blocks sit in <body>, after this file, so overrides of their selectors add one class.
 */

/* The components read the legacy page's colour variables. */
body.zt {
    --tenant-primary: var(--z-accent);
    --tenant-secondary: var(--z-accent-2);
    --tenant-primary-rgb: var(--z-accent-rgb);
    --tenant-secondary-rgb: var(--z-accent-2-rgb);
}

/* ---- Staff preview banners (draft / members-only; staff only, fixed warning colours) ---- */
.zt-ev-staffbar {
    position: sticky; top: 0; z-index: 9998; display: flex; align-items: center; justify-content: center;
    flex-wrap: wrap; gap: 8px 14px; padding: 9px 16px; font-size: .875rem; line-height: 1.4; text-align: center;
    color: #ffffff; background: linear-gradient(135deg, #b45309, #92400e); box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.zt-ev-staffbar--draft { z-index: 9999; background: linear-gradient(135deg, #d97706, #b45309); }
.zt-ev-staffbar__group { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.zt-ev-staffbar__text { opacity: .88; }
.zt-ev-staffbar__link {
    color: #ffffff; background: rgba(255, 255, 255, .18); padding: 4px 12px; border-radius: 6px;
    font-weight: 600; text-decoration: none; white-space: nowrap;
}
.zt-ev-staffbar__link:hover { color: #ffffff; background: rgba(255, 255, 255, .28); text-decoration: none; }

/* ---- Hero: banner photo (else the theme gradient), name, facts, countdown, button --------- */
.zt-ev-hero {
    position: relative; isolation: isolate; overflow: hidden; text-align: center;
    color: var(--z-hero-ink); background: linear-gradient(135deg, var(--z-hero-from), var(--z-hero-to));
    padding: 88px 0 64px;
}
@media (min-width: 768px) { .zt-ev-hero { padding: 150px 0 88px; } }
.zt-ev-hero--photo { color: #ffffff; }
.zt-ev-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.zt-ev-hero__shade {
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, .5) 50%, rgba(0, 0, 0, .72));
}
.zt-ev-hero__inner { position: relative; }
.zt-ev-hero :where(h1, p, li, a) { color: inherit; }
.zt-ev-hero__title {
    margin: 0 auto; max-width: 960px; font-size: clamp(2.1rem, 1.2rem + 3.8vw, 4.25rem); font-weight: 800;
    line-height: 1.08; overflow-wrap: anywhere;
}
.zt-ev-hero--photo .zt-ev-hero__title,
.zt-ev-hero--photo .zt-ev-hero__facts { text-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.zt-ev-hero__facts {
    list-style: none; margin: 22px auto 0; padding: 0; max-width: 900px; display: flex; flex-wrap: wrap;
    justify-content: center; gap: 10px 24px; font-size: clamp(1rem, .95rem + .3vw, 1.15rem); font-weight: 600;
}
.zt-ev-hero__facts li { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.zt-ev-hero__facts a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.zt-ev-hero__arrow { opacity: .8; }
.zt-ev-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.zt-ev-hero__btn { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; box-shadow: var(--z-shadow-lg); }
.zt-ev-hero .zt-btn--light,
.zt-ev-hero .zt-btn--light:hover { color: var(--z-hero-from); text-decoration: none; }

.zt-ev-countdown { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.zt-ev-countdown__cell {
    min-width: 72px; padding: 12px 10px; border-radius: var(--z-radius); display: flex; flex-direction: column; align-items: center;
    background: color-mix(in srgb, currentColor 14%, transparent); border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
}
@media (min-width: 640px) { .zt-ev-countdown__cell { min-width: 92px; padding: 16px 18px; } }
.zt-ev-countdown__num {
    font-family: var(--z-font-display); font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem); font-weight: 800; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.zt-ev-countdown__label { margin-top: 6px; font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; opacity: .9; }

/* Status pill (vendor who can't book right now). */
.zt-ev-status {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
    border-radius: 999px; font-weight: 600; font-size: .95rem; text-align: center;
    color: var(--z-text); background: var(--z-surface); border: 1px solid var(--z-border); box-shadow: var(--z-shadow);
}
.zt-ev-status--muted { color: var(--z-muted); background: var(--z-surface-2); box-shadow: none; }
.zt-ev-status--wait { color: var(--z-accent-text); background: var(--z-accent-soft); box-shadow: none; }
.zt-ev-status--closed { color: #e11d48; border-color: #e11d48; background: color-mix(in srgb, #e11d48 10%, var(--z-surface)); box-shadow: none; }

/* ---- About: description + facts ------------------------------------------------------ */
.zt-ev-about__text {
    margin: 0 auto 36px; max-width: 760px; text-align: center; color: var(--z-muted); overflow-wrap: anywhere;
    font-size: clamp(1.1rem, 1rem + .5vw, 1.375rem); line-height: 1.7;
}
.zt-ev-facts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.zt-ev-fact {
    display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 16px 18px;
    background: var(--z-surface); border: 1px solid var(--z-border); border-radius: var(--z-radius-lg); box-shadow: var(--z-shadow);
}
.zt-ev-fact__icon {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    color: var(--z-accent-text); background: var(--z-accent-soft);
}
.zt-ev-fact__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.zt-ev-fact__body a { color: var(--z-text); }
.zt-ev-fact__body a:hover { color: var(--z-accent-text); }
.zt-ev-fact__badge {
    align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; color: var(--z-accent-text); background: var(--z-accent-soft);
}
.zt-ev-fact__rows { margin: 6px 0 0; display: grid; gap: 6px; }
.zt-ev-fact__rows > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.zt-ev-fact__rows dt { width: 2.75rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--z-muted); }
.zt-ev-fact__rows dd { margin: 0; min-width: 0; }
.zt-ev-deadline {
    display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: 100%;
    margin: 28px auto 0; padding: 12px 18px; border-radius: var(--z-radius); font-weight: 600; text-align: center;
    color: var(--z-accent-text); background: var(--z-accent-soft); border: 1px solid var(--z-border);
}
.zt-ev-deadline--closed { color: #e11d48; border-color: #e11d48; background: color-mix(in srgb, #e11d48 10%, var(--z-surface)); }

/* ---- Vendor spaces (vendors who may book only) ------------------------------------------ */
.zt-ev-space .zt-card__body { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.zt-ev-space--out { opacity: .7; }
.zt-ev-space__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.zt-ev-space__info { min-width: 0; }
.zt-ev-space__name { margin: 0 0 6px; font-size: 1.2rem; font-weight: 700; overflow-wrap: anywhere; }
.zt-ev-space__desc { margin: 0 0 4px; font-size: .9rem; overflow-wrap: anywhere; }
.zt-ev-space__price { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.zt-ev-space__price strong { font-family: var(--z-font-display); font-size: 1.5rem; font-weight: 800; color: var(--z-accent-text); }
.zt-ev-space__left { font-size: .85rem; font-weight: 600; color: var(--z-accent-text); }
.zt-ev-space__left--out { color: #e11d48; }
.zt-ev-space__amenities { margin: 0; font-size: .9rem; color: var(--z-muted); overflow-wrap: anywhere; }
.zt-ev-space__amenities strong { color: var(--z-text); }
.zt-ev-spaces__action { display: flex; justify-content: center; margin-top: 40px; }

/* ==== Reused components ==================================================================== */
.zt-ev-block > section { padding-top: 0 !important; padding-bottom: 0 !important; background: none !important; }
.zt-ev-subhead { margin-top: 72px; }
@media (max-width: 639px) {
    .zt-ev-block .container.px-8,
    .zt-ev-block .container.px-4 { padding-left: 16px; padding-right: 16px; }
}

/* Component headings — replaced by the section's own (market wording). */
.zt-ev-artists .musical-note,
.zt-ev-artists > section > .container > .text-center.mb-16,
.zt-ev-vendors > section:first-of-type > .container > .text-center:first-child,
.zt-ev-vendors--split > section:last-of-type > .container > .text-center:first-child,
.zt-ev-speakers > section > div:first-child,
.zt-ev-schedule .evt-schedule-section > div:nth-child(2) > div:first-child,
.zt-ev-schedule .section-bg-dots,
.zt-ev-kit .evt-custom-badge,
.zt-ev-venue #venueFloorPlanSection > .container > .text-center:first-child,
.zt-ev-sponsors > section > div > .text-center:first-child,
.zt-ev-sponsors > section > div > .text-center.mt-12,
.zt-ev-tickets > section > .container > .text-center.mb-16:first-child { display: none; }

/* Tailwind colours written for a white page → tokens. Borders without a colour class take the
 * preflight grey; this keeps coloured border utilities (legend swatches …) winning. */
:where(.zt-ev-kit, .zt-ev-kit *, .zt-ev-kit ::before, .zt-ev-kit ::after) { border-color: var(--z-border); }
/* Like Tailwind's preflight on the legacy page: component headings and links take their colour
 * from where they sit (white on the artist and ticket gradients) unless a class says otherwise. */
:where(.zt-ev-kit) :where(h1, h2, h3, h4, h5, h6, a) { color: inherit; }
:where(.zt-ev-kit) :where(a, a:hover) { text-decoration: inherit; }
.zt-ev-kit .bg-white { background-color: var(--z-surface); }
.zt-ev-kit .bg-gray-50,
.zt-ev-kit .bg-gray-100 { background-color: var(--z-surface-2); }
.zt-ev-kit button.bg-gray-200,
.zt-ev-kit button.bg-gray-300 { background-color: var(--z-border); }
.zt-ev-kit .hover\:bg-gray-200:hover,
.zt-ev-kit .hover\:bg-gray-300:hover { background-color: color-mix(in srgb, var(--z-border) 80%, var(--z-text)); }
.zt-ev-kit .text-gray-900,
.zt-ev-kit .text-gray-800,
.zt-ev-kit .text-gray-700 { color: var(--z-text); }
.zt-ev-kit .text-gray-600,
.zt-ev-kit .text-gray-500,
.zt-ev-kit .text-gray-400 { color: var(--z-muted); }
.zt-ev-kit .hover\:text-gray-700:hover { color: var(--z-text); }
.zt-ev-kit .border-gray-100,
.zt-ev-kit .border-gray-200,
.zt-ev-kit .border-gray-300 { border-color: var(--z-border); }
.zt-ev-kit .border-white { border-color: var(--z-surface); }
.zt-ev-kit .btn-primary { background: var(--z-accent); color: var(--z-accent-ink); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.zt-ev-kit .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--z-shadow-lg); text-decoration: none; }
.zt-ev-kit .floating-card { transition: transform .3s ease, box-shadow .3s ease; }
@media (prefers-reduced-motion: reduce) { .zt-ev-kit .btn-primary, .zt-ev-kit .floating-card { transition: none; } }

/* Brand-coloured TEXT the components print with the raw primary colour (inline styles): use the
 * contrast-checked accent text instead, so it stays readable on dark surfaces. */
.zt-ev-vendors .event-vendor-card p[style*="color"],
.zt-ev-kit .evt-schedule-day h3[style] > span:first-child,
.zt-ev-kit .evt-timeline-row .mobile-time > span:first-child { color: var(--z-accent-text) !important; }
.zt-ev-kit .evt-timeline-time .time-start,
.zt-ev-kit .card-duration-badge,
.zt-ev-kit .evt-schedule-badge { color: var(--z-accent-text); }

/* Vendors */
.zt-ev-kit .event-vendor-card { background: var(--z-surface); }
.zt-ev-vendors img.bg-white { background-color: var(--z-chip); }
.zt-ev-kit .vendor-circle { border-color: var(--z-surface); background: var(--z-chip); }
.zt-ev-kit .vendor-day-btn:not(.active) { background: var(--z-surface); border-color: var(--z-border); color: var(--z-muted); }
.zt-ev-kit .vendor-day-btn:not(.active):hover { border-color: var(--z-accent); color: var(--z-accent-text); }
.zt-ev-kit .vendor-day-btn .vendor-count-badge { border-color: var(--z-surface); }
.zt-ev-kit .vendor-day-count { color: var(--z-muted); }

/* Speakers: the cards no longer overlap the (hidden) photo banner. */
.zt-ev-speakers > section > .container { margin-top: 0; padding-bottom: 0; }

/* Schedule */
.zt-ev-kit .evt-schedule-tab:not(.active) { color: var(--z-muted); }
.zt-ev-kit .evt-schedule-tab:not(.active):hover { background: var(--z-surface); color: var(--z-text); }
.zt-ev-kit .evt-schedule-day h3[style] { color: var(--z-text) !important; }
.zt-ev-kit .evt-timeline-card-inner { background: var(--z-surface); border-color: var(--z-border); }
.zt-ev-kit .evt-timeline-dot,
.zt-ev-kit .evt-timeline-endcap-dot { border-color: var(--z-bg); }
.zt-ev-kit .card-title { color: var(--z-text); }
.zt-ev-kit .card-desc,
.zt-ev-kit .evt-timeline-time .time-end { color: var(--z-muted); }

/* Custom section */
.zt-ev-custom__label { text-align: center; }
.zt-ev-custom__label .zt-eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.zt-ev-kit .evt-custom-title { color: var(--z-text); }
.zt-ev-kit .evt-custom-subtext { color: var(--z-muted); }
.zt-ev-kit .evt-custom-photo { background: var(--z-surface-2); }

/* Venue floor plan: collapsed until the component reveals its block (a layout loaded). */
.zt-ev-venue { padding: 0; }
.zt-ev-venue:not(.is-shown) .zt-ev-venue__head { display: none; }
.zt-ev-venue.is-shown { padding: 64px 0; }
@media (min-width: 768px) { .zt-ev-venue.is-shown { padding: 88px 0; } }
.zt-ev-kit #venueLayoutSection { margin-bottom: 0; }
.zt-ev-kit #venueLayoutContainer,
.zt-ev-kit #venueLayoutLoading { border-color: var(--z-border); box-shadow: var(--z-shadow-lg); }
.zt-ev-kit .venue-vendor-panel { background: var(--z-surface); border-color: var(--z-border); }
.zt-ev-kit .vvp-head { background: var(--z-surface-2); border-bottom-color: var(--z-border); }
.zt-ev-kit .vvp-title,
.zt-ev-kit .vvp-name { color: var(--z-text); }
.zt-ev-kit .vvp-count { color: var(--z-muted); background: var(--z-surface); }
.zt-ev-kit .vvp-search-input { color: var(--z-text); background: var(--z-surface); border-color: var(--z-border); }
.zt-ev-kit .vvp-search-input:focus { border-color: var(--z-accent-text); box-shadow: 0 0 0 3px var(--z-accent-soft); }
.zt-ev-kit .vvp-search-input::placeholder,
.zt-ev-kit .vvp-search-icon,
.zt-ev-kit .vvp-sub,
.zt-ev-kit .vvp-empty { color: var(--z-muted); }
.zt-ev-kit .vvp-search-clear:hover { color: var(--z-text); background: var(--z-surface-2); }
.zt-ev-kit .vvp-row:hover { background: var(--z-surface-2); }
.zt-ev-kit .vvp-row.is-active { background: var(--z-accent-soft); border-color: var(--z-accent); }
.zt-ev-kit .vvp-logo { background: var(--z-chip); border-color: var(--z-border); }
.zt-ev-kit .vvp-list::-webkit-scrollbar-thumb { border-color: var(--z-surface); }
@media (max-width: 639px) {
    .zt-ev-kit #venueLayoutContainer { padding: 16px; }
    .zt-ev-kit #venueLayoutViewport { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .zt-ev-kit #venueLayoutCanvas { min-width: auto !important; }
}

/* Sponsors: logos sit on light tiles in every mode; a name-only card uses the surface. */
.zt-ev-sponsors .bg-white { background-color: var(--z-chip); }
.zt-ev-sponsors .bg-white:not(:has(img)) { background-color: var(--z-surface); }
.zt-ev-sponsors__cta { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--z-border); text-align: center; }
.zt-ev-sponsors__cta-title { margin: 0 0 10px; font-size: 1.25rem; font-weight: 700; }
.zt-ev-sponsors__cta p { max-width: 640px; margin: 0 auto 22px; }

/* Tickets (the legacy page's ticket colour classes, on tokens). */
.zt-ev-tickets__icon { margin-right: .3em; font-size: .85em; color: var(--z-accent-text); }
.zt-ev-kit .ticket-card-available { border-color: rgba(var(--z-accent-rgb), .3); }
.zt-ev-kit .ticket-card-available:hover { border-color: var(--z-accent); }
.zt-ev-kit .ticket-header-gradient { background: linear-gradient(135deg, var(--z-hero-from), var(--z-hero-to)); color: var(--z-hero-ink); }
.zt-ev-kit .ticket-price-color,
.zt-ev-kit .ticket-total-color { color: var(--z-accent-text); }
.zt-ev-kit .ticket-btn-primary { background: var(--z-accent); color: var(--z-accent-ink); }
.zt-ev-kit .ticket-btn-primary:hover { background: var(--z-accent-2); color: var(--z-accent-2-ink); }
.zt-ev-kit .ticket-cart-border { border-color: rgba(var(--z-accent-rgb), .3); }
.zt-ev-kit .ticket-checkout-btn { background: var(--z-accent); color: var(--z-accent-ink); }
.zt-ev-kit .ticket-checkout-btn:hover { filter: brightness(1.08); }

/* Booking modal + event terms pop-up (components/booking-form.php). */
.zt-ev-booking .zin-event-terms-body { color: var(--z-text); }
.zt-ev-booking .zin-event-terms-body :where(h2, h3, h4, h5) { color: var(--z-text); }
.zt-ev-booking .zin-event-terms-body blockquote { color: var(--z-muted); border-left-color: var(--z-border); }
.zt-ev-booking .zin-event-terms-body :where(th, td) { border-color: var(--z-border); }
.zt-ev-booking :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
    color: var(--z-text); background-color: var(--z-surface);
}

/* The reused booking modal (views/events/components/booking-form.php, z-50) opens above the sticky
 * site header (z-100) on every template. */
body.zt #bookingModal { z-index: 1001; }
