/* ==========================================================================
   GESGolf Gare (layout + modali) — CSS personalizzabile
   ========================================================================== */

:root{
  --gg-accent: #e4872a;      /* arancio bottoni e icone */
  --gg-accent-2: #ff8a00;    /* arancio label “RICERCA GARE” */
  --gg-text: #555;
  --gg-muted: #888;
  --gg-border: #eaeaea;
  --gg-bg: #ffffff;

  --gg-date-bg: #f6e7a6;
  --gg-date-text: #666;

  --gg-radius: 14px;
  --gg-radius-sm: 6px;
  --gg-shadow: 0 15px 50px rgba(0,0,0,.35);

  --gg-font: inherit;
  --gg-title-size: 36px;
  --gg-sub-size: 20px;

  --gg-gap: 18px;
  --gg-pad: 16px;

  --gg-modal-w: 1100px;
  --gg-modal-h: 80vh;

}

/* Wrapper */
.gesgolf-wrap{
  font-family: var(--gg-font);
  max-width: 100%;
  padding: 20px;
}

/* Heading */
.gesgolf-heading{
  color: #EFF2B7;
  font-weight: 800;
  margin-bottom: 10px;
}

/* Filtri */
.gesgolf-filters{
  display:flex;
  gap:14px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.gesgolf-filters label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:14px;
  color: var(--gg-accent-2);
  font-weight: 700;
}

.gesgolf-filters select{
  min-width: 220px;
  padding:10px 12px;
  border:1px solid #ddd;
  border-radius:4px;
  background:#fff;
}

.gesgolf-btn{
  padding:10px 18px;
  border:0;
  background: var(--gg-accent);
  color:#fff;
  border-radius:3px;
  cursor:pointer;
  font-weight:800;
}

.gesgolf-btn:disabled{
  opacity:.6;
  cursor:not-allowed;
}

/* Output */
.gesgolf-output{ margin-top: 18px; }
.gesgolf-loading{ font-style: italic; opacity:.75; }
.gesgolf-error{ color:#b00020; font-weight: 800; }

/* Lista gare */
.gesgolf-list{
  display:flex;
  flex-direction:column;
  gap: var(--gg-gap);
}

.gesgolf-row{
  display:flex;
  gap: var(--gg-gap);
  align-items:stretch;
  padding-bottom: var(--gg-gap);
}

/* Box data */
.gesgolf-datebox{
  width:110px;
  min-width:110px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  border-radius:2px;
  border: 1px solid #eff2b6;
}

.gesgolf-day{
  font-size:52px;
  line-height:1;
  font-weight:800;
  color: #eff2b6;
  margin-top:6px;
}

.gesgolf-dow{
  font-size:26px;
  font-weight:800;
  color: #eff2b6;
  margin-bottom:10px;
  text-transform: lowercase;
}

/* Titolo e descrizione */
.gesgolf-main{ flex:1; }

.gesgolf-title{
  font-size: var(--gg-title-size);
  font-weight:800;
  color: #ffffff;
  margin:0 0 6px 0;
  font-family: var(--e-global-typography-6cdf864-font-family), Sans-serif;
}

.gesgolf-sub{
  font-size: var(--gg-sub-size);
  color: #eff2b6;
  margin:0 0 12px 0;
}

/* Icone/bottoni */
.gesgolf-icons{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  align-items:center;
}

.gesgolf-icoBtn{
  display:inline-flex;
  align-items:center;
  gap:5px;
  border:0;
  background:transparent;
  cursor:pointer;
  color: var(--gg-accent);
  font-size: 18px;
  font-weight:800;
  padding: 10px 10px !important;
}

.gesgolf-icoBtn:hover{ opacity:.85; }
.gesgolf-ico{ font-size:22px; }

/* Modale */
.gesgolf-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:999999;
}

.gesgolf-modal{
  width: min(var(--gg-modal-w), 92vw);
  height: min(var(--gg-modal-h), 800px);
  background: #013220;
  border-radius: var(--gg-radius);
  box-shadow: var(--gg-shadow);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.gesgolf-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom:1px solid #eee;
}

.gesgolf-modal-title{
  font-size: 18px;
  font-weight:900;
  color:#eff2b6;
  margin:0;
}

.gesgolf-modal-close{
  border:0;
  background:#f3f3f3;
  border-radius: 10px;
  padding:8px 10px;
  cursor:pointer;
  font-weight:900;
}

