@font-face {
  font-family: "Dancing Script";
  src: url("/assets/history/dancing-script.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

.municipal-history {
  --history-cream: #f8f3e3;
  --history-ink: #163a24;
  --history-green: #1a4828;
  --history-gold: #efcf79;
  background: var(--history-cream);
  color: var(--history-ink);
  scroll-margin-top: 6rem;
}

.history-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 19fr) minmax(0, 34fr) minmax(0, 47fr);
  align-items: center;
  column-gap: clamp(24px, 3.1vw, 56px);
  row-gap: clamp(22px, 2.4vw, 42px);
  padding: clamp(40px, 3.9vw, 70px) clamp(32px, 5.5vw, 100px) clamp(66px, 6.2vw, 110px);
  background: radial-gradient(ellipse at 25% 28%, #fffbee, transparent 65%);
}

.history-panel::before,
.history-panel::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  width: clamp(100px, 12.5vw, 230px);
  aspect-ratio: 1;
  background: url("/assets/history/coffee.svg") no-repeat top left / contain;
  pointer-events: none;
}

.history-panel::before { left: 0; }

.history-panel::after {
  right: 0;
  width: clamp(100px, 15vw, 270px);
  height: 85%;
  aspect-ratio: auto;
  background: url("/assets/history/guadua.svg") no-repeat top right / 100% 100%;
}

.history-heading {
  position: relative;
  z-index: 2;
  grid-column: 1 / 3;
  padding-inline-start: clamp(30px, 6vw, 110px);
  text-align: center;
}

.history-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.3vw, 25px);
  margin: 0 0 .85em;
  color: #3a581e;
  font: 800 clamp(10px, 1.05vw, 17px)/1.4 var(--sans);
  letter-spacing: .21em;
}

.history-kicker::before,
.history-kicker::after {
  content: "";
  width: clamp(10px, 2.6vw, 48px);
  height: 1px;
  flex-shrink: 0;
  background: currentColor;
}

.history-heading h2 {
  margin: 0;
  color: inherit;
  font: 700 clamp(2.4rem, 4.6vw, 5rem)/1.02 Georgia, serif;
  letter-spacing: -.045em;
}

.history-heading h2 em {
  display: table;
  position: relative;
  margin: -.03em auto .13em;
  padding: 0 .1em .13em;
  color: inherit;
  font: 700 1.46em/.97 "Dancing Script", "Snell Roundhand", "Segoe Script", "Apple Chancery", cursive;
  letter-spacing: -.055em;
}

.history-heading h2 em::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 15%;
  height: .18em;
  border-top: .055em solid #658820;
  border-radius: 70% 54% 0 0;
  transform: rotate(-4deg);
}

.history-photo {
  position: absolute;
  inset: 0 0 0 43%;
  overflow: hidden;
}

.history-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 44%;
  mask-image: linear-gradient(to right, transparent 12%, #0007 28%, #000 45%);
}

.history-logo {
  position: relative;
  z-index: 2;
  grid-area: 2 / 1;
  display: block;
  width: 100%;
  max-width: 19rem;
  height: auto;
  justify-self: center;
}

.history-copy {
  position: relative;
  z-index: 2;
  grid-area: 2 / 2;
  max-width: 30rem;
  font: 500 clamp(.96rem, 1.13vw, 1.23rem)/1.55 var(--sans);
}

.history-prose {
  border-inline-start: 1px solid #718262;
  padding-inline-start: clamp(16px, 2vw, 38px);
}

.history-prose p { margin: 0; }
.history-prose p + p { margin-block-start: .75em; }

