/* ==========================================================================
   FONT & IMPORTAZIONE
   ========================================================================== */

/* Importazione font personalizzato (con fallback e swap) */
@font-face {
  font-family: 'Candara';
  src: url('/assets/fonts/Candara.woff2') format('woff2'),
       url('/assets/fonts/Candara.woff') format('woff'),
       url('/assets/fonts/Candara.ttf') format('truetype');
  font-display: swap;
}

:root { color-scheme: light; }
*, *::before, *::after { box-sizing: border-box; }

/* ==========================================================================
   RESETE E STILI BASE
   ========================================================================== */

html,
body {
  font-family: 'Candara', sans-serif;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-weight: 300;
  color: black;
  line-height: 1.45;
  background: url('/assets/images/background.jpg') center no-repeat;
  background-size: cover;
  font-size: 16px;

  /* evita scroll orizzontale, consente scroll verticale */
  overflow-x: hidden;
  /* base: 1rem = 16px */
}

/* Link generici */
a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Focus visibile tastiera */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #159ec0;
  outline-offset: 2px;
}

/* Skip link accessibile */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  background: #fff;
  color: #000;
  z-index: 9999;
}

/* ==========================================================================
   STRUTTURA DEL LAYOUT
   ========================================================================== */

/* Elementi che occupano tutto lo spazio disponibile */
article,
.blog-container,
.content {
  flex: 1;
}

/* Header */
header {
  background-color: rgb(29, 29, 29);
  background-size: cover;
  height: auto;
  margin-bottom: 1.875rem; /* 30px */
}

/* Footer */
footer {
  margin: 2.5rem;          /* 40px */
  padding: 0.625rem;       /* 10px */
  text-align: right;
  font-size: min(1.25rem, 2vh); /* 20px = 1.25rem */
}

/* ==========================================================================
   TITOLI E SEZIONI PRINCIPALI
   ========================================================================== */

/* Titolo principale */
.title {
  height: 9rem;
  /* Se il viewport è molto ampio la dimensione non supera 5rem, altrimenti usa 6vw */
  font-size: min(6vw, 5rem);
  color: antiquewhite;
  text-transform: uppercase;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title a:hover {
  text-decoration: none;
}

/* per lo sfondo frattale */
#fractalCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffffff00;
}

.controls {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  color: #fff;
  font-family: Arial, sans-serif;
}

.controls label {
  margin-right: 0.5rem;
}

/* Titoli generici */
h1 {
  text-align: center;
  margin: 3.75rem; /* 60px */
}

/* Titoli degli articoli e del blog */
.blog-container h1,
article h1 {
  font-size: 2rem; /* 32px = 2rem */
  color: #222;
  text-align: left;
}

/* Peso del titolo */
h1 {
  font-weight: 300;
}

/* ==========================================================================
   MENU DI NAVIGAZIONE
   ========================================================================== */

/* Stili esistenti (.menu) – mantieni per retrocompatibilità */
.menu {
  background-color: rgb(29, 29, 29);
  color: white;
  font-weight: bold;
}

/* Lista del menu */
ul.menu {
  width: 100%;
  height: 2.2em;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-evenly;
  border-top: 0.0625rem solid white; /* 1px */
}

/* Singoli elementi del menu */
li.menu {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0.9375rem; /* 15px */
}

/* Nuove classi navigazione semantica */
.site-nav {
  background-color: rgb(29, 29, 29);
  color: #fff;
  font-weight: bold;
}
.site-nav-list {
  width: 100%;
  min-height: 2.2em;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-evenly;
  border-top: 1px solid #fff;
}
.site-nav-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 0.9375rem; /* 15px */
}

/* Contenuto interno del menu */
ul.content {
  clear: both;
  text-align: center;
  color: black;
  font-size: min(1.875rem, 2.5vw); /* 30px = 1.875rem */
  display: inline-block;
  vertical-align: middle;
  align-self: center;
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 100;
}