.gesgolf-modal-body{
  padding: var(--gg-pad);
  overflow:auto;
  flex:1;
}

/* Tabelle nel modale */
.gesgolf-modal-body table{
  width:100%;
  border-collapse:collapse;
}

.gesgolf-modal-body th,
.gesgolf-modal-body td{
  border-bottom:1px solid #eee;
  padding:10px 8px;
  text-align:left;
  font-size:14px;
}

.gesgolf-modal-body th{
  background:#003320;
  font-weight:900;
}

/* PDF embed */
.gesgolf-pdf{
  width:100%;
  height:100%;
  min-height:65vh;
  border:0;
}

.gesgolf-openext{
  display:inline-block;
  margin-top:10px;
	color: #fff !important;
}

																	  
.gesgolf-classifiche-top{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:12px;
}

.gesgolf-class-label{
  font-weight:600;
}

.gesgolf-class-select{
  width:100%;
  max-width:420px;
  padding:10px;
  border-radius:10px;
  border:1px solid #ddd;
}

.gesgolf-class-title{
  margin: 10px 0 12px 0;
  font-size: 18px;
  font-weight: 700;
}
																	  
.gesgolf-head-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.gesgolf-counter{
  font-size:14px;
  opacity:.85;
  font-weight:500;
}

.gesgolf-filters button{
  padding: 10px !important;
}


																	  
/* Mobile */
@media (max-width: 760px){
  .gesgolf-row{ flex-direction:column; }
  .gesgolf-datebox{
    width:100%;
    min-width:unset;
    flex-direction:row;
    gap:14px;
    padding:12px;
    justify-content:flex-start;
  }
  .gesgolf-day{ font-size:42px; margin:0; }
  .gesgolf-dow{ font-size:22px; margin:0; }
  .gesgolf-title{ font-size:28px; }
  .gesgolf-sub{ font-size:16px; }
}
	

/* Mobile: pulsanti in linea con swipe orizzontale */
@media (max-width: 930px){
  .gesgolf-icons{
    flex-wrap: nowrap;              /* non andare a capo */
    overflow-x: auto;               /* abilita scroll orizzontale */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* scroll “fluido” iOS */
    gap: 12px;
    padding: 6px 2px 10px;          /* un po' di respiro */
    scroll-snap-type: x mandatory;  /* “snap” facoltativo */
  }

  .gesgolf-icoBtn{
    flex: 0 0 auto;                 /* larghezza naturale, non si restringe */
    white-space: nowrap;            /* testo su una riga */
    scroll-snap-align: start;       /* snap */
  }

  /* opzionale: nasconde la scrollbar (Chrome/Safari) */
  .gesgolf-icons::-webkit-scrollbar{
    height: 0;
  }
	
  /* RIGA PULSANTI */
  .gesgolf-icons{
    position: relative;

    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;

    margin-right: -20px;   /* esce solo a destra */
    padding-right: 20px;   /* mantiene respiro interno */
    padding-bottom: 8px;
  }

  /* Impedisce che vadano a capo */
  .gesgolf-icoBtn{
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Nasconde scrollbar (Safari/Chrome mobile) */
  .gesgolf-icons::-webkit-scrollbar{
    display: none;
  }

}



@media (max-width: 611px){
.gesgolf-filters{
  display: grid;
  gap: 10px;
}

.gesgolf-filters label,
.gesgolf-filters button{
  flex: 1;
}

.gesgolf-filters select{
  width: 100%;
  min-width: 0;
}
	}


.gesgolf-empty{
  font-weight:700;
  opacity:.9;
}

.gesgolf-label-wide{
  min-width: 320px;
  flex: 1 1 320px;
}

.gesgolf-class-page{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.gesgolf-class-main-title{
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
}

.gesgolf-class-update{
  font-size: 16px;
  font-weight: 700;
  opacity: .9;
}

.gesgolf-class-top-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.gesgolf-class-nav{
  border:1px solid rgba(255,255,255,.12);
  padding:14px;
  background-color: #eff2b6;
}

.gesgolf-class-nav-title{
  font-weight:800;
  margin-bottom:10px;
  color: #014522;
}

.gesgolf-class-nav-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.gesgolf-class-nav-link{
  text-decoration:none;
  color: #014522;
}

.gesgolf-class-block-clean{
  margin-top:6px;
}

.gesgolf-class-block-title{
  margin:0 0 12px 0;
  font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    font-family: var(--e-global-typography-6cdf864-font-family), Sans-serif;
}

.gesgolf-table-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}


.gesgolf-clean-table th,
.gesgolf-clean-table td{
  padding: 2px 2px;
    vertical-align: middle;
    background-color: #003320;
    font-size: 12px;
    min-width: 25px;
    width: auto;
    text-align: left;
}

.gesgolf-class-legend{
  margin-top:8px;
  font-style:italic;
  opacity:.9;
}

@media (max-width: 760px){
  .gesgolf-class-main-title{ font-size: 26px; }
  .gesgolf-class-block-title{ font-size: 22px; }
}

.gesgolf-icoLink{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background-color: var(--e-global-color-d3e274b);
    font-family: "Josefin Sans", Sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--e-global-color-4a1e557);
    border-radius: 0px 0px 0px 0px;
}


