/* Custom styles layered on top of Pico.css */

:root {
  --pico-font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Project cards on the projects index */
main article {
  margin-bottom: 1.5rem;
}

main article h2 {
  margin-bottom: 0.25rem;
}

/* --- Project cards, status badges, progress bars ------------------------ */

.project-card {
  padding: 1.25rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}

.project-card h2,
.project-card h3 {
  margin-bottom: 0.5rem;
}

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

/* Colors come from Pico's palette so they work in light and dark mode */
.status-active    { color: var(--pico-primary); }
.status-ongoing   { color: var(--pico-primary); }
.status-complete  { color: var(--pico-ins-color); }
.status-completed { color: var(--pico-ins-color); }
.status-paused    { color: var(--pico-muted-color); }
.status-planned   { color: var(--pico-muted-color); }

.progress {
  margin-bottom: 0.75rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.progress progress {
  margin-bottom: 0;
}

/* Tables in project write-ups stay readable on small screens */
main table {
  display: block;
  overflow-x: auto;
}

/* Screenshots keep their aspect ratio and never overflow */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--pico-border-radius);
}

footer small {
  color: var(--pico-muted-color);
}

/* --- Photography gallery ------------------------------------------------ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.photo-grid-item {
  display: block;
  overflow: hidden;
  border-radius: var(--pico-border-radius);
  aspect-ratio: 1 / 1;
}

.photo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: var(--pico-border-radius);
  transition: transform 0.2s ease;
}

.photo-grid-item:hover img {
  transform: scale(1.04);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--pico-border-radius);
}

.lightbox-caption {
  color: white;
  margin-top: 1rem;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

/* --- Music page ----------------------------------------------------------- */

.track,
.score {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.track audio {
  width: 100%;
  margin-top: 0.5rem;
}

.score-render {
  background: white;
  border-radius: var(--pico-border-radius);
  padding: 1rem;
  overflow-x: auto;
  margin-top: 0.75rem;
}

/* --- Accessibility ------------------------------------------------------ */

/* Skip link: off-screen until a keyboard user tabs to it */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--pico-primary-background);
  color: var(--pico-primary-inverse);
  border-radius: 0 0 var(--pico-border-radius) 0;
}

.skip-link:focus {
  left: 0;
}

/* Respect the OS "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
