* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial","Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html
{
  font-size:14px;
 
}

html, body {
  line-height:1.5;
  width: 100%;
  height: 100%;
  background-color: #f0f2f5;
  color: #2a2a2a;
  font-size:1rem;
  background-image: url(/xlam/clouds-big-new.jpg);
  background-repeat: no-repeat;
  background-position: center top;
  background-attachment: fixed;
}


 body::-webkit-scrollbar {
    height: 8px;
    width:3px;
  }

   body::-webkit-scrollbar-track {
    /*background: #e0e0e0;*/
    border-radius: 4px;
  }

   body::-webkit-scrollbar-thumb {
    background-color: #0a8fff;
    border-radius: 4px;
  }
  
  p
  {
    text-indent: 2em; 
    
  }

a
{
  color: #0a8fff;
  text-decoration: none;
}

a:hover
{
  text-decoration: underline;
}

.wrapper {
  width: 100%;
  min-height: 100vh;
  /*background: #fff;*/
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.header {
  min-height:10rem;
  background-color: #2e3b4e;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  /*align-items: center;*/
  border-bottom: 3px solid #e3e3e3;
}

.logo
{
  
  margin-bottom:auto;
  font-size: 1.8rem;
  font-family:"Times new Roman";
  font-weight: bold;
  z-index:100;
  
    text-shadow:
    0 0 3px black,
    0 0 6px black,
    0 0 9px black;
}

  .emoji 
  {
    display: inline-block;
    width: 12px; /* размер иконки */
    height: 12px;
    margin-right: 9px;
    background-image: url("https://vk.com/images/emoji/sprite.png?8");
    background-repeat: no-repeat;
    background-position: -Xpx -Ypx; /* смещение под конкретный эмодзи */
    
  }

/* меню*/

.nav {
  z-index: 100;
  font-size: clamp(1.2rem, 0.9vw, 2rem);
  margin-right:auto;
  margin-left:clamp(1rem, 2vw, 5rem);
  height:5rem;
  /*-webkit-font-smoothing: antialiased;*/
  /*-moz-osx-font-smoothing: grayscale;*/
  /*transform: translateZ(0); */
  /*text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);*/
}

.nav ul {
  list-style: none;
  display: flex;
  gap: clamp(0.5rem, 2vw, 3rem);
  position: relative;
}

.nav ul li {
  position: relative;
}

.nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 0;
  display: inline-block;
  /*transition: color 0.3s;*/
}

.nav ul li a:hover {
  color: #ffc107;
}

/* Подменю */
.nav ul li ul {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #2e3b4e;
  padding: 0.5rem 0;
  min-width: 250px;
  display: none;
  flex-direction: column;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  z-index: 999;
  gap:0px;
  word-wrap: break-word;     
  white-space: normal;       
  border-radius: 4px;
}


.nav ul li:hover > ul {
  display: flex;
}

.nav ul li ul li {
  width: 100%;
}

.nav ul li ul li a {
  width: 100%;
  padding: 0.3rem 0.5rem;
  color: white;
  text-align: left;
  white-space: break-spaces;
}

.nav ul li ul li a:hover {
  background-color: #3f4d63;
  color: #ffc107;
}

/* Третье и последующие уровни */
.nav ul li ul li {
  position: relative;
}

.nav ul li ul li ul {
  top: 0;
  left: 100%;
  position: absolute;
  display: none;
  background-color: #2e3b4e;
  min-width: 250px;
  padding: 0.5rem 0;
  flex-direction: column;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  gap: 2px;
  border-radius: 4px;
  z-index: 1000;
}

/* Показывать при наведении */
.nav ul li ul li:hover > ul {
  display: flex;
}


.nav ul li ul li > ul {
  position: absolute;
}


.nav ul li ul li > ul {
  left: 100%;
  top: 0;
}

.nav ul li ul li.reverse > ul 
{
  left: auto;
  right: 100%;
  top: 0;
  background-color: #223042;
  border:2px solid #1e2b3e;
}


/* Стрелочка у родителя третьего уровня */
.nav ul li ul li:has(ul) > a::after {
  content: "→";
  float: right;
  margin-left: 0.5rem;
  margin-top:-0.15rem;
  font-size: 1rem;
  color: #ccc;
  transition: transform 0.3s;
  
}

.nav ul li ul li.reverse > a::after 
{
  content: "←";
  float: left;
  margin-right: 0.5rem;
  margin-left: 0;
}

/* При наведении  передвинуть стрелочку */
.nav ul li ul li:hover > a::after {
  transform: translateX(0.5rem);
  color: #ffc107;
}


