/* ==========================================================================
   Texium Solutions — Partners Showcase widget
   Eyebrow + heading + intro, a vertical sidebar of partner tabs, and a
   featured panel (text content + image) that swaps per partner on
   click. One self-contained section widget — unlike the other Texium
   widgets, which are single cells meant to be repeated in a Container.
   Consumes design tokens from theme.css only.
   ========================================================================== */

.texium-partners-showcase {
  display: flex;
  flex-direction: column;
  gap: var(--texium-space-xl);
}

/* ---- Header ---- */

.texium-partners-showcase__header {
  display: flex;
  flex-direction: column;
  gap: var(--texium-space-sm);
}

.texium-partners-showcase__heading {
  margin: 0;
  font-family: var(--texium-font-heading);
  color: var(--texium-heading);
  line-height: var(--texium-leading-tight);
}

.texium-partners-showcase__description {
  margin: 0;
  max-width: 60ch;
  color: var(--texium-text-muted);
  line-height: var(--texium-leading-body);
}

/* ---- Body: sidebar + featured panel side by side ----
   Flat — no card background/border on the row itself. */

.texium-partners-showcase__body {
  display: flex;
  align-items: stretch;
  gap: var(--texium-space-md);
}

/* ---- Sidebar nav ---- */

.texium-partners-showcase__nav {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  width: 260px;
  flex-shrink: 0;
  /* Caps visible height to ~4 tabs; beyond that the list scrolls
     internally (auto-scrolled via JS, see theme.js) instead of
     stretching the sidebar taller than the featured panel. */
  max-height: 336px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border: 1px solid var(--texium-border);
  border-radius: 24px;
  padding: 14px;
}

.texium-partners-showcase__nav::-webkit-scrollbar {
  display: none;
}

.texium-partners-showcase__nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 18px 24px;
  background-color: #fff;
  border: 1px solid var(--texium-border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color var(--texium-transition-fast), border-color var(--texium-transition-fast);
}

@media (hover: hover) {
  .texium-partners-showcase__nav-item:hover {
    background-color: var(--texium-background-soft, #f4f9fe);
  }
}

.texium-partners-showcase__nav-item:focus-visible {
  outline: 2px solid var(--texium-accent);
  outline-offset: -2px;
}

.texium-partners-showcase__nav-item.is-active {
  background-color: var(--texium-primary);
  border-color: var(--texium-primary);
}

.texium-partners-showcase__nav-logo {
  display: block;
  max-width: 100%;
  width: auto;
  height: 28px;
  object-fit: contain;
}

.texium-partners-showcase__nav-logo--fallback {
  font-size: var(--texium-font-size-sm);
  font-weight: var(--texium-weight-bold);
  color: #000;
}

.texium-partners-showcase__nav-item.is-active .texium-partners-showcase__nav-logo--fallback {
  color: #fff;
}

/* ---- Featured panel ---- */

.texium-partners-showcase__featured {
  position: relative;
  flex-grow: 1;
  min-width: 0;
}

.texium-partners-showcase__featured-content {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: stretch;
  gap: var(--texium-space-2xl);
  /* The card lives here, on the featured content only — the sidebar
     nav stays flat with no background/border of its own. */
  background-color: #fff;
  border: 1px solid var(--texium-border);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--texium-shadow-sm);
  /* Custom property set inline per-partner via the accent_color repeater
     field, so a per-partner accent is available to any rule here that
     wants to key off it without needing separate generated CSS. */
  --texium-partners-accent: var(--texium-primary);
}

.texium-partners-showcase__featured-content[hidden] {
  display: none;
}

/* Fade/slide-in when a panel becomes active via JS toggling the class —
   panels are otherwise hidden via the [hidden] attribute, so this only
   plays for the panel that is visible. */

.texium-partners-showcase__featured-content.is-active {
  animation: texium-partners-panel-in 400ms var(--texium-ease-out);
}

@keyframes texium-partners-panel-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .texium-partners-showcase__featured-content.is-active {
    animation: none;
  }
}

/* ---- Content column ---- */

.texium-partners-showcase__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--texium-space-md);
  min-width: 0;
}

.texium-partners-showcase__badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 12px;
  font-size: var(--texium-font-size-xs);
  font-weight: var(--texium-weight-semibold);
  color: var(--texium-primary);
  background-color: #fff;
  border: 1px solid var(--texium-border);
  border-radius: var(--texium-radius-pill);
}

.texium-partners-showcase__partner-name {
  margin: 0;
  font-family: var(--texium-font-heading);
  font-size: 30px;
  font-weight: 700;
  line-height: var(--texium-leading-tight);
  color: var(--texium-heading);
}

.texium-partners-showcase__partner-label {
  margin-left: 0.4em;
  font-weight: var(--texium-weight-medium);
  color: var(--texium-primary);
}

.texium-partners-showcase__secondary-text {
  margin: 0;
  font-size: var(--texium-font-size-sm);
  color: var(--texium-text-muted);
}

.texium-partners-showcase__partner-description {
  color: var(--texium-text-muted);
  line-height: var(--texium-leading-body);
}

.texium-partners-showcase__partner-description p:first-child {
  margin-top: 0;
}

.texium-partners-showcase__partner-description p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .texium-partners-showcase__nav-item {
    transition: none;
  }
}

/* ---- Visual column ---- */

.texium-partners-showcase__visual {
  position: relative;
  height: 100%;
}

.texium-partners-showcase__decoration {
  position: absolute;
  width: 240px;
  height: 240px;
  top: -10%;
  right: -10%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--texium-x-cyan) 0%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

.texium-partners-showcase__media {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 340px;
  border-radius: 20px;
  overflow: hidden;
  isolation: isolate;
}

.texium-partners-showcase__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* ---- Responsive ----
   The nav becomes a horizontally-scrollable strip once there's no room
   for a sidebar + two-column panel side by side; the featured panel
   drops to one column, image order controlled by the widget's own
   "Stacking order" control (texium-partners-showcase--content-first). */

@media (max-width: 1024px) {
  .texium-partners-showcase__body {
    flex-direction: column;
  }

  .texium-partners-showcase__nav {
    flex-direction: row;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    /* Hides the scrollbar visually while keeping the scroll functional —
       touch/trackpad scroll still works, there's just no visible bar. */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .texium-partners-showcase__nav::-webkit-scrollbar {
    display: none;
  }

  .texium-partners-showcase__nav-item {
    width: auto;
    flex-shrink: 0;
  }

  .texium-partners-showcase__featured-content {
    grid-template-columns: 1fr;
    padding: 36px;
  }

  .texium-partners-showcase__visual {
    order: -1;
  }

  .texium-partners-showcase--content-first .texium-partners-showcase__visual {
    order: 1;
  }

  .texium-partners-showcase__media {
    height: 260px;
    min-height: 260px;
  }
}

@media (max-width: 600px) {
  .texium-partners-showcase__featured-content {
    padding: 24px;
    gap: var(--texium-space-lg);
    min-height: 0;
  }

  .texium-partners-showcase__partner-name {
    font-size: 24px;
  }

  .texium-partners-showcase__nav-item {
    padding: var(--texium-space-xs) var(--texium-space-sm);
  }

  .texium-partners-showcase__media {
    height: 200px;
    min-height: 200px;
  }
}
