/* ==================================================
   CSS UNIFICATO - Layout + Responsive (chatgpt)
   ================================================== */
/* LAYOUT BASE BEGIN */

@import url(norm-variabili.css);

* { box-sizing: border-box; }

/* Corpo e griglia principale */
body, .body {
  margin: 0;
  display: grid;
  justify-content: space-around;
  background: gray;
  background-image: radial-gradient(white, #BBB6AE), url(multimedia/img/svg/wavy.svg);
  background-attachment: fixed;
  background-size: cover;
}

/* Container principale */
#container {
  max-width: 1024px;
  display: grid;
  justify-content: center;
  box-shadow: black 0 0 20px;
  background: white;
}

/* Intestazione */
#intestazione {
  display: grid;
  align-items: center;
  position: sticky;
  top: 0;
  height: auto;
  max-height: 18vh;
  margin: 0;
  background: var(--background, var(--nuovo-gradient));
  background-size: cover;
  box-shadow: 0 8px 6px -6px black;
  z-index: 4;
  transition: height 0.8s ease-in-out;
  will-change: transform;
  overflow-anchor: none;
}

#intestazione.scrolled {
  min-height: 3vh;
  height: auto;
}

/* Logo */
.logo {
  transition: font-size 1.2s ease;
}
.logo a {
  color: white !important;
  text-decoration: none !important;
  text-shadow: black -2px -2px !important;
}
/* .logo { min-height: 70px; } */

/* Menu e navigazione */
#menu, nav { margin-bottom: 0; }
nav { position: absolute; bottom: 0; margin-left: 1vw; max-width: 90vw; }

/* Contenuto principale */
#content { margin-top: 1%; padding: 1% 4%; }
#titolo { width: 90%; margin-top: 8%; }

/* Generated TOC */
#generated-toc {
  margin: 1em 0;
  padding: 0.5em;
  border-left: 4px solid #ccc;
  background: #f9f9f9;
  font-family: sans-serif;
  font-size: 0.95em;
  border-radius: 6px;
  z-index: 2;
}
#generated-toc summary {
  cursor: pointer;
  font-weight: bold;
  font-size: 1.1em;
  background: #eee;
  padding: 0.4em 0.6em;
  border-radius: 4px;
}
#generated-toc ul { list-style: none; padding-left: 1em; margin: 0.5em 0; }
#generated-toc ul ul { padding-left: 1em; }
#generated-toc a {
  text-decoration: none;
  color: var(--mattone, #a00);
  display: inline-block;
  padding: 0.2em 0;
}
#generated-toc a:hover { text-decoration: underline; }
#generated-toc > ul { margin-left: 30px; padding: 0; list-style: none; }

#publatsx img, #publatdx img { max-width: 100%; max-height: 100%; }

/* Footer Gruppo */
#gruppo {
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
  background-color: #585858;
  background-image: radial-gradient(white, var(--verde-icone));
  font-size: 70%;
  width: max-content;
  box-shadow: black 3px 2px 12px;
  margin: 1% auto 3% auto;
  padding: 6px 30px 8px 30px;
  border-radius: 12px;
  text-align: center;
}
#gruppo p, #gruppo span { justify-content: center; }
#gruppo b { font-size: 120%; }
#gruppo a {
  text-decoration: none;
  color: white;
  background: #bc5a1f;
  border-radius: 4px;
  padding: 2px 4px;
  box-shadow: gray 3px 3px 3px;
  margin-top: 6px;
  font-weight: bold;
}
#gruppo #logo-gruppo { width: 400px; height: 60px; background: transparent; }

/* Abstract */
#abstract {
  width: 80%;
  margin: auto;
}
#abstract summary { background: gray; color: white; }
#abstract span { display: block; color: gray; box-shadow: var(--shadow); padding: 1%; }
#abstract span[lang]:before { content: '[' attr(lang) '] '; font-weight: bold; }

/* Footer generale */
#fondopagina, #blog-posts {
  background-color: #585858;
  background-image: linear-gradient(to top, #606060, #9F9F9F);
}
#social { text-align: center; box-shadow: none; margin: auto; }
#social img { margin: 0px 2px; }
#cookies { text-align: center; margin: auto; max-width: 30%; }

