/* Phone layout. Brand colors stay in colors.css. This file loads last. */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.btn-primary:focus-visible,
.nav-account:focus-visible,
.segment a[aria-current="page"]:focus-visible,
.bp-top :focus-visible,
.bp-help:focus-visible,
.bp-panel > summary:focus-visible {
  outline-color: var(--sun);
  box-shadow: 0 0 0 2px var(--ivory);
}

.site-header {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.bp-top {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.site-footer {
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}
.bp-foot {
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
}
.rsvp-bar,
.group-bar,
.transfer-accept,
.move-bar {
  padding-left: max(.85rem, env(safe-area-inset-left));
  padding-right: max(.85rem, env(safe-area-inset-right));
}
.group-bar,
.transfer-accept,
.move-bar {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
.footer-bottom,
.footer-bottom a,
.bp-offer-meta,
.bp-mail,
a[href^="mailto:"],
a[href^="http"],
.mono,
code,
.copy-link,
.pair-link-display,
.report-key-value,
.prewrap {
  overflow-wrap: anywhere;
}

h1, h2, h3 {
  text-wrap: balance;
  overflow-wrap: break-word;
}

.shop-card img,
.shop-photo {
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
}
.hero-lockup,
.footer-badge,
.ticket-logo,
.ticket-qr,
.guest-qr {
  height: auto;
}

#order-summary:has(.order-lines),
#order-summary:has(h3) {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .95rem 1rem .85rem;
}
.order-lines,
.order-lines li,
#payment-processing-line,
.fee-asterisk {
  font-size: 1rem;
  line-height: 1.45;
}
.order-lines li span:first-child { min-width: 0; }

.pay-fallback .btn {
  width: 100%;
  min-height: 48px;
  white-space: normal;
  text-align: center;
}
#pay-fallback:not([hidden]) {
  position: sticky;
  bottom: calc(.5rem + env(safe-area-inset-bottom));
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 860px) {
  body,
  body.admin {
    font-size: 1rem;
    line-height: 1.6;
  }
  p, li, dd, .bp-sub, .hint, .details, .lede, label {
    line-height: 1.55;
  }

  .container,
  .container.wide,
  body.admin .container.wide {
    width: min(100% - 1.5rem, var(--max));
  }
  .container,
  .container.wide,
  body.admin .container.wide,
  .bp-page,
  .bp-layout,
  .bp-main,
  .bp-record,
  .confirm-wrap,
  .sheet,
  .table-wrap,
  .bp-tabs,
  .header-inner,
  .site-header,
  .bp-top {
    min-width: 0;
    max-width: 100%;
  }

  :root { --mark-h: 2.25rem; }
  .brand { padding: .45rem 0; max-width: calc(100% - 7.25rem); }
  .header-inner { align-items: center; gap: .4rem; }
  .header-tools { gap: .35rem; margin-right: 0; }
  .header-account {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 44px;
    align-items: center;
    padding-inline: .75rem;
  }
  .nav-toggle,
  .bp-menu-btn {
    min-width: 44px;
    min-height: 44px;
    padding: .45rem .85rem;
    font-size: 1rem;
    justify-content: center;
  }
  .hint,
  .small,
  .bp-sub,
  .bp-offer-meta,
  .rsvp-bar p,
  .rsvp-bar .muted,
  .fee-asterisk {
    font-size: 1rem;
  }
  .badge { font-size: .875rem; }
  .bp-menu-btn { display: inline-flex; }
  .site-nav a,
  .segment a,
  .text-link,
  .back-link a,
  .pay-back a,
  .bp-tool-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
  }
  .site-nav a {
    display: flex;
    font-size: 1.05rem;
  }
  body.nav-locked,
  body.admin-nav-locked { overflow: hidden; }

  h1 { font-size: clamp(1.85rem, 8vw, 2.45rem); }
  .invite-hero h1,
  .event-story h1 { font-size: clamp(1.9rem, 8.4vw, 2.45rem); }
  .invite-hero .lead,
  .page-hero p,
  .event-story .lede { font-size: 1.05rem; max-width: 38rem; }
  .event-description ul,
  .event-description ol { padding-inline-start: 1.2em; }
  .md-toolbar .btn {
    min-height: 44px;
    padding-inline: .85rem;
  }
  .invite-hero .btn-row { flex-direction: column; align-items: stretch; }
  .invite-hero .btn,
  .sheet .btn-primary,
  .confirm-wrap .btn,
  .confirm-wrap .btn-row .btn,
  .membership-list .btn,
  #membership-list .btn,
  .event-rsvp .btn,
  #add-companion,
  #add-plus-one,
  #remove-plus-one,
  .res-actions .btn,
  .group-bar .btn,
  .rsvp-bar .btn {
    min-height: 48px;
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .rsvp-bar-inner { flex-wrap: wrap; align-items: stretch; }
  .rsvp-bar p { flex: 1 1 12rem; }
  .rsvp-bar .btn { flex: 1 1 9rem; width: auto; }

  .btn,
  .btn-small,
  .segment a,
  .site-footer a,
  .text-link,
  .bp-tabs a,
  .bp-home,
  .bp-drop > summary,
  .bp-pop > summary,
  .bp-actions a,
  .bp-actions button,
  .bp-modal-x,
  .cal-head .btn {
    min-height: 44px;
    min-width: 44px;
  }
  .btn, .btn-small, .nav-toggle, .bp-modal-x, .bp-home, .bp-drop > summary, .bp-pop > summary {
    align-items: center;
    justify-content: center;
  }
  .btn, .btn-small, .bp-modal-x, .bp-home, .bp-drop > summary, .bp-pop > summary {
    display: inline-flex;
  }
  .site-footer a { display: inline-flex; align-items: center; }
  .section-head.row { flex-wrap: wrap; align-items: flex-start; }
  .text-link { white-space: normal; }

  input,
  select,
  textarea,
  .bp-search input,
  .filters input,
  .filters select,
  .bulk-bar select,
  .copy-link,
  body.admin input,
  body.admin select,
  body.admin textarea,
  body.admin .filters input,
  body.admin .filters select,
  body.admin .filters label input,
  body.admin .filters label select,
  body.admin .bp-search input,
  form.stack input,
  form.stack select,
  form.stack textarea,
  td.actions input {
    font-size: 16px;
    line-height: 1.4;
  }
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    min-height: 48px;
  }
  .checks label,
  .inline-check,
  .chip,
  .marker-choice {
    min-height: 44px;
    align-items: center;
  }
  .inline-check { padding: .35rem 0; }
  input[type="checkbox"],
  input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
  }
  .marker-icon {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .grid-2,
  .grid-3,
  .form-row,
  .form-row.three,
  .variant-row,
  .pos-grid,
  .bp-settings-grid {
    grid-template-columns: 1fr;
  }
  .stats > div { min-width: 0; flex: 1 1 8.5rem; }
  .filters input,
  .copy-link,
  td.actions input,
  .bp-search { width: 100%; max-width: 100%; }

  .meta-list { flex-direction: column; align-items: stretch; }
  .meta-list li {
    width: 100%;
    border-radius: var(--radius-sm);
    text-align: left;
  }
  .share-row .btn { flex: 1 1 100%; min-height: 44px; }

  .cal-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .45rem;
  }
  .cal-head h1 { font-size: clamp(1.35rem, 5.6vw, 1.8rem); }
  .cal-agenda a { font-size: 1.05rem; }
  .cal-agenda li { overflow-wrap: anywhere; }

  .res { flex-direction: column; align-items: stretch; }
  .res-actions { width: 100%; }
  .plan-table,
  .shop-table {
    display: block;
    min-width: 0;
  }
  .plan-table thead,
  .shop-table thead { display: none; }
  .plan-table tr,
  .shop-table tr {
    display: grid;
    gap: .15rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
  }
  .plan-table td,
  .shop-table td {
    display: block;
    border: 0;
    padding: .1rem 0;
    font-size: 1rem;
    white-space: normal;
  }

  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap:has(.bp-stack) {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .bp-stack {
    display: block;
    min-width: 0;
  }
  .bp-stack thead { display: none; }
  .bp-stack tbody { display: grid; gap: .7rem; }
  .bp-stack tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: .85rem .9rem .7rem;
  }
  .bp-stack td {
    display: grid;
    grid-template-columns: minmax(6.5rem, 38%) minmax(0, 1fr);
    align-items: start;
    gap: .35rem .75rem;
    border: 0;
    padding: .4rem 0;
    font-size: 1rem;
    line-height: 1.4;
    text-align: right;
    white-space: normal;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .bp-stack td > * { min-width: 0; max-width: 100%; }
  .bp-stack td::before {
    content: attr(data-label);
    text-align: left;
    font-weight: 700;
    color: var(--muted);
    overflow-wrap: break-word;
  }
  .bp-stack td.bp-offer,
  .bp-stack td[data-label="Check-in"] {
    display: block;
    text-align: left;
  }
  .bp-stack td.bp-offer::before,
  .bp-stack td:not([data-label])::before,
  .bp-stack td[data-label=""]::before { content: none; }
  .bp-stack td.bp-offer {
    padding-bottom: .55rem;
    margin-bottom: .15rem;
    border-bottom: 1px solid var(--line);
  }
  .bp-stack td.bp-offer strong,
  .bp-stack td.bp-offer a { font-size: 1.12rem; }
  .bp-stack td[data-label="Check-in"] .btn,
  .bp-stack td[data-label="Check-in"] .bp-tool-link,
  .bp-stack .bp-inline-form .btn {
    width: 100%;
    min-height: 44px;
    margin-top: .35rem;
  }
  .bp-stack td[data-label="Select"] { min-height: 44px; align-items: center; }
  .bp-stack td[data-label="Select"] input[type="checkbox"] {
    width: 44px;
    height: 44px;
    justify-self: end;
  }
  .bp-tool-link { padding: .35rem 0; }
  .bp-offer { min-width: 0; }
  .bp-cap { white-space: normal; }
  .bp-table th,
  .bp-table td,
  .bp-offer-meta,
  .bp-status { font-size: 1rem; }
  .bp-fin { min-width: 42rem; }
  .table-wrap .bp-fin th,
  .table-wrap .bp-fin td { font-size: 1rem; }

  .bp-top-inner { flex-wrap: wrap; align-items: center; }
  .bp-top-tools { flex-wrap: wrap; justify-content: flex-end; gap: .35rem; flex: 1 1 auto; }
  .bp-top .bp-global-search {
    flex: 1 1 100%;
    width: 100%;
    order: 5;
    min-height: 48px;
  }
  .bp-search { min-height: 48px; }
  .bp-tabs { max-width: 100%; }
  .bp-tabs a { font-size: 1rem; padding: .55rem .8rem; }
  .bp-record-head { flex-direction: column; align-items: stretch; }
  .bp-record-actions,
  .bp-record .bp-record-actions {
    width: 100%;
    max-width: none;
    justify-items: stretch;
  }
  .bp-record-actions .btn-row { width: 100%; }
  .bp-record-actions .btn { flex: 1 1 9rem; min-height: 44px; }
  .bp-toolbar { align-items: stretch; }
  .bp-toolbar .btn,
  .bp-door-search .btn { min-height: 44px; }
  .bp-door-row { flex-wrap: wrap; align-items: stretch; }
  .bp-door-row form { flex: 1 1 100%; }
  .bp-door-btn { width: 100%; }
  .bp-help {
    min-width: 44px;
    min-height: 44px;
    right: env(safe-area-inset-right);
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .bp-modal {
    padding: 0;
    align-items: end;
  }
  .bp-modal-card,
  .bp-modal-card.is-wide {
    width: 100%;
    max-height: min(92dvh, 100%);
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bp-modal-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
  .bp-kicker,
  .bp-stat-label,
  .bp-panel > summary,
  .bp-user-name { font-size: 1rem; }

  .ticket-wallet { margin-inline: 0; }
  .confirm-wrap .btn-row { flex-direction: column; align-items: stretch; }
}

/* UI review, Dec 2026: Menu first and filled, Log in as a text link, short brand on small phones. */
.brand-short { display: none; }
@media (max-width: 760px) {
  .nav-toggle { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
  .site-header.nav-open .nav-toggle { background: var(--accent-hover); }
  .header-login {
    background: transparent;
    color: var(--accent);
    border: 0;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: .18em;
    padding-inline: .45rem;
  }
  .header-login:hover { color: var(--accent-hover); background: transparent; }
}
@media (max-width: 499px) {
  .brand-full { display: none; }
  .brand-short { display: inline; }
}
