/* Creating events and their settings (redesign phase 3): one event's settings page (HostEventEdit), the ticket types and
   their form, the new event and new recital forms, Belle's flyer drop, the families step after a new recital. */
/* Linked after host-shell.css and host-event.css; overrides app.css here, never there. Hairlines, not boxes; one pink action per view. */

/* ── Settings page: one column under the event header ───────────────────────────────────── */
.set-page { max-width: var(--w-read); }
/* The section bar: the event tabs' look, kept in reach under the site header while scrolling. */
.ev-tabs.set-nav { position: sticky; top: 61px; z-index: 20; background: var(--lp-bg); margin-bottom: 1.8rem; }
html.app-mode .ev-tabs.set-nav { top: calc(61px + env(safe-area-inset-top)); }
.ev-tabs a[aria-current="location"] { color: var(--lp-ink); border-bottom-color: var(--lp-brand); }
.set-section, .set-admin, .set-row, .tt-row, #seat-prices, #ticket-form { scroll-margin-top: 130px; }
.set-section { margin: 0 0 2.8rem; }
.set-title { margin: 0 0 1rem; font-size: var(--fs-heading); font-weight: var(--fw-strong); letter-spacing: -.015em; }
.set-subtitle { margin: 0 0 .5rem; font-size: var(--fs-subhead); font-weight: var(--fw-strong); }
.ev-settings .event-form .form-step:first-of-type { padding-top: 0; }
.ev-settings .seating-setup { margin-bottom: 1.6rem; }

/* Rows: one line that says its state; it opens in place. */
.set-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--lp-line); }
.set-rows > li { border-bottom: 1px solid var(--lp-line); }
.set-row > summary, .set-row-link { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .4rem 1rem; padding: .95rem 0;
    color: var(--lp-ink); text-decoration: none; }
.set-row > summary::-webkit-details-marker { display: none; }
.set-row-name { font-weight: 600; }
.set-row-state { margin-left: auto; color: var(--lp-muted); font-size: var(--fs-small); text-align: right; font-variant-numeric: tabular-nums; }
/* a small chevron: down while folded, up while open, right for a row that goes to another tab */
.set-row > summary::after, .set-row-link::after { content: ""; flex: none; align-self: center; width: .45rem; height: .45rem; margin: 0 .2rem 0 .1rem;
    border-right: 1.5px solid var(--lp-muted); border-bottom: 1.5px solid var(--lp-muted); transform: translateY(-2px) rotate(45deg); }
.set-row[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.set-row-link::after { transform: rotate(-45deg); }
.set-row > summary:hover .set-row-name, .set-row-link:hover .set-row-name { color: var(--lp-brand-text); }
.set-row-body { display: grid; gap: .9rem; padding: 0 0 1.4rem; max-width: var(--w-read); }
.set-row-body > .fine-print, .set-row-body > p { margin: 0; }
.set-row-body .order-lines { margin: 0; }
.promo-types { gap: .35rem; }

/* A feature that is off shows only its switch: its fields appear once it's turned on (all shown where :has isn't known). */
@supports selector(:has(*)) {
    .fan-funded-form:has(input[name="FanFunded.On"]:not(:checked)) .set-when-on { display: none; }
    .resale-form:has(select[name="ResaleForm.Mode"] option[value=""]:checked) .set-when-on { display: none; }
}

/* Admin (platform admins): folded at the very end, labelled with a pill. */
.set-admin { margin: 0 0 2rem; border-top: 1px solid var(--lp-line); }
.set-admin > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .8rem; padding: .95rem 0; }
.set-admin > summary::-webkit-details-marker { display: none; }
.set-admin > summary .set-row-state { margin-left: 0; }
.set-admin-rows { display: grid; max-width: var(--w-read); }
.set-admin-row { padding: 1rem 0 1.3rem; border-top: 1px solid var(--lp-line); }
.set-admin-row .set-subtitle { margin: 0; }