@media (max-width: 1000px) {
  .nav {
   padding-top:2rem;
    height: auto;
    margin: 0;
    width: 100%;
    font-size:1rem;
  }

  .nav ul {
    flex-direction: column;
    gap: 0; /* убираем горизонтальные промежутки */
    width: 100%;
  }

  .nav ul li {
    width: 100%;
  }

  .nav ul li a {
    display: block;
    padding:0.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

    /* Всё подменю второго, третьего и более уровней — всегда static */
  .nav ul li ul,
  .nav ul li ul li ul,
  .nav ul li ul li ul li ul {
    position: static;
    display: none; /* или block, если всегда раскрыты */
    width: 100%;
    box-shadow: none;
    background: none;
    padding: 0;
    min-width: 0;
  }
  
  .nav ul li ul.open,
  .nav ul li ul li ul.open,
  .nav ul li ul li ul li ul.open {
    display: block;
  }
  
  .nav ul li ul li a {
    padding-left: 2rem; /* отступ для вложенности */
  }

  .nav ul li ul li ul li a {
    padding-left: 3rem;
  }

  .nav ul li ul li ul li ul li a {
    padding-left: 4rem;
  }
  
  .nav ul li ul li ul li ul li ul li a {
    padding-left: 5rem;
  }

  /* Убираем стрелки или поворачиваем */
  .nav ul li ul li:has(ul) > a::after {
    content: "↓";
  }
  .nav > ul > li 
  {
    position: relative; /* нужно для псевдоэлемента */
  }

  .nav > ul > li:has(ul) > a::after 
  {
    content: " ↓";
    margin-left: 0.4rem;
    font-size: 0.9em;
  }

}


/* конец меню*/

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1vw;
  padding: 2vw;
  flex-grow: 1;
}

.sidebar {
  background: #f9fafb;
  padding: 1vw;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1 1 100%;
  max-width: 100%;
}

.main {
  font-family:'Times New Roman' !important;
  background: #ffffff;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex: 1 1 100%;
  max-width: 100%;
}

hr 
{
  margin: 0.4rem 0;
  border: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, #888, transparent);
  opacity: 0.6;
}

@media (min-width: 720px) {
  .sidebar {
    flex: 1 1 20%;
    max-width: 20%;
  }

  .main {
    flex: 1 1 55%;
    max-width: 55%;
  }
}


/* бока */


.sidebar {
  background: #ffffff;
  padding: 1.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 0.9rem;
}

.sidebar-section {
  margin-bottom: 1rem;
  padding: 1rem;
  /*background-color: #f8f9fa;*/
  background-color: #ddeeff80;
  border-left: 4px solid #0a8fff60;
  /*border-left: 4px solid #2e3b4e;*/
  border-radius: 4px;
}

.sidebar-title {
  font-size: 1 rem;
  font-weight: bold;
  color: #2e3b4e;
  margin-bottom: 1rem;
  margin-top:1.2rem;
  border-bottom: 0.8px dashed #bbb;
  padding-bottom: 0.3rem;
}

.sidebar-menu {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.sidebar-menu li {
  margin-bottom: 0.3rem;
  padding-left: 1.2rem;
  position: relative;
}

.sidebar-menu li::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: #0a8fff;
  
}

.sidebar-menu a {
  color: #0a8fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.sidebar-menu a:hover {
  color: #0056b3;
  text-decoration: underline;
}

@media (max-width: 1000px) {
  .sidebar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
    padding: 1rem;
    white-space: nowrap;
    scrollbar-width: thin;
    scrollbar-color: #0a8fff #e0e0e0;
  }

  .sidebar::-webkit-scrollbar {
    height: 8px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
  }

  .sidebar::-webkit-scrollbar-thumb {
    background-color: #0a8fff;
    border-radius: 4px;
  }

  .sidebar-section {
    flex: 0 0 45%;
    min-width: 240px;
    max-height:160px;
    display: inline-block;
    vertical-align: top;
    white-space: normal;
    overflow:auto;
    scrollbar-width: thin;
    scrollbar-color: #0a8fff #e0e0e0;
  }
  
  .sidebar-section a img
  {
    max-height:98%;
  
  }
}



/* подвал */


.footer
{
  width:100%;
  text-align: center;
  padding: 1rem;
  background: #2e3b4e;
  color: white;
  font-size: 0.9rem;
  border-top: 3px solid #e3e3e3;
  min-height:3rem;
  
    display: flex;
    flex-wrap: wrap; /* позволяет переносить элементы */
    justify-content: center; /* центрирует по горизонтали */
    gap: 10px; /* расстояние между элементами */
    padding: 20px;
}


.footer_item
{
   text-align: left;
  padding: 10px 20px;
  border-radius: 5px;
  white-space: nowrap; /* предотвращает перенос текста */
}

.footer_item a
{
  color:white;
}

.footer_item .hed
{
  
  margin-bottom:16px;
  text-transform:uppercase;
  
}


#umodal
{
  position: fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  z-index:9999;
  font-family: Arial;
}

#umodal-bg
{
  position:absolute;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.5);
}

#umodal-box
{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  background:#fff;
  min-width:320px;
  max-width:600px;
  padding:20px;
  border-radius:6px;
  box-shadow:0 0 20px rgba(0,0,0,0.4);
}

#umodal-title
{
  font-size:18px;
  font-weight:bold;
  margin-bottom:10px;
}

#umodal-text
{
  margin-bottom:20px;
}

#umodal-buttons
{
  text-align:right;
}

#umodal-buttons button
{
  margin-left:10px;
  padding:6px 14px;
  cursor:pointer;
}






















