/* Earthy Color Palette */
:root {
  --earth-dark: #3d2f1f;
  --earth-brown: #7a5c42;
  --earth-tan: #b89968;
  --earth-cream: #e8dcc4;
  --earth-light: #f5f1e8;
  --accent-terracotta: #c66b3d;
  --text-dark: #2c2218;
  --text-light: #f5f1e8;
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  font-family: 'Georgia', serif;
  background-color: var(--earth-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

/* Header */
header {
  background-color: var(--earth-dark);
  color: var(--text-light);
  padding: 2rem 1rem;
  text-align: center;
  border-bottom: 4px solid var(--earth-brown);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.tagline {
  font-size: 1rem;
  color: var(--earth-cream);
  font-style: italic;
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.sort-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--earth-cream);
  color: var(--text-dark);
  border: 2px solid var(--earth-brown);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.sort-btn:hover {
  background-color: var(--earth-tan);
  border-color: var(--earth-dark);
}

.sort-btn.active {
  background-color: var(--earth-brown);
  color: var(--text-light);
  border-color: var(--earth-dark);
}

/* Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (max-width: 968px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grid-container {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 2rem;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .sort-btn {
    width: 100%;
  }
}

/* Card Styling */
.card {
  display: block;
  background-color: white;
  border: 2px solid var(--earth-tan);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(61, 47, 31, 0.1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(61, 47, 31, 0.2);
  border-color: var(--accent-terracotta);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background-color: var(--earth-cream);
}

.card-content {
  padding: 1.5rem;
}

.card-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--earth-dark);
}

.card-content p {
  font-size: 0.95rem;
  color: var(--earth-brown);
  line-height: 1.5;
}

/* About Card Special Styling */
.about-card {
  background: linear-gradient(135deg, var(--earth-tan) 0%, var(--earth-cream) 100%);
  border-color: var(--earth-brown);
}

.about-card .card-content {
  padding: 2rem;
  text-align: center;
}

.about-card h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* Footer */
footer {
  background-color: var(--earth-dark);
  color: var(--text-light);
  padding: 1.5rem;
  text-align: center;
  border-top: 4px solid var(--earth-brown);
}

.home-link {
  color: var(--earth-cream);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.home-link:hover {
  color: var(--accent-terracotta);
}

/* Placeholder for missing images */
.card-image.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--earth-cream) 0%, var(--earth-tan) 100%);
  color: var(--earth-brown);
  font-style: italic;
}

/* Collection Page Specific Styles */
.collection-header {
  position: relative;
}

.header-nav {
  position: absolute;
  top: 1rem;
  left: 1rem;
}

.home-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--earth-brown);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.home-btn:hover {
  background-color: var(--accent-terracotta);
  transform: translateX(-2px);
}

.collection-description {
  max-width: 800px;
  margin: 1rem auto 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Piece Card Specific Styles */
.piece-card {
  cursor: pointer;
}

.piece-card:hover {
  transform: translateY(-4px);
}

.price {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent-terracotta);
  margin-top: 0.75rem;
}

/* Piece Detail Page Styles */
.piece-header {
  position: relative;
}

.piece-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.piece-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 968px) {
  .piece-container {
    grid-template-columns: 1fr;
  }

  .gallery-section {
    position: relative;
  }

  .nav-arrow {
    font-size: 1.5rem;
    padding: 0.75rem;
  }
}

@media (max-width: 640px) {
  .piece-header {
    overflow-x: hidden;
  }

  .piece-main {
    padding: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .piece-container {
    padding: 0;
    gap: 1rem;
    max-width: 100vw;
  }

  .gallery-section {
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100vw;
  }

  .main-image-container {
    border-radius: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  .main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }

  .thumbnail-strip {
    padding: 0.5rem;
    width: 100%;
    box-sizing: border-box;
  }

  .info-section {
    padding: 0 1rem;
  }

  .info-section h2 {
    font-size: 1.5rem;
  }

  .piece-price {
    font-size: 1.25rem;
  }

  .thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
  }

  .nav-arrow {
    font-size: 1.5rem;
    padding: 0.75rem 0.5rem;
  }
}

