/* Leggibilità di tutte le guide: caricato per ultimo, sovrascrive il CSS interno di ogni pagina.
   Testo più grande e più chiaro, colonna più stretta, colori sopra il contrasto 4,5:1. */

:root { --text-muted: color-mix(in oklch, var(--accent, #38bdf8) 10%, #c3cedb) !important; --red: #f87171 !important; --purple: #c084fc !important; }
html { scroll-padding-top: 110px; }
section[id] { scroll-margin-top: 110px; }

/* --- Colonna (la home tiene la griglia larga delle schede) --- */
body:not(:has(.guide-groups)) .container { max-width: 54rem !important; }
body:not(:has(.guide-groups)) main .container > p, .section-subtitle { max-width: 46rem; }

/* --- Testo --- */
body { font-size: 1.03125rem; line-height: 1.65; }
section p, section li, .analogy p, .alert, .alert span, .rule p, .tl-item p {
  font-size: 1.03125rem !important;
  line-height: 1.65 !important;
}
section p, section li, .analogy p, .alert span, .rule p, .tl-item p, td { color: color-mix(in oklch, var(--accent, #38bdf8) 6%, #e4e9ef); }
.card p, .card li, .mini-card p, td, th, .do-box li, .dont-box li {
  font-size: .96875rem !important;
  line-height: 1.6 !important;
}
small, section small { font-size: .875rem !important; }
.subtitle, .section-subtitle { color: color-mix(in oklch, var(--accent, #38bdf8) 12%, #cbd5df) !important; }
.motto { color: #e6c35c !important; }

/* --- Home: le schede restano compatte --- */
section p.guide-sub, .guide-sub { font-size: .90625rem !important; line-height: 1.45 !important; color: #c6d1dc !important; }

/* --- Titoli e schede: a sinistra --- */
.section-header { text-align: left !important; }
.section-header .section-subtitle, .section-header p { margin-left: 0 !important; margin-right: 0 !important; font-size: 1.0625rem !important; }
.card, .mini-card { text-align: left !important; }
.mini-card .mc-icon { text-align: left !important; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)) !important; }

/* --- Codice: niente colonne strette, commenti leggibili --- */
.grid-2:has(pre), .grid-2:has(.code-block) { grid-template-columns: 1fr !important; }
.grid-2 > *, .grid-3 > *, .do-dont > *, .rules > * { min-width: 0; }
pre, .code-block, .table-container, .diagram-container { max-width: 100%; }
pre { overflow-x: auto; }
pre, pre code, .code-block code { font-size: .875rem !important; }
.comment, pre .comment, code .comment { color: #a3b3c4 !important; }
.code-header, .code-header span { color: #b8c5d3 !important; }

/* --- Etichette e testi colorati: tinta e saturazione della guida, si alza solo la luminosità --- */
.section-number, .rule-n, .tl-year, th, .pink-text, .dir { color: oklch(from var(--accent, #38bdf8) max(l, .76) c h) !important; }
/* tre guide hanno i comandi nel colore della guida, troppo scuro su nero */
html:has(link[rel="canonical"][href$="/debian/"]) .cmd,
html:has(link[rel="canonical"][href$="/macos/"]) .cmd,
html:has(link[rel="canonical"][href$="/redis/"]) .cmd { color: oklch(from var(--accent) max(l, .76) c h) !important; }
.guide-card h3, .guide-card .guide-btn { color: oklch(from var(--c, #38bdf8) max(l, .74) c h) !important; }
main a:not([class]):not(nav a) { color: oklch(from var(--accent, #38bdf8) max(l, .76) c h) !important; }
.tag-red, .badge-red, .hl-r, .myth, .cheat-header.red, .arx-text { color: #fca5a5 !important; }
.tag-purple, .hl-p, .dl-name, .chat-label, .gas-note, .cheat-header.purple, .timeline-year { color: #d8b4fe !important; }
.lazy-badge { color: #93c5fd !important; }
footer p, footer p code { color: #aab7c6 !important; }
.frame-field small { color: inherit !important; }
.frame-field { color: #fff !important; text-shadow: 0 0 2px rgba(0,0,0,.65); }
.output, .unit-comment, .fhs-desc, .dstack-arrow { color: #c3cedb !important; }
.toc a { color: #c6d1dc !important; }

/* --- Link riconoscibili anche senza colore, focus visibile --- */
main a:not([class]):not(nav a), footer p a { text-decoration: underline !important; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, pre:focus-visible, [tabindex]:focus-visible { outline: 2px solid #fcd34d; outline-offset: 2px; }

/* --- Bottone della birra --- */
.bmc-custom { background: #4a63dd !important; color: #fff !important; }
@media (max-width: 700px) {
  .bmc-custom { font-size: .75rem !important; padding: .35rem .6rem !important; right: .5rem !important; bottom: .5rem !important; opacity: .92; }
}

/* --- Telefono --- */
@media (max-width: 760px) {
  table:not(.table-container table) { display: block; overflow-x: auto; max-width: 100%; }
  .flow-step, .flow-content, .cmp-box, main li, main p, main td { min-width: 0; overflow-wrap: anywhere; }
  main code { overflow-wrap: anywhere; }
  main pre code { overflow-wrap: normal; }
}
@media (max-width: 600px) {
  body, section p, section li, .analogy p, .alert, .alert span, .rule p, .tl-item p { font-size: 1rem !important; }
  .card p, .card li, .mini-card p, .do-box li, .dont-box li { font-size: .9375rem !important; }
  td, th { font-size: .875rem !important; }
  pre, pre code, .code-block code { font-size: .8125rem !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Pulsante "Sostieni Svogliati": vetro scuro come la barra, scritta con la sfumatura del logo */
.bmc-custom {
  background: rgba(15, 19, 32, .9) !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  color: #fbd38d !important;
  backdrop-filter: blur(8px);
}
.bmc-custom:hover {
  background: rgba(24, 29, 46, .95) !important;
  border-color: rgba(249, 115, 22, .5) !important;
}
.bmc-custom span {
  background: linear-gradient(135deg, #e94560, #f97316, #eab308);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* icona della barra in alto: il divano con la lampada al posto delle emoji */
.sv-ico svg { height: 1.35em; width: auto; vertical-align: -0.3em; display: inline-block; }
.bmc-custom .bmc-sofa { height: 1.3em; width: auto; flex: none; }
