/* Home page: services hero and feed panels. Tokens and primitives come from theme.css. */

/* ---------- Hero + services ---------- */
.home-services { margin: 0 0 2.5rem; }
.home-hero { max-width: 720px; margin-bottom: 1.75rem; }
.home-hero .page-title { font-size: clamp(1.9rem, 1.3rem + 2vw, 2.75rem); }

.services-cards-container { min-width: 0; }
/* Room for the hover lift and focus ring inside Swiper's overflow clip. */
.services-cards-container .swiper { margin: -4px; padding: 4px; }
.services-cards-container .swiper-slide { height: auto; }

#main-content-container .service-card {
  height: 100%;
  padding: .6rem;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  background: var(--h-surface);
  box-shadow: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
#main-content-container .service-card:hover {
  border-color: var(--h-line-strong);
  box-shadow: var(--h-shadow);
  transform: translateY(-2px);
}
.service-card-link {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  height: 100%;
  border-radius: var(--h-radius);
  color: var(--h-ink);
}
.service-card-link:hover { color: var(--h-ink); }
.service-card-link:focus-visible { outline-offset: 6px; }
.service-card-art {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--h-radius);
  background: var(--h-accent-tint);
}
.service-card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.service-card:hover .service-card-art img { transform: scale(1.03); }
.service-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .1rem .4rem .35rem;
}
.service-card-title { font-size: 1rem; font-weight: 600; line-height: 1.5; }
.service-card-body i { flex: 0 0 auto; color: var(--h-accent); transition: transform .18s ease; }
.service-card:hover .service-card-body i { transform: translateX(-3px); }

.services-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin-top: 1.25rem;
}
.services-navigation button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--h-line-strong);
  border-radius: 50%;
  background: var(--h-surface);
  color: var(--h-ink);
  transition: border-color .16s ease, color .16s ease, opacity .16s ease;
}
.services-navigation button:hover:not(:disabled) { border-color: var(--h-accent); color: var(--h-accent); }
.services-navigation button:disabled { opacity: .4; cursor: default; }
.services-pagination { display: flex; align-items: center; gap: 2px; width: auto !important; }
.services-pagination .swiper-pagination-bullet {
  display: grid;
  place-items: center;
  width: 22px;
  height: 40px;
  margin: 0 !important;
  background: transparent;
  opacity: 1;
}
.services-pagination .swiper-pagination-bullet::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--h-line-strong);
  transition: width .2s ease, background-color .2s ease;
}
.services-pagination .swiper-pagination-bullet-active::after { width: 18px; background: var(--h-accent); }

/* ---------- Feed panels ---------- */
.home-feed > .row { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
.home-panel {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem .5rem;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-lg);
  background: var(--h-surface);
}
.home-panel .section-head {
  margin-bottom: 0;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--h-line);
}
.home-panel-body { display: flex; flex-direction: column; }
.home-panel-body > * { padding-block: 1rem; }
.home-panel-body > * + * { border-top: 1px solid var(--h-line); }

/* Desktop: every panel is the same compact height and its list scrolls inside it. */
@media (min-width: 768px) {
  .home-panel { height: 380px; }
  .halls-container.home-panel,
  .advocate-activities-container.home-panel { height: 420px; }
  .home-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    margin-inline-end: -.75rem;
    padding-inline-end: .75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
}

.feed-item-title {
  display: block;
  margin: 0 0 .25rem;
  color: var(--h-ink);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
}
a.feed-item-title:hover { color: var(--h-accent); }
.feed-item-text {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--h-muted);
  font-size: .9rem;
  line-height: 1.75;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.feed-item-text:empty { display: none; }
.home-panel .meta-list { margin-top: .6rem; font-size: .85rem; }
.home-panel .meta-list bdi { white-space: nowrap; }

.feed-item-main { flex: 1 1 auto; min-width: 0; }
.feed-item-with-action,
.feed-item-media { display: flex; align-items: flex-start; gap: 1rem; }
.feed-item-action {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--h-line);
  border-radius: var(--h-radius-sm);
  background: var(--h-surface);
  color: var(--h-accent);
  transition: border-color .16s ease, background-color .16s ease;
}
.feed-item-action:hover { border-color: var(--h-accent); background: var(--h-accent-tint); }
.feed-item-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: var(--h-radius);
  background: var(--h-accent-tint);
  object-fit: cover;
}
.feed-item-thumb-empty { display: grid; place-items: center; color: var(--h-accent); font-size: 1.35rem; }
.feed-item-activity .feed-item-thumb { flex-basis: 136px; width: 136px; height: 100px; }

/* Halls: status as a pill, action beside it. */
#main-content-container .halls-container .halls-card {
  margin: 0;
  padding-inline: 0;
  border-inline-start: 0;
  border-radius: 0;
  background: transparent;
  cursor: default;
}
.halls-card .hall-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .75rem;
  margin-bottom: .6rem;
}
#main-content-container .halls-card.hall-open .status-pill { background: var(--h-success-soft); color: var(--h-success); }
#main-content-container .halls-card.hall-upcoming .status-pill { background: var(--h-warning-soft); color: var(--h-warning); }
#main-content-container .halls-card.hall-closed .status-pill { background: var(--h-paper-deep); color: var(--h-muted); }
#main-content-container .halls-card .hall-status .btn { width: auto; margin: 0 !important; }
#main-content-container .halls-card .hall-date { display: block; color: inherit !important; font-size: inherit; white-space: normal; }

/* ---------- Phone ---------- */
@media (max-width: 767px) {
  .home-services { margin: 4px 0 28px; scroll-margin-top: 82px; }
  .home-hero { margin-bottom: 16px; }
  .home-hero .page-title { font-size: 26px; }
  .home-hero .page-lead { font-size: 14px; }

  /* Services become a two-column launcher instead of a carousel. */
  .services-cards-container .swiper { overflow: visible; margin: 0; padding: 0; }
  .services-cards-container .swiper-wrapper {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100% !important;
    height: auto !important;
    transform: none !important;
  }
  .services-cards-container .swiper-slide { width: auto !important; height: auto !important; margin: 0 !important; }
  #main-content-container .service-card { padding: 8px; border-radius: 14px; }
  #main-content-container .service-card:hover { box-shadow: none; transform: none; }
  .service-card-link { flex-direction: row; align-items: center; gap: 10px; min-height: 48px; }
  .service-card-art { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; }
  .service-card-body { min-width: 0; padding: 0; }
  .service-card-title { font-size: 14px; line-height: 1.45; }
  .service-card-body i,
  .services-navigation { display: none; }

  .home-feed > .row { --bs-gutter-x: 16px; --bs-gutter-y: 16px; }
  .home-panel { padding: 16px 16px 4px; border-radius: 16px; }
  .home-panel .section-title { font-size: 18px; }
  .home-panel-body > * { padding-block: 14px; }
  .home-panel-body > :nth-child(n+4),
  .halls-container .home-panel-body > :nth-child(n+3),
  .advocate-activities-container .home-panel-body > :nth-child(n+3) { display: none; }
  .feed-item-action { width: 44px; height: 44px; }
  .feed-item-thumb { flex-basis: 56px; width: 56px; height: 56px; }
  .feed-item-activity { flex-direction: column; }
  .feed-item-activity .feed-item-thumb { flex-basis: auto; width: 100%; height: auto; aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  #main-content-container .service-card,
  .service-card-art img,
  .service-card-body i { transition: none; }
  #main-content-container .service-card:hover,
  .service-card:hover .service-card-art img { transform: none; }
}
