@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap");
:root {
  --font-family: "Nunito Sans", sans-serif;

  /* Light Mode */
  --bg-page: hsl(0, 0%, 99%); /* Grey 50 */
  --bg-surface: hsl(0, 100%, 100%); /* White (cards, inputs) */
  --bg-footer: hsl(0, 100%, 100%); /* White */

  --text-primary: hsl(200, 15%, 8%); /* Grey 950 */
  --text-secondary: hsl(0, 0%, 50%); /* Grey 400 */

  --shadow-sm: rgba(0, 0, 0, 0.06);
  --shadow-md: rgba(0, 0, 0, 0.08);
  --shadow-lg: rgba(0, 0, 0, 0.12);
  --shadow-nav: rgba(0, 0, 0, 0.1);
}

body.dark {
  /* Dark Mode */
  --bg-page: hsl(207, 26%, 17%); /* Blue 950 */
  --bg-surface: hsl(209, 23%, 22%); /* Blue 900 */
  --bg-footer: hsl(209, 23%, 22%); /* Blue 900 */

  --text-primary: hsl(0, 100%, 100%); /* White */
  --text-secondary: hsl(0, 100%, 100%); /* White */

  --shadow-sm: rgba(0, 0, 0, 0.3);
  --shadow-md: rgba(0, 0, 0, 0.4);
  --shadow-lg: rgba(0, 0, 0, 0.6);
  --shadow-nav: rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
}

body {
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-primary);
}

h1 {
  font-weight: 800;
  font-size: 1.3rem;
  padding: 1rem;
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: var(--bg-surface);
  box-shadow: 0 4px 4px var(--shadow-nav);
}

.nav-bar h1 a {
  color: inherit;
  text-decoration: none;
}

.nav-bar h1 a:hover {
  text-decoration: underline;
}

.nav-bar p:hover {
  cursor: pointer;
}

main {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-wrap: wrap;
  padding: 5vh;
  justify-content: space-evenly;
  gap: 1rem;
}

.card {
  width: 250px;
  margin: 1rem 0;
  overflow: hidden;
  border-radius: 5px;
  background-color: var(--bg-surface);
  box-shadow: 0 1px 2px var(--shadow-sm), 0 4px 12px var(--shadow-md);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.card:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 6px var(--shadow-md), 0 12px 24px var(--shadow-lg);
}

.card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.card img {
  width: 100%;
  height: 167px;
  object-fit: cover;
  object-position: center;
}

.text-content {
  max-width: 90%;
  min-height: 150px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.details {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  font-weight: 600;
}

.details span {
  font-weight: 300;
}

h2 {
  font-size: 1.1rem;
}

footer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 2rem 1rem;
  background-color: var(--bg-footer);
  box-shadow: 0 -2px 6px var(--shadow-nav);
}

footer p {
  margin: 0.25rem 0;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

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

.search-input {
  width: 400px;
  max-width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 6px var(--shadow-nav);
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
}

.region-select {
  width: 200px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 6px;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 2px 6px var(--shadow-nav);
  font-size: 0.9rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .search-filter {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-input,
  .region-select {
    width: 200px;
  }
}
