/* ============================================
   УЛУЧШЕННЫЙ CSS - СОВРЕМЕННЫЕ ПРАКТИКИ
   ============================================ */

/* ============================================
   CSS ПЕРЕМЕННЫЕ (Custom Properties)
   Централизованное управление цветами и значениями
   ============================================ */
:root {
  /* Цветовая палитра */
  --color-primary: #2286b4;
  --color-primary-light: #58b4df;
  --color-primary-dark: #207ca7;
  --color-secondary: #eb3134;
  --color-text: #000;
  --color-text-light: #404040;
  --color-text-muted: #b8b8b8;
  --color-text-inverse: #fff;
  --color-bg-main: #e8e8e8;
  --color-bg-white: #fff;
  --color-bg-dark: #363636;
  --color-bg-gray: #bfbfbf;
  --color-border: #ababab;
  --color-link: #d4d4d4;
  --color-link-hover: #333;
  
  /* Шрифты */
  --font-primary: Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
  --font-secondary: Rosarivo, Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
  --font-menu: 'Goudy Bookletter 1911', Arial, 'Arial Unicode MS', Helvetica, Sans-Serif;
  
  /* Размеры */
  --font-size-base: 13px;
  --font-size-small: 11px;
  --font-size-medium: 15px;
  --font-size-large: 22px;
  --font-size-xlarge: 28px;
  
  /* Отступы */
  --spacing-xs: 3px;
  --spacing-sm: 5px;
  --spacing-md: 10px;
  --spacing-lg: 20px;
  
  /* Радиусы скругления */
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 6px;
  
  /* Тени */
  --shadow-default: 0 0 3px 2px rgba(0, 0, 0, 0.25);
  
  /* Ширины */
  --width-container: 1000px;
  --width-sidebar: 200px;
  --min-width-body: 1100px;
}

/* ============================================
   БАЗОВЫЕ СТИЛИ И СБРОС
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-width: var(--min-width-body);
  color: var(--color-text);
  font-size: var(--font-size-base);
  font-family: var(--font-primary);
  font-weight: 400;
  font-style: normal;
}

/* Сброс отступов для типографики */
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, a {
  margin: 0;
  padding: 0;
}

ul {
  list-style-type: none;
}

ol {
  list-style-position: inside;
}

a img {
  border: 0;
}

form {
  padding: 0;
  margin: 0;
}

/* ============================================
   ГЛАВНЫЙ КОНТЕЙНЕР
   Современный синтаксис градиентов
   ============================================ */
#main {
  position: relative;
  width: 100%;
  min-height: 100%;
  margin: 0 auto;
  padding: 0;
  background: var(--color-bg-main);
  background: linear-gradient(to bottom, var(--color-bg-gray) 0, var(--color-bg-white) 1050px) no-repeat;
  background-attachment: fixed;
  text-align: justify;
  cursor: default;
  overflow: hidden;
}

/* ============================================
   CLEARFIX УТИЛИТА
   Современный подход
   ============================================ */
.clearfix::after,
.sheet::before,
.sheet::after,
.header::before,
.header::after,
.footer::before,
.footer::after,
.nav::before,
.nav::after,
.layout-wrapper::before,
.layout-wrapper::after,
.layout-cell::before,
.layout-cell::after {
  content: "";
  display: table;
  clear: both;
}

/* ============================================
   ОСНОВНЫЕ БЛОКИ
   ============================================ */
.sheet,
article,
footer,
header,
nav {
  display: block;
  box-sizing: border-box;
  background-origin: border-box;
}

.sheet {
  position: relative;
  width: var(--width-container);
  margin: var(--spacing-md) auto 0;
  padding: 7px;
  background: var(--color-bg-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-default);
  cursor: auto;
  z-index: 1;
}

/* ============================================
   ШАПКА САЙТА
   ============================================ */
.header {
  position: relative;
  height: 175px;
  margin: 0 auto;
  background-image: url(images/header.jpg);
  background-position: 0 0;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  z-index: 1;
}

