/*
  BlindPhone, sito di presentazione.

  Contrasti misurati con la formula WCAG 2.1 (minimo richiesto 4,5:1 per il testo,
  3:1 per i bordi dei controlli e per l'indicatore del focus):
  - testo #1b1f24 su #ffffff: 16,1:1
  - collegamenti #0b4da9 su #ffffff: 7,9:1; su #eef4fc: 7,2:1
  - testo #ffffff sulla testata #0a2257: 15,2:1
  - focus giallo #ffd447 sulla testata: 10,7:1
  - tema scuro: testo #e8eef6 su #0f1720: 15,6:1; collegamenti #8cc4ff: 9,8:1
  Nessuna informazione e' affidata al solo colore: la pagina corrente nel menu e'
  anche in grassetto e sottolineata, le note hanno un'etichetta scritta.
*/

:root {
  color-scheme: light dark;

  --sfondo: #ffffff;
  --sfondo-tenue: #eef4fc;
  --testo: #1b1f24;
  --testo-tenue: #3d4652;
  --collegamento: #0b4da9;
  --collegamento-visto: #5a2d91;
  --bordo: #5f6b7a;
  --bordo-tenue: #c9d3df;
  --testata: #0a2257;
  --testata-testo: #ffffff;
  --accento: #ffd447;
  --focus: #0b4da9;
  --pulsante: #0b4da9;
  --pulsante-testo: #ffffff;
  --nota: #fff6d6;
  --nota-bordo: #8a6100;
  --kbd: #f3f5f8;

  --larghezza: 68rem;
  --misura: 46rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sfondo: #0f1720;
    --sfondo-tenue: #172333;
    --testo: #e8eef6;
    --testo-tenue: #c3cedb;
    --collegamento: #8cc4ff;
    --collegamento-visto: #d0b3ff;
    --bordo: #8a97a8;
    --bordo-tenue: #34445a;
    --testata: #08142e;
    --testata-testo: #ffffff;
    --focus: #ffd447;
    --pulsante: #8cc4ff;
    --pulsante-testo: #0f1720;
    --nota: #2a2412;
    --nota-bordo: #e0b84a;
    --kbd: #1d2a3b;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--sfondo);
  color: var(--testo);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* ---------- Collegamenti e focus ---------- */

a {
  color: var(--collegamento);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:visited {
  color: var(--collegamento-visto);
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Il contenuto principale riceve il focus dal collegamento per saltare il menu,
   ma non e' un controllo: niente cornice attorno all'intera pagina. */
main:focus {
  outline: none;
}

.salta {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--accento);
  color: #000000;
  font-weight: 700;
  border: 2px solid #000000;
}

.salta:focus,
.salta:focus-visible {
  top: 1rem;
  outline: 3px solid #000000;
  outline-offset: 2px;
}

.salta:visited {
  color: #000000;
}

/* ---------- Impaginazione ---------- */

.contenitore {
  width: 100%;
  max-width: var(--larghezza);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 40em) {
  .contenitore {
    padding: 0 1.5rem;
  }
}

main {
  display: block;
  padding-bottom: 3rem;
}

.testo {
  max-width: var(--misura);
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 2.25rem 0 0.75rem;
}

h1 {
  font-size: clamp(1.9rem, 1.4rem + 2.2vw, 2.75rem);
  margin-top: 2rem;
}

h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.9rem);
  padding-top: 0.5rem;
  border-top: 2px solid var(--bordo-tenue);
}

