/* Shared layout polish for every page (Roger, 2026-12-01: "make all screens and layouts much better and more user
   friendly and appropriate for the device"). Loaded after Bootstrap and the base styles. */

body { line-height: 1.55; }
.container { max-width: 1200px; }
.container > p, .container > .lead, .card-body > p { max-width: 80ch; }
:focus-visible { outline: 3px solid rgba(46, 107, 79, .45); outline-offset: 2px; }
h1.h4, h2.h4 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); }
.badge { font-weight: 600; letter-spacing: .01em; }

/* Tables: a quiet header row, numbers lined up, and sideways scrolling on narrow screens (layout.js wraps any table
   that isn't already in a .table-responsive). */
.table > thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: #5b6772;
  font-weight: 600; white-space: nowrap; vertical-align: bottom; }
.table-responsive { -webkit-overflow-scrolling: touch; }

/* Long page introductions: one line, tap "More" to read the rest (layout.js, on elements with data-intro). */
.intro-clamp { display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.intro-clamp.open { display: block; -webkit-line-clamp: unset; line-clamp: unset; }
.intro-toggle { border: 0; background: none; padding: 0; color: var(--bs-link-color); font-size: .85rem; }
.intro-toggle:hover { text-decoration: underline; }

/* Phones */
@media (max-width: 575.98px) {
  .container { padding-left: .75rem; padding-right: .75rem; }
  .card-body { padding: .85rem; }
  .card-header { padding: .6rem .85rem; }
  h1, .h1 { font-size: 1.6rem; }
  h2, .h2 { font-size: 1.35rem; }
  /* 16px text in form fields, so phones don't zoom in when a field is tapped */
  .form-control, .form-select, textarea, input[type="text"], input[type="email"], input[type="number"],
  input[type="search"], input[type="password"], input[type="date"], select { font-size: 16px !important; }
  /* The button bar under the menu: one row to swipe sideways, instead of three rows of buttons */
  .quick-actions { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
    margin-left: -.75rem; margin-right: -.75rem; padding: 0 .75rem .2rem; }
  .quick-actions::-webkit-scrollbar { display: none; }
  .quick-actions .btn { flex: 0 0 auto !important; scroll-snap-align: start; }
  .table { font-size: .9rem; }
  .btn-group { flex-wrap: wrap; }
  .modal-dialog { margin: .5rem; }
  .page-head { align-items: flex-start; }
}

/* Touch screens: things big enough to tap */
@media (pointer: coarse) {
  .btn:not(.btn-link), .form-control, .form-select { min-height: 40px; }
  .btn-sm:not(.btn-link), .form-control-sm, .form-select-sm { min-height: 36px; }
  .dropdown-item { padding-top: .6rem; padding-bottom: .6rem; }
  .form-check-input { width: 1.2em; height: 1.2em; }
  .list-group-item-action { padding-top: .75rem; padding-bottom: .75rem; }
}

/* The menu on phones and tablets: roomy rows, and dropdowns that sit inside the dark menu */
@media (max-width: 991.98px) {
  .mcr-nav .navbar-collapse { padding: .4rem 0 .9rem; max-height: calc(100vh - 3.5rem); overflow-y: auto; }
  .mcr-nav .nav-link { padding: .6rem .25rem; }
  .mcr-nav .dropdown-menu { background: rgba(255, 255, 255, .06); border: 0; box-shadow: none; margin: 0 0 .4rem; }
  .mcr-nav .dropdown-item { color: rgba(255, 255, 255, .88); }
  .mcr-nav .dropdown-item:hover, .mcr-nav .dropdown-item:focus { background: rgba(255, 255, 255, .1); color: #fff; }
  .mcr-nav .dropdown-header { color: rgba(255, 255, 255, .55); }
  .mcr-nav .dropdown-divider { border-color: rgba(255, 255, 255, .15); }
}

/* Printing: just the page */
@media print {
  .mcr-nav, .quick-actions, .ticker-box, footer, #msg-toasts, .intro-toggle { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* Tournament cards (Find Tournaments and the lists like it) */
.event-card .event-title { font-size: 1.02rem; text-decoration: none; }
.event-card .event-title:hover { text-decoration: underline; }
.event-card + .event-card { border-top-color: var(--mcr-line, #dde3df); }

/* The swipeable button bar on phones: keep the first button off the screen edge when it snaps */
@media (max-width: 575.98px) { .quick-actions { scroll-padding-inline: .75rem; } }