/* Paypal e Ads */
p#paypal {
  width: 30%;
  margin: 2% auto 0 auto;
  text-align: center;
}
#paypal a {
  text-decoration: none;
  color: white;
  border: outset silver 2px;
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 120%;
}
#automatickeys {
  width: 80%;
  box-shadow: gray 4px 4px 4px;
  font-size: 110%;
  border-radius: 8px;
  border: solid maroon thin;
  padding: 2%;
}
#automatickeys a:after, .book-keys span:after { content: ','; }
#automatickeys a:last-child:after, .book-keys span:last-child:after { content: ''; margin-right: -4px; }
.adskeys {
  padding: 2px 4px;
  margin: 2.5px 3px;
  color: var(--mattone);
  box-shadow: gray 5px -2px 3px 3px;
  border-radius: 3px;
}
.adskeys:hover { color: white; background: var(--mattone); font-size: 110%; }

/*------------ valid w3c ----------------*/
#w3c {/*width: 40%;*/ 
  margin: 2% auto auto auto;
  font-size: 80%; 
  text-align: center;}
#w3c a {
  text-decoration: none; 
  border: solid black thin;
  border-radius: 2px;
  padding: 2px;
  color: white;
  background: var(--verde-icone);
}
#w3c a span {color: white;}
#w3c span {padding-left: 3px; padding-right: 3px;}
#w3c span.valid {margin-right: 0px; background: #b64d06;}
#w3c span.what {margin-right: 0px; background: var(--verde-icone);}


/* Breadcrumb */
/* #breadcrumb a { font-size: 80%; } */
ul#breadcrumb, ul#breadcrumblocal { margin: 0; padding: 0; overflow: hidden; }
ul#breadcrumb li, ul#breadcrumblocal li { list-style-type: none; float: left; }
#breadcrumblocal li:nth-of-type(1), #breadcrumblocal li:nth-of-type(2) { display: none; }

#breadcrumb li:not(:last-child)::after,
#breadcrumblocal li:not(:last-child)::after {
    content: " ➜ ";
    margin: 0 6px;
    opacity: 0.6;
}

/* LAYOUT BASE END */

/* RESPONSIVE BEGIN */

/* --- reinserito: media query per resize header/logo/menu --- */
@media only screen and (min-width: 200px) and (max-width: 767px) {
  .logo { font-size: calc(5vh + 2px); }
  .scrolled .logo { font-size: calc(4vh); }
  #menu { font-size: calc(1vh + 5.5px); }
  nav { margin-bottom: -12px; }
}

@media only screen and (min-width: 768px) and (max-width: 1023px) {
  .logo { font-size: calc(6vh + 4px); }
  .scrolled .logo { font-size: calc(4vh + 2px); }
  #menu { font-size: calc(1vh + 5.5px); }
  .scrolled #menu { font-size: calc(1vh + 5.5px); }
  nav { margin-bottom: -14px; }
}

@media screen and (min-width: 1024px) {
  .logo { font-size: calc(8vh + 8px); }
  .scrolled .logo { font-size: calc(4vh + 4px); }
  .scrolled #menu { font-size: calc(1vh + 6.5px); }
  nav { margin-bottom: -12px; }
}
/* --- fine reinserito --- */

/* Piccoli schermi - max-width: 480px */
@media screen and (max-width: 480px) {
  body.home * { box-sizing: border-box; }
  body { font-size: 100%; }

  .fl, .fr, [class^="caption_"] { float: none; width: 96%; }
  p#home-esergo { font-size: 100%; }

  #tags, #sezioni img, #siti_collegati img, .legend,
  body.home #banner-avsi { display: none; }

  #teknika span { display: block; margin: 2% 0 3% 0; border-right: none; }

  .slideshow-container { margin: 2px auto; }
  .su-amazon { margin: 10px 0 0 0; padding-bottom: 0; }
}

/* Piccoli schermi - max-width: 580px */
@media screen and (max-width: 580px) {
  #content .hide { display: none; }

  #intestazione h1 a { font-size: 11vw; }
  #intestazione h1 { width: 96% !important; }
  #intestazione { padding-bottom: 0; height: auto !important; }

  #gruppo { flex-flow: column; width: auto !important; }
  #gruppo span, #gruppo p { display: flex; flex-flow: column; }
  #gruppo span a { font-weight: bold !important; padding: 6px 18px; }
  #gruppo #logo-gruppo { max-width: 100%; height: auto !important; }

  #gruppositi { height: 36vh; margin: 0 auto; }

  .caption, .caption_right, .caption_left { float: none !important; }
  #w3c, #img_opere { display: none; }
}

