* {
  box-sizing: border-box;
}

body {
  font-family: Tahoma, Arial, Helvetica, sans-serif;
  color: #565656;
  max-width: 1980px;
  padding: 0px;
  margin: 0px;
}

h1  {
	font-size : 1.5em;
	margin-top : 0.1em;
	font-weight: normal;
  color: #971B1E;
}

h2  {
  font-size : 1.3em;
  margin-top : 0.1em;
  font-weight: normal;
  color: #971B1E;
  }

strong  {  
  color : #971B1E;
  }
  
a:link, a:visited {
  /* gentle: color: #9293bf;  darker - 44446F */
  color: #4F4F82;
  text-decoration: underline;
}

a.white:link, a.white:visited {
  /* gentle: color: #9293bf;  darker - 44446F */
  color: white;
  text-decoration: underline;
}

nav#main a.current, aside a.current {
  color: #971B1E;
}

a:hover, a:active, a:focus {
  color: #FF0000;
}

.sticky {
  position: fixed;
  top: 10px;
}

summary {
  cursor: pointer;
}

header {
  padding: 0px;
  display: none;

  background-color: #981b1e;
  color: white;

  flex-wrap: wrap;
  /* Все дивы внутри в одну строку будут, wrap - уже будет учитываться размер и будут переноситься
  justify-content: space-between; 
      растягивает расстояние между детьми заполняя контейнер равномерно 
      space-around - еще по бокам первого и последнего*/
}

p.spacer {
  display: none;
}

header > div {
  height: 77px;
  margin: auto;
}

div#h-pic {
  -webkit-flex: 0 0 330px;
  -ms-flex: 0 0 330px;
  flex: 0 0 330px;

  /* 
  background-image: url('images/header_papers_VK.jpg');
  background-repeat: no-repeat; // Do not repeat the image 
  background-size: cover; // Resize the background image to cover the entire container */
}

div#h-logo {
  -webkit-flex: 2 0;
  -ms-flex: 2 0;
  flex: 2 0;
  width: 300px;
  min-width: 270px;

  font-family: Impact, Calibri, Arial, sans-serif;
  font-size: 30px;
  letter-spacing: 2px;
  text-shadow: 2px 2px 2px #4F4F82, 0 0 25px #4F4F82, 0 0 5px blue;
  text-align: center;
  line-height: 0px;
  cursor: pointer;
}

div#h-logo > p:last-child {
  font-family: 'Trebuchet MS', 'Lucida Console', 'Lucida Sans', Arial, sans-serif;
  font-size: 15px;
  font-weight:lighter;
  letter-spacing: 0.2em;
}

div#h-services {
  -webkit-flex: 1 1;
  -ms-flex: 1 1;
  flex: 1 1;
  width: 360px;
  min-width: 130px;

  text-align: center;
}

div#h-contacts {
  -webkit-flex: 1 1;
  -ms-flex: 1 1;
  flex: 1 1;
  width: 180px;
  min-width: 140px;
}

div#h-lang {
  -webkit-flex: 0.5 1;
  -ms-flex: 0.5 1;
  flex: 0.5 1;
  text-align: right;
  width: 50px;
  min-width: 35px;
  padding: 10px;
}

/* Container for ==== Navigation --  Main -- Aside */
div.container {
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
  /* width: calc(100% + 0.5em); */
  
  margin-left: -1em;
  
  /* not working: gap: 10px; so do a negative margin and then same positive in each child div */
}

/* make gaps between nav, main, aside */
div.container > main, div.container > aside {
  margin-left: 1em;
}

div.container > main {
  margin-right: 0.3em;
}

div.templateContacts {
  margin: auto; 
  display: flex; 
  border-width: 2px; 
  border-style: dotted; 
  border-color: #981b1e; 
  padding: 10px; 
  justify-content: center; 
  align-items: center;
}

nav {
  -webkit-flex: 0 0 250px;
  -ms-flex: 0 0 250px;
  flex: 0 0 250px;
  /* min-width: 220px; */
  /* margin-right: 1em; */
  background: #f8f8f8;
  padding: 10px;
  box-shadow: 0 0 8px 2px #dadada inset;

  font-size: 0.9em;
}

/* nav h3 {
  color: white;
  background: #981b1e;
  text-align: right;
  font-weight: bold;
  font-size: 0.9em;
  padding: 0.5em;
} 

nav details {
  padding: 5px 0px;
}

nav summary {
  font-weight: bold;
  text-align: right;
  cursor: pointer;
}
*/

nav.navMain ul.menu {
  list-style-type: none;
  padding: 0em;
  overflow: scroll;

  /* li in ul will stack horizontally on smaller screens */
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start; /* поднимает div внутри родителя наверх */
  justify-content: space-around;

}

nav.navMain li {
  /* padding: 0; */
  text-align: center;
  width: 100%;
  padding-left: 1em;
}

/* Название раздела в меню  */
nav.navMain li.nav-sectionTitle {
  color: white;
  background: #981b1e;
  cursor: unset;
  font-weight: bold;
  font-size: 0.9em;
  padding: 0.5em;
  flex-basis: 100%; /* на всю ширину меню */
}

nav ul a:link, nav ul a:visited {
  /* color: #565656; */
  display: block; 
  border-width: 1px;
  border-style: outset; /* groove тоже неплохо смотрится */
  border-color: white;
  padding: 0.5em;

  /* margin: 0.2em 0.2em 0.2em 2em; */
  text-decoration: none;
  
}

nav#footer a:link, a:visited {
  display: inline-block; 

  border-width: 1px;
  border-style: outset; /* groove тоже неплохо смотрится */
  border-color: white;
  padding: 0.5em;

  margin: 0.2em 0.2em 0.2em 2em;
  text-decoration: none;
}

