* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #f4f4f4;
  color: #222;
  line-height: 1.6;
}

a {
  color: #29b6f6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* HEADER НАВЫЛЕТ */
.header {
  width: 100%;
  background: #222;
  color: #fff;
}

/* Внутренний контейнер — центрирует контент */
.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

/* ---------- Слоган в шапке ---------- */
.header__slogan {
  text-align: center;
  font-size: 14px;
  color: #bbb;
  line-height: 1.25;
  flex: 1;                       /* занимает всё свободное место между лого и nav */
  padding: 0 20px;
  min-width: 0;                  /* чтобы длинная строка не ломала flex */
}

.header__slogan span {
  display: block;                /* каждая строка — свой блок */
  white-space: nowrap;           /* не переносим внутри строки */
}

/* Вторая строка — чуть тише первой */
.header__slogan span:last-child {
  color: #888;
  font-size: 13px;
}

.header__logo {
  font-size: 22px;
  font-weight: bold;
  white-space: nowrap;
}

.header__logo a {
  color: #ddd;
}

.header__logo a:hover {
  text-decoration: none;
}

.header__nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.header__nav a {
  color: #ddd;
  font-size: 15px;
  white-space: nowrap;
}

.header__nav a:hover {
  color: #4fc3f7;
  text-decoration: none;
}

/* ---------- Горизонтальная панель навигации ---------- */
.navbar {
    width: 100%;
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.navbar__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.navbar__link {
    display: inline-block;
    padding: 12px 16px;
    color: #333;
    font-size: 15px;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}

.navbar__link:hover {
    color: #29b6f6;
    border-bottom-color: #29b6f6;
    text-decoration: none;
}

/* Активная ссылка — если захотите подсвечивать текущую */
.navbar__link.is-active {
    color: #29b6f6;
    border-bottom-color: #29b6f6;
}

/* ---------- ОБЁРТКА main + aside ---------- */
.wrapper {
  max-width: 1200px;
  margin: 10px auto;
  padding: 0 10px;
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.main {
  flex: 1;          /* занимает всё свободное место */
  min-width: 0;     /* чтобы не ломался flex при длинных словах */
}

/* ---------- СТАТЬИ ---------- */
.main h1 {
  margin-bottom: 10px;
  font-size: 26px;
}

.post {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);

  /* Картинка справа от текста */
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Картинка справа */
.post__thumb {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  order: 2;              /* ← сдвигаем картинку в конец */
}

/* Текстовый блок слева */
.post__body {
  flex: 1;
  min-width: 0;
  order: 1;
}

.post h2 {
  font-size: 20px;
  margin-bottom: 6px;
}

.post h2 a {
  color: #222;
}

.post h2 a:hover {
  color: #29b6f6;
  text-decoration: none;
}

.post__meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 10px;
}

.post__more {
  display: inline-block;
  margin-top: 10px;
  font-size: 14px;
}

/* ---------- ASIDE ---------- */
.aside {
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  padding: 20px;
  margin-top: 50px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.aside h3 {
  font-size: 16px;
  margin-bottom: 10px;
  margin-top: 15px;
}

.aside h3:first-child {
  margin-top: 0;
}

.aside ul {
  list-style: none;
}

.aside ul li {
  padding: 5px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.aside ul li:last-child {
  border-bottom: none;
}

.aside ul li a {
  color: #444;
}

/*article*/
/* Ссылка-обёртка для картинки — чтобы img не «прыгал» при hover */
.post__thumb-link {
    display: block;
    flex-shrink: 0;
    order: 2;
}

.post__thumb {
    display: block;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform .2s;
}
.post__thumb-link:hover .post__thumb {
    transform: scale(1.03);
}

/* Категория в мете — маленькая цветная метка */
.post__cat {
    display: inline-block;
    padding: 2px 8px;
    background: #e1f5fe;
    color: #0277bd;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    transition: background .15s;
}

.post__cat:hover {
    background: #b3e5fc;
    text-decoration: none;
}

/* Статья: картинка справа, текст обтекает */
.post--full {
    display: block;      /* выключаем flex, который унаследован от .post */
}

.post--full .post__thumb {
    float: right;
    width: 260px;
    height: 260px;
    margin: 0 0 15px 20px;   /* отступы: снизу и слева, чтобы текст не лип */
    order: 0;                /* сбрасываем order от .post */
    shape-outside: none;     /* прямоугольник, не овал */
}

/* Сбрасываем flex-правило post__body для статьи */
.post--full .post__body {
    order: 0;
    flex: none;
    min-width: 0;
}

/* Чтобы float не «вылезал» из карточки */
.post--full::after {
    content: "";
    display: table;
    clear: both;
}

.post--full h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

/* Содержимое статьи */
.post__content {
    margin-top: 15px;
    line-height: 1.7;
}
.post__content p {
    margin-bottom: 12px;
}
.post__content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.post__content pre {
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 8px;
    overflow-x: auto;              /* горизонтальный скролл для длинных строк */
    font: 14px/1.5 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Внутри pre тег code не должен снова красить фон */
.post__content pre code {
    background: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

/* Inline-код в тексте: `pvcreate`, `fdisk` */
.post__content code {
    background: #f0f0f0;
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 4px;
    font: .9em 'Consolas', 'Monaco', monospace;
}

.footer {
  background: #222;
  color: #aaa;
  margin-top: 40px;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  font-size: 14px;
}

/* ---------- Пагинация ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0 10px;
    flex-wrap: wrap;
}

.pagination__link {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    min-width: 40px;
    text-align: center;
}

.pagination__link:hover {
    background: #f0f0f0;
    color: #29b6f6;
    border-color: #29b6f6;
    text-decoration: none;
}

.pagination__link--active {
    background: #29b6f6;
    color: #fff;
    border-color: #29b6f6;
    font-weight: bold;
    cursor: default;
}

.pagination__link--active:hover {
    background: #29b6f6;
    color: #fff;
}

.pagination__link--disabled {
    color: #bbb;
    background: #fafafa;
    border-color: #eee;
    cursor: default;
}

.pagination__link--disabled:hover {
    background: #fafafa;
    color: #bbb;
    border-color: #eee;
}

/* ---------- АДМИНКА ---------- */
.admin {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.table th {
    background: #fafafa;
    font-size: 14px;
    color: #555;
}
.table td a {
    margin-right: 10px;
}

.form {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    max-width: 700px;
}
.form label {
    display: block;
    margin-bottom: 15px;
    font-size: 14px;
    color: #444;
}
.form input,
.form textarea,
.form select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
}
.form button {
    padding: 10px 22px;
    background: #29b6f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}
.form button:hover {
    background: #0288d1;
}
.form a {
    margin-left: 15px;
}

.login-box {
    max-width: 360px;
    margin: 80px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.login-box h1 { margin-bottom: 20px; }
.login-box input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
}
.login-box button {
    width: 100%;
    padding: 11px;
    background: #29b6f6;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.error {
    color: #c62828;
    margin-bottom: 12px;
}
.success {
    color: #2e7d32;
    margin-bottom: 15px;
    background: #e8f5e9;
    padding: 10px 15px;
    border-radius: 6px;
}

.form input[type="file"] {
    padding: 8px 0;
    border: none;
    background: transparent;
}

/*Адаптив под узкие экраны*/
/* Планшет / узкий десктоп */
@media (max-width: 800px) {
  .wrapper {
    flex-direction: column;
  }
  .aside {
    width: 100%;
  }
}

/* Мобильные */
@media (max-width: 600px) {
  .header__inner {
    justify-content: center;
    text-align: center;
  }
  .header__slogan {
    font-size: 12px;
    padding: 4px 0;
    flex: 1 1 100%;       /* переносим на отдельную строку под лого */
    order: 3;             /* уезжает вниз, под nav */
  }
  .header__slogan span {
    white-space: normal;  /* разрешаем перенос, если совсем узко */
  }
  .header__nav {
    gap: 16px;
    justify-content: center;
  }

  .navbar__inner {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .navbar__link {
    padding: 10px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  /* Статья и карточка на главной: картинка сверху */
  .post,
  .post--full {
    display: flex;              /* ← возвращаем flex для .post--full */
    flex-direction: column;
  }
  .post__thumb,
  .post--full .post__thumb {
    float: none;                /* ← сбрасываем обтекание */
    width: 100%;
    height: auto;
    max-height: 220px;
    margin: 0 0 12px 0;         /* margin со всех сторон обнуляем, снизу — 12px */
    order: 0;
  }

  .post__content pre {
    font-size: 12.5px;
    padding: 12px 14px;
  }
}