/* An event's page at its buyer link, the Event Page tab where organizers keep track
   of their events, the payout notice and Analytics' Payouts box, and the example
   price split. */

/* Links keep the account controls and hide the site's navigation tabs. */
.page-only .toolbar { display: none; }

/* An event's own background, behind the whole window at its link and in its preview.
   The root keeps the base color; the body turns clear so the picture shows through,
   under a dark tint that keeps the page readable. */
.has-page-background body { background: transparent; }
.has-page-background body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgb(14 15 17 / 62%), rgb(14 15 17 / 86%)), var(--page-background) center / cover no-repeat, var(--bg);
}

/* The event page: the full picture beside the details. Every text area is a solid
   panel, so it reads well over any background. */
.event-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.event-page-poster { position: sticky; top: 84px; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.event-page-poster img { display: block; width: 100%; height: auto; }
.event-page-poster > span { display: grid; place-items: center; aspect-ratio: var(--poster-ratio); padding: 20px; color: var(--text-muted); font-weight: 600; text-align: center; }
.event-page-details { display: grid; gap: 16px; min-width: 0; }
.event-page-panel { padding: 20px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.event-page-panel h1 { margin-bottom: 8px; font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.event-page-panel h2 { margin-bottom: 12px; font-size: 18px; }
.event-page-panel .event-meta + .event-meta { margin-top: 2px; }
.event-page .event-description { margin: 0; color: var(--text-muted); white-space: pre-line; overflow-wrap: anywhere; }
/* "Hosted by", with the organizer's Instagram link. */
.event-host { margin: 12px 0 0; color: var(--text-muted); overflow-wrap: anywhere; }
.event-host strong { color: var(--text); font-weight: 600; }
.event-host-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); text-decoration: none; }
.event-host-link:hover { text-decoration: underline; }
.event-host-icon { flex: none; }
/* Ticket tiers: the name with any early price, then the price and Get tickets. */
.event-tiers ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.event-tier { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-top: 1px solid var(--border-soft); }
.event-tier:first-child { padding-top: 0; border-top: 0; }
.event-tier-copy { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.event-tier-copy strong { font-weight: 600; }
.event-tier-early { color: var(--ok); font-size: 13px; }
.event-tier-left { color: var(--warn); font-size: 13px; }
.event-tier-note { color: var(--text-muted); font-size: 13px; }
.event-tier.is-sold-out .event-tier-price { color: var(--text-subtle); text-decoration: line-through; }
.event-tier-fees { color: var(--text-muted); font-size: 13px; }
.event-tier-buy { display: flex; align-items: center; gap: 12px; flex: none; }
.event-tier-price { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* The venue map, from its address. */
.event-map-address { margin: 0 0 12px; color: var(--text-muted); }
.event-map-frame { display: block; width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: var(--radius-sm); background: var(--surface-alt); }
.event-map-open { display: inline-block; margin-top: 10px; color: var(--text-muted); font-size: 14px; }
.page-tickets h2 { margin-bottom: 16px; font-size: 20px; }
.page-tickets .pending-payment { margin-bottom: 16px; }

/* Until Stripe is set up: a solid notice above everything on the Event Page tab. */
.payout-notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  margin-bottom: 20px; padding: 12px 16px; border: 1px solid var(--warn); border-radius: var(--radius);
  background: var(--surface); color: var(--text-muted); font-size: 14px;
}
.payout-notice[hidden] { display: none; }
.payout-notice p { flex: 1 1 320px; margin: 0; }
.payout-notice strong { color: var(--text); font-weight: 600; }

/* Create Event Page, and the Event Page tab's list of events. */
.private-page-form { max-width: 640px; }
.private-top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.organizer-events { display: grid; gap: 14px; }
.organizer-event {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; padding: 16px;
  border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface);
}
.organizer-event-poster { overflow: hidden; aspect-ratio: var(--poster-ratio); border-radius: var(--radius-sm); background: var(--surface-alt); }
.organizer-event-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.organizer-event-main { display: grid; gap: 8px; min-width: 0; }
.organizer-event-main h2 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.organizer-event-main .field-help { margin: 0; }
.organizer-event-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.organizer-event-qr { display: grid; justify-items: start; gap: 8px; }
.organizer-event-qr[hidden] { display: none; }
.organizer-event-qr img { display: block; border-radius: var(--radius-sm); image-rendering: pixelated; }
/* A preview's bar: back to the list, the event's link, and what the preview shows. */
.organizer-preview-bar {
  display: grid; gap: 10px; margin-bottom: 24px; padding: 14px 16px;
  border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface);
}
.organizer-preview-bar .field-help { margin: 0; }
.organizer-preview-bar > .win-button { justify-self: start; }
.private-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.private-link input {
  flex: 1 1 260px; min-width: 0; min-height: 32px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--field); color: var(--text); font-family: var(--mono); font-size: 13px;
}
.private-link input:focus-visible { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(140 180 255 / 18%); }
/* Buttons over an event's background are solid, so the picture never shows through. */
.event-page .win-button:not(.primary), .organizer-preview-bar .win-button:not(.primary) { background: var(--surface); }
.event-page .win-button:not(.primary):hover:not(:disabled), .organizer-preview-bar .win-button:not(.primary):hover:not(:disabled) { background: var(--surface-alt); }

