/* === Базові налаштування === */
html, body {
  font-family: "Roboto", "Noto Sans", Arial, sans-serif;
  font-size: 16px;
  color: #0f0f0f;
  background: #fff;
  margin: 0;
  padding: 0;
}

/* === Основна область контенту === */
main.content {
  display: block;
  padding: 8px 4vw;
}

main.content h1 {
  text-align: center;
  font-size: 2rem;
  margin: 0 0 10px;
  font-weight: 600;
}

.grid-description {
  max-width: 1300px;
  margin: 0 auto 35px;
  font-style: italic;
  color: #555;
  text-align: left;
  line-height: 1.5;
}

/* === Грід постів === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
  padding: 0 2vw;
  box-sizing: border-box;
}

/* === Картки постів === */
.card {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.3;
  font-weight: 600;
}

.card h3 a {
  color: #0f0f0f;
  text-decoration: none;
  transition: color 0.2s;
}

.card h3 a:hover {
  color: #0065fd;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.3; /* рядкова висота */
  font-weight: 600;

  height: calc(1.3em * 2); /* 2 рядки завжди */
  overflow: hidden;         /* обрізаємо зайве */
  text-overflow: ellipsis;    /* Додаємо три крапки */
}


/* === Зображення в картках === */
.card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 10px;
  object-fit: cover;
  display: block;
}

/* === Витяги та відео === */
.excerpt {
  color: #333;
  font-size: 0.95rem;
  line-height: 1.5;
}

.excerpt iframe,
.excerpt p iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: none;
  border-radius: 8px;
  margin-top: 10px;
  display: block;
}

/* === Посилання у витягах === */
.excerpt a {
  color: #0073aa;
  text-decoration: none;
  transition: color 0.2s;
}

.excerpt a:hover {
  text-decoration: underline;
  color: #005a90;
}

/* === Пагінація === */
.pagination {
  text-align: center;
  margin: 50px 0 30px;
  font-size: 15px;
}

.pagination a,
.pagination span {
  display: inline-block;
  margin: 0 5px;
  padding: 7px 14px;
  background: #eee;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.pagination a:hover {
  background: #ddd;
}

.pagination a.active {
  background: #ccc;
  font-weight: 600;
}

.pagination span.dots {
  background: none;
  cursor: default;
}

/* === Адаптивність === */
@media (max-width: 600px) {
  main.content {
    padding: 20px 10px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card {
    padding: 12px;
  }

  .card h3 {
    font-size: 1.05rem;
  }
}

//* === Головне меню (оновлене) === */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left .logo img {
  height: 100px;
  width: auto;
}

.title-tagline {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-title {
  font-size: 22px;
  font-weight: 600;
  color: #0f0f0f;
  margin: 0;
}

.title-tagline small {
  color: #666;
  font-size: 12px;
}

/* === Основне меню === */
.main-nav {
  flex: 1;
  text-align: right;
}

.primary-menu-ul {
  display: flex;
  flex-wrap: wrap; /* дозволяє 2 рядки */
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 14px;
}

.primary-menu-ul li a {
  display: inline-block;
  color: #0f0f0f;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 6px 8px;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
}

.primary-menu-ul li a:hover {
  color: #ff0000;
  border-bottom: 2px solid #ff0000;
}


/* === YouTube-style Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 8px 4vw;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left .logo img {
  height: 108px;
  width: auto;
}

.title-tagline {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-title {
  font-size: 22px;
  font-weight: 600;
  color: #0f0f0f;
  margin: 0;
}

.title-tagline small {
  color: #666;
  font-size: 12px;
}

/* === Головне меню === */
.main-nav {
  flex: 1;
  text-align: right;
}

.primary-menu-ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 16px;
}

.primary-menu-ul li {
  position: relative;
}

.primary-menu-ul li a {
  display: inline-block;
  color: #0f0f0f;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 6px 4px;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
}

.primary-menu-ul li a:hover {
  color: #ff0000;
  border-bottom: 2px solid #ff0000;
}



/* === Вирівнювання вбудованих фреймів у картках (YouTube, Maps) === */
.excerpt figure.wp-block-embed,
.excerpt .wp-block-embed__wrapper,
.excerpt .nv-iframe-embed {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block;
  box-sizing: border-box;
}

