/* Events: shared section styles and behaviour (all themes).
 * event_types (sticky tabs + rows), event_packages, event_gallery + lightbox.
 * Drawn with the theme's --prt-* tokens; a theme restyles them in its own CSS. */

/* ---------- event_types: sticky tab bar ---------- */
.pe-types { position: relative; }
.pe-types [data-pe-row] { scroll-margin-top: var(--pe-margin, 140px); }
.pe-tabs { position: sticky; top: var(--pe-top, 0px); z-index: 30; padding: 10px 0; margin: 0 0 clamp(24px, 4vw, 48px); background: transparent; border-block: 1px solid transparent; transition: border-color .25s, box-shadow .25s, background-color .25s; }
.pe-tabs.is-stuck { background: var(--prt-bg, #fff); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom-color: var(--prt-line); box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .35); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .pe-tabs.is-stuck { background: color-mix(in srgb, var(--prt-bg, #fff) 92%, transparent); } }
.pe-tabs__list { list-style: none; margin: 0 auto; padding: 4px 2px; display: flex; gap: 8px; justify-content: center; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.pe-tabs__list::-webkit-scrollbar { display: none; }
.pe-tabs__list li { flex: none; }
.pe-tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--prt-line); background: var(--prt-surface); color: var(--prt-ink); font-family: var(--prt-font-display); font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s, border-color .2s; }
.pe-tab .ic { width: 1.1em; height: 1.1em; color: var(--prt-primary-text); }
.pe-tab:hover { border-color: var(--prt-primary); }
.pe-tab.is-active { background: var(--prt-primary-ground, var(--prt-primary)); border-color: var(--prt-primary-ground, var(--prt-primary)); color: var(--prt-primary-ink); }
.pe-tab.is-active .ic { color: currentColor; }
.pe-tab:focus-visible { outline: 3px solid var(--prt-primary-text); outline-offset: 2px; }
@media (max-width: 860px) {
	.pe-tabs__list { justify-content: flex-start; padding-inline: 2px; }
	.pe-tabs { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent); }
}

/* ---------- event_types: rows ---------- */
.pe-rows { display: grid; gap: clamp(48px, 7vw, 96px); }
.pe-row { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; border-radius: calc(var(--prt-radius, 18px) + 8px); transition: box-shadow .4s; }
.pe-row.is-flip .pe-row__media { order: 2; }
.pe-types .pe-row__media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 30%; border-radius: var(--prt-radius, 18px); display: block; }
.pe-row h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.pe-row h3:focus { outline: none; }
.pe-row h3 em { font-style: normal; color: var(--prt-primary-text); }
.pe-row__label { margin: 18px 0 8px !important; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--prt-ink) !important; }
.pe-row__pop { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.pe-row__pop li { display: flex; gap: 8px; align-items: flex-start; color: var(--prt-ink); font-weight: 600; line-height: 1.4; }
.pe-row__pop .ic { width: 1.1em; height: 1.1em; flex: none; margin-top: .12em; color: var(--prt-primary-text); }
.pe-row.is-flash { box-shadow: 0 0 0 3px var(--prt-primary); }
@supports (color: color-mix(in srgb, red 50%, blue)) { .pe-row.is-flash { box-shadow: 0 0 0 3px var(--prt-primary), 0 0 0 14px color-mix(in srgb, var(--prt-primary) 16%, transparent); } }
@media (max-width: 860px) {
	.pe-row { grid-template-columns: 1fr; }
	.pe-row.is-flip .pe-row__media { order: 0; }
}
@media (max-width: 480px) { .pe-row__pop { grid-template-columns: 1fr; } }

/* ---------- event_packages ---------- */
.pe-packs__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
.pe-pack { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 28px 26px; background: var(--prt-surface); border: 1px solid var(--prt-line); border-radius: var(--prt-radius, 18px); }
.pe-pack.is-featured { border: 2px solid var(--prt-primary); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .35); }
.pe-pack__badge { position: absolute; top: -13px; left: 24px; padding: 4px 12px; border-radius: 999px; background: var(--prt-primary-ground, var(--prt-primary)); color: var(--prt-primary-ink); font-size: .8rem; font-weight: 800; }
.pe-pack h3 { margin: 0; }
.pe-pack__blurb { margin: 0 !important; }
.pe-pack__price { margin: 10px 0 6px !important; color: var(--prt-muted); display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.pe-pack__price b { font-family: var(--prt-font-display); font-size: 2.4rem; line-height: 1; color: var(--prt-ink); }
.pe-pack__price span { font-weight: 700; }
.pe-pack__list { list-style: none; margin: 8px 0 22px; padding: 16px 0 0; border-top: 1px solid var(--prt-line); display: grid; gap: 10px; flex: 1; align-content: start; }
.pe-pack__list li { display: flex; gap: 10px; align-items: flex-start; color: var(--prt-ink); line-height: 1.45; }
.pe-pack__list .ic { width: 1.1em; height: 1.1em; flex: none; margin-top: .15em; color: var(--prt-primary-text); }
.pe-pack .prts-btn { justify-content: center; }
.pe-packs__note { text-align: center; max-width: min(640px, 56ch); margin: 26px auto 0 !important; font-size: .92rem; }
@media (max-width: 900px) { .pe-packs__grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; gap: 30px; } }

