/* --- 1. ОБЩИЕ СТИЛИ --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: "Arial", sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8fbff;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- 2. ШАПКА И НАВИГАЦИЯ --- */
.header {
  background-color: #1e88e5;
  padding: 1rem 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* --- 3. ОСНОВНАЯ СТРУКТУРА --- */
.main-container {
  flex: 1;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0;
}

.site-title-block {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
}

.site-title {
  color: #1565c0;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-family: "Russo One", sans-serif;
}

.site-subtitle {
  color: #64b5f6;
  font-size: 1.2rem;
  font-weight: 700;
}

.content-wrapper {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.content {
  flex: 3;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --- 4. БЛОКИ ТЕКСТА И ЦВЕТА --- */
.text-block {
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.block-1 { background-color: #e3f2fd; }
.block-2 { background-color: #bbdefb; }
.block-3 { background-color: #90caf9; }
.block-body { background-color: #f8fbff; }
.block-white { background-color: #fff; }

.text-block h2 {
  color: #0d47a1;
  margin-bottom: 1rem;
}

.text-block a {
  color: #1976d2;
  text-decoration: none;
  transition: color 0.7s ease-in-out;
}

.text-block a:hover { color: #7faadb; }
.text-block a:visited { color: #1976d2; }
.text-block a:active { color: #1565c0; }

/* --- 5. БОКОВАЯ ПАНЕЛЬ (SIDEBAR) --- */
.sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-top {
  background-color: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Open Sans", sans-serif;
  font-size: 1.0rem;
}

.sidebar-bottom {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-bottom h3 {
  color: #1565c0;
  margin-bottom: 1rem;
  text-align: center;
}

ul { list-style: none; }
.sidebar-links { list-style: none; }

.sidebar-links li {
  margin-bottom: 0rem;
}

.sidebar-links a {
  color: #1976d2;
  text-decoration: none;
  display: block;
  padding: 0.5rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
}

.sidebar-links a:hover {
  color: #0d47a1;
  background-color: #e3f2fd;
  padding-left: 1rem;
}

.sidebar-links a:hover::before {
  position: absolute;
  left: 0.5rem;
}

/* --- 6. ИЗОБРАЖЕНИЯ И ТЕХНИЧЕСКИЕ КЛАССЫ --- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.pic {
  border: 2px solid #fff;
  border-radius: 5px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  display: block;
}

.sign1, .sign2 {
  display: inline !important;
  float: left;
  margin: 5px 15px 5px 0px !important;
  padding: 5px;
  background: #f0f0f0;
  border-radius: 5px;
  max-width: 45%;
}

.sign2 {
  float: right;
  margin: 5px 0px 5px 15px !important;
}

.sign3 {
  display: block !important;
  margin: 1rem auto !important;
}

figure.sign1 {
  float: left;
  margin: 5px 15px 5px 0px !important;
  padding: 5px;
  background: #e3f2fd;
  border-radius: 5px;
  max-width: 45%;
}

figure.sign2 {
  float: right;
  margin: 5px 0px 5px 15px !important;
  padding: 5px;
  background: #e3f2fd;
  border-radius: 5px;
  max-width: 45%;
}

figure.sign3 {
  display: block;
  margin: 1rem auto !important;
  padding: 5px;
  background: #e3f2fd;
  border-radius: 5px;
  max-width: 80%;
  text-align: center;
}

figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

figcaption {
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
  color: #666;
  margin-top: 8px;
  padding: 5px;
}

.post {
  margin-bottom: 10px;
  padding: 10px 40px;
}

.site-foto {
  color: #1565c0;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-family: "Rubik Dirt", sans-serif;
}

.site-foto img {
  transition: transform 0.3s ease;
}

.site-foto:hover img {
  transform: scale(1.02);
}

.sidebar-top img {
  border-radius: 8px;
  margin: 0 auto 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content img {
  margin: 1rem auto;
  border-radius: 4px;
}

/* --- 7. ТЕКСТОВАЯ ВСТАВКА И ЭЛЕМЕНТЫ --- */
.text-insert {
  background: linear-gradient(135deg, #ffffff 0%, #e3f2fd 100%);
  border-left: 4px solid #2196f3;
  border-radius: 6px;
  padding: 1.2rem;
  margin: 0rem 0;
  box-shadow: 0 3px 10px rgba(33, 150, 243, 0.15);
  transition: all 0.3s ease;
}

.text-insert:hover {
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.25);
  transform: translateY(-2px);
}

.insert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #bbdefb;
}

.insert-header h3 {
  color: #1565c0;
  margin: 0;
  font-size: 1.2rem;
}

.insert-icon { font-size: 1.4rem; }
.insert-content { margin-bottom: 1rem; }
.insert-content p { margin-bottom: 0.8rem; line-height: 1.5; }
.insert-content p:last-child { margin-bottom: 0; }

.insert-footer {
  padding-top: 0.5rem;
  border-top: 1px solid #bbdefb;
  font-size: 0.9rem;
  color: #64b5f6;
  font-style: italic;
}

#obninsk {
  float: right;
  padding: 0 1rem;
  margin: 1rem;
  background: #fff;
  border-radius: 10px;
  text-align: left;
  display: inline;
  width: auto;
  clear: none;
}

hr.gradient {
    border: 0;
    margin: 1rem;
    height: 2px;
    background: linear-gradient(90deg, #57b3f0, #658ce8);
}

.spec {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.3em;
    font-weight: 400;
}

.spec1 {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 1.1em;
    font-weight: 500;
}

.izo {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
}

.izo img {
    flex: 0 0 auto;
    max-width: 100%;
    height: auto;
}

.izo-center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}    

/* --- 8. ПОДВАЛ И КНОПКА НАВЕРХ --- */
.footer {
  background-color: #1e88e5;
  color: white;
  text-align: center;
  padding: 1.5rem;
  margin-top: auto;
}
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #1e88e5;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(30, 136, 229, 0.3);
    
    /* Усилим переход: используем cubic-bezier для эффекта прыжка */
    transition: opacity 0.4s ease, visibility 0.4s, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Состояние скрыто: уменьшаем сильнее (0.5 вместо 0.8) */
    opacity: 0;
    visibility: hidden;
    transform: scale(0.3); 
    
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    /* Кнопка возвращается в полный размер с легким "подскоком" */
    transform: scale(1); 
}

/* Эффект при наведении тоже добавит ощущения "живости" */
.scroll-to-top:hover {
    background: #1565c0;
    transform: scale(1.1); /* Кнопка чуть увеличится при наведении */
}


/* ==============================================================
   9. АДАПТИВНОСТЬ (ВСЕ МЕДИА-ЗАПРОСЫ ВНИЗУ)
   ============================================================== */

@media (max-width: 768px) {
  /* Основная сетка */
  .nav {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .content-wrapper {
    flex-direction: column;
  }

  .site-title {
    font-size: 2rem;
  }

  .sidebar {
    order: -1;
  }

  .sidebar-top,
  .sidebar-bottom {
    width: 100%;
  }

  /* Обтекание картинок */
  figure.sign1,
  figure.sign2,
  img.sign1,
  img.sign2,
  .sign1,
  .sign2 {
    float: none !important;
    display: block !important;
    margin: 1rem auto !important;
    max-width: 100% !important;
    padding: 10px;
  }

  /* Текстовая вставка */
  .text-insert {
    padding: 1rem;
    margin: 1rem 0;
  }

  .insert-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .insert-icon {
    align-self: flex-end;
  }

  /* Кнопка наверх */
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 24px;
  }
}