.excerpt figure.wp-block-embed iframe,
.excerpt .nv-iframe-embed iframe,
.excerpt iframe {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
  border: none;
  border-radius: 8px;
}


/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-left .logo img {
  height: 80px;
  width: auto;
}

.title-tagline {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.site-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: #0f0f0f;
}

/* === Основне меню === */
.main-nav {
  flex: 1;
  text-align: right;
}

.primary-menu-ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 14px;
}

.primary-menu-ul li a {
  display: inline-block;
  color: #0f0f0f;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  padding: 6px 8px;
  transition: color 0.2s, border-color 0.2s;
  border-bottom: 2px solid transparent;
}

.primary-menu-ul li a:hover {
  color: #ff0000;
  border-bottom: 2px solid #ff0000;
}

/* === Базове меню для мобільних === */
.navbar-toggle {
  display: block;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2100;
}

.navbar-toggle .bars span {
  display: block;
  width: 26px;
  height: 3px;
  background: #0f0f0f;
  margin: 5px 0;
  border-radius: 2px;
}

/* Мобільне меню */
@media (max-width: 960px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 80%;
    background: #fff;
    padding: 70px 20px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: right 0.3s ease;
    z-index: 2000;
  }

  .main-nav.menu-open {
    right: 0;
  }

  .primary-menu-ul {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  body.menu-open {
    overflow: hidden; /* блокуємо скрол сторінки */
  }
}

/* Приховуємо гамбургер на десктопі */
.navbar-toggle {
  display: none; /* за замовчуванням не видно */
}

/* Показуємо тільки на мобільних */
@media (max-width: 960px) {
  .navbar-toggle {
    display: block;
  }
}

/*--------------------*/
/* === Контейнер сторінки === */
.page-container {
  display: flex;
  width: 95vw;
  max-width: none;
  margin: 40px 0 40px auto;
  padding: 0;
  gap: 16px;

}

/* === Основний контент === */
/* === Контейнер сторінки === */
.page-container {
  display: flex;
  width: 95vw;
  max-width: none;
  margin: 40px 0 40px auto;
  padding: 0;
  gap: 16px;
}

/* === Основний контент === */
.main-content {
  flex: 1;
}

/* === Сайдбар === */
.sidebar {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* === Картки постів у сайдбарі === */
.sidebar .card {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
}

.sidebar .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.sidebar .card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}

.sidebar .card h4 {
  margin: 8px 0 6px;
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar .card .excerpt {
  font-size: 0.9rem;
  color: #555;
  margin-top: 8px;
  font-weight: 400;
}

/* === Адаптив під мобільні === */
@media (max-width: 768px) {
  .page-container {
    flex-direction: column;   /* спочатку контент, потім сайдбар */
    width: 100%;
    margin: 20px auto;
  }

  .sidebar {
    width: 100%;              /* повна ширина під контентом */
    order: 2;                 /* переносимо після контенту */
  }

  .main-content {
    order: 1;                 /* основний контент зверху */
  }
}

/* === Обмеження ширини вбудованих відео у основному контенті === */
.main-content iframe,
.main-content .wp-block-embed,
.main-content .wp-block-embed__wrapper,
.main-content figure.wp-block-embed {
  max-width: 100%;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  display: block;
  box-sizing: border-box;
  overflow: hidden;
}

/* Забороняємо iframe виходити за межі контейнера */
.main-content iframe {
  max-width: 100% !important;
  display: block;
  margin: 0 auto;
}

/* Усуваємо зсув сайдбара */
.page-container {
  overflow-x: hidden;
}

/* === Вирівнювання відео по центру в основному контенті === */
.main-content iframe,
.main-content .wp-block-embed,
.main-content .wp-block-embed__wrapper,
.main-content figure.wp-block-embed {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: block;
  box-sizing: border-box;
}

/* Іноді WordPress додає внутрішній відступ у figure */
.main-content figure.wp-block-embed {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Забезпечує, що відео не виходить за межі контенту */
.main-content {
  overflow: hidden;
}

<style>
.static-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.static-gallery img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}
</style>


