.tsic, .tsic * { box-sizing: border-box; }
.tsic, .tsic-grid, .tsic-grid__item, .tsic-single, .tsic-card, .tsic-card__media { background-color: transparent; }
.tsic-grid { display:grid; grid-template-columns:repeat(var(--tsic-columns, 3),minmax(0,1fr)); gap:20px; }
.tsic-grid__item { min-width:0; }
.tsic-single { width:100%; }
.tsic-card {
  --tsic-panel-left:0px; --tsic-panel-bottom:26px;
  --tsic-panel-width:54%; --tsic-panel-hover-width:72%;
  --tsic-panel-min-height:84px; --tsic-panel-hover-min-height:110px;
  --tsic-radius-normal:0 11px 11px 0; --tsic-radius-hover:0 32px 32px 0;
  --tsic-panel-bg:#050505; --tsic-panel-hover-bg:#050505;
  --tsic-duration:450ms; --tsic-easing:cubic-bezier(.22,1,.36,1);
  position:relative; isolation:isolate; width:100%; aspect-ratio:3 / 4; border-radius:9px; background:transparent;
  overflow:hidden; color:#fff;
}
.tsic-card__media { position:absolute; inset:0; overflow:hidden; }
.tsic-card__image { display:block; width:100%; height:100%; object-fit:cover; object-position:center center; }
.tsic-card__surface-link { position:absolute; inset:0; z-index:1; cursor:pointer; }
.tsic-card__panel {
  position:absolute; z-index:2; left:var(--tsic-panel-left); bottom:var(--tsic-panel-bottom);
  width:min(var(--tsic-item-panel-width, var(--tsic-panel-width)), calc(100% - var(--tsic-panel-left)));
  max-width:calc(100% - var(--tsic-panel-left)); min-height:var(--tsic-item-panel-height, var(--tsic-panel-min-height));
  padding:16px 18px; border-radius:0; background:transparent;
  display:flex; flex-direction:column; justify-content:center; gap:8px;
  transform:translate3d(0,0,0);
  transition:none;
}

/* Badge background stays independent from text, but never reacts to hover. */
.tsic-card::before {
  content:""; display:block; position:absolute; z-index:2; pointer-events:none;
  left:var(--tsic-panel-left); bottom:var(--tsic-panel-bottom);
  width:min(var(--tsic-item-panel-width, var(--tsic-panel-width)), calc(100% - var(--tsic-panel-left)));
  height:var(--tsic-item-panel-height, var(--tsic-panel-min-height));
  min-height:var(--tsic-panel-min-height);
  background:var(--tsic-panel-bg); border-radius:var(--tsic-radius-normal);
}
/* Text stays in precisely the same location regardless of badge dimensions. */
.tsic-card__panel { z-index:3; }
.tsic-card__name, .tsic-card__role { position:relative; z-index:1; }

