#cardGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid black;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #2c0101; /* badge text biele */
}

.badge.psychologia {
  background-color: #6c5ce7;
}
.badge.teologia {
  background-color: #0984e3;
}
.badge.duchovne {
  background-color: #00b894;
}

.title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.title a {
  text-decoration: none;
  color: #2c3e50;
  transition: color 0.3s ease;
}

.title a:hover {
  color: #6c5ce7;
}

.quote {
  font-style: italic;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.6;
}

.source {
  font-size: 0.85rem;
  color: #888;
}

/* Layout switching */
#cardGrid.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

#cardGrid.list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#cardGrid.list .card {
  border-bottom: 1px solid #ddd;
  padding-bottom: 15px;
}

/* Controls */
.controls {
  max-width: 1100px;
  margin: 0 auto 30px;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
  justify-content: center;
}

#searchInput {
  flex: 1 1 250px;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#searchInput:focus {
  border-color: #6c5ce7;
  box-shadow: 0 0 6px rgba(108, 92, 231, 0.3);
  outline: none;
}

#filterSelect {
  flex: 1 1 220px;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#filterSelect:focus {
  border-color: #00b894;
  box-shadow: 0 0 6px rgba(0, 184, 148, 0.3);
  outline: none;
}

/* Toggle layout button */
#toggleLayout {
  padding: 10px 18px;
  border-radius: 6px;
  border: none;
  background-color: #ffffff;
  color: #4c4c4c;               /* biele písmo */
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  border: 1px solid black;
}

#toggleLayout:hover {
  background-color: #ffffff;
  color: #4c4c4c;
  transform: translateY(-2px);
}

#toggleLayout:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  #searchInput,
  #filterSelect,
  #toggleLayout {
    width: 100%;
  }
}




