* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

header {
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: #2c3e50;
  text-decoration: none;
}

nav a:not(.logo) {
  color: #666;
  text-decoration: none;
  padding: 0.5rem 1rem;
  transition: color 0.3s;
}

nav a:hover {
  color: #2c3e50;
}

.search-button {
  background: #27ae60;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s;
}

.search-button:hover {
  background: #229954;
}

/* Search Modal Styles */
.search-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.2s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.search-modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 2rem;
  width: 90%;
  max-width: 800px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.search-close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.search-close:hover,
.search-close:focus {
  color: #000;
}

#searchInput {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-top: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

#searchInput:focus {
  border-color: #2c3e50;
}

#searchResults {
  margin-top: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.search-result-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid #eee;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
  border-radius: 8px;
}

.search-result-item:hover {
  background: #f8f9fa;
}

.search-result-item img {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
}

.search-result-content h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: #2c3e50;
}

.search-result-date {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.search-result-tags {
  font-size: 0.85rem;
  color: #888;
  font-style: italic;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: #666;
}

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

.latest-postcards h2,
.archive h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.postcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.postcard-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
}

.postcard-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 10;
}

.postcard-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.postcard-card:hover img {
  transform: scale(1.1);
}

.postcard-card h3 {
  padding: 1rem;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.postcard-card:hover h3 {
  color: #27ae60;
}

.postcard-card .date {
  display: block;
  padding: 0 1rem 1rem;
  color: #666;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.postcard-card:hover .date {
  color: #27ae60;
}

.view-all {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #27ae60;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
}

.view-all:hover {
  background: #229954;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 3rem 0 2rem;
  gap: 1rem;
}

.pagination-numbers {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.pagination-link {
  padding: 0.75rem 1.5rem;
  background: #27ae60;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
  white-space: nowrap;
}

.pagination-link:hover:not(.disabled) {
  background: #229954;
}

.pagination-link.disabled {
  background: #bdc3c7;
  cursor: not-allowed;
}

.pagination-number {
  padding: 0.5rem 0.75rem;
  min-width: 40px;
  text-align: center;
  background: white;
  color: #2c3e50;
  text-decoration: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: background 0.3s;
}

.pagination-number:hover {
  background: #ecf0f1;
}

.pagination-number.active {
  background: #27ae60;
  color: white;
  border-color: #27ae60;
  font-weight: bold;
}

.pagination-ellipsis {
  padding: 0.5rem 0.25rem;
  color: #666;
}

.postcard-detail article {
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.postcard-detail h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.metadata {
  display: flex;
  gap: 1rem;
  margin-bottom: 0;
  color: #666;
  flex-wrap: wrap;
}

.metadata .price {
  font-weight: bold;
  color: #27ae60;
}

.postcard-image {
  margin: 2rem 0;
}

.postcard-image img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 4px;
}

.postcard-description {
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0;
}

.postcard-description h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.tag {
  background: #ecf0f1;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #555;
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.share-label {
  font-size: 0.95rem;
  color: #666;
  font-weight: 500;
  margin-right: 0.25rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  color: #666;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.share-twitter:hover {
  background: #1DA1F2;
  color: white;
}

.share-facebook:hover {
  background: #1877F2;
  color: white;
}

.share-pinterest:hover {
  background: #E60023;
  color: white;
}

.share-copy:hover {
  background: #27ae60;
  color: white;
}

.share-copy.copied {
  background: #27ae60;
  color: white;
}

.related-postcards {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #ecf0f1;
}

.related-postcards h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
}

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

.related-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.related-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
}

.related-card h3 {
  padding: 1rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

.postcard-nav {
  margin-top: 2rem;
}

.postcard-nav a {
  color: #2c3e50;
  text-decoration: none;
  font-weight: 500;
}

.archive-count {
  color: #666;
  margin-bottom: 2rem;
}

/* Lightbox styles */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9998;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

.lightbox-close:hover {
  color: #bbb;
}

footer {
  background: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

@media (max-width: 768px) {
  .postcard-grid {
    grid-template-columns: 1fr;
  }
  
  main {
    padding: 0 1rem;
  }
  
  .postcard-detail h1 {
    font-size: 1.8rem;
  }
  
  .share-buttons {
    flex-wrap: wrap;
  }
  
  .share-btn {
    width: 36px;
    height: 36px;
  }
  
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .related-card h3 {
    font-size: 0.85rem;
    padding: 0.75rem;
  }
  
  .pagination {
    flex-direction: column;
  }
  
  .pagination-numbers {
    order: -1;
  }
  
  .search-modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 1rem;
  }
  
  .search-result-item img {
    width: 80px;
    height: 60px;
  }
  
  .lightbox-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  .lightbox-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}