/* ---------- event_gallery ---------- */
.pe-gal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(150px, 16vw, 230px); grid-auto-flow: dense; gap: 14px; }
.pe-gal__item { min-width: 0; }
/* A gallery of 1–4 or 6 photos (round 17): one even row (or 3 + 3) instead of the big tile with a gap
   beside it. 5 and 10 keep the designed mosaic. Browsers without :has() keep the mosaic. */
.pe-gal:not(:has(> :nth-child(5))) { grid-template-columns: repeat(var(--pe-gal-n, 4), minmax(0, 1fr)); }
.pe-gal:has(> :nth-child(3):last-child) { --pe-gal-n: 3; }
.pe-gal:has(> :nth-child(2):last-child) { --pe-gal-n: 2; }
.pe-gal:has(> :nth-child(1):last-child) { --pe-gal-n: 1; }
.pe-gal:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pe-gal:is(:not(:has(> :nth-child(5))), :has(> :nth-child(6):last-child)) > .pe-gal__item { grid-column: auto; grid-row: auto; }
.pe-gal__item:nth-child(10n + 1), .pe-gal__item:nth-child(10n + 8) { grid-column: span 2; grid-row: span 2; }
.pe-gal__link { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; border-radius: var(--prt-radius, 18px); background: var(--prt-surface-alt); }
/* Three classes: a theme's `.prt-page .entry-content img { height: auto }` (0,2,1, later) must not undo the fill (C#1).
   People photos are cropped from a third of the way down, where the faces usually are (C#2). */
.pe-gal .pe-gal__item .pe-gal__link img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 30%; display: block; transition: transform .5s ease; }
.pe-gal__link:hover img, .pe-gal__link:focus-visible img { transform: scale(1.05); }
.pe-gal__link:focus-visible { outline: 3px solid var(--prt-primary-text); outline-offset: 3px; }
.pe-gal__zoom { position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s; }
.pe-gal__zoom .ic { width: 18px; height: 18px; }
.pe-gal__link:hover .pe-gal__zoom, .pe-gal__link:focus-visible .pe-gal__zoom { opacity: 1; transform: none; }
@media (hover: none) { .pe-gal__zoom { opacity: 1; transform: none; } }
@media (max-width: 760px) {
	.pe-gal { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 44vw; gap: 10px; }
	.pe-gal__item:nth-child(10n + 1), .pe-gal__item:nth-child(10n + 8) { grid-column: span 2; grid-row: span 1; }
	/* Short galleries on phones: two columns, an odd first photo full width (3 = 1 + 2). */
	.pe-gal:is(:not(:has(> :nth-child(5))), :has(> :nth-child(6):last-child)):has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pe-gal:has(> :nth-child(3):last-child) > .pe-gal__item:first-child { grid-column: span 2; }
}

/* ---------- lightbox (built by prt-pages-events.js) ---------- */
.pe-lb { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden; }
.pe-lb::backdrop { background: rgba(8, 12, 22, .9); }
.pe-lb__stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 64px 76px 56px; }
.pe-lb__fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; pointer-events: none; }
.pe-lb__img { display: block; max-width: min(1400px, 100%); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto; border-radius: 12px; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); pointer-events: auto; transition: opacity .25s; }
.pe-lb.is-loading .pe-lb__img { filter: blur(2px); }
.pe-lb__cap { font-weight: 600; text-align: center; max-width: 60ch; color: #fff; }
.pe-lb__count { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); margin: 0; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .9rem; font-weight: 700; color: #fff; }
.pe-lb__btn { position: absolute; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; transition: background .2s, transform .2s; }
.pe-lb__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pe-lb__btn:hover { background: rgba(255, 255, 255, .28); }
.pe-lb__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pe-lb__btn[hidden] { display: none; }
.pe-lb__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.pe-lb__next { right: 14px; top: 50%; transform: translateY(-50%); }
.pe-lb__close { top: 12px; right: 14px; }
.pe-lb.is-open .pe-lb__stage { animation: pe-lb-in .3s ease both; }
@keyframes pe-lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
	.pe-lb__stage { padding: 64px 12px 96px; }
	.pe-lb__img { max-height: calc(100dvh - 190px); }
	.pe-lb__prev, .pe-lb__next { top: auto; bottom: 22px; transform: none; }
	.pe-lb__prev { left: calc(50% - 64px); }
	.pe-lb__next { right: calc(50% - 64px); }
}

@media (prefers-reduced-motion: reduce) {
	.pe-tabs, .pe-tab, .pe-row, .pe-gal__link img, .pe-gal__zoom, .pe-lb__img, .pe-lb__btn { transition: none !important; }
	.pe-lb.is-open .pe-lb__stage { animation: none; }
	.pe-gal__link:hover img { transform: none; }
}

