:root {
  --bg-color: #f8f9fa;
  --accent-color: rgba(0, 0, 0, 0.30);
  --card-bg: #fdfdf0;
  --text-main: #1a1a1a;
  --text-muted: #666666;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.25rem;
}

.card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card-img-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 16/10;
  min-height: clamp(120px, 26vw, 190px);
  overflow: hidden;
}

.card-img-container img {
  width: 8rem;
  height: auto;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-info {
  padding: 1.5rem;
}

.card-info h3 {
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.card-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  width: 90%;
  max-width: 800px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  position: relative;
  transform: scale(0.8);
  transition: var(--transition);
  overflow: hidden;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) transparent;
}

.modal-body::-webkit-scrollbar {
  width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 10px;
}

.modal-text {
  padding: 2.5rem;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-color);
  border: none;
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-body img {
  margin-top: 2.5rem;
  width: 12rem;
  max-height: 420px;
  object-fit: cover;
}

.modal-text h2 { margin-bottom: 1rem; }
.modal-text p { color: var(--text-muted); line-height: 1.6; }

@media (max-width: 992px) {
  .grid-container { padding: 0 1.25rem; }
  .card-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
}

@media (max-width: 640px) {
  .grid-container { padding: 0 1rem; }
  .card-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .card-img-container { aspect-ratio: 4/3; min-height: clamp(150px, 42vw, 220px); }
}
