/* =========================
   Home page
========================= */

.home-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 96px 12px 100px;
  box-sizing: border-box;
}

.home-hero {
  padding: 24px;
  border: 1px solid #dfe8f7;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f3f8ff);
}

.home-hero h1 {
  margin: 0;
  color: #1a2b44;
  font-size: clamp(24px, 3.1vw, 34px);
  line-height: 1.2;
}

.home-hero p {
  margin: 10px 0 0;
  color: #3d4b63;
  line-height: 1.8;
}

.section-head {
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  color: #1f2e45;
}

.section-head p {
  margin: 8px 0 0;
  color: #4a5b75;
  font-size: 14px;
}

.event-section,
.category-section {
  margin-top: 24px;
}

.home-ad-section {
  margin-top: 24px;
}

.home-ad-section[hidden] {
  display: none !important;
}

.home-ad-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.home-ad-card {
  display: grid;
  grid-template-columns: minmax(150px, 32%) minmax(0, 1fr);
  min-height: 132px;
  overflow: hidden;
  border: 1px solid #dde7f6;
  border-radius: 16px;
  background: #ffffff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(31, 57, 98, 0.08);
  transition: transform 0.15s, box-shadow 0.2s;
}

.home-ad-card--text-only {
  grid-template-columns: minmax(0, 1fr);
}

.home-ad-card:hover,
.home-ad-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(31, 57, 98, 0.14);
}

.home-ad-card:focus-visible {
  outline: 3px solid #315ea8;
  outline-offset: 2px;
}

.home-ad-image {
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  background: #e9eef7;
}

.home-ad-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 18px 20px;
}

.home-ad-label {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef3fb;
  color: #3f5f91;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.home-ad-title {
  margin: 9px 0 0;
  color: #1f2d42;
  font-size: clamp(17px, 1.8vw, 23px);
  line-height: 1.4;
}

.home-ad-description {
  margin: 7px 0 0;
  color: #445571;
  font-size: 14px;
  line-height: 1.6;
}

.event-swiper-wrap {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
}

.swipe-nav {
  width: 48px;
  height: 48px;
  border: 1px solid #ceddf7;
  border-radius: 50%;
  background: #ffffff;
  color: #315ea8;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.swipe-nav:hover {
  background: #eff5ff;
}

.event-track {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 4px 0 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.event-track::-webkit-scrollbar {
  display: none;
}

.event-card {
  display: block;
  flex: 0 0 100%;
  min-width: 0;
  max-width: none;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #dde7f6;
  background: #ffffff;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-shadow: 0 6px 20px rgba(31, 57, 98, 0.08);
}

.event-card:hover {
  border-color: #8eafe4;
  box-shadow: 0 8px 24px rgba(31, 57, 98, 0.14);
}

.event-card:focus-visible {
  outline: 3px solid #2f6edb;
  outline-offset: 3px;
}

.event-image {
  width: 100%;
  height: clamp(220px, 24vw, 360px);
  object-fit: cover;
  display: block;
  background: #e9eef7;
}

.event-body {
  padding: 20px;
}

.event-name {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  color: #1f2d42;
}

.event-period {
  margin: 8px 0 0;
  color: #54709d;
  font-size: 12px;
}

.event-summary {
  margin: 8px 0 0;
  color: #445571;
  font-size: 15px;
  line-height: 1.7;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-card {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #dde7f6;
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(29, 62, 109, 0.11);
}

.category-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 10px;
  background: #ebeff6;
}

.category-name {
  margin-top: 8px;
  color: #24344e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.category-hint {
  margin-top: 4px;
  color: #5d6f8d;
  font-size: 11px;
}

.empty-message {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  border: 1px dashed #cfd9ec;
  color: #597195;
  font-size: 14px;
  background: #f7faff;
  box-sizing: border-box;
}

@media (hover: none) {
  .home-page {
    padding: 86px 8px 88px;
  }

  .home-hero {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .section-head p {
    font-size: 13px;
  }

  .event-swiper-wrap {
    grid-template-columns: 1fr;
  }

  .home-ad-list {
    grid-template-columns: 1fr;
  }

  .home-ad-card {
    grid-template-columns: minmax(112px, 36%) minmax(0, 1fr);
    min-height: 112px;
  }

  .home-ad-image {
    min-height: 112px;
  }

  .home-ad-body {
    padding: 14px;
  }

  .home-ad-description {
    font-size: 13px;
  }

  .swipe-nav {
    display: none;
  }

  .event-card {
    flex-basis: 100%;
  }

  .event-image {
    height: clamp(210px, 62vw, 320px);
  }

  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

}