.history-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  min-height: 46px;
  max-width: calc(100% - clamp(16px, 2vw, 38px));
  margin: 1em 0 0 clamp(16px, 2vw, 38px);
  padding: .7em 1.2em;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(110deg, #416a15, #064423);
  box-shadow: 0 5px 10px #163a2429;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.history-link:hover { background: #0c4527; }
.history-link:focus-visible {
  outline: 3px solid var(--history-ink);
  outline-offset: 4px;
}

.history-link svg,
.history-values-list svg {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-link svg { width: 1.15em; }

.history-values {
  position: relative;
  z-index: 3;
  margin-top: -1px;
  padding-block: 16px clamp(24px, 3vw, 54px);
  background: linear-gradient(var(--history-green), #143f26);
  color: #fffcf2;
}

.history-wave {
  position: absolute;
  bottom: calc(100% - 1px);
  left: 0;
  display: block;
  width: 100%;
  height: clamp(26px, 3.6vw, 60px);
  pointer-events: none;
}

.history-values-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1460px;
  margin: 0 auto;
  padding: 0 clamp(15px, 4vw, 70px);
  list-style: none;
}

.history-values-list li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 25px);
  padding: .15rem clamp(10px, 1.5vw, 28px);
  font: 700 clamp(.9rem, 1.32vw, 1.36rem)/1.28 var(--sans);
}

.history-values-list li + li { border-inline-start: 1px solid #d4bf7382; }

.history-values-list svg {
  width: clamp(40px, 4.4vw, 77px);
  color: var(--history-gold);
}

.history-values-list span { max-width: 12em; }

@media (min-width: 900px) and (max-width: 1199px) {
  .history-panel {
    grid-template-columns: minmax(0, 16fr) minmax(0, 40fr) minmax(0, 44fr);
    padding-inline: 4%;
  }

  .history-photo { inset-inline-start: 49%; }
  .history-panel::after { opacity: .8; }
}

@media (max-width: 899px) {
  .history-panel {
    grid-template-columns: minmax(0, 28fr) minmax(0, 72fr);
    column-gap: clamp(16px, 4vw, 36px);
    row-gap: 0;
    padding: 34px 0 62px;
  }

  .history-panel::before { width: clamp(78px, 15vw, 140px); }

  .history-panel::after {
    width: clamp(54px, 13vw, 113px);
    height: 155px;
  }

  .history-heading {
    grid-column: 1 / -1;
    padding-inline: clamp(50px, 13vw, 115px);
  }

  .history-heading h2 { font-size: clamp(2rem, 6vw, 3.5rem); }

  .history-photo {
    position: relative;
    inset: auto;
    grid-area: 2 / 1 / 3 / -1;
    height: clamp(210px, 44vw, 360px);
    margin-block: -6px 18px;
  }

  .history-photo img {
    object-position: 50% 28%;
    mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 83%, transparent);
  }

  .history-logo {
    grid-area: 3 / 1;
    width: calc(100% - 24px);
    max-width: 13rem;
    justify-self: end;
  }

  .history-copy {
    grid-area: 3 / 2;
    max-width: 35rem;
    margin-inline-end: clamp(24px, 7vw, 58px);
  }

  .history-values-list li { padding-inline: 10px; }
}

@media (max-width: 599px) {
  .history-panel {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 34px;
    padding-bottom: 54px;
  }

  .history-heading { padding-inline: 42px; }
  .history-heading h2 { font-size: clamp(1.95rem, 7vw, 2.6rem); }
  .history-kicker { letter-spacing: .13em; }
  .history-kicker::before, .history-kicker::after { width: 12px; }
  .history-photo { margin-block-end: 10px; }

  .history-logo {
    grid-area: 3 / 1;
    width: 8.6rem;
    justify-self: center;
    margin-bottom: 18px;
  }

  .history-copy {
    grid-area: 4 / 1;
    justify-self: center;
    margin-inline: 23px;
  }

  .history-values-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 450px;
  }

  .history-values-list li {
    justify-content: start;
    padding-block: 11px;
  }

  .history-values-list li:nth-child(odd) { border-inline-start: 0; }
  .history-values-list li:nth-child(n+3) { border-block-start: 1px solid #d4bf7359; }
}
