/* =========================================================================
   OHS Stylesheet – compatibility build (Courier‑primary, no dark‑mode)
   ========================================================================= */

/* ───────── Base / Reset ────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family:'Work Sans',Monserat,Merriweather;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  /* horizontal padding only – no top gap so nav sits flush */
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

:root {
  --pink-hover: #f9c2c2;
  --pink: #8F2B24;
  --bg: #fffaf5;
  --text: #222;
  --radius: 12px;
}

/* duplicate body rule kept for backward‑compatibility -------------------- */
body {
  font-family:'Work Sans',Monserat,Merriweather;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Accessible focus ring -------------------------------------------------- */
*:focus-visible {
  outline: 3px solid var(--pink-hover);
  outline-offset: 2px;
}

/* ───────── Navigation ─────────────────────────────────────────────────── */
nav {
  width: 100%;
  background: var(--text);
  align-self: stretch; /* ensure nav spans full viewport inside flex body */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--text);
    z-index: 1000;       /* sits above the hero */
}
  
  /* push content down so the bar doesn’t overlap it */
  .hero{ margin-top: 3.5rem; }          /* adjust if your nav is taller */
  


nav ul {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

/* ───────── Headings ───────────────────────────────────────────────────── */
h1 {
  text-align: center;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin: 2rem 0 1.5rem;
}

/* ───────── Search Bar & Filters ───────────────────────────────────────── */
.search-bar {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.search-bar form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.search-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.filters-row {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: end;
  gap: 1rem 2rem;
}

.results-count-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.results-count {
  font-weight: 600;
  color: var(--text);
  padding: 0.5rem 0;
  min-width: 100px;
  text-align: center;
}

.search-bar input[type="text"] {
  flex: 1 1 250px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 2px solid #ccc;
  border-radius: var(--radius);
  min-width: 0;
}

.search-bar button {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  background: var(--pink);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
  color: #fff;
}

.search-bar button:hover {
  background: var(--pink-hover);
  color: #222;
}

.filters {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
}

.filters select {
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 1rem;
  max-width: 180px;
}

/* ───────── Results grid ──────────────────────────────────────────────── */
.results {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  width: 100%;
  max-width: 1200px;
}

.artist-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fefefe;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .artist-card {
    transition: none;
  }
}

.artist-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.artist-card img {
  width: 100%;
  height: 250px; /* Increased from 200px for better proportions */
  object-fit: cover;
  object-position: center top; /* Focus on the top/face area */
  border-radius: 8px 8px 0 0; /* Rounded top corners */
  background-color: #f5f5f5; /* Fallback color while loading */
  transition: transform 0.2s ease;
}

/* Add loading state */
.artist-card img:not([src]), 
.artist-card img[src=""] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Image loading states */
.artist-card img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.artist-card img[src]:not([src=""]) {
  opacity: 1;
}

/* Error state for broken images */
.artist-card img[src*="placeholder.jpg"] {
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #6c757d;
}

.artist-info {
  padding: 1rem;
  flex: 1;
}

.artist-info h2 {
  font-family: "Georgia", serif;
  font-size: clamp(1rem, 2vw + 0.6rem, 1.3rem);
  margin: 0 0 0.5rem;
}

.artist-info p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

/* ───────── Modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 900;
  padding: 1rem;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  position: relative;
  overflow-y: auto;
  max-height: 90dvh;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
}

/* ───────── Media queries ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .artist-card img {
    height: 200px;
  }
}

@media (max-width: 600px) {
  /* keep nav flush on mobile too */
  body {
    padding: 0 0.5rem 1.5rem;
  }
  .filters {
    flex-direction: column;
    gap: 0.75rem;
  }
  nav ul {
    gap: 0.5rem 1rem;
  }
  .artist-card img {
    height: 180px;
  }
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.5rem;
  }
  .search-bar input[type="text"] {
    flex: 1 1 200px;
  }
  .artist-info h2 {
    font-size: 1rem;
  }
}

/* ───────── Add Artist Page ───────────────────────────────────────────── */
.add-artist {
  width: 100%;
  max-width: 680px;
  margin: 3rem auto 2rem;
  padding: 0 1rem;
  font-size: 1rem;
}

.add-artist .form-group {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.5rem 1rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.add-artist label {
  font-weight: 600;
  text-align: right;
  padding-top: 0.6rem;
  font-family:'Work Sans',Monserat,Merriweather;
}

.add-artist label .required {
  color: #d33;
  margin-left: 2px;
}

.add-artist input[type="text"],
.add-artist input[type="url"],
.add-artist input[type="number"],
.add-artist input[type="file"],
.add-artist textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.add-artist textarea {
  resize: vertical;
  min-height: 110px;
}

.add-artist input:focus,
.add-artist textarea:focus {
  outline: none;
  border-color: var(--pink-hover);
  box-shadow: 0 0 0 3px rgba(243, 156, 163, 0.35);
}

.add-artist button[type="submit"] {
  padding: 0.8rem 1.6rem;
  background: var(--pink);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  margin-top: 0.5rem;
  font-family:'Work Sans',Monserat,Merriweather;
  

}

.add-artist button[type="submit"]:hover {
  background: var(--pink-hover);
}

.form-status {
  color: #179400;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

@media (max-width: 600px) {
  .add-artist .form-group {
    grid-template-columns: 1fr;
  }
  .add-artist label {
    text-align: left;
    padding-top: 0;
  }
}

/* ───────── Pagination ─────────────────────────────────────────────────-- */
.pagination-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
  font-family: inherit;
  color: #222;
}

.page-link,
.ellipsis {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
}

.page-link:hover {
  background: #8F2B24;
}

.page-link.current {
  background: #8F2B24;
  color: #fff;
  cursor: default;
}
