/* Frontend styles for Homepage Layout Manager */

/* Форсуємо вертикальне розташування секцій в контейнері теми */
.ast-container:has(.hlm-section) {
  display: flex !important;
  flex-direction: column !important;
}

.hlm-section {
  display: block;
  width: 100%;
  margin-bottom: 60px;
  padding: 0;
  clear: both;
}

.hlm-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
  color: #1a1a1a;
  border-bottom: 3px solid #0073aa;
  padding-bottom: 12px;
  display: inline-block;
}

.hlm-items {
  display: grid;
  gap: 24px;
}

/* Grid Layout - 3 колонки */
.layout-grid .hlm-items {
  grid-template-columns: repeat(3, 1fr);
}

.layout-grid .hlm-item {
  display: flex;
  flex-direction: column;
}

/* List Layout - картка з картинкою зліва */
.layout-list .hlm-items {
  grid-template-columns: 1fr;
  gap: 20px;
}

.layout-list .hlm-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.layout-list .hlm-item a {
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 20px;
}

.layout-list .hlm-item img {
  width: 250px;
  min-width: 250px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.layout-list .hlm-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.layout-list .hlm-meta {
  padding: 10px 20px 0 0;
}

.layout-list .hlm-item h3 {
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  align-items: start;
}

/* Hero Layout - перший елемент великий */
.layout-hero .hlm-items {
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}

.layout-hero .hlm-item:first-child {
  grid-row: span 2;
}

.layout-hero .hlm-item:first-child img {
  height: 400px;
  object-fit: cover;
}

.layout-hero .hlm-item:first-child h3 {
  font-size: 28px;
  padding: 24px;
}

/* Базові стилі карток */
.hlm-item {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.hlm-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.hlm-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.hlm-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.hlm-item:hover img {
  transform: scale(1.05);
}

.hlm-date {
  font-size: 14px;
  color: #7f8c8d;
  font-weight: 400;
}

.hlm-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 10px 20px 0;
}

.hlm-views {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #7f8c8d;
}

.hlm-views-dot {
  position: relative;
  width: 8px;
  height: 8px;
}

.hlm-views-dot:before {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: #0073aa;
  border-radius: 2px;
}

.i-icon:before {
  font-family: sans-serif;
  font-style: normal;
  font-weight: 400;
  vertical-align: top;
  width: 1em;
  display: inline-block;
}

.i-icon-eye:before {
  content: "\1F441";
}

.hlm-item h3,
.hlm-widget-title {
  padding: 20px;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: #2c3e50;
  flex: 1;
  display: flex;
  align-items: center;
}

.hlm-item:hover h3,
.hlm-item:hover .hlm-widget-title {
  color: #0073aa;
}

.hlm-widget-item {
  padding: 20px;
}

.hlm-widget-item .hlm-widget-title {
  padding: 0 0 15px 0;
}

/* Widgets */
/* .hlm-widgets removed as widgets are now items */

/* Responsive */
@media (max-width: 1024px) {
  .layout-grid .hlm-items {
    grid-template-columns: repeat(2, 1fr);
  }

  .layout-hero .hlm-items {
    grid-template-columns: 1fr 1fr;
  }

  .layout-hero .hlm-item:first-child img {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .hlm-section {
    margin-bottom: 40px;
  }

  .hlm-title {
    font-size: 26px;
    margin-bottom: 20px;
  }

  .layout-grid .hlm-items,
  .layout-hero .hlm-items {
    grid-template-columns: 1fr;
  }

  .layout-hero .hlm-item:first-child {
    grid-row: span 1;
  }

  .layout-hero .hlm-item:first-child img {
    height: 250px;
  }

  .layout-hero .hlm-item:first-child h3 {
    font-size: 22px;
    padding: 20px;
  }

  .layout-list .hlm-item a {
    flex-direction: column;
  }

  .layout-list .hlm-item img {
    width: 100%;
    min-width: 100%;
    height: 200px;
  }

  .layout-list .hlm-item h3 {
    padding: 20px;
  }

  .hlm-item img {
    height: 200px;
  }
}
