/* ==========================================================================
   WBF – People Finder (Offcanvas Optimized) - UNIFIED CSS
   ========================================================================== */

/* --- Tokens --- */
:root{
  --wbf-ink:#111;
  --wbf-muted:#5a6b66;
  --wbf-bg:#fff;
  --wbf-surface:#fff;
  --wbf-green:#0c5241;
  --wbf-accent:#146f84;
  --wbf-border:rgba(0,0,0,.12);
  --wbf-ring:rgba(110, 231, 183, 0.35);
  --radius:12px;
  --shadow:0 4px 20px rgba(0,0,0,.15);
}

/* --- Base - No Scroll --- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--wbf-ink);
  font: 14px/1.5 'Open Sans', system-ui, -apple-system, sans-serif;
  overflow: hidden;
  height: auto;
  min-height: auto;
}

/* --- Reset Bootstrap --- */
.container, .container-fluid, .row, [class^="col-"], [class*=" col-"] {
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
}

.container-fluid.padding {
  padding: 16px;
}

/* ==========================================================================
   DARK GREEN BOX - Contains everything
   ========================================================================== */

.bgblue {
  background: linear-gradient(135deg, #0a1612 0%, #0d1f1a 50%, #0f2318 100%);
  color: #fff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(110, 231, 183, 0.1);
  margin: 0 0 12px 0;
  position: relative;
}

.bgblue::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 183, 0.4), transparent);
}

/* --- Intro text --- */
.bgblue > p:first-of-type {
  color: #a7f3d0 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  margin: 0 0 14px 0 !important;
  text-align: left !important;
  opacity: 1 !important;
  max-width: none !important;
}

/* --- Labels inside box --- */
.bgblue label {
  display: block !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #6ee7b7 !important;
  text-transform: uppercase !important;
  letter-spacing: 1.2px !important;
  margin: 0 0 6px 0 !important;
  padding: 0 !important;
}

/* --- Field containers --- */
.bgblue p[align="left"] {
  margin: 0 0 12px 0 !important;
  text-align: left !important;
  color: #fff !important;
}

.bgblue p[align="left"]:last-of-type {
  margin-bottom: 0 !important;
}

.bgblue p span {
  display: block !important;
  margin-top: 0 !important;
}

.bgblue p br {
  display: none !important;
}

/* --- Inputs inside dark box --- */
.bgblue input[type="text"],
.bgblue select {
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 12px !important;
  background: #fff !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 8px !important;
  color: #1f2937 !important;
  font-family: 'Open Sans', sans-serif !important;
  font-size: 14px !important;
  outline: none !important;
  margin: 0 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

.bgblue select {
  padding-right: 36px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
}

.bgblue input[type="text"]:focus,
.bgblue select:focus {
  border-color: #6ee7b7 !important;
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.25) !important;
}

.bgblue input[type="text"]::placeholder {
  color: #9ca3af !important;
}

/* ==========================================================================
   BUTTONS - Green gradient style
   ========================================================================== */