/* Gallery Section */
.gallery-section {
  position: sticky;
  top: 2rem;
}

.main-image-container {
  position: relative;
  width: 100%;
  background-color: var(--earth-cream);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.main-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(61, 47, 31, 0.7);
  color: var(--text-light);
  border: none;
  font-size: 2rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.nav-arrow:hover {
  background-color: rgba(61, 47, 31, 0.9);
}

.nav-arrow-left {
  left: 0;
  border-radius: 0 4px 4px 0;
}

.nav-arrow-right {
  right: 0;
  border-radius: 4px 0 0 4px;
}

/* Thumbnail Strip */
.thumbnail-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.5rem 0;
}

.thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 2px solid var(--earth-tan);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.thumbnail:hover {
  border-color: var(--accent-terracotta);
}

.thumbnail.active {
  border-color: var(--accent-terracotta);
  border-width: 3px;
}

/* Info Section */
.info-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--earth-dark);
}

.piece-price {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-terracotta);
  margin-bottom: 1.5rem;
}

.description {
  margin-bottom: 2rem;
  line-height: 1.8;
}

.piece-meta {
  padding-top: 1.5rem;
  border-top: 2px solid var(--earth-cream);
}

.piece-meta p {
  margin-bottom: 0.5rem;
}

.piece-meta a {
  color: var(--accent-terracotta);
  text-decoration: none;
  transition: color 0.3s ease;
}

.piece-meta a:hover {
  color: var(--earth-dark);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 0.7;
}

/* About Page Styles */
.about-header {
  position: relative;
}

.about-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.about-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 968px) {
  .about-container {
    grid-template-columns: 1fr;
  }

  .about-sidebar {
    order: 1;
  }
}

.about-content {
  line-height: 1.8;
}

.about-intro {
  margin-bottom: 3rem;
}

.lead-text {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--earth-brown);
  line-height: 1.6;
  border-left: 4px solid var(--accent-terracotta);
  padding-left: 1.5rem;
  margin: 2rem 0;
}

.about-section {
  margin-bottom: 2.5rem;
}

.about-section h2 {
  font-size: 1.8rem;
  color: var(--earth-dark);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--earth-cream);
  padding-bottom: 0.5rem;
}

.about-section p {
  margin-bottom: 1rem;
}

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  background-color: var(--earth-light);
  border-left: 4px solid var(--accent-terracotta);
  font-style: italic;
  color: var(--earth-brown);
}

blockquote cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--earth-dark);
}

.contact-info {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: var(--earth-cream);
  border-radius: 8px;
}

.contact-info p {
  margin-bottom: 0.75rem;
}

.contact-info a {
  color: var(--accent-terracotta);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-info a:hover {
  color: var(--earth-dark);
  text-decoration: underline;
}

.about-sidebar {
  position: sticky;
  top: 2rem;
}

.artist-photo {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(61, 47, 31, 0.2);
}

.artist-photo img {
  width: 100%;
  height: auto;
  display: block;
}

/* Error Page Styles */
.error-main {
  max-width: 800px;
  margin: 4rem auto;
  padding: 2rem 1rem;
  text-align: center;
}

.error-container {
  background-color: white;
  border: 2px solid var(--earth-tan);
  border-radius: 8px;
  padding: 3rem 2rem;
  box-shadow: 0 4px 12px rgba(61, 47, 31, 0.1);
}

.error-container h2 {
  font-size: 2.5rem;
  color: var(--earth-dark);
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.1rem;
  color: var(--earth-brown);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.error-actions {
  margin-top: 2rem;
}

.btn-primary {
  display: inline-block;
  padding: 0.75rem 2rem;
  background-color: var(--earth-brown);
  color: var(--text-light);
  text-decoration: none;
  border-radius: 4px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--accent-terracotta);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(61, 47, 31, 0.2);
}
