/* ESMÉRA — Matter category interaction
 * Interaction-only layer for the current static three-panel composition.
 * Grid and responsive structure remain owned by esmera-master.css.
 */

.esv-territory-panel,
.esv-territory-panel:nth-child(1),
.esv-territory-panel:nth-child(2),
.esv-territory-panel:nth-child(3) {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink-inverse);
  text-decoration: none;
}

.esv-territory-media,
.esv-territory-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
}

.esv-territory-media {
  z-index: 0;
  overflow: hidden;
}

.esv-territory-media img,
.esv-territory-panel:hover .esv-territory-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.esv-territory-shade {
  z-index: 1;
  pointer-events: none;
  transition: background 260ms var(--ease-esmera);
}

.esv-territory-copy {
  position: absolute;
  z-index: 2;
  top: auto;
  right: clamp(20px, 2.6vw, 42px);
  bottom: clamp(28px, 3.8vw, 54px);
  left: clamp(20px, 2.6vw, 42px);
  width: auto;
  max-width: 34ch;
  margin: 0;
  opacity: 1;
  clip-path: none;
  transform: none;
  pointer-events: none;
}

.esv-territory-copy h2,
.esv-territory-copy p {
  overflow-wrap: break-word;
}

.esv-territory-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  margin-top: 16px;
  border-bottom: 1px solid currentColor;
  color: inherit;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .025em;
}

.esv-territory-link::after {
  content: "↗";
  font-size: 12px;
  transition: transform 180ms var(--ease-esmera);
}

.esv-territory-panel.is-clickable {
  cursor: pointer;
}

.esv-territory-panel.is-clickable:focus-visible {
  outline: 1px solid rgba(243, 240, 232, .9);
  outline-offset: -8px;
}

@media (hover: hover) and (pointer: fine) {
  .esv-territory-panel.is-clickable:hover .esv-territory-shade {
    background: linear-gradient(
      180deg,
      rgba(17, 18, 16, .03) 20%,
      rgba(17, 18, 16, .16) 54%,
      rgba(17, 18, 16, .78) 100%
    );
  }

  .esv-territory-panel.is-clickable:hover .esv-territory-link::after {
    transform: translate3d(2px, -2px, 0);
  }
}

@media (max-width: 1100px) and (min-width: 768px) {
  .esv-territory-copy {
    right: 20px;
    bottom: 28px;
    left: 20px;
  }
}

@media (max-width: 767px) {
  .esv-territory-copy {
    right: var(--page-x);
    bottom: clamp(28px, 8vw, 44px);
    left: var(--page-x);
    max-width: min(34ch, calc(100% - (var(--page-x) * 2)));
  }

  .esv-territory-link {
    min-height: 40px;
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .esv-territory-shade,
  .esv-territory-link::after {
    transition: none !important;
  }
}
