/* ============================================================
   BRONX CONNECTION RP — Regolamento
   Layout documentazione: barra alta + 3 colonne
   Usa le variabili di style.css (--cyan, --panel, --line...)
   ============================================================ */

:root {
  --rg-top:      64px;
  --rg-side:     300px;
  --rg-toc:      248px;
  --rg-gap:      40px;
}

.rgbody {
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(63,246,246,.07), transparent 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(224,69,154,.06), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
.rgbody::after { opacity: .32; }

/* ─────────────────────────  BARRA ALTA  ───────────────────────── */
.rgtop {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--rg-top);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 18px;
  padding-inline: 20px;
  background: rgba(5, 8, 15, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.rgtop__burger {
  display: none;
  font-size: 1.35rem;
  color: var(--cyan);
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.rgtop__brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rgtop__brand img { width: 30px; height: 30px; border-radius: 8px; }
.rgtop__brand span {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .08em;
  font-size: .98rem;
}
.rgtop__brand span b { color: var(--cyan); }
.rgtop__brand em {
  font-style: normal;
  font-size: .68rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid var(--line);
}

/* ricerca */
.rgsearch {
  position: relative;
  flex: 1;
  max-width: 480px;
  margin-inline: auto;
  display: flex;
  align-items: center;
}
.rgsearch svg {
  position: absolute; left: 13px;
  width: 17px; height: 17px;
  color: var(--muted-2);
  pointer-events: none;
}
.rgsearch input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 40px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.rgsearch input::placeholder { color: var(--muted-2); }
.rgsearch input:focus {
  border-color: rgba(63,246,246,.45);
  box-shadow: 0 0 0 3px rgba(63,246,246,.08);
}
.rgsearch kbd {
  position: absolute; right: 12px;
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 7px;
  pointer-events: none;
}

.rgtop__links { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.rgtop__links a {
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  transition: color .18s;
}
.rgtop__links a:hover { color: var(--text); }
.rgtop__dc {
  color: var(--bg) !important;
  background: var(--cyan);
  padding: 8px 16px;
  border-radius: 9px;
  font-weight: 700;
}
.rgtop__dc:hover { box-shadow: var(--glow-cyan); }

/* barra di avanzamento lettura */
.rgprogress {
  position: fixed;
  top: var(--rg-top); left: 0;
  height: 2px; width: 0;
  background: var(--sunset);
  z-index: 61;
  transition: width .08s linear;
}

/* ─────────────────────────  GRIGLIA  ───────────────────────── */
.rgwrap {
  display: grid;
  grid-template-columns: var(--rg-side) minmax(0, 1fr) var(--rg-toc);
  gap: 0 var(--rg-gap);
  max-width: 1560px;
  margin-inline: auto;
  padding-top: var(--rg-top);
  padding-inline: 24px;
}

/* ─────────────────────────  SIDEBAR  ───────────────────────── */
.rgside { position: relative; }
.rgside__inner {
  position: sticky;
  top: calc(var(--rg-top) + 20px);
  max-height: calc(100vh - var(--rg-top) - 30px);
  overflow-y: auto;
  padding: 22px 14px 30px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(63,246,246,.25) transparent;
}
.rgside__inner::-webkit-scrollbar { width: 6px; }
.rgside__inner::-webkit-scrollbar-thumb { background: rgba(63,246,246,.22); border-radius: 3px; }

.rgside__head { margin-bottom: 16px; }
.rgside__head p { font-size: .82rem; color: var(--muted-2); margin-top: 6px; }

.rgside__filter {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  margin-bottom: 18px;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  outline: none;
}
.rgside__filter:focus { border-color: rgba(63,246,246,.4); }
.rgside__filter::placeholder { color: var(--muted-2); }

.rggroup { margin-bottom: 4px; }
.rggroup__head {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 9px;
  text-align: left;
  transition: background .16s;
}
.rggroup__head:hover { background: rgba(255,255,255,.04); }
.rggroup__ico { font-size: .95rem; line-height: 1; }
.rggroup__title {
  flex: 1;
  font-family: var(--font-display);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
}
.rggroup__chev {
  color: var(--muted-2);
  font-size: 1.1rem;
  transition: transform .2s;
}
.rggroup.is-open .rggroup__chev { transform: rotate(90deg); color: var(--cyan); }

.rggroup__items {
  display: none;
  margin: 2px 0 8px;
  padding-left: 19px;
  border-left: 1px solid var(--line-soft);
}
.rggroup.is-open .rggroup__items { display: block; }

.rgitem {
  display: block;
  position: relative;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: .95rem;
  line-height: 1.35;
  color: var(--muted);
  transition: color .16s, background .16s;
}
.rgitem:hover { color: var(--text); background: rgba(255,255,255,.035); }
.rgitem.is-active {
  color: var(--cyan);
  background: rgba(63,246,246,.07);
  font-weight: 600;
}
.rgitem.is-active::before {
  content: "";
  position: absolute;
  left: -20px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 17px;
  background: var(--cyan);
  border-radius: 2px;
}

.rgnav__empty { padding: 14px 10px; font-size: .9rem; color: var(--muted-2); }
.rgside__foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.rgside__foot .btn { width: 100%; justify-content: center; }

.rgscrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 49;
}

/* ─────────────────────────  CONTENUTO  ───────────────────────── */
.rgmain {
  min-width: 0;
  padding: 34px 0 60px;
}

.rgcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: .84rem;
  color: var(--muted-2);
  margin-bottom: 18px;
}
.rgcrumb a { color: var(--muted); transition: color .16s; }
.rgcrumb a:hover { color: var(--cyan); }
.rgcrumb i { font-style: normal; opacity: .45; }
.rgcrumb span { color: var(--muted-2); }

.rgtitle {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.6rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -.005em;
  text-transform: uppercase;
  background: linear-gradient(100deg, #fff 20%, var(--cyan) 115%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rglead {
  margin-top: 14px;
  font-size: 1.13rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 74ch;
}

.rgmeta {
  margin-top: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
  font-size: .82rem;
  color: var(--muted-2);
}

/* --- corpo del regolamento --- */
.rgcontent { padding-top: 12px; max-width: 82ch; }
.rgcontent p { margin: 15px 0; color: #d6e1ef; line-height: 1.72; }

.rgh {
  position: relative;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .01em;
  scroll-margin-top: calc(var(--rg-top) + 20px);
}
.rgh--1 {
  margin: 46px 0 6px;
  padding-bottom: 12px;
  font-size: 1.42rem;
  text-transform: uppercase;
  color: #fff;
  border-bottom: 1px solid var(--line);
}
.rgh--1::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 54px; height: 2px;
  background: var(--sunset);
}
.rgh--2 { margin: 34px 0 4px; font-size: 1.12rem; color: var(--cyan); }
.rgh--3 { margin: 26px 0 2px; font-size: .98rem; color: #cfe8ee; text-transform: uppercase; letter-spacing: .06em; }

.rgh__link {
  position: absolute;
  left: -22px;
  color: var(--cyan);
  opacity: 0;
  font-weight: 400;
  transition: opacity .16s;
}
.rgh:hover .rgh__link { opacity: .55; }

.rglist { margin: 14px 0 14px 4px; padding-left: 22px; }
.rglist li { margin: 7px 0; color: #d6e1ef; line-height: 1.65; }
.rglist ul, .rglist ol { margin: 7px 0 7px 2px; }
ul.rglist { list-style: none; }
ul.rglist > li { position: relative; padding-left: 4px; }
ul.rglist > li::before {
  content: "";
  position: absolute;
  left: -15px; top: .68em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: .8;
}
ul.rglist ul.rglist > li::before { background: var(--muted-2); }
ol.rglist li::marker { color: var(--cyan); font-weight: 700; }

.rgcontent strong { color: #fff; font-weight: 700; }
.rgcontent em { color: #c6d4e6; }
.rgcontent a { color: var(--cyan); border-bottom: 1px solid rgba(63,246,246,.3); }
.rgcontent a:hover { border-bottom-color: var(--cyan); }

.rgcontent mark {
  background: rgba(63,246,246,.13);
  color: #b9fbfb;
  padding: 1px 6px;
  border-radius: 5px;
  font-weight: 600;
}
.rgcontent code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .87em;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line-soft);
  color: #9beef0;
  padding: 1px 6px;
  border-radius: 5px;
}

.rgsep { margin: 34px 0; border: none; height: 1px; background: var(--line-soft); }

.rgquote {
  margin: 20px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--magenta);
  background: rgba(224,69,154,.05);
  border-radius: 0 10px 10px 0;
}
.rgquote p { margin: 6px 0; color: #cfd9e8; }

/* riquadri colorati */
.rgcallout {
  display: flex;
  gap: 13px;
  margin: 22px 0;
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  border-left-width: 3px;
  background: rgba(255,255,255,.028);
}
.rgcallout__ico { font-size: 1.05rem; line-height: 1.6; flex-shrink: 0; }
.rgcallout__body { min-width: 0; }
.rgcallout__body > :first-child { margin-top: 0; }
.rgcallout__body > :last-child { margin-bottom: 0; }
.rgcallout p { margin: 7px 0; }

.rgcallout--info   { border-left-color: var(--cyan);    background: rgba(63,246,246,.055); }
.rgcallout--warn   { border-left-color: var(--orange);  background: rgba(255,106,43,.06); }
.rgcallout--danger { border-left-color: #ff4d5e;        background: rgba(255,77,94,.06); }
.rgcallout--ok     { border-left-color: #3fd98a;        background: rgba(63,217,138,.06); }

.rgtable {
  width: 100%;
  margin: 22px 0;
  border-collapse: collapse;
  font-size: .95rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
}
.rgtable th {
  text-align: left;
  padding: 11px 14px;
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(63,246,246,.06);
  border-bottom: 1px solid var(--line);
}
.rgtable td {
  padding: 11px 14px;
  color: #d6e1ef;
  border-bottom: 1px solid var(--line-soft);
}
.rgtable tr:last-child td { border-bottom: none; }
.rgtable tr:hover td { background: rgba(255,255,255,.02); }

/* --- precedente / successivo --- */
.rgpager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 54px;
  padding-top: 26px;
  border-top: 1px solid var(--line-soft);
}
.rgpager__a {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  transition: border-color .18s, transform .18s, background .18s;
}
.rgpager__a:hover {
  border-color: rgba(63,246,246,.4);
  background: rgba(63,246,246,.04);
  transform: translateY(-2px);
}
.rgpager__a span { font-size: .78rem; color: var(--muted-2); letter-spacing: .05em; }
.rgpager__a strong {
  font-family: var(--font-display);
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}
.rgpager__a--next { text-align: right; align-items: flex-end; }

/* --- risultati ricerca --- */
.rgresults { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.rgresult {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 17px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  transition: border-color .18s, background .18s;
}
.rgresult:hover { border-color: rgba(63,246,246,.4); background: rgba(63,246,246,.04); }
.rgresult__sec { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.rgresult strong { font-family: var(--font-display); font-size: 1.02rem; color: var(--text); }
.rgresult__ex { font-size: .93rem; color: var(--muted); line-height: 1.55; }
.rgempty { padding: 30px; text-align: center; color: var(--muted-2); border: 1px dashed var(--line-soft); border-radius: 12px; }

.rgfoot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-top: 60px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  font-size: .85rem;
  color: var(--muted-2);
}
.rgfoot__links { display: flex; gap: 18px; }
.rgfoot__links a:hover { color: var(--cyan); }

/* ─────────────────────────  INDICE DESTRO  ───────────────────────── */
.rgtoc__inner {
  position: sticky;
  top: calc(var(--rg-top) + 34px);
  max-height: calc(100vh - var(--rg-top) - 50px);
  overflow-y: auto;
  padding: 22px 0 30px;
  scrollbar-width: thin;
}
.rgtoc__label {
  display: block;
  font-family: var(--font-display);
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
}
.rgtoc ul { list-style: none; border-left: 1px solid var(--line-soft); }
.rgtoc li a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: .88rem;
  line-height: 1.4;
  color: var(--muted-2);
  transition: color .16s, border-color .16s;
}
.rgtoc li a:hover { color: var(--text); }
.rgtoc li a.is-current { color: var(--cyan); border-left-color: var(--cyan); }
.rgtoc__l2 a { padding-left: 26px; font-size: .84rem; }
.rgtoc__top {
  display: inline-block;
  margin-top: 18px;
  font-size: .84rem;
  color: var(--muted-2);
}
.rgtoc__top:hover { color: var(--cyan); }

/* ─────────────────────────  RESPONSIVE  ───────────────────────── */
@media (max-width: 1240px) {
  .rgwrap { grid-template-columns: var(--rg-side) minmax(0, 1fr); }
  .rgtoc { display: none; }
}

@media (max-width: 900px) {
  :root { --rg-gap: 0px; }
  .rgwrap { grid-template-columns: 1fr; padding-inline: 18px; }
  .rgtop__burger { display: block; }
  .rgtop__brand em { display: none; }
  .rgtop__links a:not(.rgtop__dc) { display: none; }
  .rgsearch kbd { display: none; }

  .rgside {
    position: fixed;
    top: var(--rg-top); bottom: 0; left: 0;
    width: 300px;
    z-index: 50;
    background: var(--bg-2);
    border-right: 1px solid var(--line);
    transform: translateX(-102%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
  }
  .rgside.is-open { transform: none; }
  .rgside__inner { position: static; max-height: none; height: 100%; padding: 20px 16px 30px; }
  .rgscrim.is-open { display: block; }

  .rgmain { padding-top: 26px; }
  .rgpager { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .rgtop { gap: 10px; padding-inline: 12px; }
  .rgsearch { max-width: none; }
  .rgtop__brand span { display: none; }
  .rgh__link { display: none; }
}