.logo {
  margin-top: var(--spacing-lg);
}

.shapes {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  z-index: 0;
}

.shapes-left {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 570px;
  overflow: hidden;
  z-index: 0;
}

.address {
  margin: var(--spacing-sm);
  color: var(--color-text-inverse);
  font-size: 14px;
  font-family: var(--font-secondary);
  font-weight: 700;
}

.tel {
  font-size: var(--font-size-large);
  color: var(--color-secondary);
}

.headrod {
  margin-top: 15px;
  margin-left: 300px;
}

/* ============================================
   НАВИГАЦИЯ
   Улучшенные градиенты и структура
   ============================================ */
.nav {
  position: relative;
  margin: 0 auto;
  padding: 4px;
  background: var(--color-bg-dark);
  background: linear-gradient(to bottom, 
    #333 0%, 
    #404040 50%, 
    #2e2e2e 50%, 
    #3b3b3b 100%
  ) no-repeat;
  text-align: left;
  z-index: 499;
}

.nav::before {
  content: ' ';
}

/* Горизонтальное меню */
.hmenu {
  float: left;
}

ul.hmenu {
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  padding: 0;
  border: 0;
  list-style-type: none;
  min-height: 0;
  font-size: var(--font-size-medium);
  font-family: var(--font-primary);
  font-weight: 400;
  text-align: justify;
}

ul.hmenu::after {
  content: ".";
  display: block;
  height: 0;
  visibility: hidden;
  overflow: hidden;
  clear: both;
}

ul.hmenu li {
  position: relative;
  display: block;
  float: left;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 5;
}

ul.hmenu li:hover {
  z-index: 10000;
  white-space: normal;
}

ul.hmenu > li {
  margin-left: 9px;
}

ul.hmenu > li:first-child {
  margin-left: 4px;
}

ul.hmenu > li:last-child {
  margin-right: 4px;
}

ul.hmenu > li::before {
  position: absolute;
  display: block;
  content: ' ';
  top: 0;
  left: -9px;
  width: 9px;
  height: 30px;
  background: url(images/menuseparator.png) center center no-repeat;
}

ul.hmenu > li:first-child::before {
  display: none;
}

/* Ссылки горизонтального меню */
ul.hmenu a,
ul.hmenu a:link,
ul.hmenu a:visited,
ul.hmenu a:hover {
  position: relative;
  outline: 0;
  z-index: 11;
}

ul.hmenu > li > a {
  display: block;
  position: relative;
  height: 30px;
  margin: 0 auto;
  padding: 0 32px;
  border-radius: var(--radius-lg);
  color: var(--color-link);
  font-size: 12px;
  font-family: var(--font-menu);
  font-weight: 400;
  font-style: normal;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 30px;
  cursor: pointer;
}

.hmenu > li > a,
.hmenu > li > a.active,
.hmenu > li > a:hover,
.hmenu > li > a:link,
.hmenu > li > a:visited {
  font-size: 12px;
  font-family: var(--font-menu);
  font-weight: 400;
  font-style: normal;
  text-decoration: none;
  text-transform: uppercase;
  text-align: left;
}

ul.hmenu > li > a.active {
  margin: 0 auto;
  padding: 0 32px;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  background: linear-gradient(to bottom, 
    #2183b0 0%, 
    #2693c5 50%, 
    #207ca7 50%, 
    #248cbc 100%
  ) no-repeat;
  color: #d8eef8;
  text-decoration: none;
}

ul.hmenu > li:hover > a,
ul.hmenu > li > a:hover,
ul.hmenu > li > a:visited {
  text-decoration: none;
}

ul.hmenu > li > a:hover {
  margin: 0 auto;
  padding: 0 32px;
  border-radius: var(--radius-lg);
  background: var(--color-bg-gray);
  background: linear-gradient(to bottom, 
    #bdbdbd 0%, 
    #c9c9c9 50%, 
    #b8b8b8 50%, 
    #c4c4c4 100%
  ) no-repeat;
  color: var(--color-link-hover);
  text-decoration: none;
}