/* The event form's ticket tiers and page background. */
.ticket-tiers .field-help { margin: 0 0 12px; }
.tier-rows { display: grid; gap: 12px; margin-bottom: 12px; }
.ticket-tiers { margin-bottom: 18px; }
.event-host-fields { margin-top: 4px; }
.event-host-fields > .field-help { margin: 0 0 12px; }
/* Name, price, and limit on the first line; the early price and when it ends on the second. */
.tier-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end;
  padding: 12px; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.tier-row .field { margin-bottom: 0; }
.tier-row .field:has(.tier-name), .tier-row .field:has(.tier-early-until) { grid-column: span 2; }
.tier-row .tier-remove { grid-column: 1 / -1; justify-self: start; margin-top: -4px; }
.tier-row .tier-remove[hidden] { display: none; }
.page-background-field { margin-top: 20px; }
.page-background-picker { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; }
.page-background-preview {
  position: relative; flex: none; display: grid; place-items: center; width: 160px; aspect-ratio: 16 / 9; overflow: hidden;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--text-subtle); font-size: 12px;
}
.page-background-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-background-controls { display: grid; justify-items: start; gap: 8px; flex: 1 1 200px; min-width: 0; }
.page-background-controls .field-help { margin: 0; }

/* Analytics' Payouts box, with the tip to use an event link as the website Stripe asks for. */
.private-payouts {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  margin-top: 0; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.private-payouts h2 { margin-bottom: 0; font-size: 17px; }
.private-payouts > div { min-width: 0; }
.payout-website-tip { margin-top: 6px; overflow-wrap: anywhere; }
.payout-website-tip code { color: var(--text); font-family: var(--mono); font-size: 12px; }
.payout-website-tip .text-button { font-size: 13px; }
.private-payouts .notice { flex-basis: 100%; margin: 0; overflow-wrap: anywhere; }
.payout-radar { flex-basis: 100%; max-width: 640px; margin: 0; }
.private-section { margin-top: 40px; }
.private-event-form { margin: 4px 0 24px; padding: 20px; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }

@media (max-width: 760px) {
  .event-page { grid-template-columns: minmax(0, 1fr); }
  .event-page-poster { position: static; max-width: 420px; }
}
@media (max-width: 520px) {
  .organizer-event { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .tier-row { grid-template-columns: minmax(0, 1fr); }
  .tier-row .field:has(.tier-name), .tier-row .field:has(.tier-early-until) { grid-column: auto; }
}

/* "Also show on the main Events page" */
.check-field { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; cursor: pointer; }
.check-field input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--primary); }
.check-field > span { display: grid; gap: 2px; }
.check-field strong { font-weight: 500; }
.check-field .field-help { margin: 0; }
/* The Terms of Service box reads as one sentence with links. */
.terms-check > span { display: block; color: var(--text-muted); font-size: 14px; }
.terms-check a { color: var(--text); }