/* ---- event_picks: rentals for an event (event pages) ---- */
.pe-picks__cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; margin: -12px 0 30px; padding: 0; }
.pe-picks__cats a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--prt-line); background: var(--prt-surface); color: var(--prt-ink); font-weight: 700; text-decoration: none; transition: border-color .2s, color .2s; }
.pe-picks__cats a:hover { border-color: var(--prt-primary); color: var(--prt-primary-text); }
.pe-picks__cats small { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 99px; background: var(--prt-surface-alt); color: var(--prt-muted); font-size: .78rem; }
.pe-pick { list-style: none; }
.pe-pick__media { display: block; background: var(--prt-surface-alt); }
.pe-pick__media img { height: auto; aspect-ratio: 4 / 3; object-fit: contain; padding: 14px; }
.pe-pick.is-photo .pe-pick__media img { object-fit: cover; padding: 0; }
.pe-pick .prts-card__body { flex: 1; }
.pe-pick__name { margin: 0; font-size: 1.12rem; }
.pe-pick__name a { color: var(--prt-ink); text-decoration: none; }
.pe-pick__name a:hover { color: var(--prt-primary-text); }
.pe-pick__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: auto; padding-top: 12px; }
.pe-pick__more { display: inline-flex; align-items: center; gap: 6px; color: var(--prt-primary-text); font-weight: 700; text-decoration: none; }
.pe-pick__more .ic { width: 1em; height: 1em; }
/* Phones: rental cards turn sideways (photo left, details right), so six picks
   read as a short list instead of six screen-high cards. */
@media (max-width: 620px) {
	.pe-picks__grid { gap: 14px; }
	.pe-pick { display: grid; grid-template-columns: minmax(104px, 34%) minmax(0, 1fr); }
	/* The photo is a square at the top of the card (round 10: filling the card's
	   height cut a 4:3 rental photo to a 118x220 strip, 40% of it showing); it is
	   taken out of the flow so its own (lazy) dimensions never stretch the row. */
	.pe-pick__media { position: relative; overflow: hidden; align-self: start; aspect-ratio: 1; margin: 10px 0 0 10px; border-radius: calc(var(--prt-radius, 18px) * .6); }
	.pe-picks .pe-pick .pe-pick__media img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; aspect-ratio: auto; padding: 0; object-fit: cover; }
	.pe-pick .prts-card__body { padding: 14px 14px 16px; gap: 4px; }
	.pe-pick__name { font-size: 1rem; line-height: 1.25; }
	.pe-pick .prts-card__body small { font-size: .88rem; }
	.pe-pick__actions { gap: 8px 12px; padding-top: 10px; }
	.pe-pick__actions .prt-atc:not([class*="btn"]) { padding: 9px 14px; font-size: .9rem; }
	.pe-pick__more { font-size: .92rem; }
}

/* Phones (polish round 2; touch tablets too since round 3): 44px tap targets on the event picks. */
@media (max-width: 760px), (pointer: coarse) {
	.pe-pick__more, .pe-picks__cats a { min-height: 44px; }
	.pe-pick__name a { display: inline-block; padding-block: 11px; margin-block: -11px; }
}

/* Tablets and phones (polish round 3). */
/* Category pills: a tidy two-column block on phones instead of one pill per
   row (an odd last pill takes the full row); wider screens balance the rows
   with data-prt-balance (prt-slider.js), so four pills read 2 + 2, not 3 + 1. */
@media (max-width: 620px) {
	.pe-picks__cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.pe-picks__cats li { display: flex; min-width: 0; }
	.pe-picks__cats li:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.pe-picks__cats a { flex: 1; min-width: 0; justify-content: center; text-align: center; padding: 8px 10px; border-radius: 16px; line-height: 1.25; }
}
/* Portrait tablets (701-860px): the event rows stay photo beside text instead of
   a page-wide photo over each block; the "popular" list goes to one column. */
@media (min-width: 701px) and (max-width: 860px) {
	.pe-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
	.pe-row.is-flip .pe-row__media { order: 2; }
	.pe-row__pop { grid-template-columns: minmax(0, 1fr); }
}

/* Packages (round 3): three across from 720px (one narrow column before), a little tighter up to 900px. */
@media (min-width: 720px) and (max-width: 900px) {
	.pe-packs__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; gap: 16px; }
	.pe-pack { padding: 24px 18px; }
	.pe-pack__badge { left: 16px; }
	.pe-pack__price b { font-size: 2rem; }
	.prts.pe-packs .pe-pack .prts-btn { padding-left: 12px; padding-right: 12px; gap: 6px; font-size: .9rem; white-space: nowrap; }
}

/* Hover (polish round 11): "Details" underlines; its arrow nudges (transform only, not with reduced motion). */
.pe-pick__more:hover { text-decoration: underline; text-underline-offset: 3px; }
.pe-pick__more .ic { transition: transform .2s ease; }
.pe-pick__more:hover .ic { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .pe-pick__more .ic { transition: none; } .pe-pick__more:hover .ic { transform: none; } }
