/* ==========================================================================
   Storico Consigli — scoped .lp-storico. Report sobrio, monocromatico.
   Caricato SOLO su page-storico.php (da functions.php).
   ========================================================================== */

/* Neutralizzatore Woodmart (scoped al template; footer NON nascosto qui) */
body.page-template-page-storico .wd-page-title,
body.page-template-page-storico .page-header,
body.page-template-page-storico .main-page-title,
body.page-template-page-storico .title-wrapper,
body.page-template-page-storico .woodmart-breadcrumbs,
body.page-template-page-storico .wd-breadcrumbs,
body.page-template-page-storico nav.woocommerce-breadcrumb{display:none!important;}
body.page-template-page-storico .content-area,
body.page-template-page-storico .site-content,
body.page-template-page-storico .wd-page-content{padding-top:0!important;padding-bottom:0!important;}
body.page-template-page-storico .wd-content-layout{padding-block:0!important;max-width:none!important;}

.lp-storico{
  --bg:#141414; --panel:#1b1b1f; --panel2:#17171a; --line:rgba(255,255,255,.09); --line2:rgba(255,255,255,.05);
  --text:#E7E9EC; --muted:#9aa0aa; --muted2:#c2c6cc; --title:wheat; --accent:#b9975b;
  --win:#79b295; --lose:#d59178;
  --serif:Georgia,"Iowan Old Style","Times New Roman",Times,serif;
  --sans:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,"SF Mono",Consolas,monospace;
  --s1:8px; --s2:16px; --s3:24px; --s4:32px; --s5:48px; --maxw:1080px; --r:12px;
  width:100vw; margin-left:calc(50% - 50vw); margin-right:calc(50% - 50vw);
  background:var(--bg); color:var(--text); font-family:var(--sans); -webkit-font-smoothing:antialiased;
}
.lp-storico *,.lp-storico *::before,.lp-storico *::after{box-sizing:border-box;}
.lp-storico .lp-wrap{max-width:var(--maxw); margin:0 auto; padding:var(--s5) var(--s3);}
.lp-storico h1,.lp-storico h2,.lp-storico h3{font-family:var(--serif); font-weight:600; color:var(--title); line-height:1.22; margin:0; text-wrap:balance;}
.lp-storico h1{font-size:clamp(1.6rem,4vw,2.25rem); margin-bottom:var(--s2);}
.lp-storico h2{font-size:1.18rem; margin:var(--s4) 0 var(--s2);}
.lp-storico p{color:var(--muted2); line-height:1.65; margin:0 0 var(--s2);}
.lp-storico a{color:var(--accent); text-decoration:none;}
.lp-storico a:hover{text-decoration:underline;}
.lp-storico a:focus-visible,.lp-storico button:focus-visible,.lp-storico select:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:6px;}

/* 2 · Contesto */
.lp-storico .lp-context{border-left:2px solid var(--line); padding-left:var(--s2); margin:0 0 var(--s4);}
.lp-storico .lp-context p{margin:0 0 var(--s2);}
.lp-storico .lp-context dl{display:grid; grid-template-columns:1fr; gap:2px var(--s3); margin:0;}
.lp-storico .lp-context dt{color:var(--muted); font-size:.74rem; text-transform:uppercase; letter-spacing:.05em;}
.lp-storico .lp-context dd{margin:0 0 12px; color:var(--text); font-size:.95rem;}
@media(min-width:640px){ .lp-storico .lp-context dl{grid-template-columns:repeat(2,1fr);} }

/* 3 · Riepilogo numerico — stesso peso visivo per tutti (incluso ROI) */
.lp-storico .lp-cards{display:grid; grid-template-columns:repeat(2,1fr); gap:var(--s2); margin:0 0 var(--s4);}
@media(min-width:760px){ .lp-storico .lp-cards{grid-template-columns:repeat(4,1fr);} }
.lp-storico .lp-metric{background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:16px 18px;}
.lp-storico .lp-metric .v{font-family:var(--mono); font-size:1.2rem; color:var(--text); line-height:1.1;}
.lp-storico .lp-metric .k{margin-top:8px; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted);}

/* 4 · Nota metodologica */
.lp-storico .lp-method{background:var(--panel2); border:1px solid var(--line); border-radius:var(--r); padding:20px var(--s3); margin:0 0 var(--s4);}
.lp-storico .lp-method h2{margin:0 0 var(--s2);}
.lp-storico .lp-method ul{margin:0; padding-left:18px; color:var(--muted2);}
.lp-storico .lp-method li{margin:7px 0; line-height:1.55;}

