/* 1. ACCORDIONS (About This Page) */
details {
  background-color: light-dark(#f8f9fa, #1a1a1a);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

summary {
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem 0;
}

/* Creates a subtle divider when the accordion is clicked open */
details[open] summary {
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

details p {
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* 2. THE GRID SYSTEM */
.artist-gallery {
    display: grid;
    /* This one line is the "gallery" layout. It automatically creates as many 
     columns as will fit, with each column being at least 320px wide. */
     grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
     gap: 2rem; 
     padding: 0;
     list-style: none; /* Removes the default bullet points */
}

/* 3. THE CARD CONTAINER */
.artist-card {
    background-color: light-dark(#ffffff, #000000);
    border-radius: 8px; /* Softens the edges */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Adds depth to separate from background */
    overflow: hidden; /* Ensures the image doesn't break out of the rounded corners */
    
    /* Flexbox makes the card stretch and stack its internal sections */
    display: flex;
    flex-direction: column;
}

.card-header {
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.card-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

/* flex-grow: 1 forces the body to take up all empty space, 
   pushing the footer to the bottom */
.card-body {
  padding: 1.5rem;
  flex-grow: 1; 
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* Spaces out multiple artworks and the bio evenly */
}

.card-body figure {
  margin-top: auto;
  margin-bottom: auto;
}

/* 4. ARTWORK & CAPTIONS */
.artwork {
  margin: 0;
}

/* 5. THE IMAGE LOGIC */
.image-wrapper img {
    width: 100%;
    height: 250px; /* Lock the height so horizontal and vertical images align perfectly */
    
    /* object-fit is a developer's best friend. It crops the image to fill the 
     box proportionally without distorting or stretching the aspect ratio. */
     object-fit: cover; 
     display: block;
}

.artwork-caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #475569;
  text-align: center;
}

.medium {
  font-style: italic;
  color: #64748b;
}

/* 6. THE BIO ACCORDION */
.artist-bio {
  margin-top: 0;
  background-color: light-dark(#f8f9fa, #1a1a1a);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 1rem;
}

.artist-bio summary {
  font-weight: 600;
  cursor: pointer;
}

.artist-bio p {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 5. THE FOOTER & BUTTONS */
.card-footer {
  padding: 1.5rem;
  padding-left: 0.3rem;
  background-color: light-dark(#f8fafc, #1a1a1a);
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap; /* Prevents buttons from squishing on tiny screens */
  position: relative;
  max-height: max(80px, 4.5rem);
  min-height: max(80px, 4.5rem);
  width: 97.5%;
  flex-direction: row;
}

.btn {
  display: flex;
  flex: 1; /* Makes buttons equal width */
  text-align: center;
  padding: 0.75rem 1rem;
  background-color: #2563eb;
  color: white;
  text-decoration: none;
  font-weight: bold;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background-color: #1d4ed8;
}

.btn-outline {
  background-color: transparent;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.btn-outline:hover {
  background-color: light-dark(#eff6ff, #1a1a1a);
}