/* ============================================
   ВЕРТИКАЛЬНОЕ МЕНЮ
   ============================================ */
.vmenublock {
  margin: var(--spacing-xs);
}

.vmenublockheader {
  padding: 6px 0;
  margin: 0 auto;
}

.vmenublockcontent {
  margin: 0 auto;
}

ul.vmenu {
  list-style: none;
}

ul.vmenu,
ul.vmenu li {
  display: block;
  margin: 0;
  padding: 0;
  width: auto;
  line-height: 0;
}

ul.vmenu li {
  position: relative;
}

ul.vmenu > li {
  margin-top: 2px;
}

ul.vmenu > li:first-child {
  margin-top: 0;
}

ul.vmenu a {
  display: block;
  position: relative;
  text-align: justify;
  cursor: pointer;
  z-index: 1;
}

ul.vmenu > li > a {
  margin: 0 auto;
  padding: 0 10px;
  border-radius: var(--radius-lg);
  min-height: 30px;
  color: grey;
  font-size: 12px;
  font-family: var(--font-menu);
  font-weight: 400;
  font-style: normal;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 30px;
}

/* Иконки вертикального меню */
ul.vmenu > li > a::before {
  content: url(images/vmenuitemicon.png);
  display: inline-block;
  position: relative;
  margin-right: 5px;
  bottom: 2px;
  vertical-align: middle;
  font-size: 0;
  line-height: 0;
}

ul.vmenu > li > a.active::before {
  content: url(images/vmenuactiveitemicon.png);
}

ul.vmenu > li:hover > a::before,
ul.vmenu > li:hover > a.active::before,
ul.vmenu > li > a:hover::before,
ul.vmenu > li > a.active:hover::before {
  content: url(images/vmenuhovereditemicon.png);
}

/* Состояния вертикального меню */
ul.vmenu > li > a:hover,
ul.vmenu > li > a.active:hover {
  margin: 0 auto;
  padding: 0 10px;
  background: #35a9d0;
  background: linear-gradient(to bottom, 
    #30a7cf 0%, 
    #45b0d3 50%, 
    #30a7cf 50%, 
    #2fa0c6 50%, 
    #30a7cf 70%, 
    #3dacd1 100%
  ) no-repeat;
  text-decoration: underline;
}

ul.vmenu a:hover,
ul.vmenu a.active:hover {
  color: #185467;
}

ul.vmenu > li > a.active {
  margin: 0 auto;
  padding: 0 10px;
  background: #3aa7d9;
  background: linear-gradient(to bottom, 
    #36a5d9 0%, 
    #4bafdd 50%, 
    #2da1d7 50%, 
    #43abdb 100%
  ) no-repeat;
  color: #14506b;
  text-decoration: none;
}

/* ============================================
   LAYOUT СИСТЕМА
   ============================================ */
.layout-wrapper {
  position: relative;
  margin: 0 auto;
  z-index: 1;
}

