@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,700;1,300&display=swap');
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font-family: "Roboto", sans-serif;
  vertical-align: baseline;
}

html {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

caption, th, td {
  text-align: left;
  font-weight: normal;
  vertical-align: middle;
}

q, blockquote {
  quotes: none;
}

q:before, q:after, blockquote:before, blockquote:after {
  content: "";
  content: none;
}

a img {
  border: none;
}

input {
	all: unset;
}

elements-of-type(html5-block) {
  display: block;
}

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

:root {
	--menu-bg: #444;
	--color-primary: #054;
	--color-hover: #FF0;
}

#menu ul, .logo-header, main {
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

#menu ul {
    max-width: 1070px;
}
.logo-header {
    padding: 0 5px;
}

@media not all and (min-width: 40em) {
  body {
    width: 100%;
    height: 100%;
  }
  #menu {
      text-align: none;
  }
  #menu:not(.slideout-menu) {
      order: 1;
  }
  .slideout-menu {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    width: 192px;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    display: none;
  }
  .slideout-panel, #main_logo, #footer, .progress {
    position: relative;
    z-index: 1;
    /* will-change: transform; */
  }
  .slideout-open,
  .slideout-open body,
  .slideout-open .slideout-panel {
    overflow: hidden;
  }
  .slideout-open .slideout-menu {
    display: block;
  }
}

a, a:visited, a.hidden-link {
  color: inherit;
}

i.ion-trophy {
  color: #FF0000;
}

i.ion-camera {
  color: #FF0000;
}

i.ion-ios-book {
  color: #FF0000;
}

i.disabled {
  color: #E8E8E8;
}

#footer {
  color: #FFFFFF;
  background-color: #565656;
  order: 2;
}

#footer a {
  color: #FFFFFF;
}

#page, #main_logo {
  background-color: #FFFFFF;
}

#menu {
  background-color: var(--menu-bg);
  padding-top: 5px;
}

@media (min-width: 40em) {
    #menu {
        padding-top: 0px;
        text-align: center;
    }
	#lang-menu {
		margin-left: auto;
	}
}

#menu a {
  color: #FFFFFF;
}

#menu a:hover {
  color: #000000;
  background-color: var(--color-hover);
}

#menu .menu-heading {
  color: #FFF;
}

.active {
  color: #FFFFFF;
  background-color: var(--color-primary);
}

/********************/
/* Layout del logo  */
/********************/
#main_logo {
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  font-weight: bold;
  text-align: left;
  background-image: url("https://static.matteomigliorini.it/img/headerbg_thumb.jpg");
  background-position: 50% 70%;
  background-size: cover;
  background-repeat: no-repeat;
}

#main_logo img {
  margin: 10px;
  float: left;
  height: 50px;
}

#main_logo #menu_button {
  float: left;
  margin: 0 5px;
  cursor: pointer;
  width: 35px;
}

#main_logo .logo-title {
    color: white;
}

@media (min-width: 40em) {
  #main_logo {
    text-align: left;
    min-height: 240px;
    padding-left: 6px;
    padding-bottom: 5px;
    align-items: end;
    background-position: 50% 100%;
    background-image: url("https://static.matteomigliorini.it/img/headerbg.jpg");
  }
  #main_logo img {
    height: 100px;
  }
  #main_logo .logo-title {
    color: #FFF;
  }
  #main_logo #menu_button {
    display: none;
  }

  .logo-title {
      margin-left: 0;
  }

}

@media (min-width: 55em) {
  #main_logo {
    text-align: left;
  }
  #main_logo img {
    height: auto;
  }
  #main_logo .logo-address {
    display: inline-block;
  }
  #main_logo #menu_button {
    display: none;
  }
}

#menu_button {
  font-size: 20px;
}

/***********************/
/* Layout predefiniti  */
/***********************/
section {
  box-shadow: rgba(0, 0, 0, 0.26) 0px 2px 5px 0px;
  padding: 5px 9px;
  margin: 30px 5px;
  overflow: hidden;
}

section.no-border {
  box-shadow: none;
  padding: 0;
}

.content-list li {
  padding: 5px 0;
}

.bullet-list ul {
  list-style: disc outside;
  margin-left: 15px;
  text-align: justify;
}

.bullet-list ul li {
  margin: 3px 0;
}

.bullet-list ul ul {
  list-style: circle outside;
}

i {
  font-size: 1em;
  padding: 2px 4px;
}

.overflow-content {
  overflow-x: auto;
}

ul.bullet-list {
  list-style: disc inside none;
}

ul.bullet-list li {
  margin: 2px 0;
}

