/* PEX Eventos: página do evento */
body.pexi-standalone {
	--pexi-red: #c20e1a;
	--pexi-red-dark: #9d0b15;
	--pexi-green: #2b9649;
	--pexi-green-soft: #e8f4ec;
	--pexi-ink: #17181a;
	--pexi-muted: #62666d;
	--pexi-bg: #f7f5f1;
	--pexi-card: #ffffff;
	--pexi-line: #e6e1d9;
	--pexi-radius: 18px;
	--pexi-shadow: 0 1px 2px rgba(23, 24, 26, .06), 0 12px 32px -12px rgba(23, 24, 26, .18);
	margin: 0;
	background: var(--pexi-bg);
	color: var(--pexi-ink);
	font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	padding-bottom: env(safe-area-inset-bottom);
}
body.pexi-standalone *, body.pexi-standalone *::before, body.pexi-standalone *::after { box-sizing: border-box; }
body.pexi-standalone a { color: inherit; }
body.pexi-standalone img { max-width: 100%; height: auto; display: block; }
body.pexi-standalone h1, body.pexi-standalone h2 { font-family: inherit; letter-spacing: -.01em; }

.pexi-wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Barra de topo */
.pexi-top {
	position: sticky; top: 0; z-index: 50;
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
	gap: 8px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
	background: rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.admin-bar .pexi-top { top: 32px; }
@media (max-width: 782px) { .admin-bar .pexi-top { top: 0; } }
.pexi-brand { justify-self: center; display: flex; align-items: center; text-decoration: none; }
.pexi-brand img { height: 30px; width: auto; }
.pexi-iconbtn {
	display: inline-flex; align-items: center; gap: 6px;
	min-height: 44px; padding: 0 14px; border-radius: 999px;
	border: 1px solid var(--pexi-line); background: #fff; color: var(--pexi-ink);
	font: 600 14px/1 inherit; text-decoration: none; cursor: pointer;
	transition: background .15s, border-color .15s;
}
.pexi-iconbtn:hover { background: var(--pexi-bg); border-color: #d6d0c6; }
.pexi-iconbtn:focus-visible, .pexi-btn:focus-visible, .pexi-chip:focus-visible { outline: 3px solid var(--pexi-green); outline-offset: 2px; }
.pexi-back { justify-self: start; }
.pexi-share { justify-self: end; }
@media (max-width: 520px) { .pexi-iconbtn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .pexi-iconbtn { padding: 0; width: 44px; justify-content: center; } }

/* Destaque */
.pexi-hero { position: relative; overflow: hidden; padding: 20px 0 28px; }
.pexi-hero__bg {
	position: absolute; inset: -40px; background-size: cover; background-position: center;
	filter: blur(40px) saturate(1.3); opacity: .45; transform: scale(1.1);
}
.pexi-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(247,245,241,0) 0%, var(--pexi-bg) 92%); pointer-events: none; }
.pexi-hero__grid { position: relative; z-index: 1; display: grid; gap: 20px; }
@media (min-width: 860px) {
	.pexi-hero { padding: 40px 0 48px; }
	.pexi-hero__grid { grid-template-columns: minmax(280px, 400px) 1fr; gap: 40px; align-items: start; }
	.pexi-poster { position: sticky; top: 90px; }
}