.empty-state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* The ticket pricing example on the Create Event Page tab: a thin segmented bar above
   a table that gives every part's name, amount, and share. The four colors passed the
   palette checks (colorblind separation and contrast) on this site's dark surfaces. */
.price-split {
  --split-organizer: #338ced; --split-tax: #e76624; --split-card: #00a888; --split-site: #d28e05;
  max-width: 720px; margin-top: 56px; padding: 24px; border: 1px solid var(--border-soft);
  border-radius: var(--radius); background: var(--surface);
}
.price-split [data-split="organizer"] { --fill: var(--split-organizer); }
.price-split [data-split="tax"] { --fill: var(--split-tax); }
.price-split [data-split="card"] { --fill: var(--split-card); }
.price-split [data-split="site"] { --fill: var(--split-site); }
.price-split-title { margin-bottom: 16px; font-size: 18px; }
/* The ticket price box: type a price to redraw the example. */
.price-split-input { margin-bottom: 20px; }
.price-split-money { position: relative; max-width: 200px; }
.price-split-money > span { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.field .price-split-money input { padding-left: 26px; font-variant-numeric: tabular-nums; }
.field .price-split-money input[aria-invalid] { border-color: var(--err); }
.price-split-hint { margin: 0; color: var(--err); font-size: 13px; }
.price-split-chart { position: relative; margin-bottom: 12px; }
/* Each part is a 24px hover target with an 8px bar inside, 2px gaps between parts. */
.price-split-bar { display: flex; align-items: center; gap: 2px; height: 24px; }
.price-split-segment { position: relative; flex: 1 1 0; min-width: 3px; height: 24px; outline: none; }
.price-split-segment::before { content: ""; position: absolute; inset: 8px 0; background: var(--fill); }
.price-split-segment:first-child::before { border-radius: 4px 0 0 4px; }
.price-split-segment:last-child::before { border-radius: 0 4px 4px 0; }
.price-split-segment:hover::before, .price-split-segment:focus-visible::before { filter: brightness(1.2); }
.price-split-segment:focus-visible { border-radius: 4px; box-shadow: 0 0 0 2px var(--accent); }
.price-split-tooltip {
  position: absolute; bottom: calc(100% + 4px); z-index: 2; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt);
  color: var(--text); font-size: 13px; white-space: nowrap; pointer-events: none; transform: translateX(-50%);
}
.price-split-tooltip span:last-child { color: var(--text-muted); }
.price-split-key { flex: none; width: 12px; height: 2px; border-radius: 1px; background: var(--fill); }
.price-split-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-split-table th, .price-split-table td { padding: 10px 0; border-top: 1px solid var(--border-soft); font-weight: 400; text-align: left; vertical-align: top; }
.price-split-table thead th { padding-top: 0; border-top: 0; color: var(--text-muted); font-size: 12px; }
.price-split-table td, .price-split-table thead th + th { padding-left: 16px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-split-part { display: flex; align-items: flex-start; gap: 10px; }
.price-split-part > span:last-child { display: grid; gap: 2px; }
.price-split-table strong { font-weight: 500; }
.price-split-swatch { flex: none; width: 10px; height: 10px; margin-top: 5px; border-radius: 2px; background: var(--fill); }
.price-split-detail { color: var(--text-muted); font-size: 12px; }
.price-split-table tbody tr.is-active > * { background: var(--surface-alt); }
.price-split-table tfoot th, .price-split-table tfoot td { font-weight: 600; }

@media (max-width: 640px) {
  .price-split { padding: 18px 16px; }
  .private-event-form { padding: 16px; }
}
