/* ============================================================
   БЛОК "ПОДІЇ НА ГОЛОВНІЙ" — events-index.css
   Підключіть цей файл у <head> index.html:
   <link rel="stylesheet" href="css/events-index.css" />
   ============================================================ */

/* ── Секція-обгортка ─────────────────────────────────────── */
.index-events-section {
  max-width: 1220px;
  margin: 0 auto 40px;
  padding: 0 16px;
  font-family: 'Inter', Arial, sans-serif;
}

.index-events-inner {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 36px 32px 40px;
  position: relative;
  overflow: hidden;
}

/* Декоративна смужка зверху */
.index-events-inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3d4215 0%, #f1bc2c 50%, #3d4215 100%);
}

/* ── Заголовок + посилання "Усі події" ───────────────────── */
.index-events-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.index-events-main-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: #3d4215;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.index-events-icon {
  font-size: 1.1em;
  line-height: 1;
}

.index-events-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #c48a39;
  text-decoration: none;
  padding: 8px 18px;
  border: 2px solid #c48a39;
  border-radius: 50px;
  transition: background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.index-events-all-link:hover {
  background: #c48a39;
  color: #fff;
}

/* ── Вибір року (таби) ───────────────────────────────────── */
.index-events-years {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.index-events-year-btn {
  position: relative;
  padding: 9px 22px;
  font-size: 16px;
  font-weight: 700;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  background: #f5f5f5;
  color: #555;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.15s ease;
  letter-spacing: 0.5px;
  overflow: hidden;
}

.index-events-year-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(241,188,44,.35) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.index-events-year-btn:hover:not(.active) {
  border-color: #c48a39;
  color: #3d4215;
  transform: translateY(-2px);
}

.index-events-year-btn:hover:not(.active)::after {
  opacity: 1;
}

.index-events-year-btn.active {
  background: #3d4215;
  border-color: #3d4215;
  color: #f1bc2c;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(61, 66, 21, 0.28);
}

.index-events-year-btn:focus-visible {
  outline: 3px solid #f1bc2c;
  outline-offset: 3px;
}

/* ── Сітка карток ────────────────────────────────────────── */
.index-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  transition: opacity 0.2s ease;
  min-height: 120px;
}

.index-events-grid--fading {
  opacity: 0;
  pointer-events: none;
}

/* ── Картка події ─────────────────────────────────────────── */
.index-event-card {
  list-style: none;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.09);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.index-event-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}

.index-event-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* Зображення */
.index-event-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8e8e8;
}

.index-event-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.index-event-card:hover .index-event-card__img {
  transform: scale(1.06);
}

/* Overlay "Дізнатися більше" */
.index-event-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(61, 66, 21, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.index-event-card:hover .index-event-card__overlay {
  opacity: 1;
}

.index-event-card__overlay-text {
  color: #f1bc2c;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 2px solid #f1bc2c;
  padding: 8px 20px;
  border-radius: 50px;
  transition: background 0.2s ease, color 0.2s ease;
}

.index-event-card:hover .index-event-card__overlay-text {
  background: #f1bc2c;
  color: #3d4215;
}

/* Тіло картки */
.index-event-card__body {
  padding: 14px 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.index-event-card__title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.index-event-card__desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.index-event-card__date {
  font-size: 12px;
  font-weight: 600;
  color: #c48a39;
  margin-top: 4px;
  display: block;
}

/* ── Порожній стан ───────────────────────────────────────── */
.index-events-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #888;
  font-size: 16px;
  padding: 40px 0;
}

/* ── Кнопка "Показати більше" ────────────────────────────── */
.index-events-show-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.index-events-show-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 700;
  background: #f1bc2c;
  color: #3d4215;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  box-shadow: 0 3px 10px rgba(241,188,44,.4);
}

.index-events-show-more:hover {
  background: #3d4215;
  color: #f1bc2c;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(61,66,21,.3);
}

.index-events-show-more:focus-visible {
  outline: 3px solid #3d4215;
  outline-offset: 3px;
}

/* ── SEO-посилання (приховані візуально, але індексуються) ── */
.index-events-seo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.index-events-seo-links a {
  font-size: 12px;
  color: #999;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.index-events-seo-links a:hover {
  color: #3d4215;
  border-color: #3d4215;
}

/* ── Адаптив ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .index-events-inner {
    padding: 24px 16px 28px;
  }

  .index-events-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .index-events-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .index-events-all-link {
    align-self: flex-end;
  }
}

@media (max-width: 480px) {
  .index-events-grid {
    grid-template-columns: 1fr;
  }

  .index-events-year-btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  .index-events-main-title {
    font-size: 20px;
  }

  .index-events-seo-links {
    display: none; /* на зовсім малих — приховуємо для чистоти UI */
  }
}

/* ── Prefer reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .index-event-card,
  .index-event-card__img,
  .index-event-card__overlay,
  .index-events-year-btn,
  .index-events-show-more,
  .index-events-grid {
    transition: none !important;
  }
  .index-event-card:hover {
    transform: none;
  }
}
