/* stocks.css — responsive gallery with hover overlay slide-up */

/* Local fallback vars */
:root {
  --stocks-gold: #f4c542;
  --stocks-overlay-bg: rgba(11, 18, 32, 0.6);
  --stocks-overlay-light: rgba(255, 255, 255, 0.85);
  --stocks-radius: 10px;
}

/* Section base (white background assumed in your layout) */
#stocks-market {
  background: transparent;
  color: #0b1220;
}

/* Intro */
.stocks-intro .h3 {
  font-weight: 700;
}
.stocks-intro .lead {
  color: rgba(11, 18, 32, 0.75);
}

/* Card / figure */
.stock-card {
  position: relative;
  border-radius: var(--stocks-radius);
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  box-shadow: var(--shadow);
  height: 100%;
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stock-card:focus {
  outline: none;
  box-shadow: 0 10px 30px rgba(13, 110, 253, 0.12);
  transform: translateY(-4px);
}

/* image */
.stock-img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 0.9, 0.32, 1);
}

/* overlay (hidden by default, slides up on hover/focus-within) */
.stock-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.stock-overlay-inner {
  width: 100%;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.22, 0.9, 0.32, 1);
  padding: 1rem;
  box-sizing: border-box;
  background: linear-gradient(
    180deg,
    rgba(11, 18, 32, 0.25),
    rgba(11, 18, 32, 0.55)
  );
  color: var(--stocks-overlay-light);
  pointer-events: auto;
}

.stock-card:hover .stock-img,
.stock-card:focus .stock-img,
.stock-card:focus-within .stock-img {
  transform: scale(1.03);
}

.stock-card:hover .stock-overlay-inner,
.stock-card:focus .stock-overlay-inner,
.stock-card:focus-within .stock-overlay-inner {
  transform: translateY(0%);
}

/* text inside overlay */
.stock-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #fff;
}
.stock-desc {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
}

/* button: use gold gradient + slight shadow, sized for small screens */
.stocks-open-chat {
  background: linear-gradient(90deg, #ffd166, var(--stocks-gold));
  border: none;
  color: #0b1220;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(244, 197, 66, 0.12);
}

/* make sure the button is accessible and focusable */
.stocks-open-chat:focus {
  outline: 2px solid rgba(255, 209, 102, 0.35);
  outline-offset: 3px;
}

/* indicator small devices: taller images */
@media (max-width: 575.98px) {
  .stock-img {
    height: 180px;
  }
  .stock-overlay-inner {
    padding: 0.8rem;
  }
}

/* medium screens */
@media (min-width: 576px) and (max-width: 991.98px) {
  .stock-img {
    height: 200px;
  }
}

/* desktop: larger */
@media (min-width: 992px) {
  .stock-img {
    height: 220px;
  }
}

/* reduce motion: show overlay instantly and stop transforms */
@media (prefers-reduced-motion: reduce) {
  .stock-img {
    transition: none !important;
    transform: none !important;
  }
  .stock-overlay-inner {
    transition: none !important;
    transform: translateY(0%) !important;
  }
}

.row-cols-md-3 > .col {
  display: flex;
  flex-wrap: wrap;
}
.stock-card .stock-overlay-inner .stock-desc {
  opacity: 0.95;
}

/* optional: make figures keyboard-friendly */
.stock-card {
  -webkit-tap-highlight-color: transparent;
}
