/* Home Banner Section - Pinterest-style masonry grid */
.home-banner-section {
  position: relative;
  --home-banner-gap: 1.25rem;
  --home-banner-radius: 14px;
  --home-banner-shadow: 0 4px 18px rgba(1, 79, 37, 0.08);
  --home-banner-shadow-hover: 0 12px 32px rgba(1, 79, 37, 0.18);
  --home-banner-tag-bg: rgba(1, 79, 37, 0.92);
  --home-banner-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.55) 100%);
  --home-banner-topbar-height: 3rem;
}

.home-banner-section__topbar {
  position: relative;
  height: var(--home-banner-topbar-height);
  margin-bottom: 0.5rem;
}

.home-banner-shuffle-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 999px;
  background: #014f25;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(1, 79, 37, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.home-banner-shuffle-btn:hover,
.home-banner-shuffle-btn:focus {
  background: #026b33;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(1, 79, 37, 0.28);
  outline: none;
}

.home-banner-shuffle-btn:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px #014f25;
}

.home-banner-section__header {
  margin-bottom: 1.75rem;
  text-align: center;
}

.home-banner-section--has-shuffle .home-banner-masonry {
  margin-top: 0.75rem;
}

.home-banner-section__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: #014f25;
}

.home-banner-section__subtitle {
  margin: 0;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  color: #5a6b60;
}

.home-banner-masonry {
  column-count: 4;
  column-gap: var(--home-banner-gap);
  transition: opacity 0.25s ease;
}

.home-banner-masonry--shuffling {
  opacity: 0.35;
}

.home-banner-card {
  break-inside: avoid;
  margin: 0 0 var(--home-banner-gap);
  display: inline-block;
  width: 100%;
  border-radius: var(--home-banner-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--home-banner-shadow);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.home-banner-card:hover,
.home-banner-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--home-banner-shadow-hover);
}

.home-banner-card__media-link,
.home-banner-card__title-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.home-banner-card__media-link:hover,
.home-banner-card__media-link:focus,
.home-banner-card__title-link:hover,
.home-banner-card__title-link:focus {
  color: inherit;
  text-decoration: none;
}

.home-banner-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.home-banner-card__link:hover,
.home-banner-card__link:focus {
  color: inherit;
  text-decoration: none;
}

.home-banner-card__media {
  position: relative;
  overflow: hidden;
  background: #eef3ef;
}

.home-banner-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--home-banner-overlay);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.home-banner-card:hover .home-banner-card__media::after,
.home-banner-card:focus-within .home-banner-card__media::after {
  opacity: 1;
}

.home-banner-card__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.home-banner-card--small .home-banner-card__image {
  min-height: 140px;
}

.home-banner-card--medium .home-banner-card__image {
  min-height: 190px;
}

.home-banner-card--tall .home-banner-card__image {
  min-height: 260px;
}

.home-banner-card--wide .home-banner-card__image {
  min-height: 142px;
}

.home-banner-card__tag {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 1.5rem);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--home-banner-tag-bg);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.home-banner-card__tag--top-left {
  top: 0.75rem;
  left: 0.75rem;
}

.home-banner-card__tag--top-right {
  top: 0.75rem;
  right: 0.75rem;
}

.home-banner-card__tag--bottom-left {
  bottom: 0.75rem;
  left: 0.75rem;
}

.home-banner-card__tag--bottom-right {
  bottom: 0.75rem;
  right: 0.75rem;
}

.home-banner-card__body {
  padding: 0.9rem 1rem 1.1rem;
}

.home-banner-card__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #123524;
}

.home-banner-card__info {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #5f6f66;
}

.home-banner-card__info p {
  margin: 0 0 0.45rem;
}

.home-banner-card__info p:last-child {
  margin-bottom: 0;
}

.home-banner-card__info a {
  color: #014f25;
  text-decoration: underline;
  word-break: break-word;
}

.home-banner-card__info a:hover,
.home-banner-card__info a:focus {
  color: #026b33;
}

.home-banner-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #6b7b72;
  background: #f7faf8;
  border-radius: var(--home-banner-radius);
}

@media (min-width: 1200px) and (max-width: 1366px) {
  .home-banner-masonry {
    column-count: auto;
    columns: auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--home-banner-gap);
  }

  .home-banner-card {
    break-inside: auto;
    margin: 0;
    display: block;
    width: auto;
  }
}

@media (min-width: 1367px) {
  .home-banner-masonry {
    column-count: 5;
  }
}

@media (max-width: 1199px) {
  .home-banner-masonry {
    column-count: 3;
  }
}

@media (max-width: 991px) {
  .home-banner-masonry {
    column-count: 2;
  }

  .home-banner-section {
    --home-banner-gap: 1rem;
    --home-banner-topbar-height: 3.25rem;
  }
}

@media (max-width: 575px) {
  .home-banner-masonry {
    column-count: 1;
  }

  .home-banner-card__body {
    padding: 0.85rem 0.9rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-banner-card,
  .home-banner-card__media::after,
  .home-banner-masonry,
  .home-banner-shuffle-btn {
    transition: none;
  }

  .home-banner-card:hover,
  .home-banner-card:focus-within {
    transform: none;
  }

  .home-banner-shuffle-btn:hover,
  .home-banner-shuffle-btn:focus {
    transform: none;
  }
}