ul.content li {
  width: 12.5rem; /* 200px */
  height: 2.1875rem; /* 35px */
  display: flex;
  align-items: center;
  margin: 1.5em;
  cursor: pointer;
  padding: 1em;
  background: rgba(43, 43, 43, 0.8);
  position: relative;
  color: white;
  border-radius: 0.3125rem; /* 5px */
  text-align: center;
}

/* Effetti hover per i bottoni del menu */
ul.content li::before,
ul.content li::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 0.3125rem;
  width: 105%;
  transition: all 0.4s;
}

ul.content li::before {
  left: 0;
  height: 130%;
  background: linear-gradient(to right, #159ec0, #25ff2536);
}

ul.content li::after {
  left: -10%;
  height: 120%;
  background: #ffffff56;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.164);
}

ul.content li:hover::before {
  transform: translateX(-2.5%);
}

ul.content li:hover::after {
  transform: translateX(15%);
}

/* ==========================================================================
   CONTENUTO ARTICOLI & BLOG
   ========================================================================== */

/* Articolo singolo */
article {
  max-width: 62.5rem; /* 1000px */
  margin: 0 auto;
  padding: 1.25rem; /* 20px */
  color: #222;
  line-height: 1.6;
}

/* Paragrafi degli articoli */
article p {
  font-size: 1.125rem; /* 18px */
  color: #222;
  margin-bottom: 0.9375rem; /* 15px */
}

/* Link all'interno degli articoli */
article a {
  color: #0077cc;
  text-decoration: none;
  font-weight: bold;
}

article a:hover {
  text-decoration: underline;
}

/* Immagini negli articoli */
article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.25rem auto; /* 20px */
  border-radius: 0.3125rem;
}

/* Citazioni */
article blockquote {
  background: rgba(255, 255, 255, 0.1);
  border-left: 0.3125rem solid #0077cc; /* 5px */
  padding: 0.625rem 1.25rem; /* 10px 20px */
  font-style: italic;
  color: #222;
  margin: 1.25rem 0; /* 20px */
}

/* Liste negli articoli */
article ul,
article ol {
  margin: 1.25rem 0; /* 20px */
  padding-left: 1.25rem; /* 20px */
}

article li {
  margin-bottom: 0.625rem; /* 10px */
}

/* ---------------------------
   Stile per il codice
------------------------------*/

/* Codice inline */
article code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.125rem 0.3125rem; /* 2px 5px */
  border-radius: 0.1875rem; /* circa 3px */
  font-family: "Courier New", monospace;
  color: #ffcc00;
}

/* Blocchi di codice */
article pre {
  background: #1e1e1e;
  color: #f8f8f2;
  padding: 0.9375rem; /* 15px */
  border-radius: 0.3125rem;
  overflow-x: auto;
  font-family: "Courier New", monospace;
}

/* ==========================================================================
   BLOG LIST (INDEX)
   ========================================================================== */

.blog-list {
  list-style: none;
  padding: 0;
  margin: 4rem;
}

.blog-list li {
  margin-left: 20em;
  margin-bottom: 1.25rem; /* 20px */
  padding: 0.9375rem;      /* 15px */
  background: rgba(255, 255, 255, 0.1);
  border-left: 0.3125rem solid #0077cc; /* 5px */
  border-radius: 0.3125rem;
  transition: all 0.3s ease-in-out;
}

.blog-list li:hover {
  background: rgba(255, 255, 255, 0.2);
}

.blog-list a {
  text-decoration: none;
  color: #222;
  font-size: 1.25rem; /* 20px */
  font-weight: bold;
}

.blog-list a:hover {
  text-decoration: underline;
}

.blog-list small {
  display: block;
  font-size: 0.875rem; /* 14px */
  color: #666;
  margin-top: 0.3125rem; /* 5px */
}

.content {
  text-align: center;
  margin-top: 2em;
}
