/* stack-tile.css — mini hypercard preview tiles for the home page grid.
   Variables (--stack-card-bg, etc.) are set by the matching
   .stack-theme-{key} rules in cards-themes.css. */

.stack-tile {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--stack-card-bg, #fff);
  color: var(--stack-card-fg, #000);
  border: 2px solid var(--stack-card-border, #000);
  border-radius: 4px;
  box-shadow: 4px 4px 0 var(--stack-card-border, #000);
  overflow: hidden;
  font-family: var(--stack-card-font, system-ui, sans-serif);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stack-tile:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--stack-card-border, #000);
}

.stack-tile:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--stack-card-border, #000);
}

.stack-tile__chrome {
  display: flex;
  background: var(--stack-chrome-bg, #dcdcdc);
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.stack-tile__chrome--top {
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--stack-card-border, #000);
}

.stack-tile__chrome--bottom {
  justify-content: center;
  gap: 0.4rem;
  border-top: 2px solid var(--stack-card-border, #000);
}

.stack-tile__title {
  font-weight: 600;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.stack-tile__counter {
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.stack-tile__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--stack-card-bg, #fff);
  color: var(--stack-card-fg, #000);
  border: 1px solid var(--stack-card-border, #000);
  border-radius: 3px;
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.7;
}

.stack-tile__stage {
  flex: 1;
  padding: 0.75rem 0.9rem;
  overflow: hidden;
  position: relative;
}

/* Fade-out mask at bottom so clipped content looks intentional */
.stack-tile__stage::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5rem;
  background: linear-gradient(to bottom, transparent, var(--stack-card-bg, #fff));
  pointer-events: none;
}

.stack-tile__card-title {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--stack-card-border, #000);
  line-height: 1.2;
  font-weight: 700;
}

.stack-tile__preview > * + * {
  margin-top: 0.4rem;
}

.stack-tile__heading {
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.3;
}

.stack-tile__paragraph {
  font-size: 0.75rem;
  line-height: 1.4;
  opacity: 0.9;
}

.stack-tile__image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80px;
  object-fit: cover;
  border: 1px solid var(--stack-card-border, #000);
}

.stack-tile__intro,
.stack-tile__empty {
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.7;
}

.stack-tile__empty {
  text-align: center;
  padding: 1rem;
}