.gesgolf-class-block-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}

.gesgolf-backtop{
display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 4px;
    text-decoration: none;
    color: #014522;
    background-color: var(--e-global-color-d3e274b);
}

.gesgolf-backtop .dashicons{
  font-size:20px;
  width:20px;
  height:20px;
  line-height:20px;
}

.gesgolf-backtop:hover{
  opacity:.9;
}

.gesgolf-empty{
  font-weight:700;
  opacity:.9;
}

.gesgolf-label-wide{
  min-width: 320px;
  flex: 1 1 320px;
}

.gesgolf-icoLink{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
}

.gesgolf-class-page{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.gesgolf-class-main-title{
  font-size:34px;
  font-weight:800;
  line-height:1.1;
}

.gesgolf-class-update{
  font-size:16px;
  font-weight:700;
  opacity:.9;
}

.gesgolf-class-top-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.gesgolf-class-nav{
  border:1px solid rgba(255,255,255,.12);
  padding:14px;
}

.gesgolf-class-nav-title{
  font-weight:800;
  margin-bottom:10px;
}

.gesgolf-class-nav-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.gesgolf-class-nav-link{
  text-decoration:none;
}

.gesgolf-class-block-clean{
  margin-top:6px;
}

.gesgolf-class-block-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:12px;
}

.gesgolf-class-block-title{
  margin:0;
  font-size:28px;
  font-weight:800;
}

.gesgolf-backtop{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  min-width:42px;
  border-radius:4px;
  text-decoration:none;
  background: var(--gg-accent, #e4872a);
  color:#fff;
}

.gesgolf-backtop .dashicons{
  font-size:20px;
  width:20px;
  height:20px;
  line-height:20px;
}

.gesgolf-backtop:hover{
  opacity:.9;
}

.gesgolf-table-scroll{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  background-color: #003420;
}

.gesgolf-clean-table{
  border-collapse:separate;
  border-spacing:0;
}



.gesgolf-class-legend{
  margin-top:8px;
  font-style:italic;
  opacity:.9;
}

.gesgolf-scorepersona-wrap{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.gesgolf-scorepersona-head{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.gesgolf-scorepersona-title{
  font-size:28px;
  font-weight:800;
  line-height:1.1;
}

.gesgolf-scorepersona-subtitle{
  font-size:16px;
  font-weight:700;
  opacity:.9;
}

.gesgolf-scorepersona-topbar{
  display:flex;
  justify-content:flex-end;
}

.gesgolf-scorepersona-giri{
  min-width:180px;
}

.gesgolf-scorepersona-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

.gesgolf-scorepersona-table{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.gesgolf-scorepersona-table table{
  width:100%;
  border-collapse:collapse;
}

.gesgolf-scorepersona-table th,
.gesgolf-scorepersona-table td{
  padding:10px 8px;
  border-bottom:1px solid rgba(255,255,255,.18);
  text-align:center;
}

.gesgolf-back{
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  padding: 6px 12px;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
}

html{
  scroll-behavior:smooth;
}

@media (max-width: 760px){
  .gesgolf-class-main-title{
    font-size:26px;
  }

  .gesgolf-class-block-title{
    font-size:22px;
  }

  .gesgolf-scorepersona-grid{
    grid-template-columns:1fr;
  }

  .gesgolf-scorepersona-topbar{
    justify-content:flex-start;
  }

  .gesgolf-scorepersona-title{
    font-size:22px;
  }
}

.gesgolf-modal-body td a {color: #eff2b6 !important; }