.pexi-poster { position: relative; margin: 0 auto; width: 100%; max-width: 420px; }
.pexi-poster img { width: 100%; max-height: 58vh; object-fit: contain; width: auto; margin: 0 auto; border-radius: var(--pexi-radius); box-shadow: var(--pexi-shadow); background: #ddd; }
.pexi-badge {
	position: absolute; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px;
	font: 700 13px/1.2 inherit; letter-spacing: .02em; color: #fff; background: var(--pexi-green);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.pexi-badge--soldout, .pexi-badge--ended { background: var(--pexi-ink); }
.pexi-badge--live { background: var(--pexi-red); }

.pexi-card { background: var(--pexi-card); border-radius: var(--pexi-radius); padding: 22px 20px; box-shadow: var(--pexi-shadow); }
@media (min-width: 860px) { .pexi-card { padding: 32px; } }

.pexi-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pexi-chip {
	display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px;
	background: var(--pexi-bg); color: var(--pexi-ink); font: 600 13px/1.2 inherit; text-decoration: none;
	border: 1px solid var(--pexi-line);
}
.pexi-chip--city { background: var(--pexi-green-soft); border-color: transparent; color: #1d6b33; }
.pexi-chip--state { background: var(--pexi-ink); color: #fff; border-color: transparent; }
.pexi-chip svg { width: 15px; height: 15px; }

body.pexi-standalone .pexi-title { margin: 0 0 6px; font-size: clamp(28px, 5.4vw, 44px); line-height: 1.08; font-weight: 800; color: var(--pexi-ink); text-wrap: balance; overflow-wrap: anywhere; }
.pexi-venue { margin: 0 0 18px; color: var(--pexi-muted); font-size: 16px; }

/* Contagem */
.pexi-count { margin: 0 0 20px; padding: 16px; border-radius: 14px; background: var(--pexi-ink); color: #fff; }
.pexi-count__label { margin: 0 0 10px; font: 600 13px/1.2 inherit; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.75); }
.pexi-count__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pexi-count__grid[hidden] { display: none; }
.pexi-count__grid div { text-align: center; background: rgba(255,255,255,.08); border-radius: 10px; padding: 10px 4px 8px; }
.pexi-count__grid b { display: block; font: 800 clamp(24px, 6vw, 34px)/1 inherit; font-variant-numeric: tabular-nums; }
.pexi-count__grid span { display: block; margin-top: 4px; font-size: 12px; color: rgba(255,255,255,.7); }
.pexi-count.is-live { background: var(--pexi-red); }
.pexi-count.is-live .pexi-count__label { color: #fff; margin: 0; font-size: 15px; }
.pexi-count.is-live .pexi-count__label::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #fff; animation: pexi-pulse 1.4s infinite; vertical-align: 1px; }
.pexi-count--ended { background: var(--pexi-bg); color: var(--pexi-ink); }
.pexi-count--ended .pexi-count__label { margin: 0; color: var(--pexi-ink); text-transform: none; letter-spacing: 0; font-size: 15px; }
@keyframes pexi-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pexi-count.is-live .pexi-count__label::before { animation: none; } }

/* Ficha */
.pexi-facts { margin: 0 0 22px; display: grid; gap: 0; border-top: 1px solid var(--pexi-line); }
.pexi-facts > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--pexi-line); }
.pexi-facts dt { display: flex; align-items: center; gap: 8px; color: var(--pexi-muted); font-size: 14px; font-weight: 600; }
.pexi-facts dt svg { color: var(--pexi-green); flex: none; }
.pexi-facts dd { margin: 0; font-weight: 600; }
.pexi-facts dd small { display: block; font-weight: 400; color: var(--pexi-muted); font-size: 14px; }
@media (max-width: 380px) { .pexi-facts > div { grid-template-columns: 1fr; gap: 2px; } }

/* Botões */
.pexi-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pexi-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 52px; padding: 0 22px; border-radius: 14px; border: 0;
	font: 700 16px/1.1 inherit; text-decoration: none; cursor: pointer; list-style: none;
	transition: transform .12s, background .15s, box-shadow .15s;
}
.pexi-btn::-webkit-details-marker { display: none; }
.pexi-btn--primary { background: var(--pexi-red); color: #fff !important; box-shadow: 0 8px 20px -8px rgba(194, 14, 26, .7); flex: 1 1 260px; }
.pexi-btn--primary:hover { background: var(--pexi-red-dark); transform: translateY(-1px); }
.pexi-btn--primary:active { transform: translateY(0); }
.pexi-btn--ghost { background: #fff; color: var(--pexi-ink); border: 1.5px solid var(--pexi-line); }
.pexi-btn--ghost:hover { border-color: var(--pexi-ink); }
.pexi-btn--disabled { background: #e9e6e1; color: #7b7f86; cursor: not-allowed; flex: 1 1 200px; }
.pexi-btn--block { width: 100%; margin-top: 12px; }
.pexi-note { margin: 12px 0 0; font-size: 13px; color: var(--pexi-muted); }
.pexi-link { color: var(--pexi-red) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.pexi-link--more { display: inline-block; margin-top: 16px; }

.pexi-addcal { flex: 0 1 auto; }
.pexi-addcal[open] { flex: 1 1 100%; }
.pexi-addcal[open] summary { border-color: var(--pexi-ink); }
@media (max-width: 859px) { .pexi-addcal { flex: 1 1 100%; } .pexi-addcal summary { width: 100%; } }
/* O menu abre por baixo do botão, dentro do cartão (no iPhone não fica cortado). */
.pexi-addcal__menu {
	margin-top: 8px; display: grid; gap: 4px;
	background: var(--pexi-bg); border-radius: 14px; border: 1px solid var(--pexi-line); padding: 6px;
}
.pexi-addcal__menu a { display: flex; align-items: center; min-height: 48px; padding: 0 14px; border-radius: 10px; text-decoration: none; font-weight: 600; background: #fff; }
.pexi-addcal__menu a:hover { background: var(--pexi-green-soft); }

/* Blocos */
.pexi-block { margin-top: 36px; }
body.pexi-standalone .pexi-h2 { margin: 0 0 14px; font-size: 22px; line-height: 1.25; font-weight: 800; color: var(--pexi-ink); }
.pexi-about > * { max-width: 760px; }
.pexi-content { font-size: 17px; line-height: 1.7; }
.pexi-content p { margin: 0 0 1em; }
body.pexi-standalone .pexi-content h1, body.pexi-standalone .pexi-content h2, body.pexi-standalone .pexi-content h3, body.pexi-standalone .pexi-content h4 { font-size: 19px; line-height: 1.35; margin: 1.2em 0 .5em; color: var(--pexi-ink); font-weight: 800; }
body.pexi-standalone .pexi-content > :first-child { margin-top: 0; }
body.pexi-standalone .pexi-content p { color: var(--pexi-ink); }
.pexi-content iframe { max-width: 100%; }
.pexi-source { margin-top: 18px; font-size: 13px; color: var(--pexi-muted); }
.pexi-source a { color: var(--pexi-muted); }

.pexi-video { position: relative; display: block; width: 100%; margin-top: 18px; padding: 0; border: 0; border-radius: var(--pexi-radius); overflow: hidden; aspect-ratio: 16 / 9; background: #000; cursor: pointer; }
body.pexi-standalone .pexi-video img { width: 100%; height: 100%; object-fit: cover; opacity: .9; transition: opacity .2s; }
.pexi-video:hover img { opacity: 1; }
.pexi-video__play { position: absolute; inset: 0; display: grid; place-items: center; }
.pexi-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pexi-sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 640px) { .pexi-sessions { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.pexi-sessions li { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #fff; border-radius: 14px; border: 1px solid var(--pexi-line); }
.pexi-sessions__date { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: var(--pexi-green-soft); color: #1d6b33; font-size: 12px; font-weight: 700; text-transform: uppercase; line-height: 1; }
.pexi-sessions__date b { font-size: 20px; }
.pexi-sessions__info { flex: 1; font-weight: 600; }
.pexi-sessions__buy { padding: 10px 14px; border-radius: 10px; background: var(--pexi-red); color: #fff !important; font-weight: 700; font-size: 14px; text-decoration: none; }
.pexi-sessions__sold { font-size: 13px; font-weight: 700; color: var(--pexi-muted); }

.pexi-map { border-radius: var(--pexi-radius); overflow: hidden; background: #e9efe9; height: 300px; width: 100%; }
.pexi-map__load { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 100%; border: 0; background: radial-gradient(circle at 50% 40%, #fff 0, #e6efe8 70%); cursor: pointer; font: inherit; color: var(--pexi-ink); text-align: center; padding: 16px; }
.pexi-map__load svg { width: 34px; height: 34px; color: var(--pexi-red); }
.pexi-map__load strong { display: block; font-size: 17px; }
.pexi-map__load span { color: var(--pexi-muted); font-size: 14px; }
.pexi-map__load em { margin-top: 8px; font-style: normal; font-weight: 700; color: var(--pexi-green); text-decoration: underline; text-underline-offset: 3px; }
.pexi-map iframe { width: 100%; height: 100%; border: 0; display: block; }

.pexi-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pexi-more__card { display: flex; flex-direction: column; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--pexi-line); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.pexi-more__card:hover { transform: translateY(-2px); box-shadow: var(--pexi-shadow); }
.pexi-more__img { aspect-ratio: 4 / 3; background: var(--pexi-bg); overflow: hidden; }
body.pexi-standalone .pexi-more__img img { width: 100%; height: 100%; object-fit: cover; }
.pexi-more__date { padding: 12px 14px 0; font-size: 13px; font-weight: 700; color: var(--pexi-green); text-transform: capitalize; }
.pexi-more__title { padding: 2px 14px 14px; font-weight: 700; line-height: 1.3; }

/* Rodapé: ver assets/footer.css */
@media (max-width: 859px) { body.pexi-standalone:not(.pexi-agenda-page) .pexi-foot.pexi-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* Barra fixa no telemóvel */
.pexi-sticky {
	position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
	display: flex; align-items: center; gap: 12px; justify-content: space-between;
	padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
	background: rgba(255,255,255,.96); border-top: 1px solid var(--pexi-line);
	-webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
	transform: translateY(110%); transition: transform .25s ease;
}
.pexi-sticky.is-visible { transform: none; }
.pexi-sticky div { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pexi-sticky strong { font-size: 15px; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pexi-sticky span { font-size: 13px; color: var(--pexi-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pexi-sticky .pexi-btn { flex: none; min-height: 46px; padding: 0 22px; }
@media (min-width: 860px) { .pexi-sticky { display: none; } }

.pexi-toast {
	position: fixed; z-index: 80; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
	padding: 12px 18px; border-radius: 12px; background: var(--pexi-ink); color: #fff; font-weight: 600; font-size: 14px;
	opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.pexi-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 860px) { .pexi-poster img { max-height: none; width: 100%; } }

/* ---------- Agenda (cidade / categoria / todos) ---------- */
.pexi-agenda-hero { padding: 26px 0 8px; background: linear-gradient(180deg, #fff 0%, var(--pexi-bg) 100%); }
@media (min-width: 860px) { .pexi-agenda-hero { padding: 44px 0 12px; } }
.pexi-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--pexi-muted); margin-bottom: 10px; }
.pexi-crumbs a { color: var(--pexi-muted); text-decoration: none; }
.pexi-crumbs a:hover { color: var(--pexi-ink); text-decoration: underline; }
.pexi-crumbs [aria-current] { color: var(--pexi-ink); font-weight: 600; }
body.pexi-standalone .pexi-agenda-title { margin: 0; color: var(--pexi-ink); font-size: clamp(30px, 6vw, 48px); line-height: 1.05; font-weight: 800; text-wrap: balance; }
.pexi-agenda-sub { margin: 8px 0 0; color: var(--pexi-green); font-weight: 700; }
.pexi-agenda-desc { margin-top: 10px; max-width: 680px; color: var(--pexi-muted); }
.pexi-agenda-desc p { margin: 0 0 .6em; }

.pexi-filters { position: sticky; top: 64px; z-index: 40; background: rgba(247,245,241,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: 10px 0 6px; border-bottom: 1px solid transparent; }
.admin-bar .pexi-filters { top: 96px; }
@media (max-width: 782px) { .admin-bar .pexi-filters { top: 64px; } }
.pexi-filters.is-stuck { border-bottom-color: var(--pexi-line); }
.pexi-scroller { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pexi-scroller::-webkit-scrollbar { display: none; }
.pexi-pill {
	flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px;
	border: 1px solid var(--pexi-line); background: #fff; color: var(--pexi-ink) !important; font: 600 14px/1 inherit; text-decoration: none; cursor: pointer; white-space: nowrap;
	transition: background .15s, border-color .15s, color .15s;
}
.pexi-pill span { font-size: 12px; color: var(--pexi-muted); font-weight: 700; }
.pexi-pill:hover { border-color: var(--pexi-ink); }
.pexi-pill.is-on { background: var(--pexi-ink); border-color: var(--pexi-ink); color: #fff !important; }
.pexi-pill.is-on span { color: rgba(255,255,255,.7); }
.pexi-pill--when.is-on { background: var(--pexi-green); border-color: var(--pexi-green); }
.pexi-pill:focus-visible { outline: 3px solid var(--pexi-green); outline-offset: 2px; }

.pexi-month { margin-top: 26px; }
.pexi-month[hidden] { display: none; }
body.pexi-standalone .pexi-month__t { margin: 0 0 12px; color: var(--pexi-ink); line-height: 1.2; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.pexi-month__t::after { content: ""; flex: 1; height: 1px; background: var(--pexi-line); }
.pexi-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .pexi-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1040px) { .pexi-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }

.pexi-ev { display: flex; flex-direction: column; background: #fff; border-radius: 16px; overflow: hidden; border: 1px solid var(--pexi-line); text-decoration: none; color: var(--pexi-ink); transition: transform .15s, box-shadow .15s; }
.pexi-ev[hidden] { display: none; }
.pexi-ev:hover { transform: translateY(-3px); box-shadow: var(--pexi-shadow); }
.pexi-ev:focus-visible { outline: 3px solid var(--pexi-green); outline-offset: 2px; }
.pexi-ev__img { position: relative; aspect-ratio: 3 / 4; background: #e9e5de; overflow: hidden; }
body.pexi-standalone .pexi-ev__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.pexi-ev:hover .pexi-ev__img img { transform: scale(1.04); }
.pexi-ev__noimg { display: grid; place-items: center; width: 100%; height: 100%; font-size: 56px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--pexi-green), #1d6b33); }
.pexi-ev__date { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; min-width: 50px; padding: 6px 8px 7px; border-radius: 12px; background: #fff; color: var(--pexi-red); font-size: 11px; font-weight: 800; text-transform: uppercase; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.pexi-ev__date b { font-size: 22px; color: var(--pexi-ink); margin-bottom: 2px; }
.pexi-ev__badge { position: absolute; top: 10px; right: 10px; padding: 5px 10px; border-radius: 999px; background: var(--pexi-green); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.pexi-ev__badge.is-sold { background: var(--pexi-ink); }
.pexi-ev__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; flex: 1; }
.pexi-ev__kicker { font-size: 12px; font-weight: 700; color: var(--pexi-green); text-transform: uppercase; letter-spacing: .04em; }
.pexi-ev__title { font-weight: 800; font-size: 16px; line-height: 1.25; margin-bottom: 4px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pexi-ev__meta { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--pexi-muted); line-height: 1.35; }
.pexi-ev__meta svg { flex: none; margin-top: 1px; color: var(--pexi-green); }
.pexi-ev__price { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 700; }
@media (max-width: 420px) { .pexi-ev__body { padding: 10px 10px 12px; } .pexi-ev__title { font-size: 15px; } }

.pexi-empty { margin: 36px auto; max-width: 560px; text-align: center; padding: 30px 20px; background: #fff; border: 1px dashed var(--pexi-line); border-radius: var(--pexi-radius); color: var(--pexi-muted); }
.pexi-empty__t { color: var(--pexi-ink); font-weight: 800; font-size: 18px; margin: 0 0 6px; }
.pexi-empty .pexi-btn { margin-top: 12px; }
.pexi-empty--filter { font-weight: 600; }
