/* cignyl-sftp 20260826 */
/* ------------------------------ */
/* v2 Card (shadcn-like)          */
/* ------------------------------ */

.v2-theme .v2-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;

  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: 0 2px 2px 0 hsl(var(--foreground) / 0.06);
  
  height: 100%;
}

.v2-theme .v2-card--variant-default {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-color: hsl(var(--border));
}

.v2-theme .v2-card--variant-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border-color: hsl(var(--border));
}

.v2-theme .v2-card--variant-destructive {
  background:
    linear-gradient(0, hsl(var(--destructive) / 0.10), hsl(var(--destructive) / 0.10)),
    hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--destructive));
}

.v2-theme .v2-card--variant-success {
  background:
    linear-gradient(0, hsl(var(--success) / 0.10), hsl(var(--success) / 0.10)),
    hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--success));
}

.v2-theme .v2-card--variant-warning {
  background:
    linear-gradient(0, hsl(var(--warning) / 0.14), hsl(var(--warning) / 0.14)),
    hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--warning));
}

.v2-theme .v2-card--variant-info {
  background:
    linear-gradient(0, hsl(var(--info) / 0.10), hsl(var(--info) / 0.10)),
    hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--info));
}

.v2-theme .v2-card--variant-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  box-shadow: none;
}

.v2-theme .v2-card--variant-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
  box-shadow: none;
}

.v2-theme .v2-card--variant-link {
  background: transparent;
  color: hsl(var(--primary));
  border-color: transparent;
  box-shadow: none;
}

.v2-theme .v2-card--variant-muted {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}

.v2-theme .v2-card__image-wrap {
  width: 100%;
  overflow: hidden;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
}

.v2-theme .v2-card__image-wrap--ratio-16-9 { aspect-ratio: 16 / 9; }
.v2-theme .v2-card__image-wrap--ratio-4-3  { aspect-ratio: 4 / 3; }
.v2-theme .v2-card__image-wrap--ratio-1-1  { aspect-ratio: 1 / 1; }

.v2-theme .v2-card__image-wrap--height-sm { height: 140px; }
.v2-theme .v2-card__image-wrap--height-md { height: 180px; }
.v2-theme .v2-card__image-wrap--height-lg { height: 240px; }

.v2-theme .v2-card__image-link {
  display: block;
}

.v2-theme .v2-card__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center;
}

/* When the image wrapper defines a fixed box, make the image fill it. */
.v2-theme .v2-card__image-wrap--ratio-16-9 .v2-card__image,
.v2-theme .v2-card__image-wrap--ratio-4-3 .v2-card__image,
.v2-theme .v2-card__image-wrap--ratio-1-1 .v2-card__image,
.v2-theme .v2-card__image-wrap--height-sm .v2-card__image,
.v2-theme .v2-card__image-wrap--height-md .v2-card__image,
.v2-theme .v2-card__image-wrap--height-lg .v2-card__image {
  height: 100%;
}

.v2-theme .v2-card__image--fit-contain {
  object-fit: contain;
  background: hsl(var(--muted));
}

.v2-theme .v2-card__image--pos-top { object-position: top; }
.v2-theme .v2-card__image--pos-bottom { object-position: bottom; }
.v2-theme .v2-card__image--pos-left { object-position: left; }
.v2-theme .v2-card__image--pos-right { object-position: right; }
.v2-theme .v2-card__image--pos-center { object-position: center; }

.v2-theme .v2-card__header {
  padding: var(--v2-space-lg);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--v2-space-md);
}

.v2-theme .v2-card__header-left {
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-xsm); /* closest to 0.375rem */
  min-width: 0;
}

.v2-theme .v2-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.v2-theme .v2-card__description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.35;
}

.v2-theme .v2-card__header-right {
  flex: 0 0 auto;
}

.v2-theme .v2-card__content {
  padding: var(--v2-space-lg);
  flex: 1 1 auto;
}

.v2-theme .v2-card__content--columns {
  display: flex;
  flex-direction: column;
  gap: var(--v2-space-md);
}

.v2-theme .v2-card__content--rows {
  display: flex;
  flex-direction: row;
  gap: var(--v2-space-md);
}

.v2-theme .v2-card__content--with-header {
  padding-top: 0;
}

.v2-theme .v2-card__footer {
  padding: var(--v2-space-lg);
  display: flex;
  align-items: center;
  gap: var(--v2-space-xsm);
}

.v2-theme .v2-card__footer--with-header {
  padding-top: 0;
}

.v2-theme .v2-card__button-bar {
  padding: var(--v2-space-lg);
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--foreground));
  border-top: 1px solid hsl(var(--border));
}

.v2-theme .v2-card__button-bar-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--v2-space-md);
}

.v2-theme .v2-card__button-bar-left,
.v2-theme .v2-card__button-bar-right {
  display: flex;
  align-items: center;
  gap: var(--v2-space-xsm);
  flex-wrap: wrap;
}

.v2-theme .v2-card__button-bar-right {
  justify-content: flex-end;
}

.v2-theme .v2-card__button-bar-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--v2-space-sm);
}

.v2-theme .v2-card__button-bar--mode-stack .v2-card__button-bar-split {
  display: none;
}

.v2-theme .v2-card__button-bar--mode-split .v2-card__button-bar-stack {
  display: none;
}

.v2-theme .v2-card__button-bar--stack-full-width-true .v2-btn {
  width: 100%;
  justify-content: center;
}

.v2-theme .v2-card--clickable-true {
  cursor: pointer;
  transition: box-shadow 120ms ease, transform 120ms ease;
}

.v2-theme .v2-card--clickable-true:hover {
  box-shadow: 0 4px 14px hsl(var(--foreground) / 0.10);
}

.v2-theme .v2-card--clickable-true:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

.v2-theme .v2-card--disabled-true {
  opacity: 0.6;
  cursor: default;
}

/* Dark-only glass (Signal / Cignyl handoff). Light cards stay opaque. */
html.v2-theme-dark .v2-theme .v2-card,
html.v2-theme-dark .v2-theme .v2-card--variant-default {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.20);
  box-shadow: 0 28px 65px rgba(2, 6, 23, 0.35);
}

html.v2-theme-dark .v2-theme .v2-card--variant-secondary,
html.v2-theme-dark .v2-theme .v2-card--variant-muted {
  background: rgba(30, 41, 59, 0.78);
  border-color: rgba(148, 163, 184, 0.20);
  backdrop-filter: blur(6px);
}

html.v2-theme-dark .v2-theme .v2-card--variant-destructive,
html.v2-theme-dark .v2-theme .v2-card--variant-success,
html.v2-theme-dark .v2-theme .v2-card--variant-warning,
html.v2-theme-dark .v2-theme .v2-card--variant-info {
  backdrop-filter: blur(6px);
}

html.v2-theme-dark .v2-theme .v2-card--clickable-true:hover {
  box-shadow: 0 32px 90px rgba(15, 23, 42, 0.45);
}

