/* Mobile layout safeguards for the home page. */
.home-content img,
header .client-logo {
  max-width: 100%;
  height: auto;
}

.home-content .news-poster {
  display: block;
  margin: 0 auto;
}

.course-table-wrapper { width: 100%; }

.home-poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: center;
}

.home-poster-grid a { display: block; }

.home-poster-grid img {
  display: block;
  width: 100%;
  height: auto;
}

.home-map {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  border: 0;
}

@media (max-width: 767px) {
  header .header-spacer { display: none; }

  .home-content {
    padding-right: 12px;
    padding-left: 12px;
  }

  .courses-table,
  .courses-table tbody,
  .courses-table tr { display: block; width: auto; }

  .courses-table thead { display: none; }

  .courses-table tbody tr {
    margin-bottom: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
  }

  .courses-table td {
    display: grid;
    width: auto;
    grid-template-columns: minmax(100px, 38%) minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px;
    border-top: 1px solid #eee;
    overflow-wrap: anywhere;
  }

  .courses-table td:first-child { border-top: 0; }

  .courses-table td::before {
    color: #555;
    font-weight: bold;
  }

  .courses-table td:nth-child(1)::before { content: "Курс №"; }
  .courses-table td:nth-child(2)::before { content: "Специалност"; }
  .courses-table td:nth-child(3)::before { content: "Дата"; }
  .courses-table td:nth-child(4)::before { content: "Място"; }
  .courses-table td:nth-child(5)::before { content: "Регистрация"; }

  .home-poster-grid { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .courses-table td {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
