/* Witzzart 2.1.0 - phone and tablet responsiveness layer.
   Covers the creator dashboard, the create/edit event wizard, the public booking flow and the attendee/profile pages.
   Presentation only: no markup contracts, ids, names or scripts are changed by this file.
   Every rule sits inside a max-width (or touch-device) media query, so desktop layouts at 1200px and up are untouched.
   Loaded last (after witzzart-typography.css), so selectors start with "html body" to win over page-level <style> blocks. */

/* ------------------------------------------------------------------
   1. Rows that sit outside a .container
   Bootstrap rows carry negative side margins that rely on a padded parent. Where a page puts a row
   straight into #main-content the row ends up wider than the screen and its right edge is cut off.
   The wz-row-fit marker removes the negative margins below the desktop breakpoint.
   ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
  html body .wz-row-fit { margin-left: 0 !important; margin-right: 0 !important; }
}
@media (max-width: 767.98px) {
  html body .wz-row-fit { --bs-gutter-x: 1rem; padding-left: 0 !important; padding-right: 0 !important; }
}

/* ------------------------------------------------------------------
   2. My bookings list (profile) on tablets and small laptops
   Below 768px the card already stacks (witzzart-mybookings-m160.css). From 768px up the action buttons stayed on
   one non-wrapping line (status, Ticket, Cancel tickets, View Details can reach 1000px) and pushed the page
   sideways. They now wrap only when they do not fit; when they fit the layout is unchanged.
   ------------------------------------------------------------------ */
@media (min-width: 768px) {
  html body .card-hover:has(.event-title) { flex-wrap: wrap !important; }
  html body .card-hover:has(.event-title) > .d-flex:first-child { flex: 1 1 320px; min-width: 0; }
  html body .card-hover:has(.event-title) > .d-flex:first-child > div:last-child { min-width: 0; }
  html body .card-hover:has(.event-title) .event-title { overflow-wrap: anywhere; }
  html body .card-hover:has(.event-title) > .d-flex:last-child:not(:first-child) {
    flex: 0 1 auto; flex-wrap: wrap; max-width: 100%; justify-content: flex-start !important; gap: 10px !important;
  }
}

/* ------------------------------------------------------------------
   3. Text size in fields (stops iOS/iPadOS from zooming into the page on focus) and long-text safety
   ------------------------------------------------------------------ */
@media (max-width: 767.98px), (pointer: coarse) and (max-width: 1024px) {
  html body #main-content :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=hidden]), select, textarea) {
    font-size: 16px !important;
  }
}
@media (max-width: 767.98px) {
  html body #main-content :is(h1, h2, h3, h4, h5, h6, p, li, dd, dt, label, .card-title, .event-title) { overflow-wrap: break-word; }
}

/* ------------------------------------------------------------------
   4. Touch targets (phones and tablets with a finger, not a mouse)
   ------------------------------------------------------------------ */
@media (pointer: coarse) and (max-width: 991.98px) {
  html body #main-content :is(.btn-view, .studio-btn, .ax-gallery__btn, .bk-btn, .bk-cta, .btn-view-details, .btn-view-ticket) {
    min-height: 44px;
  }
  html body #main-content :is(.bk-date) { min-height: 44px; }
  html body #main-content :is(.copy-btn, .edit-btn, .owner-edit-link) {
    min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  }
  html body #main-content :is(.btn.btn-sm, .btn.btn-link, .input-group-text.bg-white) { min-height: 40px; }
  /* Create-event wizard: time-format toggle, calendar arrows, artist/link delete buttons, image delete buttons */
  html body #step-2 #s2FormatToggle button { min-height: 44px; min-width: 44px; }
  html body #step-2 :is(#s2CalPrev, #s2CalNext) { min-width: 44px; min-height: 44px; }
  html body .artist-link-row .delete-link-btn { min-width: 40px; min-height: 40px; }
  html body .artist-card-item .delete-artist-btn { min-width: 44px !important; min-height: 44px !important; }
  html body .existing-image > .btn-danger::after { content: ""; position: absolute; inset: -9px; }
  html body #step-5 a.d-inline-flex { min-height: 32px; align-items: center; }
  html body #main-content .pagination .page-link { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
}

/* ------------------------------------------------------------------
   5. Pagination: wrap instead of overflowing on narrow screens
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body #main-content .pagination { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
}

/* ------------------------------------------------------------------
   6. Ticket management ("Your Events" table)
   Seven columns do not fit a phone. The table keeps a readable width and scrolls sideways inside its card,
   the fixed 410px height is removed, and the row menus use fixed positioning so they are not cut off.
   ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
  html body .event-table .table-responsive { height: auto !important; max-height: none !important; overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  html body .event-table .table-responsive > .table { min-width: 860px; }
  html body .event-table .table-responsive td:first-child, html body .event-table .table-responsive th:first-child { min-width: 250px; }
  html body .event-table .table-responsive td, html body .event-table .table-responsive th { white-space: nowrap; }
  html body .event-table .table-responsive td:first-child { white-space: normal; }
}
@media (max-width: 575.98px) {
  html body .event-table > .p-4 { padding: 14px !important; }
  html body .event-table td, html body .event-table th { padding: 14px 12px !important; }
}

/* ------------------------------------------------------------------
   7. Creator dashboard: experience cards (phones)
   The status badge was pinned to the top right while the title only kept 4rem free, so long statuses such as
   "Booking Closed" or "Event Cancelled" were drawn over the title. The badge now sits in its own row.
   ------------------------------------------------------------------ */
