/* ─── Graisana CMS – style.css ─────────────────────────────────────────────── */

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--a, #009246); border-radius: 2px; }

/* ── Custom Cursor ── */
#cur { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; }
#cdot { width: 5px; height: 5px; background: var(--a, #009246); border-radius: 50%; position: absolute; transform: translate(-50%,-50%); }
#cring { width: 28px; height: 28px; border: 1.5px solid rgba(0,146,70,.45); border-radius: 50%; position: absolute; transform: translate(-50%,-50%); transition: width .3s cubic-bezier(.16,1,.3,1), height .3s cubic-bezier(.16,1,.3,1), border-color .25s; }
body:has(a:hover) #cring, body:has(button:hover) #cring { width: 50px; height: 50px; border-color: var(--a, #009246); }
@media (pointer: coarse) { body { cursor: auto !important; } #cur { display: none; } }

/* ── Scroll reveal ── */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.rv.on { opacity: 1; transform: translateY(0); }
.d1{transition-delay:.08s} .d2{transition-delay:.18s} .d3{transition-delay:.28s} .d4{transition-delay:.38s}

/* ── Subtle grain texture ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  opacity: .18; pointer-events: none; z-index: 0;
}

/* ── Hero ── */
.hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  z-index: 1; pointer-events: none;
}

/* Compass rose */
.hero-compass { position: absolute; right: -3rem; top: 50%; transform: translateY(-50%); width: 380px; height: 380px; opacity: .04; z-index: 1; pointer-events: none; }
@keyframes compass-rot { to { transform: rotate(360deg); } }
.hero-compass svg { animation: compass-rot 90s linear infinite; transform-origin: center; width: 100%; height: 100%; }
.hero-coords { position: absolute; bottom: 3rem; right: 2rem; font-family: var(--fm); font-size: .62rem; letter-spacing: .2em; color: rgba(255,255,255,.18); z-index: 2; }

/* ── Wave separator ── */
.wave-sep { display: block; width: 100%; overflow: hidden; line-height: 0; margin-bottom: -1px; }
.wave-sep svg { display: block; width: 100%; }

/* ── Button enhancements (safe - don't touch .card) ── */
.btn-primary {
  position: relative; overflow: hidden;
}
.btn-primary::before {
  content: ''; position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transition: left .5s;
}
.btn-primary:hover::before { left: 140%; }

/* ── Nav active ── */
.nav-links a.active { background: rgba(0,146,70,.12) !important; color: var(--a) !important; }
.nav-links a:hover { background: rgba(0,146,70,.08) !important; color: var(--a) !important; }

/* ── Page header accent ── */
.page-header { position: relative; }
.page-header::before {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 3rem; height: 2px; background: var(--a);
}

/* ── Footer top border ── */
footer { position: relative; }
footer::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--a), var(--a2), var(--a), transparent);
  opacity: .4;
}

/* ── Marquee dot ── */
.mqi .dot { background: var(--a) !important; box-shadow: 0 0 5px rgba(0,146,70,.5); }

/* ── Photo gallery zoom ── */
.album-cover img { transition: transform .6s cubic-bezier(.16,1,.3,1); }
.album-card:hover .album-cover img { transform: scale(1.06); }
.album-card { transition: transform .3s, border-color .3s, box-shadow .3s !important; }
.album-card:hover { transform: translateY(-4px) !important; border-color: rgba(0,146,70,.35) !important; box-shadow: 0 12px 32px rgba(0,0,0,.3) !important; }
.photo-item { transition: box-shadow .3s !important; }
.photo-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.4) !important; }
.photo-item img { transition: transform .4s cubic-bezier(.16,1,.3,1) !important; }
.photo-item:hover img { transform: scale(1.08) !important; }

/* ── Classifiche card year ── */
.cl-card-year .badge { background: rgba(0,146,70,.1) !important; color: var(--a) !important; border-color: rgba(0,146,70,.22) !important; }