.tsic-card__name { margin:0; padding:0; color:#fff; font-size:20px; font-weight:700; line-height:1.25; }
.tsic-card__name a { color:inherit; text-decoration:none; }
.tsic-card__name a:hover { text-decoration:underline; }
.tsic-card__role { color:#ff281d; font-size:16px; font-weight:400; line-height:1.35; }
.tsic-card__details { color:#fff; line-height:1.45; font-size:14px; }
.tsic-card__details p { margin:0; }
.tsic-card__actions { padding-top:4px; }
.tsic-card__button { display:inline-flex; align-items:center; justify-content:center; border-radius:5px; padding:8px 12px; text-decoration:none; background:#d7251d; color:white; font-size:13px; font-weight:600; transition:background-color .2s ease; }
.tsic-card__button:hover { color:#fff; background:#aa1510; }
.tsic--reveal .tsic-card__details, .tsic--reveal .tsic-card__actions {
  opacity:0; max-height:0; overflow:hidden; visibility:hidden; padding-top:0;
  transition:max-height var(--tsic-duration) var(--tsic-easing), opacity var(--tsic-duration) var(--tsic-easing), visibility 0s linear var(--tsic-duration), padding var(--tsic-duration) var(--tsic-easing);
}
.tsic--reveal .tsic-card__details p { margin:0; }
.tsic--reveal .tsic-card__actions { pointer-events:none; }
.tsic--reveal .tsic-card:is(:hover,:focus-within) .tsic-card__details,
.tsic--reveal .tsic-card:is(:hover,:focus-within) .tsic-card__actions {
  opacity:1; max-height:220px; visibility:visible; pointer-events:auto;
  transition:max-height var(--tsic-duration) var(--tsic-easing), opacity var(--tsic-duration) var(--tsic-easing), visibility 0s, padding var(--tsic-duration) var(--tsic-easing);
}
.tsic--reveal .tsic-card:is(:hover,:focus-within) .tsic-card__actions { padding-top:4px; }
/* Intro effects are triggered once per card on entering the viewport.
   Hover never starts or reverses these animations. */
.tsic.tsic--animate-ready .tsic-card:not(.tsic-is-visible)::before,
.tsic.tsic--animate-ready .tsic-card:not(.tsic-is-visible) .tsic-card__panel {
  opacity:0;
}
.tsic.tsic--animate-ready.tsic--curve .tsic-card:not(.tsic-is-visible)::before {
  clip-path:inset(0 100% 0 0);
}
.tsic.tsic--animate-ready.tsic--slide .tsic-card:not(.tsic-is-visible)::before,
.tsic.tsic--animate-ready.tsic--slide .tsic-card:not(.tsic-is-visible) .tsic-card__panel {
  transform:translateY(30px);
}
.tsic.tsic--animate-ready.tsic--curve .tsic-card.tsic-is-visible::before,
.tsic.tsic--animate-ready.tsic--curve .tsic-card.tsic-is-visible .tsic-card__panel,
.tsic.tsic--animate-ready.tsic--slide .tsic-card.tsic-is-visible::before,
.tsic.tsic--animate-ready.tsic--slide .tsic-card.tsic-is-visible .tsic-card__panel,
.tsic.tsic--animate-ready.tsic--fade .tsic-card.tsic-is-visible::before,
.tsic.tsic--animate-ready.tsic--fade .tsic-card.tsic-is-visible .tsic-card__panel {
  animation-duration:var(--tsic-duration);
  animation-timing-function:var(--tsic-easing);
  animation-fill-mode:both;
  animation-delay:calc(var(--tsic-index, 0) * var(--tsic-stagger, 100ms));
}
.tsic.tsic--animate-ready.tsic--curve .tsic-card.tsic-is-visible::before { animation-name:tsic-badge-curve; }
.tsic.tsic--animate-ready.tsic--curve .tsic-card.tsic-is-visible .tsic-card__panel { animation-name:tsic-text-fade; }
.tsic.tsic--animate-ready.tsic--slide .tsic-card.tsic-is-visible::before,
.tsic.tsic--animate-ready.tsic--slide .tsic-card.tsic-is-visible .tsic-card__panel { animation-name:tsic-badge-up; }
.tsic.tsic--animate-ready.tsic--fade .tsic-card.tsic-is-visible::before,
.tsic.tsic--animate-ready.tsic--fade .tsic-card.tsic-is-visible .tsic-card__panel { animation-name:tsic-text-fade; }
@keyframes tsic-badge-curve {
  from { opacity:0; clip-path:inset(0 100% 0 0); }
  to { opacity:1; clip-path:inset(0 0 0 0); }
}
@keyframes tsic-text-fade {
  from { opacity:0; }
  to { opacity:1; }
}
@keyframes tsic-badge-up {
  from { opacity:0; transform:translateY(30px); }
  to { opacity:1; transform:translateY(0); }
}
.tsic-card__role a { color:inherit; text-decoration:none; }
.tsic-card__role a:hover { text-decoration:underline; }
.tsic-card__panel { pointer-events:none; }
.tsic-card__panel a { pointer-events:auto; position:relative; z-index:3; }
.tsic-card__details { position:absolute; bottom:calc(100% + 8px); left:0; width:100%; background:var(--tsic-panel-bg); border-radius:8px; padding:12px; pointer-events:none; }
.tsic--reveal .tsic-card__details { max-height:0; padding:0 12px; }
.tsic--reveal .tsic-card:is(:hover,:focus-within) .tsic-card__details { max-height:220px; padding:12px; }
/* Buttons are always visible (and accessible) when enabled, without moving the name. */
.tsic .tsic-card__actions, .tsic--reveal .tsic-card__actions {
  opacity:1; max-height:none; visibility:visible; pointer-events:auto; overflow:visible; padding-top:4px; transition:none;
}
.tsic--static.tsic--reveal .tsic-card__details { max-height:none; padding:12px; opacity:1; visibility:visible; }
@media (hover:none) {
  .tsic-card::before { width:min(var(--tsic-item-panel-width, var(--tsic-panel-width)), calc(100% - var(--tsic-panel-left))); }
  .tsic--reveal .tsic-card__details, .tsic--reveal .tsic-card__actions { max-height:none; opacity:1; visibility:visible; overflow:visible; pointer-events:auto; }
  .tsic--reveal .tsic-card__actions { padding-top:4px; }
}
@media (prefers-reduced-motion:reduce) {
  .tsic-card::before, .tsic-card__image, .tsic-card__panel, .tsic-card__details, .tsic-card__actions { transition:none !important; }
}

/* Frontend visibility guard for theme styles targeting generic grid/card tags. */
.tsic.tsic--curve, .tsic.tsic--slide, .tsic.tsic--fade, .tsic.tsic--static {
  display:block; visibility:visible; opacity:1; background:transparent;
}
.tsic .tsic-grid { display:grid; visibility:visible; opacity:1; background:transparent; }
.tsic .tsic-grid__item, .tsic .tsic-card { visibility:visible; opacity:1; }
.tsic .tsic-card__media, .tsic .tsic-card__image { visibility:visible; opacity:1; }

/* Accessibility: show the badge immediately when reduced motion is requested. */
@media (prefers-reduced-motion:reduce) {
  .tsic.tsic--animate-ready .tsic-card::before,
  .tsic.tsic--animate-ready .tsic-card__panel {
    animation:none !important; opacity:1 !important;
    transform:none !important; clip-path:none !important;
  }
}

/* Beta 9 — responsive stacking containment.
   Each widget establishes a local stacking/paint context, preventing card
   overlays from escaping into neighbouring Elementor sections. */
.tsic {
  position: relative;
  z-index: 0;
  isolation: isolate;
  /* Do not use layout/paint containment: keep the widget in normal document flow. */
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tsic .tsic-grid,
.tsic .tsic-single {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.tsic .tsic-grid__item {
  position: relative;
  min-width: 0;
  isolation: isolate;
}
.tsic .tsic-card {
  max-width: 100%;
  min-width: 0;
  isolation: isolate;
}
/* Restrict the absolutely positioned click overlay to its own card. */
.tsic .tsic-card__surface-link {
  inset: 0;
  max-width: 100%;
  max-height: 100%;
}
@media (max-width: 1024px) {
  .tsic,
  .tsic .tsic-grid,
  .tsic .tsic-single,
  .tsic .tsic-grid__item {
    min-width: 0;
    max-width: 100%;
  }
  .tsic .tsic-card__panel,
  .tsic .tsic-card::before {
    max-width: calc(100% - var(--tsic-panel-left));
  }
}

/* Beta 10 — structural responsive height fix.
   Keep the media box in normal flow. In previous versions both the photo
   and overlays were absolutely positioned; height relied on the card's
   aspect-ratio, which could be affected by responsive/theme styles.
   The media box now reserves the image height, so the grid and Elementor
   containers always have measurable content height. */
.tsic .tsic-card {
  display: block;
  height: auto;
  aspect-ratio: auto !important;
  position: relative;
  width: 100%;
  min-width: 0;
}
.tsic .tsic-card__media {
  position: relative;
  inset: auto;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--tsic-card-ratio, 3 / 4);
  overflow: hidden;
}
.tsic .tsic-card__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tsic .tsic-grid,
.tsic .tsic-grid__item,
.tsic .tsic-single {
  height: auto;
  min-height: 0;
}
/* The badge and optional clickable overlay stay positioned relative to
   their card; only the image's layout box contributes to page height. */
.tsic .tsic-card__panel,
.tsic .tsic-card__surface-link {
  position: absolute;
}


/* Beta 11 — Elementor responsive widget wrapper guard.
   The grid itself has a natural height, but some Elementor/theme responsive
   layouts report a much shorter height for .elementor-widget-tsic_*.  Keep
   card geometry unchanged and only normalize the immediate widget wrapper. */
@media (max-width: 1024px) {
  .elementor-widget-tsic_grid,
  .elementor-widget-tsic_single {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }
  .elementor-widget-tsic_grid > .elementor-widget-container,
  .elementor-widget-tsic_single > .elementor-widget-container {
    display: flow-root;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: visible;
  }
}