/* ── Ticket types: one readable line each; Edit opens the form in place ─────────────────────── */
.tt-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding: .95rem 0; }
.tt-text { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.tt-sold { color: var(--lp-muted); font-variant-numeric: tabular-nums; }
.tt-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tt-tags:empty { display: none; }
.tt-edit { font-size: var(--fs-small); font-weight: 600; color: var(--lp-brand-text); text-decoration: none; }
.tt-edit:hover { text-decoration: underline; }
/* "Mark sold out" / "Reopen sales": a text action on the Edit link's baseline */
.btn.tt-soldout { min-height: 0; padding: 0; font-weight: 600; line-height: inherit; }
.btn.tt-soldout:hover:not(:disabled) { background: none; text-decoration: underline; }
.tt-row.is-muted .tt-text { color: var(--lp-muted); }
.tt-row.is-open > .tt-form { padding: 0 0 1.4rem; }
.tt-new { margin-top: 1rem; }
.tt-new > summary { list-style: none; display: inline-flex; }
.tt-new > summary::-webkit-details-marker { display: none; }
.tt-new[open] > summary { margin-bottom: 1.1rem; }
.tt-form { max-width: var(--w-read); }

/* the price: which number is typed, the box, a hint for that choice, and what buyers pay and the host gets */
.tt-price { gap: .55rem; }
.form-grid .tt-amount { display: flex; align-items: center; gap: .45rem; max-width: 12rem; }
.form-grid .tt-amount input { flex: 1; min-width: 0; }
.tt-currency { color: var(--lp-muted); font-weight: 600; }
.tt-hint { margin: 0; }
@supports selector(:has(*)) {
    .tt-form .tt-hint-buyer, .tt-form:has([data-tt-mode][value="buyer"]:checked) .tt-hint-ticket { display: none; }
    .tt-form:has([data-tt-mode][value="buyer"]:checked) .tt-hint-buyer { display: block; }
}
.tt-sum { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

/* "Raise the price as tickets sell: after [50] sold, $[20]" */
.tt-raises > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-small); padding: .2rem 0; }
.tt-raise { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .65rem; font-size: var(--fs-body); }
.form-grid .tt-raise input { width: 6.5rem; }