main {
    padding-bottom: 10px;
}

td, th {
  padding: 7px;
}

dl {
  overflow: hidden;
  *zoom: 1;
}

dl > div {
  overflow: hidden;
  *zoom: 1;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 5px 0;
}

dt {
  width: 33.33333%;
  float: left;
  padding-left: 0.83333%;
  padding-right: 0.83333%;
}

dd {
  width: 66.66667%;
  float: right;
  padding-left: 0.83333%;
  padding-right: 0.83333%;
  clear: right;
}


/***********************/
/* Posizione generale  */
/*   delle sezioni     */
/***********************/
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#page {
  overflow: hidden;
  max-width: 2000px;
  padding: 0 15px;
  flex-grow: 1;
  align-self: center;
  width: 100%;
}

#errors:not(:empty) {
    width: 100%;
    max-width: 1080px;
	margin: 30px auto 20px auto;
	background-color: #E70;
  box-shadow: rgba(0, 0, 0, 0.26) 0px 2px 5px 0px;
  padding: 10px 9px;
  overflow: hidden;
}

.grouped-sections {
    display: flex;
    flex-direction: row;
    justify-content: end;
    margin: 30px 0;
}

.grouped-sections > * {
    margin-top: 0;
    margin-bottom: 0;
}

.near-chess {
    flex-wrap: wrap;
}

.near-chess section {
    margin-bottom: 30px;
}


.near-chess section:not(.chess-problem) {
    flex-grow: 1;
}

/****************/
/* Layout menu  */
/****************/
#menu {
  padding-left: 5px;
}

#menu ul {
  display: flex;
  flex-direction: column;
}

#menu a {
  display: block;
  padding: 0.4em;
  text-decoration: none;
}

#menu .menu-flag {
  margin: -5px 0;
}

@media (min-width: 40em) {
  #menu {
    padding-left: 0;
    display: block;
  }
  #menu ul {
    display: inline-flex;
    flex-direction: row;
    justify-content: start;
  }
  #menu .menu-heading {
    display: none;
  }
}

/***********************
 * Tipografia generale *
 * 		(fonts)	   *
 ***********************/

/***********************
 * Tipografia generale *
 * 		(per tag)	   *
 ***********************/
body {
  font-size: 18px;
}

h1, h2 {
  font-size: 22px;
  margin: 5px 5px 9px;
}

h3 {
  font-size: 18px;
  margin: 5px 0;
}

h4 {
  font-size: 14px;
  margin: 10px 0;
}

p {
    margin: 5px;
}

p, li {
    line-height: 1.3;
}

.generic-title {
  font-weight: bold;
  font-size: 20px;
  margin: 5px 0;
}

.generic-subtitle {
  font-weight: bold;
  font-size: 15px;
  margin: 5px 0;
}

a.hidden-link {
  text-decoration: inherit;
}

em {
  font-style: italic;
}

strong {
  font-weight: bold;
}

section > h1, article > h1 {
  font-size: 20px;
}

pre {
  font-family: "Lucida-Console";
  font-size: 12px;
}

dt {
  font-weight: bold;
}

/**********************
 * Elementi specifici *
 **********************/
#menu {
  font-weight: bold;
}

#menu .menu-heading {
  text-transform: uppercase;
  font-size: 15px;
}

#propic {
    padding: 0px;
    box-shadow: rgba(0, 0, 0, 0.26) 0px 2px 5px 0px;
    margin-left: 5px;
    margin-right: 5px;
    min-width: 130px;
    object-fit: cover;
    display: none;
}

@media (min-width: 40em) {
    #propic {
        display: block
    }

    #personal_info {
        min-height: 200px;
    }
}

#footer {
  text-align: center;
  font-size: 18px;
}

#footer h2 {
    font-size: 15px;
    margin-bottom: 2px;
}

#footer .contacts ul li {
    display: inline-block
}

#home_contacts li a, #home_contacts li, #home_contacts .mail-popup.displayed {
    display: flex;
    flex-direction: row;
    align-items: center;
}

#home_contacts li span {
    margin-left: 4px;
}

.mail-popup {
    display: none;
    position: relative;
    margin-bottom: 3px;
}

.mail-popup.displayed {
    display: inline-block;
}

.mail-tooltip {
    display: none;
    font-size: 13px;
    margin-left: 10px;
    color: #565656;
    background-color: white;
    padding: 1px 2px;
    border-radius: 10px;
}

#home_contacts .mail-tooltip {
    background-color: #565656;
    color: white;
}

