/* app/theme.css */
html {
  background-color: hsl(var(--bg));
}

:root {
  /* Base */
  --bg: 168 50% 97%; /* soft mint white */
  --fg: 222 35% 14%; /* deep navy */

  /* Brand */
  --primary: 163 55% 42%; /* teal */
  --primary-foreground: 0 0% 100%;

  --accent: 258 55% 64%; /* soft purple */
  --accent-foreground: 0 0% 100%;

  /* Secondary */
  --secondary: 155 60% 52%; /* bright mint */
  --secondary-foreground: 222 35% 14%;

  /* Destructive */
  --destructive: 350 78% 44%;
  --destructive-foreground: 0 0% 100%;

  /* Surfaces */
  --card: 0 0% 100%;
  --card-foreground: 222 35% 14%;
  --border: 168 25% 88%;
  --muted: 215 14% 58%;

  /* Shape */
  --radius: 0.75rem;
}

[data-theme="dark"] {
  /* Base */
  --bg: 228 38% 11%; /* deep navy */
  --fg: 0 0% 100%;

  /* Brand */
  --primary: 163 60% 52%; /* bright teal */
  --primary-foreground: 0 0% 100%;

  --accent: 258 60% 72%; /* soft lavender */
  --accent-foreground: 0 0% 100%;

  /* Secondary */
  --secondary: 155 55% 48%;
  --secondary-foreground: 222 35% 14%;

  /* Destructive */
  --destructive: 350 78% 50%;
  --destructive-foreground: 0 0% 100%;

  /* Surfaces */
  --card: 228 32% 17%;
  --card-foreground: 0 0% 100%;
  --border: 228 28% 26%;
  --muted: 220 18% 52%;
}

/* Animated logo gradient text */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.logo-gradient-text {
  background: linear-gradient(
    270deg,
    hsl(var(--primary)),
    hsl(var(--accent)),
    hsl(var(--secondary)),
    hsl(var(--primary))
  );
  background-size: 300% 300%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 5s ease infinite;
}

/* ── Carousel lightbox ───────────────────────────────────────────────────── */
#carousel-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#carousel-lightbox.is-open {
  opacity: 1;
}

#carousel-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#carousel-lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 90vw;
  max-height: 90vh;
}

#carousel-lightbox-img {
  max-width: 90vw !important;
  max-height: 80vh !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  display: block !important;
  border-radius: 0.875rem;
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.25s ease;
  cursor: zoom-out;
}

#carousel-lightbox.is-open #carousel-lightbox-img {
  transform: scale(1);
}

#carousel-lightbox-caption {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  text-align: center;
  margin: 0;
}

#carousel-lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10000;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  transition: background 0.15s ease;
}

#carousel-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Content images: shrunk and zoomable on hover */
.prose img {
  max-width: 65% !important;
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 0.75rem;
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: zoom-in;
}

.prose img:hover {
  transform: scale(1.08);
  box-shadow: 0 20px 48px -8px rgba(0, 0, 0, 0.22);
}

pre {
  background-color: hsl(var(--card));
}

code {
  background-color: hsl(var(--card));
  padding-top: 0.3em;
  padding-bottom: 0.3em;
  border-radius: 0.4em;
}

[data-theme="dark"] pre {
  background-color: hsl(228 32% 9%);
}

[data-theme="dark"] code {
  background-color: hsl(228 32% 9%);
}
