/*
 * Site themes — base stylesheet (every theme loads it before its own theme.css).
 *
 * RULES (see themes/_base/tokens.php):
 *   - Colours, fonts, radii and shadows come ONLY from --z-* tokens. Light / Dark / Auto is a
 *     token swap: no [data-zin-mode] selectors, no prefers-color-scheme queries, ever.
 *   - Everything is scoped under body.zt so the shared header/footer markup on legacy pages
 *     (which never load this file) is unaffected.
 *   - Element rules are wrapped ENTIRELY in :where() (zero specificity), so any component
 *     class wins — e.g. the hero's light title over the page's heading colour (the Market Day
 *     ".e2 button" trap).
 */

body.zt {
    background: var(--z-bg);
    color: var(--z-text);
    font-family: var(--z-font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
:where(body.zt) :where(h1, h2, h3, h4) {
    font-family: var(--z-font-display);
    color: var(--z-text);
    line-height: 1.15;
    letter-spacing: -0.01em;
}
:where(body.zt) :where(a) { color: var(--z-accent-text); }
:where(body.zt) :where(a:hover) { text-decoration: underline; text-underline-offset: 3px; }
:where(body.zt) :where(:focus-visible) { outline: 3px solid var(--z-focus); outline-offset: 2px; }
:where(body.zt) :where(img) { max-width: 100%; height: auto; }
body.zt main { background: var(--z-bg); }

/* ---- Layout -------------------------------------------------------------------------- */
.zt-container { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 640px) { .zt-container { padding-left: 24px; padding-right: 24px; } }
@media (min-width: 1024px) { .zt-container { padding-left: 32px; padding-right: 32px; } }
.zt-container--narrow { max-width: 820px; }

.zt-section { padding: 64px 0; }
@media (min-width: 768px) { .zt-section { padding: 88px 0; } }
.zt-section--tint { background: var(--z-surface-2); border-top: 1px solid var(--z-border); border-bottom: 1px solid var(--z-border); }
.zt-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .zt-grid--2, .zt-grid--3, .zt-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
    .zt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .zt-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---- Heading block (components/heading.php) ------------------------------------------ */
.zt-heading { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.zt-heading--left { margin-left: 0; text-align: left; }
.zt-eyebrow {
    display: inline-block; font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--z-accent-text); background: var(--z-accent-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 14px;
}
.zt-title { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); font-weight: 800; margin: 0; }
.zt-subtitle { color: var(--z-muted); font-size: 1.0625rem; line-height: 1.7; margin: 14px 0 0; }

/* ---- Hero band ------------------------------------------------------------------------- */
.zt-hero {
    position: relative; isolation: isolate; color: var(--z-hero-ink);
    background: linear-gradient(135deg, var(--z-hero-from), var(--z-hero-to));
    padding: 88px 0 72px; text-align: center; overflow: hidden;
}
.zt-hero :where(h1, h2, h3, p, a) { color: inherit; }
.zt-hero__title { font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem); font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.zt-hero__sub { font-size: clamp(1rem, .95rem + .4vw, 1.25rem); opacity: .92; max-width: 720px; margin: 16px auto 0; line-height: 1.6; }

/* ---- Buttons --------------------------------------------------------------------------- */
.zt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
    font-weight: 700; font-size: .975rem; text-decoration: none; cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.zt-btn:hover { text-decoration: none; transform: translateY(-1px); }
.zt-btn--primary { background: var(--z-accent); color: var(--z-accent-ink); }
.zt-btn--secondary { background: var(--z-surface); color: var(--z-text); border-color: var(--z-border); }
.zt-btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
@media (prefers-reduced-motion: reduce) { .zt-btn { transition: none; } .zt-btn:hover { transform: none; } }

/* ---- Cards, chips, empty states ------------------------------------------------------- */
.zt-card {
    background: var(--z-surface); color: var(--z-text); border: 1px solid var(--z-border);
    border-radius: var(--z-radius-lg); box-shadow: var(--z-shadow); overflow: hidden; min-width: 0;
}
.zt-card__body { padding: 20px 22px; }
.zt-muted { color: var(--z-muted); }
.zt-chip { background: var(--z-chip); border-radius: var(--z-radius); padding: 10px; display: inline-flex; align-items: center; justify-content: center; }
.zt-empty { text-align: center; color: var(--z-muted); padding: 48px 16px; border: 1px dashed var(--z-border); border-radius: var(--z-radius-lg); }

/* ---- Tenant rich text (blog, about story, legal pages) ---------------------------------
 * Tenants paste text with inline colours chosen for a white page; on any token background
 * those would vanish, so inline colours/backgrounds are neutralised. */
.zt-prose { color: var(--z-text); line-height: 1.8; font-size: 1.0625rem; overflow-wrap: anywhere; }
.zt-prose :where(h1, h2, h3, h4) { margin: 1.6em 0 .6em; font-weight: 700; }
.zt-prose :where(h1) { font-size: 1.875rem; }
.zt-prose :where(h2) { font-size: 1.5rem; }
.zt-prose :where(h3) { font-size: 1.25rem; }
.zt-prose :where(h4) { font-size: 1.0625rem; }
.zt-prose > :first-child { margin-top: 0; }
.zt-prose :where(strong, b) { font-weight: 700; }
.zt-prose :where(p, ul, ol, blockquote, table) { margin: 0 0 1.1em; }
.zt-prose :where(ul) { list-style: disc; padding-left: 1.4em; }
.zt-prose :where(ol) { list-style: decimal; padding-left: 1.4em; }
.zt-prose :where(a) { color: var(--z-accent-text); text-decoration: underline; }
.zt-prose :where(blockquote) { border-left: 3px solid var(--z-accent); padding-left: 1em; color: var(--z-muted); }
.zt-prose :where(table) { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.zt-prose :where(td, th) { border: 1px solid var(--z-border); padding: 8px 10px; }
.zt-prose [style*="color"] { color: inherit !important; }
.zt-prose [style*="background"] { background: transparent !important; }

/* ---- Builder preview: click-to-edit outlines (only printed for staff in the preview) ---- */
[data-zin-field] { cursor: pointer; }
[data-zin-field]:hover { outline: 2px dashed var(--z-focus); outline-offset: 3px; }

/* ---- Breadcrumb trail (hero) ----------------------------------------------------------- */
.zt-crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; font-size: .9rem; opacity: .9; }
.zt-crumbs a { color: inherit; }

/* ---- Legal pages (themes/_base/sections/legal) ----------------------------------------- */
.zt-legal-body { padding-bottom: 32px; }
.zt-legal-card { padding: 28px 24px; }
@media (min-width: 768px) { .zt-legal-card { padding: 40px 44px; } }
.zt-legal-stamp { font-size: .875rem; margin: 0 0 20px; }
.zt-legal-related { padding-bottom: 24px; }
.zt-legal-related__title { font-size: 1.125rem; font-weight: 700; margin: 0 0 14px; }
.zt-legal-link { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.zt-legal-link i { width: 18px; text-align: center; }
.zt-legal-contact { padding: 8px 0 72px; text-align: center; }

/* ---- Empty state icon, light button, CTA band (components/cta.php) ---------------------- */
.zt-empty__icon { font-size: 1.75rem; opacity: .6; margin-bottom: 10px; display: block; }
.zt-empty p { margin: 0; }
.zt-btn--light { background: var(--z-hero-ink); color: var(--z-hero-from); }
.zt-cta { padding: 24px 0 88px; }
.zt-cta__panel {
    border-radius: var(--z-radius-lg); padding: 48px 24px; text-align: center; color: var(--z-hero-ink);
    background: linear-gradient(135deg, var(--z-hero-from), var(--z-hero-to)); box-shadow: var(--z-shadow-lg);
}
@media (min-width: 768px) { .zt-cta__panel { padding: 64px 48px; } }
.zt-cta__panel :where(h2, p) { color: inherit; }
.zt-cta__title { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 800; margin: 0; }
.zt-cta__text { max-width: 640px; margin: 14px auto 0; opacity: .92; font-size: 1.0625rem; line-height: 1.65; }
.zt-cta__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---- Hero with a photo (components/page_hero.php) ------------------------------------- */
.zt-hero--photo { color: #ffffff; }
.zt-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.zt-hero__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.45) 50%, rgba(0,0,0,.65)); }
.zt-hero__inner { position: relative; }

/* ---- Inverse band + statistics -------------------------------------------------------- */
.zt-band-inverse { background: var(--z-text); color: var(--z-bg); padding: 64px 0; }
.zt-stats { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .zt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.zt-stat { text-align: center; padding: 20px 12px; border-radius: var(--z-radius-lg); background: rgba(var(--z-bg-rgb), .06); }
.zt-stat__num { font-family: var(--z-font-display); font-weight: 800; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); line-height: 1.1; overflow-wrap: anywhere; }
.zt-stat__label { margin-top: 6px; opacity: .8; font-weight: 500; }

/* ---- Photo strip (components/gallery_strip.php) -------------------------------------- */
.zt-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(78%, 1fr); gap: 16px; overflow-x: auto;
    scroll-snap-type: x mandatory; padding-bottom: 12px; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
@media (min-width: 640px) { .zt-strip { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (min-width: 1024px) { .zt-strip { grid-auto-columns: calc((100% - 32px) / 3); } }
.zt-strip__item { position: relative; margin: 0; scroll-snap-align: start; border-radius: var(--z-radius-lg); overflow: hidden; background: var(--z-surface-2); aspect-ratio: 3 / 2; }
.zt-strip__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zt-strip__item figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 14px; color: #fff; font-weight: 600;
    background: linear-gradient(transparent, rgba(0,0,0,.7)); }

/* ---- Custom code sections -------------------------------------------------------------- */
.zt-custom-code { overflow-x: auto; }

/* ---- Forms, alerts, modal (contact form, sponsor inquiry) ------------------------------- */
.zt-form { display: grid; gap: 16px; }
.zt-form__row { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .zt-form__row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.zt-form__field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: .9rem; font-weight: 600; color: var(--z-text); }
.zt-form__field :where(input, select, textarea) {
    width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px; font: inherit; font-weight: 400; font-size: 1rem;
    line-height: 1.4; color: var(--z-text);
    background: var(--z-surface-2); border: 1px solid var(--z-border); border-radius: var(--z-radius);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.zt-form__field :where(input, select, textarea):focus { outline: none; border-color: var(--z-accent-text); box-shadow: 0 0 0 3px var(--z-accent-soft); background: var(--z-surface); }
.zt-form__field :where(input, textarea)::placeholder { color: var(--z-muted); opacity: .75; }
.zt-form__field textarea { resize: vertical; min-height: 140px; }
/* Dropdowns: our own chevron. The native arrow ignores padding, so Safari and Firefox draw it right on
   the border. Two thin diagonal strokes in --z-muted (follows Light / Dark / Auto), 16px from the right
   edge. Longhands at a specificity above every template's `background:` shorthand — including the
   :focus rules, which would otherwise wipe the image the moment the dropdown is opened. */
body.zt .zt-form__field select,
body.zt .zt-form__field select:hover,
body.zt .zt-form__field select:focus {
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    padding-right: 44px;
    background-image:
        linear-gradient(45deg, transparent calc(50% - .75px), var(--z-muted) calc(50% - .75px), var(--z-muted) calc(50% + .75px), transparent calc(50% + .75px)),
        linear-gradient(135deg, transparent calc(50% - .75px), var(--z-muted) calc(50% - .75px), var(--z-muted) calc(50% + .75px), transparent calc(50% + .75px));
    background-size: 6px 6px, 6px 6px;
    background-position: calc(100% - 22px) calc(50% + 1px), calc(100% - 16.5px) calc(50% + 1px);
    background-repeat: no-repeat;
    cursor: pointer;
}
body.zt .zt-form__field select::-ms-expand { display: none; }
body.zt .zt-form__field select:-moz-focusring { color: transparent; text-shadow: 0 0 0 var(--z-text); }
.zt-form__req { color: #e11d48; font-weight: 700; }
.zt-form__opt { color: var(--z-muted); font-weight: 400; }
/* Country code + number read as one control: both keep their borders and overlap by 1px, and the
   focused half is lifted above the other so its whole border and focus ring show. */
.zt-form__phone { display: flex; min-width: 0; }
.zt-form__phone select { width: auto; flex: 0 0 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; }
body.zt .zt-form__phone select { padding-left: 14px; padding-right: 38px; }
.zt-form__phone input { flex: 1 1 auto; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.zt-form__phone :where(select, input):focus { position: relative; z-index: 1; }
.zt-form__errors { border: 1px solid #e11d48; border-radius: var(--z-radius); padding: 10px 14px; }
.zt-form__errors p { margin: 4px 0; }
.zt-form__errors a { color: #e11d48; font-weight: 600; }
.zt-form__note { margin: 0; font-size: .9rem; }
.zt-form__status { margin: 0; min-height: 1.2em; font-size: .9rem; color: var(--z-muted); }
.zt-honeypot { position: absolute; left: -9999px; top: -9999px; }
.zt-btn--block { width: 100%; }
.zt-alert { display: flex; gap: 14px; align-items: flex-start; border-radius: var(--z-radius); padding: 16px 18px; margin: 0 0 20px; border: 1px solid; }
.zt-alert > i { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto; }
.zt-alert p { margin: 0; }
.zt-alert__title { font-weight: 700; margin-bottom: 2px !important; }
.zt-alert--ok { border-color: #16a34a; background: color-mix(in srgb, #16a34a 10%, var(--z-surface)); }
.zt-alert--ok > i { background: #16a34a; }
.zt-alert--error { border-color: #e11d48; background: color-mix(in srgb, #e11d48 10%, var(--z-surface)); }
.zt-alert--error > i { background: #e11d48; }
.zt-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 6, 23, .6); }
.zt-modal.hidden { display: none; }
.zt-modal__panel { width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--z-surface); color: var(--z-text); border-radius: var(--z-radius-lg); box-shadow: var(--z-shadow-lg); }
.zt-modal__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 18px 22px; color: var(--z-hero-ink); background: linear-gradient(135deg, var(--z-hero-from), var(--z-hero-to)); }
.zt-modal__head :where(h3, p) { color: inherit; }
.zt-modal__title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.zt-modal__sub { margin: 2px 0 0; opacity: .85; font-size: .875rem; }
.zt-modal__x { background: transparent; border: 0; color: inherit; width: 36px; height: 36px; border-radius: 10px; cursor: pointer; }
.zt-modal__body { padding: 20px 22px; }
.zt-modal__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---- Small shared pieces: badges, centring, screen-reader text, clamping, size variants ---- */
.zt-center { text-align: center; }
.zt-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.zt-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.zt-accent-text { color: var(--z-accent-text); }
.zt-badge { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--z-surface-2); color: var(--z-text); border: 1px solid var(--z-border); vertical-align: middle; }
.zt-badge--accent { background: var(--z-accent-soft); color: var(--z-accent-text); border-color: transparent; }
.zt-badge--sale { background: #e11d48; color: #fff; border-color: transparent; }
.zt-btn--lg { min-height: 54px; padding: 14px 30px; font-size: 1.05rem; }
.zt-btn--sm { min-height: 36px; padding: 6px 14px; font-size: .875rem; }
.zt-section-more { margin-top: 36px; }
.zt-link-arrow { font-weight: 700; display: inline-flex; gap: 8px; align-items: center; }

/* ---- Countdown (data-zt-countdown; ticked by /public/assets/themes/_base/theme.js) ---- */
.zt-countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 22px; max-width: 420px; }
.zt-countdown__cell { text-align: center; padding: 12px 6px; border-radius: var(--z-radius); background: var(--z-accent-soft); }
.zt-countdown__num { display: block; font-family: var(--z-font-display); font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); font-weight: 800; color: var(--z-accent-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.zt-countdown__label { display: block; font-size: .75rem; font-weight: 600; color: var(--z-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ---- Logo wall (vendors attending, sponsors) — logos sit on light tiles in every mode ---- */
.zt-logo-wall { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.zt-logo-wall__item { width: 120px; height: 84px; padding: 12px; border: 1px solid var(--z-border); text-decoration: none; transition: transform .15s ease; }
.zt-logo-wall__item:hover { transform: translateY(-2px); }
.zt-logo-wall__item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.zt-logo-wall__initials { font-weight: 800; font-size: 1.5rem; color: #1f2937; }
.zt-logo-wall__name { font-weight: 700; color: #1f2937; text-align: center; font-size: .9rem; line-height: 1.2; overflow-wrap: anywhere; }
.zt-logo-wall--sponsors .zt-logo-wall__item { width: 180px; height: 104px; }
.zt-logo-wall--sponsors img { filter: grayscale(1); opacity: .75; transition: filter .2s ease, opacity .2s ease; }
.zt-logo-wall--sponsors .zt-logo-wall__item:hover img { filter: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .zt-logo-wall__item, .zt-logo-wall--sponsors img { transition: none; } }

/* ---- Person card (artists, speakers) + product card ------------------------------------ */
.zt-person__media { display: block; aspect-ratio: 4 / 3; background: var(--z-surface-2); overflow: hidden; }
.zt-person__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zt-person__initials { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 3rem; font-weight: 800; color: var(--z-accent-text); background: var(--z-accent-soft); }
.zt-person__name { font-size: 1.2rem; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.zt-person__name a { color: inherit; text-decoration: none; }
.zt-person__meta { margin: 0 0 8px; color: var(--z-accent-text); font-weight: 600; font-size: .9rem; }
.zt-person .zt-btn { margin-top: 12px; }
.zt-product__media { position: relative; display: block; aspect-ratio: 1; background: var(--z-surface-2); overflow: hidden; }
.zt-product__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zt-product__sale { position: absolute; top: 10px; left: 10px; }
.zt-product__cat { margin: 0 0 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--z-accent-text); }
.zt-product__name { font-size: 1rem; margin: 0; }
.zt-product__name a { color: inherit; text-decoration: none; }
.zt-product__vendor { font-size: .85rem; margin: 4px 0 0; }
.zt-product__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.zt-product__price { font-weight: 800; }
.zt-product__price s { font-weight: 400; color: var(--z-muted); font-size: .85em; }

/* ---- [hidden] always hides — component display rules (.zt-alert flex, .zt-chip inline-flex …)
 *      must never resurrect an element a script or the markup hid. ---------------------------- */
body.zt [hidden] { display: none !important; }
