/* ==============================
   БАЗОВЫЕ СТИЛИ САЙТА
============================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.post-page {
  background: #c9d4e5;
}

body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background: #fff;
  color: #000;
  line-height: 1.5;
}

/* ==============================
   ШАПКА (HEADER)
============================== */
header {
  background: #0b1f3a;   /* как .site-footer */
  color: #b0b0b0;
  padding: 15px;
  text-align: center;
  font-size: 18px;
}

header a {
  color: #b0b0b0;        /* как ссылки в футере */
  text-decoration: none;
}

header nav a {
  color: #b0b0b0;        /* как ссылки в футере */
  text-decoration: none;
  font-size: 16px;
}

header nav a:hover {
  color: #e0e0e0;
  text-decoration: underline;
}
header nav {
  display: flex;
  justify-content: center;
  gap: 36px;      /* было 20px */
  margin-top: 14px; /* было 8px */
  flex-wrap: wrap;  /* чтобы на мобилке переносилось */
}
@media (max-width: 600px){
  header nav { gap: 8px; }
  header nav a { padding: 4px 6px; }
}

.site-header .logo{
  color:#fff;            /* белый */
  font-weight:700;
  font-size:20px;
  text-decoration:none;
}

.site-header .logo:hover{
  color:#e0e0e0;
  text-decoration:none;
}

/* ==============================
   ГЛАВНАЯ СТРАНИЦА — HERO
============================== */
.hero {
  display: flex;
  justify-content: center;
  padding: 24px;
  background: #c9d4e5;
  
}

.hero-card {
  max-width: 900px;
  width: 100%;
  background: #fff;
  border: 0px solid #ddd;
  padding: 24px;
  margin: 0 auto;
  
}

.hero-card h1 {
  font-family: sans-serif;
  font-size: 23px;
  line-height: 1.2;
  margin: 0 0 12px;
}

.hero-card p {
  font-family: sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 700px) {
  .hero {
    padding: 16px;
  }
  .hero-card {
    padding: 16px;
  }
  .hero-card h1 {
    font-size: 23px;
  }
  .hero-card p {
    font-size: 16px;
    color: #000;
    line-height: 1.7;
  }
}

/* ==============================
   КАРТОЧКИ ПРОЕКТОВ (index.php)
============================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  padding: 20px 15px;
  max-width: 1100px;
  margin: 0 auto;
  margin-top: 20px;
}

.card {
  background: #eee;
  padding: 20px;
  text-align: left;
  border: 1px solid #ccc;
  font-size: 16px;
}

.card h2 {
  font-size: 17px;
  line-height: 1.3;
  margin-bottom: 7px;
}

.card h2 a {
  color: inherit;
  text-decoration: none;
}

.card h2 a:hover {
  text-decoration: underline;
}

.card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  margin-bottom: 10px;
}

/* адаптив */
@media (max-width: 700px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   ПАГИНАЦИЯ
============================== */
.pagination {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid #ccc;
  text-decoration: none;
  color: #000;
  border-radius: 4px;
}

.pagination a:hover {
  background: #000;
  color: #fff;
}

.pagination .current {
  background: #000;
  color: #fff;
  border-color: #000;
}

/* ==============================
   СТРАНИЦА ОДНОГО ПОСТА (post.php)
============================== */
.post-container {
  max-width: 850px;
  margin: 40px auto;
  padding: 0 20px;
}

.post-card {
  background: #fff;
  border: 1px solid #ccc;
  padding: 25px;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

.post-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  margin-bottom: 20px;
  display: block;
  border-radius: 4px;
}

.post-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.post-card .content {
  font-size: 16px;
  line-height: 1.6;
  color: #222;
}

.post-card .content h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 18px 0 10px;
  line-height: 1.4;
}


.post-card .content h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 16px 0 10px;
  line-height: 1.4;
}

.post-card .content p {
  margin-bottom: 15px;
}

.post-card .content strong,
.post-card .content b {
  font-weight: 600;
  color: #000;
}

/* списки */
.post-card .content ul {
  list-style-type: disc;
  margin: 10px 0 20px 25px;
  padding-left: 0;
}

.post-card .content ol {
  list-style-position: outside;
  margin: 10px 0 20px 30px;
  padding-left: 0;
}

