/* Shared contextual links between Maui History chapters and tour pages. */

.hbs-internal-links__shell {
  width: min(calc(100% - 40px), 1180px);
  margin: 0 auto;
}

.hbs-internal-links__header {
  max-width: 760px;
  margin-bottom: clamp(30px, 4vw, 46px);
}

.hbs-internal-links__header--centered {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.hbs-internal-links__eyebrow {
  margin: 0 0 12px;
  color: #8a5c19;
  font-family: var(--hbs-sans, "Josefin Sans", sans-serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.8px;
  line-height: 1.35;
  text-transform: uppercase;
}

.hbs-internal-links__header h2 {
  margin: 0;
  color: #20170f;
  font-family: var(--hbs-display, Georgia, serif);
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.06;
}

.hbs-internal-links__header > p:last-child {
  margin: 18px 0 0;
  color: #625b53;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.72;
}

.hbs-context-links {
  padding: clamp(68px, 8vw, 100px) 0;
  border-top: 1px solid rgba(91, 67, 39, 0.13);
  border-bottom: 1px solid rgba(91, 67, 39, 0.13);
  background: #f3ede4;
}

.hbs-context-links__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.hbs-context-links__grid--count-1 {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.hbs-context-links__grid--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hbs-context-link {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 26px 50px 26px 26px;
  border: 1px solid rgba(91, 67, 39, 0.22);
  border-left: 4px solid #d19f40;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(45, 31, 17, 0.06);
  color: #20170f;
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.hbs-context-link__kind {
  margin-bottom: 13px;
  color: #8a5c19;
  font-family: var(--hbs-sans, "Josefin Sans", sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  line-height: 1.3;
  text-transform: uppercase;
}

.hbs-context-link strong {
  color: inherit;
  font-family: var(--hbs-display, Georgia, serif);
  font-size: clamp(23px, 2.1vw, 30px);
  line-height: 1.12;
}

.hbs-context-link__copy {
  margin-top: 14px;
  color: #625b53;
  font-size: 15px;
  line-height: 1.62;
}

.hbs-context-link__arrow {
  position: absolute;
  top: 26px;
  right: 24px;
  color: #8a5c19;
  font-size: 24px;
  line-height: 1;
}

.hbs-context-link:hover {
  border-color: rgba(138, 92, 25, 0.58);
  border-left-color: #d19f40;
  box-shadow: 0 18px 38px rgba(45, 31, 17, 0.11);
  transform: translateY(-3px);
}

.hbs-context-link:focus-visible,
.hbs-product-history-card figcaption a:focus-visible {
  outline: 3px solid #8a5c19;
  outline-offset: 4px;
}

.hbs-product-history-card > a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -7px;
  box-shadow: 0 0 0 3px #8a5c19;
}

.hbs-product-history-links {
  padding: clamp(76px, 9vw, 116px) 0;
  background: #f9f5ee;
}

.hbs-product-history-links__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.hbs-product-history-links__grid--count-1 {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

.hbs-product-history-links__grid--count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hbs-product-history-card {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  margin: 0;
}

.hbs-product-history-card > a {
  position: relative;
  isolation: isolate;
  min-height: 380px;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(91, 67, 39, 0.2);
  border-bottom: 4px solid #d19f40;
  background: #20170f;
  box-shadow: 0 14px 32px rgba(34, 24, 14, 0.12);
  color: #fff;
  text-decoration: none;
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.hbs-product-history-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.hbs-product-history-card__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(17, 11, 6, 0.05) 15%, rgba(17, 11, 6, 0.88) 100%);
}

.hbs-product-history-card__content {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 28px;
}

.hbs-product-history-card__eyebrow,
.hbs-product-history-card__content > span:last-child {
  font-family: var(--hbs-sans, "Josefin Sans", sans-serif);
  font-weight: 700;
}

.hbs-product-history-card__eyebrow {
  margin-bottom: 9px;
  color: #f0c56d;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hbs-product-history-card__content strong {
  color: #fff;
  font-family: var(--hbs-display, Georgia, serif);
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.06;
}

.hbs-product-history-card__content > span:last-child {
  margin-top: 15px;
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.hbs-product-history-card figcaption {
  min-height: 46px;
  padding: 9px 3px 0;
  color: #625b53;
  font-size: 12px;
  line-height: 1.45;
}

.hbs-product-history-card figcaption a {
  color: #744b16;
  text-underline-offset: 2px;
}

.hbs-product-history-card > a:hover {
  box-shadow: 0 20px 44px rgba(34, 24, 14, 0.2);
  transform: translateY(-4px);
}

.hbs-product-history-card > a:hover img {
  transform: scale(1.035);
}

/* Imported Divi content has broad link and figure-image rules. Keep this
   component self-contained when it is appended to the legacy Pipiwai page. */
.page-content .hbs-product-history-card > a {
  color: #fff;
  text-decoration: none;
}

.page-content .hbs-product-history-card img {
  height: 100%;
}

@media (max-width: 980px) {
  .hbs-context-links__grid,
  .hbs-product-history-links__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hbs-context-links__grid--count-1 {
    grid-template-columns: minmax(0, 560px);
  }

  .hbs-product-history-links__grid--count-1 {
    grid-template-columns: minmax(0, 560px);
  }

  .hbs-product-history-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .hbs-context-links__grid--count-3 > li:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .hbs-internal-links__shell {
    width: min(calc(100% - 32px), 1180px);
  }

  .hbs-context-links__grid,
  .hbs-product-history-links__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hbs-context-link {
    min-height: 0;
  }

  .hbs-product-history-card:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .hbs-context-links__grid--count-3 > li:last-child {
    grid-column: auto;
  }

  .hbs-product-history-card > a {
    min-height: 330px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hbs-context-link,
  .hbs-product-history-card > a,
  .hbs-product-history-card img {
    transition: none;
  }

  .hbs-context-link:hover,
  .hbs-product-history-card > a:hover {
    transform: none;
  }

  .hbs-product-history-card > a:hover img {
    transform: none;
  }
}

@media print {
  .hbs-context-links,
  .hbs-product-history-links {
    display: none;
  }
}
