/* ============================================================
   Card Screenshots — browser-window framed previews
   ============================================================ */

/* ---- Wrapper: the "window" frame ---- */
.card-screenshot-link {
  display: block;
  overflow: hidden;
  border: 1.5px solid var(--border, #d4cfc7);
  border-radius: 7px;
  margin-bottom: 1.6rem;
  text-decoration: none;
  background: var(--bg-alt, #edeae3);
  position: relative;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.07),
    0 6px 24px rgba(0,0,0,0.09);
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.card-screenshot-link:hover {
  border-color: var(--navy, #1e3a5f);
  box-shadow:
    0 4px 10px rgba(0,0,0,0.09),
    0 10px 36px rgba(0,0,0,0.14);
  transform: translateY(-2px);
}

/* ---- Browser chrome bar (traffic-light dots) ---- */
.card-screenshot-link::before {
  content: '';
  display: block;
  height: 32px;
  /* Three circles drawn with radial-gradient; warm toolbar background */
  background:
    radial-gradient(circle at center, #ff5f57 0px, #ff5f57 5px, transparent 5px) 14px 50% no-repeat,
    radial-gradient(circle at center, #febc2e 0px, #febc2e 5px, transparent 5px) 30px 50% no-repeat,
    radial-gradient(circle at center, #28c840 0px, #28c840 5px, transparent 5px) 46px 50% no-repeat,
    linear-gradient(to bottom, #efece5 0%, #e6e2da 100%);
  border-bottom: 1px solid var(--border, #d4cfc7);
  flex-shrink: 0;
}

/* ---- Screenshot image ---- */
.card-screenshot {
  width: 100%;
  aspect-ratio: 16 / 8.4;
  object-fit: cover;
  object-position: top center;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;

  /* Shimmer placeholder while image loads */
  background-image: linear-gradient(
    90deg,
    var(--bg-alt, #edeae3) 0%,
    var(--border-light, #e8e4dc) 50%,
    var(--bg-alt, #edeae3) 100%
  );
  background-size: 200% 100%;
  animation: screenshot-shimmer 1.6s ease-in-out infinite;
}

.card-screenshot.loaded {
  opacity: 1;
  background-image: none;
  animation: none;
}

@keyframes screenshot-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 600px) {
  .card-screenshot { aspect-ratio: 16 / 10; }
}

/* ============================================================
   Theme variants
   ============================================================ */

/* ---- Brutalist ---- */
[data-theme="brutalist"] .card-screenshot-link {
  border: 2.5px solid #0a0a0a;
  border-radius: 0;
  box-shadow: 5px 5px 0 #0a0a0a;
  transform: none;
}

[data-theme="brutalist"] .card-screenshot-link:hover {
  box-shadow: 7px 7px 0 #0a0a0a;
  transform: translate(-2px, -2px);
}

[data-theme="brutalist"] .card-screenshot-link::before {
  height: 28px;
  background:
    radial-gradient(circle at center, #0a0a0a 0px, #0a0a0a 4px, transparent 4px) 12px 50% no-repeat,
    radial-gradient(circle at center, #0a0a0a 0px, #0a0a0a 4px, transparent 4px) 26px 50% no-repeat,
    radial-gradient(circle at center, #0a0a0a 0px, #0a0a0a 4px, transparent 4px) 40px 50% no-repeat,
    #f0f0f0;
  border-bottom: 2px solid #0a0a0a;
}

/* ---- Neocities ---- */
[data-theme="neocities"] .card-screenshot-link {
  border: 2px solid #ff66ff;
  border-radius: 0;
  box-shadow: 4px 4px 0 #ffff66;
  transform: none;
}

[data-theme="neocities"] .card-screenshot-link:hover {
  border-color: #ffff66;
  box-shadow: 6px 6px 0 #ff66ff;
  transform: translate(-2px, -2px);
}

[data-theme="neocities"] .card-screenshot-link::before {
  height: 28px;
  background:
    radial-gradient(circle at center, #ff3399 0px, #ff3399 5px, transparent 5px) 14px 50% no-repeat,
    radial-gradient(circle at center, #ffff66 0px, #ffff66 5px, transparent 5px) 30px 50% no-repeat,
    radial-gradient(circle at center, #66ff99 0px, #66ff99 5px, transparent 5px) 46px 50% no-repeat,
    #1a0030;
  border-bottom: 2px solid #ff66ff;
}
