/**
 * Portfolio page banner (page 777): three Cover blocks in a Columns block
 * with the class "portfolio-panels". One dark overlay and one green frame
 * across all three, like the other page banners; each panel shows the
 * company logo, a one-line description and a "Learn more" button.
 * Hovering or focusing a panel lifts its overlay so the photo shows.
 *
 * :not(#xpt-portfolio) outranks the Customizer CSS and the covers' inline
 * styles. Plain CSS outside the Sass build; loaded by AssetsServiceProvider.
 */

.wp-block-columns.portfolio-panels:not(#xpt-portfolio) {
  --pp-ink: 22, 32, 29;
  --pp-green: #00ce7c;
  --pp-mist: #d6e6df;
  position: relative;
  gap: 0 !important;
  margin: 0 !important;
  background: rgb(var(--pp-ink));
}

/* One frame across all three panels, clear of the 94px header. */
.wp-block-columns.portfolio-panels:not(#xpt-portfolio)::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 102px 24px 24px 24px;
  border: 1px solid rgba(0, 206, 124, 0.45);
  pointer-events: none;
}

.portfolio-panels:not(#xpt-portfolio) > .wp-block-column {
  flex-basis: 0 !important;
  flex-grow: 1;
  margin: 0 !important;
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-cover {
  position: relative;
  min-height: clamp(520px, 44vw, 640px);
  height: 100%;
  margin: 0 !important;
  padding: 140px 40px 72px;
  align-items: center;
}

/* Thin dividers between the panels, inside the frame. */
.portfolio-panels:not(#xpt-portfolio) > .wp-block-column + .wp-block-column .wp-block-cover::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 102px;
  bottom: 24px;
  left: 0;
  width: 1px;
  background: rgba(0, 206, 124, 0.3);
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-cover__image-background {
  transition: transform 0.8s cubic-bezier(0.32, 0.72, 0, 1), filter 0.4s ease;
}

/* Same dark field as the other banners, darker at the bottom for the text. */
.portfolio-panels:not(#xpt-portfolio) .wp-block-cover__background {
  z-index: 1;
  opacity: 1 !important;
  background:
    linear-gradient(180deg,
      rgba(var(--pp-ink), 0.5) 0%,
      rgba(var(--pp-ink), 0.25) 40%,
      rgba(var(--pp-ink), 0.6) 100%) !important;
  transition: opacity 0.4s ease;
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-cover:hover .wp-block-cover__background,
.portfolio-panels:not(#xpt-portfolio) .wp-block-cover:focus-within .wp-block-cover__background {
  opacity: 0.8 !important;
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-cover:hover .wp-block-cover__image-background,
.portfolio-panels:not(#xpt-portfolio) .wp-block-cover:focus-within .wp-block-cover__image-background {
  transform: scale(1.04);
  filter: saturate(1);
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-cover__inner-container {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  text-align: center;
}

/* The old spacers only padded the panel; spacing now comes from the cover. */
.portfolio-panels:not(#xpt-portfolio) .wp-block-spacer { display: none; }

/* Logos: same visual height; the XPT tile sits in a thin light border. */
.portfolio-panels:not(#xpt-portfolio) .wp-block-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 110px;
  margin: 0 0 28px !important;
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-image img {
  width: auto !important;
  max-width: 280px;
  height: auto !important;
  max-height: 96px;
  object-fit: contain;
}

.portfolio-panels:not(#xpt-portfolio) .wp-block-image img.wp-image-1486 { max-height: 84px; }

/* Short green rule between logo and description. */
.portfolio-panels:not(#xpt-portfolio) .portfolio-panel__desc::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 0 auto 20px;
  background: var(--pp-green);
}

.portfolio-panels:not(#xpt-portfolio) .portfolio-panel__desc {
  max-width: 34ch;
  min-height: 3em; /* two lines, so the links line up across panels */
  margin: 0 auto 20px !important;
  font-family: "TradeGothicLT", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px !important;
  line-height: 1.5;
  color: var(--pp-mist) !important;
}

/* "Learn more" keeps the site button style (buttons.css). */
.portfolio-panels:not(#xpt-portfolio) .portfolio-panel__link { margin: 8px 0 0 !important; }

/* The whole panel is the link target. */
.portfolio-panels:not(#xpt-portfolio) .portfolio-panel__link .wp-block-button__link::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 0;
}

/* Hovering anywhere on the panel shows the button's hover state. */
.portfolio-panels:not(#xpt-portfolio) .wp-block-cover:hover .wp-block-button__link:not(#xpt-btn) { background: #33e39a; }

.portfolio-panels:not(#xpt-portfolio) .wp-block-button__link:focus-visible { outline: none !important; }
.portfolio-panels:not(#xpt-portfolio) .wp-block-button__link:focus-visible::before {
  outline: 3px solid var(--pp-green);
  outline-offset: -8px;
}

@media (max-width: 781px) {
  .wp-block-columns.portfolio-panels:not(#xpt-portfolio) { flex-direction: column; }
  .wp-block-columns.portfolio-panels:not(#xpt-portfolio)::after { display: none; }
  .portfolio-panels:not(#xpt-portfolio) > .wp-block-column { flex-basis: auto !important; }
  .portfolio-panels:not(#xpt-portfolio) .wp-block-cover { min-height: 0; padding: 56px 24px; }
  .portfolio-panels:not(#xpt-portfolio) > .wp-block-column:first-child .wp-block-cover { padding-top: 120px; }
  .portfolio-panels:not(#xpt-portfolio) > .wp-block-column + .wp-block-column .wp-block-cover::before {
    top: 0; bottom: auto; left: 24px; right: 24px; width: auto; height: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-panels:not(#xpt-portfolio) * { transition: none !important; }
}