.post-card .content li {
  margin-bottom: 8px;
  line-height: 1.4;
  padding-left: 3px;
   font-size: 16px;
}

.post-card .content p + ul,
.post-card .content p + ol {
  margin-top: 8px;
}

.back-link {
  color:#0056b3;
  text-decoration: underline;
  font-weight: bold;
}

@media (max-width: 700px) {
  .post-container {
    padding: 0px;
  }

  .post-card {
    padding: 15px;
  }

  .post-card .content {
    font-size: 16px;
    line-height: 1.6;
  }

  .post-card .content h1,
  .post-card .content h2,
  .post-card .content h3 {
    color: #000;
  }

  .post-card .content h2 {
    font-size: 20px;
    margin: 14px 0 8px; /* ← адаптивные отступы */
    line-height: 1.4;
  }

  .post-card .content h3 {
    font-size: 18px;
    margin: 12px 0 6px;
  }
}

@media (max-width: 700px) {
  .post-card .content h1 {
    font-size: 21px;
    margin: 16px 0 10px;
    line-height: 1.25;
  }
}
/* ====== СТРАНИЦА КОНТАКТОВ ====== */

.contact-container {
  max-width: 600px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #ccc;
  padding: 25px;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

.contact-container h1 {
  font-size: 26px;
  margin-bottom: 20px;
  text-align: center;
}

.contact-container form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-container label {
  font-weight: 600;
}

.contact-container input[type="text"],
.contact-container textarea {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.contact-container textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-container button {
  background: #000;
  color: #fff;
  padding: 12px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.contact-container button:hover {
  background: #333;
}

.message {
  margin-top: 15px;
  text-align: center;
  font-weight: 600;
}

.message.success {
  color: green;
}

.message.error {
  color: red;
}

/* Мобильная адаптация */
@media (max-width: 600px) {
  .contact-container {
    margin: 20px 10px;
    padding: 20px;
  }

  .contact-container h1 {
    font-size: 22px;
  }

  .contact-container input[type="text"],
  .contact-container textarea {
    font-size: 15px;
  }

  .contact-container button {
    font-size: 15px;
    padding: 10px;
  }
}

/* ==============================
   СТИЛИ СТРАНИЦЫ AI-PROJECTS
============================== */

.ai-content {
  font-size: 17px;
  line-height: 1.75;
  color: #222;
}

.ai-content p {
  margin-bottom: 18px;
}

.ai-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 28px 0 14px;
  line-height: 1.4;
}

.ai-content h3 {
  font-size: 19px;
  font-weight: 700;
  margin: 22px 0 12px;
  line-height: 1.4;
}

.ai-content ul {
  list-style-type: disc;
  margin: 10px 0 20px 25px;
  padding-left: 0;
}

.ai-content ol {
  list-style-position: outside;
  margin: 10px 0 20px 30px;
  padding-left: 0;
}

.ai-content li {
  margin-bottom: 8px;
  line-height: 1.6;
  padding-left: 3px;
}

.ai-content p + ul,
.ai-content p + ol {
  margin-top: 8px;
}

@media (max-width: 700px) {
  .ai-content {
    font-size: 18px;
    line-height: 1.7;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 20px 0;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
}

thead {
  background: #f3f5f8;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e8ef;
  vertical-align: top;
}

th {
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}


.site-footer{
  background:#0b1f3a;
  color:#b0b0b0;
  min-height:100px;           /* вместо height, чтобы на мобилке не ломалось */
  display:flex;
  align-items:center;
  padding: 16px 0;
}

.footer-inner{
  width:min(1200px, 100%);
  margin:0 auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.site-footer a{
  color:#b0b0b0;
  text-decoration:none;
}
.site-footer a:hover{ color:#e0e0e0; text-decoration:underline; }

.footer-menu{
  display:flex;
  flex-wrap:wrap;             /* чтобы ссылки переносились */
  gap:12px 16px;
}

.footer-contact{
  display:flex;
  flex-direction:column;
  gap:6px;
  text-align:right;
}

.footer-title{ color:#e0e0e0; font-weight:600; }
.footer-copy{ font-size:14px; }

/* Адаптив */
@media (max-width: 768px){
  .footer-inner{
    flex-direction:column;    /* всё столбиком */
    align-items:flex-start;
  }
  .footer-contact{ text-align:left; }
}
