/*
 * Tema risultatiginnastica — Bootstrap 5.3.
 * Solo personalizzazioni: griglia, spaziature e utility sono quelle di Bootstrap (non ridefinirle qui).
 * Il font delle icone degli attrezzi (gr-*) è in risultatiginnastica.css.
 */
:root {
  --rg-red: #e30613;
  --rg-red-dark: #b8050f;
  --rg-bg-soft: #eef4f7;
  --rg-nav-h: 64px;
  --bs-primary: #e30613;
  --bs-primary-rgb: 227, 6, 19;
  --bs-link-color: #e30613;
  --bs-link-color-rgb: 227, 6, 19;
  --bs-link-hover-color: #b8050f;
  --bs-link-hover-color-rgb: 184, 5, 15;
  --bs-body-font-family: 'PT Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

html { scroll-behavior: smooth; touch-action: manipulation; }
body { padding-top: var(--rg-nav-h); -webkit-font-smoothing: antialiased; }
::selection { background: var(--rg-red); color: #fff; }

h1, h2, h3, h4, h5, h6, .navbar-brand { font-family: 'PT Sans Narrow', sans-serif; font-weight: 700; }
h1 { color: var(--rg-red); font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem); }
a { text-decoration: none; }

/* ---------- Navbar: bianca, rossa dopo lo scroll ---------- */
.rg-navbar {
  min-height: var(--rg-nav-h);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
  transition: background-color .2s linear, box-shadow .2s linear;
}
.rg-navbar .navbar-brand { color: var(--rg-red); text-transform: uppercase; display: flex; align-items: center; gap: .6rem; }
.rg-navbar .navbar-brand img { height: 36px; width: 36px; border-radius: 50%; background: #fff; padding: 2px; }
.rg-navbar .nav-link { font-weight: 600; font-size: .875rem; text-transform: uppercase; color: rgba(0, 0, 0, .8); }
.rg-navbar .nav-link:hover,
.rg-navbar .nav-link.active { color: var(--rg-red); }
.rg-navbar .logo_bn { display: none; }
.rg-navbar.scrolled { background: var(--rg-red); box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.rg-navbar.scrolled .navbar-brand,
.rg-navbar.scrolled .nav-link { color: #fff; }
.rg-navbar.scrolled .logo { display: none; }
.rg-navbar.scrolled .logo_bn { display: inline-block; }
.rg-navbar.scrolled .navbar-toggler { background: #fff; }
@media (max-width: 1199.98px) {
  .rg-navbar .navbar-collapse { padding: .5rem 0 1rem; }
}

/* ---------- Home: elenco gare ---------- */
.rg-home { background: var(--rg-bg-soft); padding: 3rem 0 4rem; }
.rg-home-intro { max-width: 36rem; margin: 0 auto 2.5rem; text-align: center; }
.rg-home-intro h2 { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem); margin-bottom: .5rem; }
.rg-home-intro p { color: #6c757d; margin: 0; }

.rg-event { border: 0; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); transition: transform .15s ease, box-shadow .15s ease; }
.rg-event:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0, 0, 0, .08); }
.rg-event-logo { height: 170px; padding: 1.25rem 1.25rem 0; display: flex; align-items: center; justify-content: center; }
.rg-event-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.rg-event .card-title { font-size: 1.05rem; line-height: 1.3; color: #313437; }
.rg-event .rg-event-dates { color: #7d8285; font-size: .9rem; }
.rg-event .btn { padding-inline: .9rem; }
.rg-event.event-disabled { opacity: .55; }
.rg-event.event-disabled .rg-event-badge { display: inline-block; }
.rg-event-badge { display: none; }

/* ---------- Pagine CMS ---------- */
.rg-page { padding: 2rem 0 3rem; }
.rg-page .breadcrumb { --bs-breadcrumb-divider: '›'; font-size: .9rem; }
.rg-page .content img { max-width: 100%; height: auto; }
.editPageButton { position: fixed; right: 1rem; bottom: 4.5rem; z-index: 1030; }

/* ---------- Footer ---------- */
.rg-footer { background: #1f1f1f; color: #fff; font-size: .8rem; padding: 1.5rem 0; text-align: center; }
.rg-footer h5 { font-size: 1rem; margin-bottom: .5rem; }
.rg-footer a { color: #fff; }
.rg-footer a:hover { color: #ffb3b8; }
.iubenda-embed:not(.iubenda-nostyle) { background: transparent !important; box-shadow: none !important; }

/* ---------- Risultati / ODL (Views/frontend/results.php + js/results.js) ---------- */
.rg-results-head { background: var(--rg-bg-soft); padding: 1.5rem 0 1.75rem; border-bottom: 1px solid #e3eaee; }
.rg-results-head .breadcrumb { --bs-breadcrumb-divider: '›'; font-size: .85rem; margin-bottom: 1rem; }
.rg-results-event { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.rg-results-logo { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: .75rem; padding: .5rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); flex-shrink: 0; }
.rg-eyebrow { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: #7d8285; font-weight: 600; }
.results .pageTitle { font-size: clamp(1.35rem, 1.05rem + 1.1vw, 2rem); line-height: 1.2; margin: .15rem 0 .25rem; }
.rg-results-dates { color: #7d8285; }
.rg-results-filters .form-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; margin-bottom: .3rem; }
@media (max-width: 575.98px) {
  .rg-results-logo { width: 64px; height: 64px; }
  .rg-results-event { gap: .9rem; }
}

.rg-results-body { padding-top: 1.75rem; padding-bottom: 3rem; }

/* select2 con l'aspetto dei campi Bootstrap 5 */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single { height: calc(1.5em + .75rem + 2px); border: var(--bs-border-width) solid var(--bs-border-color); border-radius: var(--bs-border-radius); background: #fff; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: calc(1.5em + .75rem); padding-left: .75rem; padding-right: 2.5rem; color: var(--bs-body-color); }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: #8a9095; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: calc(1.5em + .75rem); right: .5rem; }
.select2-container--default .select2-selection--single .select2-selection__clear { margin-right: .25rem; font-size: 1.1rem; color: #8a9095; }
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #f1838a; box-shadow: 0 0 0 .25rem rgba(227, 6, 19, .15); }
.select2-dropdown { border-color: var(--bs-border-color); border-radius: var(--bs-border-radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .1); overflow: hidden; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--rg-red); }
.select2-container--default .select2-search--dropdown .select2-search__field { border-radius: var(--bs-border-radius); padding: .35rem .5rem; }

/* schede delle gare */
.rg-comp {
  display: flex; align-items: center; gap: .85rem; height: 100%;
  padding: .85rem 1rem; background: #fff; color: #313437;
  border: 1px solid #e6ebee; border-left: 4px solid var(--rg-red); border-radius: .6rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.rg-comp:hover, .rg-comp:focus-visible { color: #313437; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, .08); border-color: #f1b4b8; border-left-color: var(--rg-red); }
.rg-comp-icon { width: 2.6rem; height: 2.6rem; flex-shrink: 0; border-radius: 50%; background: #fdecee; color: var(--rg-red); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.rg-comp-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.rg-comp-cat { font-family: 'PT Sans Narrow', sans-serif; font-weight: 700; font-size: 1.05rem; }
.rg-comp-title { font-size: .82rem; color: #6c757d; }
.rg-comp-type { align-self: flex-start; font-size: .7rem; font-weight: 700; color: #6c757d; background: #f1f3f5; border-radius: 1rem; padding: .1rem .5rem; }
.rg-comp.absolute { border-left-color: #b8860b; }

/* gara aperta */
.rg-comp-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.rg-comp-head .selectCompetition { font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); margin: 0; color: #313437; }
.rg-tabs { --bs-nav-underline-link-active-color: var(--rg-red); --bs-nav-link-color: #6c757d; --bs-nav-link-hover-color: var(--rg-red); --bs-nav-underline-gap: 1.5rem; margin-bottom: 1rem; font-weight: 600; }
.rg-results-card { border: 0; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.rg-results-card .card-body { padding: .75rem 1rem 1rem; }
@media (max-width: 575.98px) { .rg-results-card .card-body { padding: .5rem; } }

/* tabelle (bootstrap-table) */
.rg-results-card .bootstrap-table .fixed-table-toolbar { padding-bottom: .5rem; }
.rg-results-card .bootstrap-table .fixed-table-toolbar .search { width: min(100%, 20rem); }
.rg-results-card .bootstrap-table .fixed-table-container { border: 0; }
.rg-results-card .fixed-table-body { overflow-x: auto; }
.rg-results-card .table { margin-bottom: 0; font-size: .92rem; }
.rg-results-card .table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; font-weight: 600; border-bottom-width: 1px; white-space: nowrap; }
.rg-results-card .table > tbody td { padding-top: .6rem; padding-bottom: .6rem; }
.rg-results-card .table small { color: #7d8285; }

.rg-pos { display: inline-flex; align-items: center; justify-content: center; min-width: 2rem; height: 2rem; border-radius: 50%; font-weight: 700; background: #f1f3f5; color: #495057; }
.rg-pos-1 { background: #f6d365; color: #5c4400; }
.rg-pos-2 { background: #dfe3e8; color: #3d4349; }
.rg-pos-3 { background: #e8b88f; color: #5a3212; }
.rg-points { font-weight: 700; color: var(--rg-red); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rg-athlete { display: flex; align-items: center; gap: .75rem; min-width: 11rem; }
.rg-athlete-name { flex: 1; min-width: 0; }
.rg-athlete .athlete { font-weight: 700; }
.rg-athlete .athleteTool { font-size: 1.4rem; color: #adb5bd; }
@media (max-width: 767.98px) { .rg-athlete .athleteTool { display: none; } }
.text-bold { font-weight: 700; }


.eventLogo { min-height: 160px; }
#forms-login .btn { text-align: center !important; }