nav ul a:hover {
  color: #FF0000;
  border-color: #FF0000;
}

nav#footer {
  width: 100%;
  margin: 13px 0;
  padding: 2px 10px;
  font-size: 0.9em;
  
  text-align: center;
}

nav#footer > h3 {
  background: none;
  color: #565656;
  padding: 2px 5px;
  line-height: 1.2em;
  text-align: center;

}

nav#footer p {
  line-height: 1.2em;
}

/* >> перед заголовком h1 в main */
span#pretitle  {
	font-size : 50pt;
  margin: 0em;
  letter-spacing: -0.4em;
	color : #971B1E;
}

/* For this website use both main and article - cause there are pages with several quite independent and whoe articles on same page*/
main {
  -webkit-flex: 4;
  -ms-flex: 4;
  flex: 4;
  min-width: 320px;

  /* margin: 10px; */

  font-size: 1.2em;

  background: #f8f8f8;
  padding: 10px 20px;
  box-shadow: 3px -3px 3px 1px #dadada;
  position: relative; 
  overflow-wrap: break-word;
  /* position: relative; required for child <details> to position absolutely in respect of a closest parent with relative positioning. does not change layout for <main> if left top right bottom are not set */
}

main p {
  line-height: 1.5;
  text-align: justify;
  overflow-wrap: break-word;
}

main p.comments {
  line-height: 1.2;
  color: #888888;
}

main ul {
  list-style-type: square;
  padding-left: 1.5em;
  text-align: justify;
}

main ol {
  padding-left: 1.5em;
  text-align: justify;
  list-style-type:decimal;
}

/* УДАЛИТЬ ПОЗДНЕЕ (вроде на главной только использую) */
main li > p {
  font-size : 0.8em;
  padding: 0em 1.5em 1em 2em;
  color : #636466;
}

/* отступ сверху между li items */
main dt, main ul.indent > li {
  padding-top: 1em;
}

main dl {
  text-align: justify;
}

main img {
  float: right;
  margin: 0 0 1em 1em;
}

main details {
  min-width: 320px;
  width: 40%;
  margin: 0em 0em 0.5em 1em;
  font-size: 0.9em;
  overflow: scroll;
  float: right;
  border: 1px;
  background: #eeeeee;
  padding: 20px;
  clear: both;
  box-shadow: 2px 2px 8px 2px #dadada;
}
main summary::-webkit-details-marker {
  display: none;
}

details.intext {
  all: unset;
  overflow: scroll;
  padding-bottom: 1em;
  padding-left: 0.5em;
}
details.intext[open] {
  border-left: 1px solid #706969;
}
details.intext > summary {
  all: unset;
  width: fit-content;
  cursor: pointer;
  color: #4F4F82;
}
details.intext > summary::-webkit-details-marker {
  display: unset;
}
  
/* main details[open] summary {
  background: red;
} */

aside {
  -webkit-flex: 2;
  -ms-flex: 2;
  flex: 2;

  /* Divs in aside will stack horizontally on smaller screens */
  display: -webkit-flex;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start; /* поднимает div внутри aside наверх */
  justify-content: space-between;

  /* margin: 0 10px; */

  font-size: 0.9em;

  background: #f8f8f8;
}

aside > article {
  -webkit-flex: 1;
  -ms-flex: 1;
  flex: 1 1 280px;
  margin-right: 10px;
  
}

aside h3, summary {
  color: white;
  background: #636466;
  font-size: 0.9em;
  padding: 0.5em;
  width: 100%;
}

aside ul {
  list-style-type: none;
  padding: 0em 1.5em;
}

aside li {
  padding-top: 0.5em;
}

aside p {
  padding: 0em 1em;;
}

footer {
  width: 85%;
  text-align: center;
  font-size: 0.8em;
  margin: auto;
}

/*
details:not([open]) > *:not(summary),
details:not([open]) > *text* {
  any direct child elements other than summary, or any direct child text nodes 
  display: none;
}
*/

/* Responsive layout - makes the menu and the content (inside the section) sit on top of each other instead of next to each other */
@media (max-width: 1000px) {
  div#h-pic {
    display: none;
  }

  header > div {
    flex: auto;
    height: auto;
  }
}

@media (max-width: 800px) {
  aside {
    min-width: 90%;
    margin-top: 1em;
  }
  main details {
    min-width:unset;
  }
}

@media (max-width: 631px) {

  body {
    padding: 0px 10px;
    font-size: 0.9rem;
  }

  div.container, nav, main, aside {
    display: block;
    min-width: unset;
  }
  
  div.container {
    padding: 0;
    margin: 0;
  }
 
  main, aside {
    margin-left: 0px !important;    
  }

  nav#main {
   padding: 0;
  }

  main, aside {
    margin-top: 1em;
  }

  aside {
    padding-left: 10px;
  }

  nav li {
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    padding: 5px;
    vertical-align: middle;
    align-self: center;
  }
}

@media (max-width: 430px) {
/*
  header {
    font-size: 0.7rem;
  }

  div#h-logo {
    font-size: 17px;
    min-width: 170px;
  }

  div#h-contacts {
    min-width: unset;
  }

  div#h-logo > p:last-child {
    font-size: 8px;
    font-weight:lighter;
    letter-spacing: 0.2em;
  }
*/

  nav#main {
/*     включить если не получится бургер
    max-height: 500px; */
    overflow: scroll;
    margin-top: 0px;
  }

  footer {
    width: 100%;
  }

  main details {
    width: 100%;
    margin-left: unset;
    overflow: scroll;
    float: none;
  }

  main details[open] {
    max-height: 400px;
  }

}
@media (max-width: 340px) {
  .navMain .menu-icon {
    padding: 30px 30px 20px 5px !important;
    width: 20px;
  }
}