@media (max-width: 768px) {
  html body .exp-card > .exp-status-badge {
    position: static !important; display: table; margin: 0 0 8px auto; max-width: 100%;
  }
  html body .exp-card .exp-title-col { padding-right: 0 !important; }
}

/* ------------------------------------------------------------------
   8. Commissions page: stacked px-4 rows left a card only about 250px wide on a phone
   ------------------------------------------------------------------ */
@media (max-width: 767.98px) {
  html body .wz-fit-pad { padding-left: 0 !important; padding-right: 0 !important; }
  html body .wz-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
  html body .wz-chip-row > .badge { margin-right: 0 !important; }
}

/* ------------------------------------------------------------------
   9. Booking dialogs (Review your booking, messages)
   "Change" and "Confirm & Pay" shared one non-wrapping row, so on a 320px phone the pay button was cut off.
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body .bk-dlg-actions { flex-wrap: wrap; }
  html body .bk-dlg-actions .bk-btn { flex: 1 1 132px; min-width: 0; white-space: normal; }
  html body .bk-dialog { max-width: calc(100vw - 24px); box-sizing: border-box; }
}

/* ------------------------------------------------------------------
   10. Page hero banners (Artist, Commissions, user type, self verification)
   The hero text ran to within 2-4px of the screen edge and the headline stayed at desktop size on a 320px phone.
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body .hero-section .hero-content { padding-left: 20px; padding-right: 20px; box-sizing: border-box; }
  html body .hero-section .hero-content :is(h1, .display-4) { font-size: clamp(1.9rem, 9vw, 2.75rem); line-height: 1.15; overflow-wrap: break-word; }
}

/* ------------------------------------------------------------------
   11. Footer on tablets (769px to 909px)
   The four footer columns have a combined minimum width of about 840px (witzzart-shell-m194.css), so between
   roughly 772px and 872px they were wider than the screen and the whole page could be dragged sideways on
   iPad portrait and 800px tablets. Two columns per row until there is room for four.
   ------------------------------------------------------------------ */
@media (min-width: 769px) and (max-width: 909.98px) {
  html body .footer-desktop-cols .row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; row-gap: 30px; }
}

/* ------------------------------------------------------------------
   12. Big gradient numbers in three-up stat rows (artist profile)
   3.5rem figures such as "24.8K" were wider than a one-third column on a phone and the last characters were cut off.
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body .col-4 .stat-number { font-size: clamp(1.5rem, 8.5vw, 2.25rem); }
}

/* ------------------------------------------------------------------
   13. Fixed minimum widths that are wider than a 320px phone
   - Ticket management filter bar: inline min-widths of 250px / 300px / 150px pushed the form past the screen edge.
   - Artist profile newsletter box: the email field kept its default width and carried the button off screen.
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body .filter-section form > * { min-width: 0 !important; flex: 1 1 100% !important; }
  html body .filter-section form .status-filter, html body .filter-section form .date-range-wrapper { width: 100%; }
  html body .newsletter-form { flex-wrap: wrap; gap: 10px; }
  html body .newsletter-input { flex: 1 1 100%; min-width: 0; border-right: 1px solid rgba(212, 175, 55, 0.2); border-radius: var(--border-radius-sm, 8px); }
  html body .newsletter-btn { flex: 1 1 100%; justify-content: center; }
}

/* ------------------------------------------------------------------
   14. Creator dashboard "My Experiences" table on tablets (769px to 991px)
   The table needs about 813px, so on iPad portrait widths (770-840px) it stuck out past its card.
   Tighter cell padding brings it back inside; wider screens keep the existing spacing.
   ------------------------------------------------------------------ */
@media (min-width: 769px) and (max-width: 991.98px) {
  html body .desktop-view .table th, html body .desktop-view .table td { padding-left: 0.6rem; padding-right: 0.6rem; }
  html body .desktop-view .table th:first-child, html body .desktop-view .table td:first-child { padding-left: 1rem; }
  html body .desktop-view .table th:last-child, html body .desktop-view .table td:last-child { padding-right: 0.75rem !important; }
  html body .desktop-view .dt-action-btn { padding-left: 12px; padding-right: 12px; white-space: normal; line-height: 1.25; text-align: center; }
}

/* ------------------------------------------------------------------
   15. Profile "Password & Security" rows (User/UserProfile)
   Each row is a non-wrapping flex line (text on the left, button on the right). Next to a long value such as an
   e-mail address the button was carried about 45px past the edge of a 320px to 356px phone.
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body .security-item { flex-wrap: wrap; gap: 0.75rem; }
  html body .security-item > :first-child { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
}

/* ------------------------------------------------------------------
   16. Edit profile: "Followers" and "Following" counters sit on one non-wrapping line that was 2px wider than a 320px phone
   ------------------------------------------------------------------ */
@media (max-width: 575.98px) {
  html body .d-flex.d-xl-block.d-xxl-flex { flex-wrap: wrap; row-gap: 4px; }
}