.content-layout {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.content-layout-row {
  display: table-row;
}

.layout-cell {
  display: table-cell;
  vertical-align: top;
}

.postcontent .content-layout {
  border-collapse: collapse;
}

.content-layout .sidebar1 {
  width: var(--width-sidebar);
  margin: 0 auto;
  background: transparent;
}

.content-layout .content {
  margin: 0 auto;
}

/* ============================================
   КОНТЕНТ И ТИПОГРАФИКА
   ============================================ */
.postcontent,
.postcontent table {
  font-family: var(--font-primary);
}

.postcontent,
ul.vmenu a {
  text-align: justify;
}

.postcontent p {
  margin: 12px 0;
}

.postcontent h2,
.postcontent h3 {
  font-family: var(--font-secondary);
  font-weight: 400;
  font-style: normal;
  text-transform: uppercase;
  line-height: 120%;
}

.postcontent h2 {
  margin: var(--spacing-md) 0 0;
  color: var(--color-primary-light);
  font-size: var(--font-size-large);
}

.postcontent h3 {
  margin: var(--spacing-md) 0 0;
  color: var(--color-text-muted);
  font-size: 18px;
}

/* ============================================
   БЛОКИ И ПОСТЫ
   ============================================ */
.block {
  margin: var(--spacing-xs);
}

.post {
  margin: var(--spacing-xs);
  padding: var(--spacing-sm);
  background: var(--color-bg-white);
  border: 1px solid rgba(171, 171, 171, 0.9);
  border-radius: var(--radius-lg);
}

/* ============================================
   ФОРМЫ И ЭЛЕМЕНТЫ ВВОДА
   ============================================ */
input,
select,
textarea {
  vertical-align: middle;
  font-size: 12px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  margin: 0 auto;
  padding: 8px 0;
  background: var(--color-bg-white);
  border: 1px solid var(--color-bg-gray);
  border-radius: var(--radius-lg);
  color: var(--color-text-light);
  font-size: 12px;
  font-family: var(--font-primary);
  font-weight: 700;
  font-style: normal;
  text-transform: uppercase;
  text-shadow: none;
}

/* ============================================
   СТАТЬИ И МЕДИА
   ============================================ */
.article img {
  margin: var(--spacing-sm);
}

.article table,
table.article {
  margin: 1px;
  border-collapse: collapse;
}

.article td {
  padding: 2px;
  border: 1px dotted var(--color-border);
}

pre {
  padding: 0.1em;
  overflow: auto;
}

blockquote {
  margin: var(--spacing-md) 0 0 25px;
  padding: 15px 15px 15px 52px;
  background: #cfcfcf url(images/postquote.png) no-repeat;
  color: #041015;
  font-family: var(--font-primary);
  font-weight: 400;
  font-style: italic;
  text-align: justify;
  overflow: auto;
  clear: both;
}

/* ============================================
   ПОДВАЛ
   ============================================ */
.footer {
  position: relative;
  margin: 0 auto;
  padding: var(--spacing-lg);
  background: var(--color-bg-dark);
  border-top: 1px solid var(--color-bg-gray);
  border-radius: var(--radius-sm);
  color: #c4c4c4;
  font-size: var(--font-size-small);
  font-family: var(--font-primary);
  text-align: center;
}

.footer td {
  color: #c4c4c4;
  font-size: var(--font-size-small);
  font-family: var(--font-primary);
}

.footer p {
  padding: 0;
  text-align: center;
}

/* ============================================
   УТИЛИТАРНЫЕ КЛАССЫ
   ============================================ */
.big {
  font-size: 16px;
}

.plain-link {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   МЕДИА-ЗАПРОСЫ ДЛЯ АДАПТИВНОСТИ
   Добавлены для улучшения отзывчивости
   ============================================ */
@media screen and (max-width: 1100px) {
  body {
    min-width: 100%;
  }
  
  .sheet {
    width: 95%;
    max-width: var(--width-container);
  }
}

@media screen and (max-width: 768px) {
  .content-layout {
    display: block;
  }
  
  .layout-cell {
    display: block;
    width: 100%;
  }
  
  .content-layout .sidebar1 {
    width: 100%;
  }
  
  ul.hmenu > li > a {
    padding: 0 15px;
  }
}

/* ============================================
   УЛУЧШЕНИЯ ПРОИЗВОДИТЕЛЬНОСТИ
   ============================================ */
/* Оптимизация анимаций и переходов */
.hmenu a,
.vmenu a {
  transition: background-color 0.2s ease, color 0.2s ease;
  will-change: background-color, color;
}

/* Оптимизация рендеринга для фиксированных элементов */
#main {
  transform: translateZ(0);
  backface-visibility: hidden;
}