/* Tabelle responsive - max-width: 600px */
@media screen and (max-width: 600px) {
  table { border: 0; }
  table caption { font-size: 1.3em; }
  table thead {
    border: none;
    clip: rect(0 0 0 0);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
  }
  table tr {
    border-bottom: 3px solid #ddd;
    display: block;
    margin-bottom: .625em;
  }
  table td {
    border-bottom: 1px solid #ddd;
    display: block;
    font-size: .8em;
    text-align: right;
  }
  table td::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
  }
  table td:last-child { border-bottom: 0; }
}

/* Piccoli schermi - max-width: 780px */
@media all and (max-width: 780px) {
  #content { margin-top: 2%; }
  #logo h1 { font-size: 7.5vw; }

  .fl, .fr, #corpo, #spalla, h6, .boxino { float: none; }
  #corpo, #spalla, .boxino { width: 100%; }
  #spalla { position: static; }
  p#paypal { margin-top: 6%; }

  iframe, #searchbox, #w3c { display: none; }
  object { max-width: 90% !important; }
  blockquote .hide { display: block; }

  /* Simboli piccoli schermi */
  .top, .bottom {
    display: inline-block;
    margin: 0;
    line-height: 0.6em;
    font-weight: bold;
    font-size: 22px;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .top { background: linear-gradient(to bottom, olive 60%, transparent 50%); }
  .bottom { background: linear-gradient(to top, olive 60%, transparent 50%); }
}

/* Piccoli schermi - max-height: 768px */
@media screen and (max-height: 768px) {
  #rimandi li { line-height: 75%; }
}

/* Medie schermate - max-width: 1024px */
@media screen and (max-width: 1024px) {
  #spalla { display: none; }
  #corpo { min-width: 95%; }
  #rimandi { min-width: 100%; }
}

/* Grandi schermate - max-width: 1240px */
@media screen and (max-width: 1240px) {
    #publatsx, #publatdx { display: none; }
    #container { margin-left: auto; margin-right: auto; }
}

/* Grandi schermate - min-width: 580px */
@media screen and (min-width: 580px) {
    #gruppo { flex-flow: column; max-height: 105vh; }
    #gruppo a { font-weight: bold !important; width: 80%; }
    .su-amazon { margin-bottom: 20px; }
}

/* Desktop ampio - min-width: 1240px */
@media screen and (min-width: 1240px) {
 #olon {
    margin: 0;
    display: grid;
    justify-content: space-around;
    }
 #container { margin-left: 0; margin-right: 0; width: 1024px; }
 #publatsx, #publatdx {
  position: sticky;
  top: 8vh;
  max-width: 120px;
  height: 500px;
  box-shadow: 0 0 7px white;
 }
 #publatsx p, #publatdx p {
  font-size: 110%;
  background: white;
  min-height: 100%;
  min-width: 100%;
  margin: 0;
  padding: 2px;
  box-shadow: gray 2px 2px 2px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
 }
 #logo h1 { font-size: 500%; }

.fixed-toc {
 position: fixed;
 top: 5%;
 right: 1%;
 width: 15vw;
 background: white;
 opacity: 0.8;
 border-radius: 8px;
 font-size: 85%;
 overflow: auto;
 max-height: 92%;
 margin-bottom: 4%;
}
.fixed-toc ul, .fixed-toc li { padding-left: 0; }
}

/* Desktop ampio - min-width: 1240px (body grid) */
@media screen and (min-width: 1240px) {
 body { grid-template-columns: auto 1024px auto; }
 body.home { grid-template-columns: 1024px; }
 #container, #fondopagina #teknika { min-width: 1024px; }
}
/* RESPONSIVE END */
/*subtitle BEGIN*/
.logo .subtitle {font-size: 34%; position: absolute; top: -20%; left: 12%; 
    animation: subtitle-drop 0.8s ease-out forwards; 
    width: 100%;}

.linklogo {position: relative;} /*pro animazione*/

@keyframes subtitle-drop {
  0% {
    transform: translateY(-50px);
    opacity: 0;
  }
  70% {
    transform: translateY(5px);
    opacity: 1;
  }
  100% {
    transform: translateY(0);
  }
}

/*per accessibilita BEGIN */
@media (prefers-reduced-motion: reduce) {
  .logo .subtitle {
    animation: none;
    opacity: 1;
  }
}
/*per accessibilita della animazione subtitle END */

/*subtitle END*/