.mail-tooltip_container {
    text-align: left;
    position: absolute;
    width: 120px;
    right: -120px;
}

.mail-popup:hover .mail-tooltip {
    display: inline-block;
}

.mail-label.hidden {
    display: none;
}

#home_contacts {
    display: none;
    min-width: 50%;
}

#credits {
    display: none;
    padding: 10px;
}

.logo-title {
  font-weight: bold;
  font-size: 24px;
}

header a {
    text-decoration: none;
}

.logo-address {
  font-family: "Segoe-B";
  font-size: 11px;
}


@media (min-width: 40em) {
  .logo-title {
    font-size: 26px;
  }
  .logo-address {
    font-size: 19px;
  }
  .big-news-item .news-item-title {
    font-size: 23px;
  }
  .big-news-item .news-item-caption {
    font-size: 17px;
  }
}

@media (min-width: 55em) {
  .logo-title {
    font-size: 36px;
  }
  .logo-address {
    font-size: 26px;
  }
  .big-news-item .news-item-title {
    font-size: 26px;
  }
  .big-news-item .news-item-caption {
    font-size: 19px;
  }
}

.notfound {
  font-weight: bold;
  font-size: 25px;
  text-align: center;
}

a.button {
    cursor: pointer;
    border-radius: 10px;
    padding: 4px 5px;
    margin: 0 3px;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    font-weight: bold;
    float: right;
}

a.button-small {
	font-size: 0.8em;
}

.chess-problem {
    width: 150px;
    float: right;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 9px;
}

#close_problem {
    display: none;
}
.chess-problem.started #close_problem {
    display: block;
    position: absolute;
    right: 7px;
}

.chess-problem:not(.started) #pgn {
    display: none;
}

.chess-problem.started {
    width: 100%;
}

.chess-problem h3 {
    text-align: center
}

#myBoard {
    cursor: pointer;
}

.started #myBoard {
    cursor: auto;
}

.started .piece-417db[data-piece*="w"] {
    cursor: grab;
    touch-action: none;
}

.grabbing {
    cursor: grabbing;
    z-index: 2;
}

#status {
}

.chess-problem:not(.started) h3, .chess-problem:not(.started) #status {
    display: none;
}

@media (min-height: 60rem) {
    .home-footer .contacts {
        display: none;
    }
    #home_contacts, .home-footer #credits {
        display: block;
    }

    .chess-problem:not(.started) h3, .chess-problem:not(.started) #status {
        display: block;
    }
}

@media (min-width: 40em) {
    .chess-problem {
        width: 200px;
    }

    .chess-problem.started {
        width: 400px;
    }

    .chess-problem:not(.started) h3, .chess-problem:not(.started) #status {
        display: block;
    }
}



/* Progress bar */

.progress {
  display: inline;
  top: 0;
  height: 4px;
  width: 100%;
  border-radius: 2px;
  background-clip: padding-box;
  overflow: hidden;
  background-color: #FFF;
  height: 3px;

  .indeterminate {
    display: none;
    background-color: var(--color-primary);

    &:before {
      content: "";
      position: absolute;
      background-color: inherit;
      top: 0;
      left: 0;
      bottom: 0;
      will-change: left, right;
      -webkit-animation: indeterminate 2.1s
        cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
      animation: indeterminate 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395)
        infinite;
    }
    &:after {
      content: "";
      position: absolute;
      background-color: inherit;
      top: 0;
      left: 0;
      bottom: 0;
      will-change: left, right;
      -webkit-animation: indeterminate-short 2.1s
        cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
      animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.84, 0.44, 1)
        infinite;
      -webkit-animation-delay: 1.15s;
      animation-delay: 1.15s;
    }
  }
}

.htmx-request.progress {
  display: inline;
  position: sticky;
  .indeterminate {
    display: inline;
  }
}

@-webkit-keyframes indeterminate {
  0% {
    left: -35%;
    right: 100%;
  }
  60% {
    left: 100%;
    right: -90%;
  }
  100% {
    left: 100%;
    right: -90%;
  }
}
@keyframes indeterminate {
  0% {
    left: -35%;
    right: 100%;
  }
  60% {
    left: 100%;
    right: -90%;
  }
  100% {
    left: 100%;
    right: -90%;
  }
}
@-webkit-keyframes indeterminate-short {
  0% {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  100% {
    left: 107%;
    right: -8%;
  }
}
@keyframes indeterminate-short {
  0% {
    left: -200%;
    right: 100%;
  }
  60% {
    left: 107%;
    right: -8%;
  }
  100% {
    left: 107%;
    right: -8%;
  }
}