/* ── New event and new recital ──────────────────────────────────────────────────────────── */
.new-event > h1 { margin-bottom: 1.4rem; }
.new-event-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 960px) { .new-event-grid { grid-template-columns: 1fr; } }
.new-event .event-form, .recital-form { max-width: var(--w-read); }
.new-event .event-form .form-step:first-of-type, .recital-form .form-step:first-of-type { padding-top: 0; }
/* The preview card on a neutral surface (no pink until there's a poster or a colour of the host's). */
.event-preview .preview-art { --art: var(--lp-surface-2); }
.event-preview .preview-initials { color: var(--lp-muted); text-shadow: none; }
.event-preview .preview-art.has-colour .preview-initials { color: #fff; text-shadow: 0 2px 12px rgb(0 0 0 / .25); }

/* Belle: "Start with your flyer", a real drop zone */
.belle-drop { margin: 0 0 2.2rem; max-width: var(--w-read); }
.belle-drop-zone { display: grid; justify-items: center; gap: .45rem; padding: 2.4rem 1.5rem; text-align: center;
    border: 1.5px dashed var(--lp-line); border-radius: var(--radius); background: var(--lp-surface); transition: border-color .15s, background-color .15s; }
.belle-drop-zone.is-dragging { border-color: var(--lp-brand); background: color-mix(in srgb, var(--lp-brand) 6%, var(--lp-surface)); }
.belle-drop-title { margin: 0; font-size: var(--fs-subhead); font-weight: var(--fw-strong); letter-spacing: -.02em; }
.belle-drop-line { margin: 0 0 .7rem; color: var(--lp-muted); }
.belle-drop .belle-flyer-button { cursor: pointer; }
.belle-drop.is-busy .belle-flyer-button { opacity: .55; pointer-events: none; }
.belle-drop .belle-flyer-result { margin-top: .9rem; }
.belle-drop .belle-flyer-result p { margin: 0; }
.belle-skip { display: block; width: fit-content; margin: .9rem auto 0; font-size: var(--fs-small); font-weight: 600; color: var(--lp-muted); text-decoration: none; }
.belle-skip:hover { color: var(--lp-ink); }

/* The poster as one compact row: a thumbnail beside "Add a poster" */
.form-step-poster { gap: .4rem; }
.image-field-compact .image-drop { aspect-ratio: auto; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; place-items: center start;
    gap: 1rem; padding: .7rem .9rem; border: 1px solid var(--lp-line); border-radius: var(--radius-sm); background: var(--lp-bg); text-align: left; }
.image-field-compact .image-drop.has-image { background: var(--lp-bg); border-style: solid; }
.image-field-compact .image-drop::before { content: ""; grid-area: 1 / 1; width: 52px; height: 65px; border-radius: 6px; background: var(--lp-surface-2); }
.image-field-compact .image-drop img { position: static; grid-area: 1 / 1; width: 52px; height: 65px; border-radius: 6px; background: #1B1A22; }
.image-field-compact .image-hint, .image-field-compact .image-drop.has-image .image-hint { position: static; grid-area: 1 / 2; display: grid; gap: .1rem;
    padding: 0; max-width: none; background: none; color: var(--lp-muted); border-radius: 0; }
.image-field-compact .image-hint::before { content: none; }
.image-field-compact .image-hint strong, .image-field-compact .image-drop.has-image .image-hint strong { color: var(--lp-ink); font-size: var(--fs-body); }
.image-field-compact .image-hint span { font-size: var(--fs-small); }
.image-field-compact [data-image-status] { margin: .35rem 0 0; }

/* ── Several shows (HostRecitalNew): the event form's sections, no boxed fieldsets ───────────── */
.recital-form { gap: 0; }
.recital-form .form-step .row-3 + details { margin-top: -.2rem; }
.recital-form details > summary { cursor: pointer; font-weight: 600; font-size: var(--fs-small); }
.recital-form details[open] > summary { margin-bottom: .7rem; }
.recital-form .addon-choice { padding: .2rem 0; }

/* After a new recital: the families step */
.roster-step { margin: 0 0 1.8rem; padding: 1.2rem 1.3rem; border-radius: var(--radius); background: var(--lp-surface); max-width: var(--w-read); }
.roster-step h2 { margin: 0 0 .35rem; font-size: var(--fs-subhead); font-weight: var(--fw-strong); letter-spacing: -.01em; }
.roster-step p { margin: 0; color: var(--lp-muted); }
.roster-step-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-top: .9rem; }
.roster-step-actions a:not(.btn) { font-weight: 600; color: var(--lp-muted); text-decoration: none; }
.roster-step-actions a:not(.btn):hover { color: var(--lp-ink); }

/* Become a host: the first form after "Start selling" */
.become-host .become-next { margin: -.2rem 0 1.2rem; color: var(--lp-muted); }

/* Phones: the form's buttons stay in reach at the bottom, edge to edge (app.css sized them for a padded panel these forms no longer sit in). */
@media (max-width: 640px) {
    .ev-settings .event-form .form-submit, .new-event .event-form .form-submit { margin: 0 -1rem; padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
        background: var(--lp-bg); }
}

/* Families: "Import families" is a section row (hairlines, no fill); the table stacks on a phone (family and ⋯, dancers, emails). */
.roster-import { margin: 0 0 1.8rem; border-top: 1px solid var(--lp-line); border-bottom: 1px solid var(--lp-line); max-width: var(--w-read); }
.roster-import > summary { cursor: pointer; list-style: none; padding: .9rem 0; }
.roster-import > summary::-webkit-details-marker { display: none; }
.roster-import > summary::before { content: "▸ "; color: var(--lp-muted); }
.roster-import[open] > summary::before { content: "▾ "; }
.roster-import[open] { padding-bottom: 1.2rem; }
.roster-import > p { margin-top: 0; }
.panel + .roster-import { margin-top: 1.2rem; }
details.panel:has(+ .roster-import) { max-width: var(--w-read); }
@media (max-width: 639.98px) {
    .roster-table, .roster-table tbody, .roster-table tr, .roster-table td { display: block; }
    .roster-table thead { display: none; }
    .roster-table tr { display: grid; grid-template-columns: minmax(0, 1fr) 2.5rem; gap: .25rem 1rem; padding: .9rem 0; border-bottom: 1px solid var(--lp-line); }
    .roster-table td { padding: 0; border: 0; margin: 0; grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
    .roster-table td.r-family { grid-row: 1; }
    .roster-table td.row-actions { grid-column: 2; grid-row: 1; text-align: right; }
    .roster-table .row-menu-items { white-space: normal; }
}