.row.center,
.center {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  justify-content: stretch !important;
  align-items: stretch !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* PRIMARY BUTTON - All variations */
.bluebutton,
input.bluebutton,
input[type="button"],
input[type="button"].bluebutton,
input[name="Submitquer"],
input[value="NEW SEARCH"],
input[value="Find persons"],
form input.bluebutton,
form input[type="button"],
.container-fluid input.bluebutton,
.container-fluid input[type="button"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  min-width: 0 !important;
  padding: 10px 20px !important;
  background: linear-gradient(135deg, #86efac 0%, #6ee7b7 50%, #5eead4 100%) !important;
  border: none !important;
  border-radius: 8px !important;
  color: #064e3b !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 15px rgba(110, 231, 183, 0.35) !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
  white-space: nowrap !important;
  margin: 0 !important;
  float: none !important;
}

.bluebutton:hover,
input.bluebutton:hover,
input[type="button"]:hover,
input[type="button"].bluebutton:hover,
input[name="Submitquer"]:hover,
input[value="NEW SEARCH"]:hover,
input[value="Find persons"]:hover,
form input.bluebutton:hover,
form input[type="button"]:hover,
.container-fluid input.bluebutton:hover,
.container-fluid input[type="button"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(110, 231, 183, 0.45) !important;
}

/* RESET BUTTON - Ghost style */
input[type="reset"],
input[type="reset"].bluebutton,
input[value="Reset Form"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 1 !important;
  min-width: 0 !important;
  padding: 10px 8px !important;
  background: #fff !important;
  border: 2px solid #e5e7eb !important;
  border-radius: 8px !important;
  color: #4b5563 !important;
  font-family: 'Montserrat', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s !important;
  white-space: nowrap !important;
  margin: 0 !important;
  float: none !important;
}

input[type="reset"]:hover,
input[type="reset"].bluebutton:hover,
input[value="Reset Form"]:hover {
  background: #f9fafb !important;
  border-color: #d1d5db !important;
  transform: translateY(-2px) !important;
}

/* --- Hidden --- */
input[type="hidden"] {
  display: none !important;
}

/* ==========================================================================
   TABLE (for results list)
   ========================================================================== */

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--wbf-surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th, .table td {
  border-bottom: 1px solid var(--wbf-border);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.table th {
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--wbf-green);
  color: #fff;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table a {
  color: var(--wbf-accent);
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

/* --- A11y focus --- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--wbf-ring);
  outline-offset: 2px;
}

/* --- Typography --- */
h3.people-finder-top {
  color: var(--wbf-green);
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
}

/* --- New Search button container --- */
.people-finder-button {
  display: none !important;
}

.people-finder-button + form {
  display: flex !important;
  justify-content: center !important;
  margin-bottom: 16px !important;
}

/* Results page text */
.container-fluid > .row p {
  color: var(--wbf-ink);
  font-size: 14px;
  line-height: 1.6;
}

.container-fluid hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 16px 0;
}

/* Footer text */
.footer-pf p {
  color: var(--wbf-muted);
  font-size: 12px;
  text-align: center;
  margin-top: 16px;
}

/* ==========================================================================
   PERSON DETAIL PAGE - Header, Photo, Results
   ========================================================================== */

/* --- 1) HEADER - Verde scuro solido --- */
.wbf-pf__head,
.wbf-pf--soft .wbf-pf__head {
  background: linear-gradient(135deg, #0a1612 0%, #0d1f1a 50%, #0f2318 100%) !important;
}

/* --- 2) FOTO - 96x130px --- */
.pf-photo,
.pf-summary .pf-photo {
  width: 96px !important;
  height: 130px !important;
  min-width: 96px !important;
  max-width: 96px !important;
  object-fit: cover !important;
}

/* ==========================================================================
   3) RISULTATI SU DUE RIGHE - No scroll orizzontale
   ========================================================================== */

/* Rimuove scroll orizzontale */
.pf-table-wrap {
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Tabella risultati - layout a due righe */
.pf-results,
.pf-results--compact {
  width: 100% !important;
  table-layout: fixed !important;
}

/* Nascondi header della tabella */
.pf-results thead {
  display: none !important;
}

/* Ogni TR diventa un blocco con due righe */
.pf-results tbody tr {
  display: block !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.pf-results tbody tr:last-child {
  border-bottom: none !important;
}

/* Tutte le celle diventano inline o block */
.pf-results tbody td {
  display: inline !important;
  padding: 0 !important;
  border: none !important;
  vertical-align: middle !important;
}

/* === PRIMA RIGA: Anno, Nome Evento, Rank === */

/* Anno */
.pf-results tbody td.year {
  display: inline-block !important;
  font-weight: 700 !important;
  color: #0c5241 !important;
  min-width: 45px !important;
  margin-right: 8px !important;
}

/* Evento - solo il nome principale sulla prima riga */
.pf-results tbody td.event {
  display: inline !important;
}

.pf-results tbody td.event .cell-main {
  display: inline !important;
  font-weight: 600 !important;
}

.pf-results tbody td.event .cell-main a {
  color: #111 !important;
  text-decoration: none !important;
}

.pf-results tbody td.event .cell-main a:hover {
  color: #0c5241 !important;
  text-decoration: underline !important;
}

/* Sottotitolo evento (luogo, tipo) - nascosto */
.pf-results tbody td.event .cell-sub {
  display: none !important;
}

/* Rank */
.pf-results tbody td.rank {
  display: inline-block !important;
  margin-left: 8px !important;
}

.pf-results tbody td.rank .rk {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  height: 24px !important;
  padding: 0 6px !important;
  background: #f3f4f6 !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  color: #374151 !important;
}

/* Medaglie */
.pf-results tbody td.rank .rk.r1 {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #92400e !important;
}

.pf-results tbody td.rank .rk.r2 {
  background: linear-gradient(135deg, #e5e7eb, #d1d5db) !important;
  color: #374151 !important;
}

.pf-results tbody td.rank .rk.r3 {
  background: linear-gradient(135deg, #fed7aa, #fdba74) !important;
  color: #9a3412 !important;
}

/* === SECONDA RIGA: Partner/Team === */

/* Team/Partner - va a capo */
.pf-results tbody td.team {
  display: block !important;
  margin-top: 4px !important;
  padding-left: 53px !important;
}

.pf-results tbody td.team::before {
  content: "↳ " !important;
  color: #9ca3af !important;
  font-size: 12px !important;
}

.pf-results tbody td.team .cell-main {
  display: inline !important;
  font-size: 13px !important;
  color: #6b7280 !important;
}

.pf-results tbody td.team .cell-main a {
  color: #0c5241 !important;
  text-decoration: none !important;
}

.pf-results tbody td.team .cell-main a:hover {
  text-decoration: underline !important;
}

.pf-results tbody td.team .cell-sub {
  display: none !important;
}