h3 {
  font-size: 1.3rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

code,
kbd {
  font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  overflow-wrap: anywhere;
}

code {
  background: var(--kbd);
  padding: 0.05em 0.3em;
  border-radius: 0.25em;
}

kbd {
  display: inline-block;
  padding: 0 0.4em;
  border: 1px solid var(--bordo);
  border-bottom-width: 2px;
  border-radius: 0.3em;
  background: var(--kbd);
  line-height: 1.4;
  white-space: nowrap;
}

pre {
  background: var(--kbd);
  border: 1px solid var(--bordo-tenue);
  padding: 0.75rem 1rem;
  border-radius: 0.4rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre code {
  background: none;
  padding: 0;
}

/* ---------- Testata e menu ---------- */

.testata {
  background: var(--testata);
  color: var(--testata-testo);
  --focus: #ffd447;
}

.testata-interno {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.marchio {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--testata-testo);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  min-height: 44px;
}

.marchio:visited {
  color: var(--testata-testo);
}

.marchio:hover {
  text-decoration: underline;
}

.marchio img {
  width: 48px;
  height: 48px;
  padding: 4px;
  background: #ffffff;
  border-radius: 10px;
}

.menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu li + li {
  margin-top: 0;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  color: var(--testata-testo);
  text-decoration: none;
  border-bottom: 4px solid transparent;
}

.menu a:visited {
  color: var(--testata-testo);
}

.menu a:hover {
  text-decoration: underline;
}

.menu a[aria-current="page"] {
  font-weight: 700;
  border-bottom-color: var(--accento);
}

@media (max-width: 30em) {
  .menu ul {
    gap: 0.25rem;
  }

  .menu a {
    padding: 0.25rem 0.45rem;
  }
}

/* ---------- Apertura della home ---------- */

.apertura {
  background: var(--sfondo-tenue);
  border-bottom: 1px solid var(--bordo-tenue);
}

.apertura-interno {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 48em) {
  .apertura-interno {
    grid-template-columns: minmax(0, 1fr) 14rem;
    gap: 3rem;
  }
}

.apertura h1 {
  margin-top: 1.5rem;
}

.sottotitolo {
  font-size: 1.3rem;
  max-width: 40rem;
}

.apertura-logo {
  justify-self: center;
  width: 12rem;
  padding: 1rem;
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid var(--bordo-tenue);
}

@media (max-width: 47.99em) {
  .apertura-logo {
    order: -1;
    width: 5rem;
    padding: 0.5rem;
    border-radius: 1rem;
    justify-self: start;
    margin-top: 1.25rem;
    margin-bottom: -1rem;
  }
}

.azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.azioni li + li {
  margin-top: 0;
}

.pulsante {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--pulsante);
  border-radius: 0.5rem;
  background: var(--pulsante);
  color: var(--pulsante-testo);
  font-weight: 700;
  text-decoration: none;
}

.pulsante:visited {
  color: var(--pulsante-testo);
}

.pulsante:hover {
  text-decoration: underline;
}

.pulsante.secondario {
  background: transparent;
  color: var(--collegamento);
}

.pulsante.secondario:visited {
  color: var(--collegamento);
}

/* ---------- Riquadri delle funzioni ---------- */

.griglia {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.griglia > li + li {
  margin-top: 0;
}

.riquadro {
  border: 1px solid var(--bordo-tenue);
  border-top: 4px solid var(--collegamento);
  border-radius: 0.5rem;
  padding: 0.25rem 1.25rem 0.75rem;
  background: var(--sfondo);
}

.riquadro h3 {
  margin-top: 1rem;
}

.riquadro ul {
  padding-left: 1.2rem;
}

.idee {
  counter-reset: idea;
  list-style: none;
  padding: 0;
  max-width: var(--misura);
}

.idee li {
  counter-increment: idea;
  position: relative;
  padding-left: 3.25rem;
  margin-top: 1rem;
}

.idee li::before {
  content: counter(idea);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--collegamento);
  color: var(--sfondo);
  font-weight: 700;
  text-align: center;
  line-height: 2.25rem;
}

/* ---------- Note e avvertenze ---------- */

.nota {
  max-width: var(--misura);
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  background: var(--nota);
  border: 1px solid var(--nota-bordo);
  border-left-width: 6px;
  border-radius: 0.25rem;
}

.nota p:last-child {
  margin-bottom: 0;
}

.etichetta {
  font-weight: 700;
}

/* ---------- Tabelle dei tasti ---------- */

table {
  width: 100%;
  max-width: var(--misura);
  border-collapse: collapse;
}

caption {
  text-align: left;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.5rem 0;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--bordo-tenue);
  overflow-wrap: break-word;
  hyphens: auto;
}

@media (max-width: 30em) {
  th,
  td {
    padding: 0.4rem 0.4rem;
    font-size: 1rem;
  }
}

thead th {
  background: var(--sfondo-tenue);
  border-bottom: 2px solid var(--bordo);
}

tbody th {
  font-weight: 600;
}

/* ---------- Indice della guida ---------- */

.indice {
  max-width: var(--misura);
  margin: 1.5rem 0 2rem;
  padding: 0.75rem 1.25rem;
  background: var(--sfondo-tenue);
  border: 1px solid var(--bordo-tenue);
  border-radius: 0.5rem;
}

.indice h2 {
  font-size: 1.25rem;
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: 0;
}

.indice ol {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

.indice ol ol {
  margin-top: 0.35rem;
}

.su {
  margin-top: 1.5rem;
  font-size: 1rem;
}

dl.recapiti dt {
  font-weight: 700;
  margin-top: 1rem;
}

dl.recapiti dd {
  margin: 0.25rem 0 0;
}

/* ---------- Piede ---------- */

.piede {
  background: var(--sfondo-tenue);
  border-top: 1px solid var(--bordo-tenue);
  padding: 1.5rem 0 1rem;
  font-size: 1rem;
  color: var(--testo-tenue);
}

.piede a {
  color: var(--collegamento);
}

/* ---------- Contrasto elevato di Windows ---------- */

@media (forced-colors: active) {
  :focus-visible,
  .salta:focus {
    outline: 3px solid Highlight;
  }

  .menu a[aria-current="page"] {
    border-bottom-color: Highlight;
  }

  .marchio img,
  .apertura-logo {
    forced-color-adjust: none;
  }

  .idee li::before {
    forced-color-adjust: none;
    background: CanvasText;
    color: Canvas;
  }
}

/* ---------- Stampa ---------- */

@media print {
  .salta,
  .menu,
  .su,
  .azioni {
    display: none;
  }

  .testata,
  .piede,
  .apertura {
    background: none;
    color: #000000;
  }

  .marchio,
  .marchio:visited {
    color: #000000;
  }

  body {
    font-size: 11pt;
  }
}