/* ── Admin bar ── */
.admin-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000; background: rgba(5,14,8,.97); border-top: 1px solid rgba(0,146,70,.3); display: flex; align-items: center; justify-content: space-between; padding: .5rem 2rem; font-size: .72rem; font-family: var(--fm, monospace); color: var(--a, #009246); }
.ab-links { display: flex; gap: 1rem; }
.ab-links a { color: rgba(255,255,255,.5); text-decoration: none; transition: color .2s; }
.ab-links a:hover { color: var(--a, #009246); }

/* ── Photogallery Lightbox ── */
#lb { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
#lb[hidden] { display: none; }
#lb-backdrop { position: absolute; inset: 0; background: rgba(5,14,8,.97); backdrop-filter: blur(16px); }
#lb-box { position: relative; z-index: 1; width: min(96vw,1100px); max-height: 94vh; display: flex; flex-direction: column; background: var(--bg2,#081510); border: 1px solid rgba(0,146,70,.2); border-radius: 8px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.6); }
#lb-header { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.2rem; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
#lb-title { font-size: 1rem; font-weight: 500; color: #fff; font-family: var(--fd); }
#lb-counter { font-family: var(--fm,monospace); font-size: .65rem; color: var(--gm); letter-spacing: .15em; }
#lb-close { background: none; border: 1px solid rgba(255,255,255,.12); color: #aaa; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: .9rem; display: flex; align-items: center; justify-content: center; transition: border-color .2s,color .2s; }
#lb-close:hover { border-color: var(--a); color: var(--a); }
#lb-stage { flex: 1; min-height: 0; display: flex; align-items: center; position: relative; overflow: hidden; }
#lb-img-wrap { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 200px; max-height: 70vh; padding: 1rem 0; overflow: hidden; }
#lb-img { max-width: 100%; max-height: 68vh; object-fit: contain; border-radius: 2px; transition: opacity .2s; display: block; }
#lb-img.loading { opacity: 0; }
#lb-spinner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; pointer-events: none; }
#lb-spinner::after { content: ''; width: 28px; height: 28px; border: 2px solid rgba(0,146,70,.2); border-top-color: var(--a); border-radius: 50%; animation: lb-spin .7s linear infinite; }
#lb-img.loading ~ #lb-spinner, #lb-spinner.show { opacity: 1; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
#lb-prev, #lb-next { flex-shrink: 0; width: 48px; height: 100%; background: none; border: none; color: rgba(255,255,255,.3); font-size: 2.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color .2s,background .2s; }
#lb-prev:hover, #lb-next:hover { color: var(--a); background: rgba(0,146,70,.06); }
#lb-prev:disabled, #lb-next:disabled { opacity: .15; cursor: default; }
#lb-thumbs { display: flex; gap: .4rem; padding: .7rem 1rem; overflow-x: auto; flex-shrink: 0; border-top: 1px solid rgba(255,255,255,.05); scrollbar-width: thin; scrollbar-color: var(--a) transparent; }
#lb-thumbs::-webkit-scrollbar { height: 3px; }
#lb-thumbs::-webkit-scrollbar-thumb { background: var(--a); }
.lb-thumb { width: 56px; height: 56px; flex-shrink: 0; border: 2px solid transparent; border-radius: 3px; overflow: hidden; cursor: pointer; transition: border-color .15s,opacity .15s; opacity: .45; }
.lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb.active { border-color: var(--a); opacity: 1; }
.lb-thumb:hover { opacity: .8; }
#lb-desc { font-size: .78rem; color: var(--gm); margin-top: .2rem; line-height: 1.5; }
#lb-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; color: var(--gm); font-size: .8rem; padding: 3rem; }

/* ── Sponsor card ── */
.sponsor-item { transition: border-color .3s, transform .3s, box-shadow .3s !important; }
.sponsor-item:hover { border-color: rgba(0,146,70,.35) !important; transform: translateY(-3px) !important; box-shadow: 0 8px 24px rgba(0,0,0,.25) !important; }

/* ── Social buttons ── */
.social-btn:hover { border-color: var(--a) !important; color: var(--a) !important; background: rgba(0,146,70,.07) !important; }

/* ── Hstats numbers ── */
.hstat-num { color: var(--a) !important; }

/* ── Stat section background ── */
.hstats { background: rgba(0,146,70,.06) !important; border-color: rgba(0,146,70,.12) !important; }

/* ── Info box ── */
.info-box { border-left-color: var(--a) !important; background: rgba(0,146,70,.05) !important; }
.info-box .label { color: var(--a) !important; }

/* ── Form focus ── */
.iscr-form-wrap input:focus,
.iscr-form-wrap textarea:focus,
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus { border-color: var(--a) !important; box-shadow: 0 0 0 3px rgba(0,146,70,.1) !important; }

/* ── Bando PDF button ── */
.bando-pdf-btn:hover { transform: translateY(-2px) !important; box-shadow: 0 8px 24px rgba(0,146,70,.28) !important; }
