.agrimpex-history-origin {
  position: relative;
  width: 100%;
  margin: 0;
  padding: var(--ho-pt, 16px) var(--ho-px, 24px) var(--ho-pb, 16px);
  background: var(--ho-bg, #fff);
  color: var(--ho-text, #111);
  box-sizing: border-box;
  border: 0 !important;
  outline: 0;
}

.agrimpex-history-origin__inner {
  width: min(100%, var(--ho-max, 1440px));
  min-height: var(--ho-min-h, 250px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, var(--ho-image-col, 48%)) minmax(0, 1fr);
  gap: var(--ho-gap, 72px);
  align-items: center;
}

.agrimpex-history-origin.layout-content-left .agrimpex-history-origin__inner,
.agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--ho-image-col, 48%));
}

.agrimpex-history-origin.layout-content-left .agrimpex-history-origin__content,
.agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__content {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.agrimpex-history-origin.layout-content-left .agrimpex-history-origin__image-wrap,
.agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__image-wrap {
  grid-column: 2;
  grid-row: 1;
}

.agrimpex-history-origin.layout-image-left .agrimpex-history-origin__image-wrap,
.agrimpex-history-origin-editor.layout-image-left .agrimpex-history-origin__image-wrap {
  grid-column: 1;
  grid-row: 1;
}

.agrimpex-history-origin.layout-image-left .agrimpex-history-origin__content,
.agrimpex-history-origin-editor.layout-image-left .agrimpex-history-origin__content {
  grid-column: 2;
  grid-row: 1;
}

.agrimpex-history-origin.align-start .agrimpex-history-origin__inner { align-items: start; }
.agrimpex-history-origin.align-end .agrimpex-history-origin__inner { align-items: end; }

/* Obszar zdjęć zachowuje tę samą szerokość niezależnie od liczby fotografii. */
.agrimpex-history-origin__image-wrap {
  width: 100%;
  height: var(--ho-image-h, 230px);
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--ho-image-gap, 8px);
  overflow: hidden;
}
.agrimpex-history-origin__image-wrap.images-2,
.agrimpex-history-origin.images-2 .agrimpex-history-origin__image-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agrimpex-history-origin__image-wrap.images-3,
.agrimpex-history-origin.images-3 .agrimpex-history-origin__image-wrap { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.agrimpex-history-origin__image-item,
.agrimpex-history-origin__image-placeholder {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--ho-image-radius, 0);
  background: #f1f1ef;
  border: 0;
}

.agrimpex-history-origin__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agrimpex-history-origin__image-placeholder {
  display: grid;
  place-items: center;
  padding: 16px;
  color: #777;
  font: 600 13px/1.4 Inter, Arial, sans-serif;
  text-align: center;
}