/* 5 · Discontinuità */
.lp-storico .lp-break{border-top:1px dashed var(--line); border-bottom:1px dashed var(--line); padding:var(--s3) var(--s2); margin:0 0 var(--s4); text-align:center;}
.lp-storico .lp-break .tag{display:inline-block; font-size:.72rem; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); border:1px solid var(--line); border-radius:999px; padding:5px 12px; margin-bottom:12px;}
.lp-storico .lp-break p{max-width:62ch; margin:0 auto; color:var(--muted2);}

/* 6 · Grafico */
.lp-storico .lp-chart{border:1px solid var(--line); border-radius:var(--r); padding:16px; margin:0 0 var(--s4); background:var(--panel);}
.lp-storico .lp-chart svg{width:100%; height:auto; display:block;}
.lp-storico .lp-chart .ln{fill:none; stroke:var(--accent); stroke-width:2; stroke-linejoin:round; stroke-linecap:round;}
.lp-storico .lp-chart .ar{fill:var(--accent); opacity:.08;}
.lp-storico .lp-chart .zero{stroke:var(--line); stroke-width:1; stroke-dasharray:3 3;}
.lp-storico .lp-chart .lbl{fill:var(--muted); font:11px/1 var(--mono);}
.lp-storico .lp-chart figcaption{margin:10px 0 0; font-size:.8rem; color:var(--muted);}

/* 7 · Filtri + tabella */
.lp-storico .lp-filters{display:flex; flex-wrap:wrap; gap:var(--s2); align-items:end; margin:0 0 var(--s2);}
.lp-storico .lp-filters label{display:flex; flex-direction:column; gap:5px; font-size:.76rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted);}
.lp-storico .lp-filters select{background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:8px; padding:9px 11px; font-size:.9rem; min-width:170px; font-family:inherit;}
.lp-storico .lp-count{margin-left:auto; align-self:center; font-size:.82rem; color:var(--muted);}

.lp-storico .lp-tablewrap{overflow:auto; max-height:560px; border:1px solid var(--line); border-radius:var(--r); -webkit-overflow-scrolling:touch;}
.lp-storico table{width:100%; border-collapse:separate; border-spacing:0; font-size:.9rem; min-width:700px;}
.lp-storico thead th{position:sticky; top:0; z-index:2; background:var(--panel2); color:var(--muted); text-align:left; font-weight:600; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; padding:12px 14px; border-bottom:1px solid var(--line); white-space:nowrap;}
.lp-storico tbody td{padding:11px 14px; border-bottom:1px solid var(--line2); color:var(--muted2); white-space:nowrap;}
.lp-storico tbody tr:nth-child(even) td{background:rgba(255,255,255,.018);}
.lp-storico tbody tr:last-child td{border-bottom:0;}
/* prima colonna fissa in scroll orizzontale (mobile), non compressa */
.lp-storico th:first-child,.lp-storico td:first-child{position:sticky; left:0; z-index:1;}
.lp-storico tbody td:first-child{background:var(--panel);}
.lp-storico tbody tr:nth-child(even) td:first-child{background:#1f1f24;}
.lp-storico thead th:first-child{z-index:3;}
/* esito discreto ma le perdite ben visibili */
.lp-storico .lp-out{display:inline-flex; align-items:center; gap:8px; font-weight:600; color:var(--muted2);}
.lp-storico .lp-out .dot{width:9px; height:9px; border-radius:50%; flex:0 0 auto;}
.lp-storico .lp-out--win .dot{background:var(--win);}
.lp-storico .lp-out--lose{color:var(--text);}
.lp-storico .lp-out--lose .dot{background:var(--lose);}
.lp-storico .lp-out--neu .dot{background:var(--muted);}

.lp-storico .lp-more{display:inline-flex; margin:var(--s2) 0 0; background:transparent; color:var(--text); border:1px solid var(--line); border-radius:9px; padding:10px 18px; font-size:.9rem; cursor:pointer; font-family:inherit;}
.lp-storico .lp-more:hover{border-color:var(--accent);}

/* 8-9 · Chiusura + legale */
.lp-storico .lp-close{margin:var(--s5) 0 0;}
.lp-storico .lp-close a{display:inline-flex; border:1px solid var(--line); border-radius:9px; padding:12px 22px; color:var(--text); font-weight:600;}
.lp-storico .lp-close a:hover{border-color:var(--accent); text-decoration:none;}
.lp-storico .lp-legal{margin-top:var(--s4); padding-top:var(--s2); border-top:1px solid var(--line2); font-size:.82rem; color:var(--muted); line-height:1.6;}
