/* ===== גלריה — סקשן 4 ===== */
.gallery-hakfar {
  padding: clamp(3.5rem, 7vw, 5rem) clamp(1rem, 3vw, 2rem);
  background-color: #f9f4eb;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

.gallery-hakfar__inner {
  max-width: 1180px;
  margin-inline: auto;
}

/* Header */
.gallery-hakfar__header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 2.75rem);
}

.gallery-hakfar__title-deco {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.4rem;
}

.gallery-hakfar__wing {
  width: clamp(50px, 10vw, 90px);
  height: 2px;
  background: linear-gradient(to left, var(--hk-orange, #f26522), transparent);
  position: relative;
}

.gallery-hakfar__wing::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--hk-orange, #f26522);
  border-right: 2px solid var(--hk-orange, #f26522);
  transform: translateY(-50%) rotate(45deg);
}

.gallery-hakfar__wing--flip {
  background: linear-gradient(to right, var(--hk-orange, #f26522), transparent);
}

.gallery-hakfar__wing--flip::after {
  right: auto;
  left: 0;
  transform: translateY(-50%) rotate(-135deg);
}

.gallery-hakfar__heart {
  color: var(--hk-orange, #f26522);
  font-size: 0.65rem;
}

.gallery-hakfar__title {
  font-family: var(--hk-font, "Assistant", sans-serif);
  font-size: clamp(2rem, 4.5vw, 2.65rem);
  font-weight: 800;
  color: var(--hk-navy, #1a3260);
  margin-bottom: 0.6rem;
}

.gallery-hakfar__subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-family: var(--hk-font, "Assistant", sans-serif);
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  font-weight: 600;
  color: #5c4a3a;
}

.gallery-hakfar__leaf {
  color: var(--hk-orange, #f26522);
  display: flex;
  line-height: 0;
}

.gallery-hakfar__leaf--flip {
  transform: scaleX(-1);
}

/* Grid */
.gallery-hakfar__grid {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 1.5vw, 1rem);
  padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.gallery-hakfar__row {
  display: grid;
  gap: clamp(0.65rem, 1.5vw, 1rem);
}

.gallery-hakfar__row--top {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-hakfar__row--bottom {
  grid-template-columns: repeat(4, 1fr);
}

.gallery-hakfar__item {
  border-radius: 18px;
  overflow: hidden;
  background-color: #e8dfd2;
  background-repeat: no-repeat;
  box-shadow: 0 4px 20px rgba(26, 50, 96, 0.08);
}

.gallery-hakfar__item.site-image-loaded {
  background-size: cover !important;
  background-position: center !important;
}

.gallery-hakfar__item--lg {
  aspect-ratio: 4 / 3.1;
  min-height: 180px;
}

.gallery-hakfar__item--sm {
  aspect-ratio: 1.15 / 1;
  min-height: 120px;
}

/* Crop from gallery mockup — top row (fallback before JS only) */
.gallery-hakfar__item--sabich:not(.site-image-loaded) {
  background-size: 310% 195%;
  background-position: 10% 34%;
}

.gallery-hakfar__item--falafel:not(.site-image-loaded) {
  background-size: 310% 195%;
  background-position: 50% 34%;
}

.gallery-hakfar__item--tunisian:not(.site-image-loaded) {
  background-size: 310% 195%;
  background-position: 90% 34%;
}

/* Bottom row */
.gallery-hakfar__item--tahini:not(.site-image-loaded) {
  background-size: 400% 240%;
  background-position: 10% 78%;
}

.gallery-hakfar__item--toppings:not(.site-image-loaded) {
  background-size: 400% 240%;
  background-position: 37% 78%;
}

.gallery-hakfar__item--pita:not(.site-image-loaded) {
  background-size: 400% 240%;
  background-position: 63% 78%;
}

.gallery-hakfar__item--eggplant:not(.site-image-loaded) {
  background-size: 400% 240%;
  background-position: 90% 78%;
}

.gallery-hakfar__item.has-custom-bg {
  background-size: cover !important;
  background-position: center !important;
}

/* Orange badge overlay */
.gallery-hakfar__badge {
  position: absolute;
  bottom: clamp(0.5rem, 2vw, 1.25rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  min-width: min(280px, 88%);
  padding: 0.85rem 2rem 0.95rem;
  text-align: center;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 72' preserveAspectRatio='none'%3E%3Cpath fill='%23F26522' d='M12 36 C12 14 28 4 48 6 L232 6 C252 4 268 14 268 36 C268 58 252 68 232 66 L48 66 C28 68 12 58 12 36 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 6px 16px rgba(242, 101, 34, 0.35));
}

.gallery-hakfar__badge p {
  font-family: var(--hk-font, "Assistant", sans-serif);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 800;
  color: var(--hk-navy, #1a3260);
  line-height: 1.35;
}

.gallery-hakfar__badge-heart {
  display: block;
  color: var(--hk-navy, #1a3260);
  font-size: 0.55rem;
  margin: 0.15rem 0;
}

/* Reveal */
.gallery-hakfar .gallery-hakfar__item {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-hakfar.visible .gallery-hakfar__item {
  opacity: 1;
  transform: scale(1);
}

.gallery-hakfar.visible .gallery-hakfar__row--top .gallery-hakfar__item:nth-child(1) { transition-delay: 0.05s; }
.gallery-hakfar.visible .gallery-hakfar__row--top .gallery-hakfar__item:nth-child(2) { transition-delay: 0.1s; }
.gallery-hakfar.visible .gallery-hakfar__row--top .gallery-hakfar__item:nth-child(3) { transition-delay: 0.15s; }
.gallery-hakfar.visible .gallery-hakfar__row--bottom .gallery-hakfar__item:nth-child(1) { transition-delay: 0.2s; }
.gallery-hakfar.visible .gallery-hakfar__row--bottom .gallery-hakfar__item:nth-child(2) { transition-delay: 0.25s; }
.gallery-hakfar.visible .gallery-hakfar__row--bottom .gallery-hakfar__item:nth-child(3) { transition-delay: 0.3s; }
.gallery-hakfar.visible .gallery-hakfar__row--bottom .gallery-hakfar__item:nth-child(4) { transition-delay: 0.35s; }

/* Responsive */
@media (max-width: 768px) {
  .gallery-hakfar__row--top {
    grid-template-columns: 1fr;
  }

  .gallery-hakfar__row--bottom {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-hakfar__badge {
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    margin: 1rem auto 0;
  }

  .gallery-hakfar__grid {
    padding-bottom: 0;
  }
}

@media (max-width: 480px) {
  .gallery-hakfar__row--bottom {
    grid-template-columns: 1fr;
  }
}