.agrimpex-history-origin__content {
  width: min(100%, var(--ho-content-max, 560px));
  min-height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: var(--ho-text, #111);
  position: relative;
}


/* Wyrównanie poziome treści intro */
.agrimpex-history-origin.text-left .agrimpex-history-origin__content,
.agrimpex-history-origin-editor.text-left .agrimpex-history-origin__content {
  align-items: flex-start;
  text-align: left;
}
.agrimpex-history-origin.text-center .agrimpex-history-origin__content,
.agrimpex-history-origin-editor.text-center .agrimpex-history-origin__content {
  align-items: center;
  text-align: center;
}
.agrimpex-history-origin.text-right .agrimpex-history-origin__content,
.agrimpex-history-origin-editor.text-right .agrimpex-history-origin__content {
  align-items: flex-end;
  text-align: right;
}
.agrimpex-history-origin.text-center .agrimpex-history-origin__note,
.agrimpex-history-origin-editor.text-center .agrimpex-history-origin__note {
  justify-content: center;
}
.agrimpex-history-origin.text-right .agrimpex-history-origin__note,
.agrimpex-history-origin-editor.text-right .agrimpex-history-origin__note {
  justify-content: flex-end;
}
.agrimpex-history-origin.text-right .agrimpex-history-origin__button,
.agrimpex-history-origin-editor.text-right .agrimpex-history-origin__button {
  align-self: flex-end;
}
.agrimpex-history-origin.text-center .agrimpex-history-origin__button,
.agrimpex-history-origin-editor.text-center .agrimpex-history-origin__button {
  align-self: center;
}

/* Timeline: pełna wysokość bloku z niewielkim odstępem od górnej i dolnej krawędzi. */
.agrimpex-history-origin__timeline {
  position: absolute;
  z-index: 3;
  top: var(--ho-timeline-edge-gap, 12px);
  bottom: var(--ho-timeline-edge-gap, 12px);
  width: var(--ho-timeline-width, 2px);
  height: auto;
  background: var(--ho-timeline-color, #dedede);
  pointer-events: none;
}

/*
 * Punkt i łącznik mają wskazywać środek etykiety roku.
 * Pozycja jest liczona od środka całej kolumny treści, ponieważ treść jest
 * pionowo centrowana w kolumnie. Korekta --ho-year-anchor-shift pozwala
 * dopasować pozycję w razie niestandardowych odstępów.
 */
.agrimpex-history-origin__timeline-dot {
  position: absolute;
  top: calc(50% - var(--ho-year-anchor-shift, 0px));
  left: 50%;
  width: var(--ho-timeline-dot-size, 10px);
  height: var(--ho-timeline-dot-size, 10px);
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--ho-timeline-dot, #f36c21);
  box-shadow: 0 0 0 3px var(--ho-timeline-ring, #ffd2b6);
  transform: translate(-50%, -50%);
}

.agrimpex-history-origin__timeline-connector {
  position: absolute;
  top: calc(50% - var(--ho-year-anchor-shift, 0px));
  width: var(--ho-timeline-connector, 22px);
  height: var(--ho-timeline-width, 2px);
  background: var(--ho-timeline-color, #dedede);
  transform: translateY(-50%);
}

/* Treść po lewej / zdjęcia po prawej — timeline po lewej stronie treści. */
.agrimpex-history-origin.layout-content-left .agrimpex-history-origin__timeline,
.agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__timeline {
  left: calc(-1 * var(--ho-timeline-offset, 28px));
}
.agrimpex-history-origin.layout-content-left .agrimpex-history-origin__timeline-connector,
.agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__timeline-connector {
  left: 50%;
}

/* Zdjęcia po lewej / intro po prawej — timeline lustrzanie po prawej stronie treści. */
.agrimpex-history-origin.layout-image-left .agrimpex-history-origin__timeline,
.agrimpex-history-origin-editor.layout-image-left .agrimpex-history-origin__timeline {
  right: calc(-1 * var(--ho-timeline-offset, 28px));
}
.agrimpex-history-origin.layout-image-left .agrimpex-history-origin__timeline-connector,
.agrimpex-history-origin-editor.layout-image-left .agrimpex-history-origin__timeline-connector {
  right: 50%;
}

/* Przy prawym wyrównaniu intro rok i pozostałe elementy zachowują prawą krawędź. */
.agrimpex-history-origin.text-right .agrimpex-history-origin__year,
.agrimpex-history-origin-editor.text-right .agrimpex-history-origin__year {
  align-self: flex-end;
}


.agrimpex-history-origin__year {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: var(--ho-year-py, 5px) var(--ho-year-px, 16px);
  margin: 0 0 var(--ho-content-spacing, 14px);
  border: var(--ho-year-bw, 1px) solid var(--ho-year-border, #536d57);
  border-radius: var(--ho-year-radius, 999px);
  background: var(--ho-year-bg, #fff);
  color: var(--ho-year-text, #233b29) !important;
  font: var(--ho-year-weight, 700) var(--ho-year-size, 16px)/1 Inter, Arial, sans-serif;
}

.agrimpex-history-origin__heading {
  margin: 0 0 var(--ho-content-spacing, 14px);
  color: var(--ho-text, #111) !important;
  font-family: Inter, Arial, sans-serif;
  font-size: var(--ho-heading-size, 34px);
  font-weight: var(--ho-heading-weight, 700);
  line-height: var(--ho-heading-line, 1.08);
  letter-spacing: -.035em;
  text-wrap: balance;
}

.agrimpex-history-origin__description {
  margin: 0;
  color: var(--ho-muted, #555) !important;
  font: var(--ho-desc-weight, 400) var(--ho-desc-size, 16px)/var(--ho-desc-line, 1.5) Inter, Arial, sans-serif;
}
.agrimpex-history-origin__description p { color: inherit !important; }
.agrimpex-history-origin__description > * { margin: 0; }
.agrimpex-history-origin__description > * + * { margin-top: .7em; }

.agrimpex-history-origin__note {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: var(--ho-note-mt, 20px);
  color: var(--ho-note-text, #111) !important;
  font: var(--ho-note-weight, 600) var(--ho-note-size, 15px)/1.3 Inter, Arial, sans-serif;
}

.agrimpex-history-origin__note-icon {
  width: var(--ho-icon-size, 44px);
  height: var(--ho-icon-size, 44px);
  flex: 0 0 var(--ho-icon-size, 44px);
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ho-note-icon, #fff);
  background: var(--ho-note-circle, #0c4b2f);
}

.agrimpex-history-origin__note-icon svg,
.agrimpex-history-origin__note-icon-img {
  width: 52%;
  height: 52%;
  display: block;
  object-fit: contain;
}

.agrimpex-history-origin__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: var(--ho-btn-mt, 18px);
  padding: var(--ho-btn-py, 11px) var(--ho-btn-px, 20px);
  border: var(--ho-btn-bw, 1px) solid var(--ho-btn-border, #174f2a);
  border-radius: var(--ho-btn-radius, 999px);
  background: var(--ho-btn-bg, #174f2a);
  color: var(--ho-btn-text, #fff) !important;
  font: var(--ho-btn-weight, 600) var(--ho-btn-size, 14px)/1.15 Inter, Arial, sans-serif;
  text-decoration: none !important;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.agrimpex-history-origin__button:hover,
.agrimpex-history-origin__button:focus-visible {
  background: var(--ho-btn-hover-bg, #0f3f21);
  color: var(--ho-btn-hover-text, #fff) !important;
  transform: translateY(-1px);
}
.agrimpex-history-origin__button-arrow { font-size: 1.15em; line-height: 1; }

.agrimpex-history-origin.has-reveal:not(.is-visible) .agrimpex-history-origin__image-wrap,
.agrimpex-history-origin.has-reveal:not(.is-visible) .agrimpex-history-origin__content {
  opacity: 0;
  transform: translateY(var(--ho-reveal-y, 18px));
}
.agrimpex-history-origin.has-reveal .agrimpex-history-origin__image-wrap,
.agrimpex-history-origin.has-reveal .agrimpex-history-origin__content {
  transition: opacity var(--ho-reveal-duration, 650ms) ease, transform var(--ho-reveal-duration, 650ms) ease;
}
.agrimpex-history-origin.has-reveal.is-visible .agrimpex-history-origin__image-wrap,
.agrimpex-history-origin.has-reveal.is-visible .agrimpex-history-origin__content {
  opacity: 1;
  transform: none;
}

@media (max-width: 1024px) {
  .agrimpex-history-origin__inner {
    grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
    gap: min(var(--ho-gap, 72px), 42px);
  }
  .agrimpex-history-origin.layout-content-left .agrimpex-history-origin__inner,
  .agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 46%);
  }
  .agrimpex-history-origin__image-wrap { height: var(--ho-tablet-image-h, 220px); }
  .agrimpex-history-origin__heading { font-size: clamp(28px, 3.1vw, var(--ho-heading-size, 34px)); }
}

@media (max-width: 680px) {
  .agrimpex-history-origin__timeline { display: none; }

  .agrimpex-history-origin {
    padding-left: var(--ho-mobile-px, 20px);
    padding-right: var(--ho-mobile-px, 20px);
  }

  .agrimpex-history-origin.layout-content-left .agrimpex-history-origin__content,
  .agrimpex-history-origin.layout-content-left .agrimpex-history-origin__image-wrap,
  .agrimpex-history-origin.layout-image-left .agrimpex-history-origin__content,
  .agrimpex-history-origin.layout-image-left .agrimpex-history-origin__image-wrap,
  .agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__content,
  .agrimpex-history-origin-editor.layout-content-left .agrimpex-history-origin__image-wrap,
  .agrimpex-history-origin-editor.layout-image-left .agrimpex-history-origin__content,
  .agrimpex-history-origin-editor.layout-image-left .agrimpex-history-origin__image-wrap {
    grid-column: auto;
    grid-row: auto;
  }

  .agrimpex-history-origin__inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--ho-mobile-gap, 28px);
    min-height: 0;
  }

  .agrimpex-history-origin.mobile-content-first .agrimpex-history-origin__content { order: 1; }
  .agrimpex-history-origin.mobile-content-first .agrimpex-history-origin__image-wrap { order: 2; }
  .agrimpex-history-origin__image-wrap {
    height: var(--ho-mobile-image-h, 230px);
    grid-template-columns: repeat(var(--ho-mobile-image-cols, 1), minmax(0, 1fr)) !important;
  }
  .agrimpex-history-origin__content { width: 100%; max-width: none; }
  .agrimpex-history-origin__heading { font-size: var(--ho-mobile-heading-size, 28px); }
  .agrimpex-history-origin__note { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .agrimpex-history-origin.has-reveal .agrimpex-history-origin__image-wrap,
  .agrimpex-history-origin.has-reveal .agrimpex-history-origin__content {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}


/* v6: punkt timeline jest kotwiczony bezpośrednio do etykiety roku,
   dzięki czemu zawsze wskazuje dokładnie jej środek. */
.agrimpex-history-origin__timeline-dot,
.agrimpex-history-origin__timeline-connector {
  display: none !important;
}

/* Rok staje się punktem odniesienia dla poziomego łącznika i kropki. */
.agrimpex-history-origin__year {
  position: relative;
  z-index: 4;
}

/* Układ: treść po lewej / zdjęcia po prawej.
   Timeline znajduje się po lewej stronie treści, a łącznik biegnie od linii do etykiety roku. */
.agrimpex-history-origin.layout-content-left.has-timeline .agrimpex-history-origin__year::before,
.agrimpex-history-origin-editor.layout-content-left.has-timeline .agrimpex-history-origin__year::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + var(--ho-timeline-offset, 28px) - var(--ho-timeline-connector, 22px));
  width: var(--ho-timeline-connector, 22px);
  height: var(--ho-timeline-width, 2px);
  background: var(--ho-timeline-color, #dedede);
  transform: translateY(-50%);
  pointer-events: none;
}

.agrimpex-history-origin.layout-content-left.has-timeline .agrimpex-history-origin__year::after,
.agrimpex-history-origin-editor.layout-content-left.has-timeline .agrimpex-history-origin__year::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + var(--ho-timeline-offset, 28px) - (var(--ho-timeline-dot-size, 10px) / 2));
  width: var(--ho-timeline-dot-size, 10px);
  height: var(--ho-timeline-dot-size, 10px);
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--ho-timeline-dot, #f36c21);
  box-shadow: 0 0 0 3px var(--ho-timeline-ring, #ffd2b6);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Układ lustrzany: zdjęcia po lewej / intro po prawej.
   Timeline jest po prawej stronie treści, a łącznik i kropka odwracają się automatycznie. */
.agrimpex-history-origin.layout-image-left.has-timeline .agrimpex-history-origin__year::before,
.agrimpex-history-origin-editor.layout-image-left.has-timeline .agrimpex-history-origin__year::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + var(--ho-timeline-offset, 28px) - var(--ho-timeline-connector, 22px));
  width: var(--ho-timeline-connector, 22px);
  height: var(--ho-timeline-width, 2px);
  background: var(--ho-timeline-color, #dedede);
  transform: translateY(-50%);
  pointer-events: none;
}

.agrimpex-history-origin.layout-image-left.has-timeline .agrimpex-history-origin__year::after,
.agrimpex-history-origin-editor.layout-image-left.has-timeline .agrimpex-history-origin__year::after {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + var(--ho-timeline-offset, 28px) - (var(--ho-timeline-dot-size, 10px) / 2));
  width: var(--ho-timeline-dot-size, 10px);
  height: var(--ho-timeline-dot-size, 10px);
  box-sizing: border-box;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--ho-timeline-dot, #f36c21);
  box-shadow: 0 0 0 3px var(--ho-timeline-ring, #ffd2b6);
  transform: translateY(-50%);
  pointer-events: none;
}

/* Korekta pionowa działa teraz bezpośrednio na łączniku i punkcie przy roku. */
.agrimpex-history-origin.has-timeline .agrimpex-history-origin__year::before,
.agrimpex-history-origin.has-timeline .agrimpex-history-origin__year::after,
.agrimpex-history-origin-editor.has-timeline .agrimpex-history-origin__year::before,
.agrimpex-history-origin-editor.has-timeline .agrimpex-history-origin__year::after {
  margin-top: calc(-1 * var(--ho-year-anchor-shift, 0px));
}

@media (max-width: 680px) {
  .agrimpex-history-origin__year::before,
  .agrimpex-history-origin__year::after {
    display: none !important;
  }
}
