:root {
  --color-gold: #ebcc66;
  --color-lavender: #bda2dc;
  --color-soft-pink: #daa8ba;
  --color-cream: #f7f5f2;
  --color-black: #2e2a3b;
  --color-border: #d8cfc2;

  --font-heading: "Playfair Display", serif;
  --font-body: "Inter", sans-serif;
  --shadow-soft: 0 4px 10px rgba(0, 0, 0, 0.08);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}
html, body {
    height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: 1.5;
  background-color: var(--color-cream);
  color: var(--color-black);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
    flex:1;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3 {
    font-family: var(--font-heading);
}

p, label, input, button, select {
    font-family: var(--font-body);
}

.container {
  width: min(1200px, 92%);
  margin: 0 auto;
}

/* Header */
.site-header {
  padding: 20px 0;
}

.site-header__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-header__branding {
  display: flex;
  align-items: center;
}

.site-header__logo {
  width: 110px;
  height: auto;
}

.site-header__title-group {
  margin-top: 12px;
}

.site-header__title {
  margin: 0;
  font-size: 2rem;
  font-family: var(--font-heading);
}

.site-header__subtitle {
  margin-top: 6px;
  font-size: 1rem;
}

/* Navigation */
.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.nav__link {
  text-decoration: none;
  color: var(--color-black);
  font-weight: 600;
  padding-bottom: 4px;
  border-bottom: 3px solid transparent;
}

.nav__link--active {
  color: var(--color-soft-pink);
  border-bottom: 3px solid var(--color-gold);
  font-family: var(--font-heading);
  font-style: italic;
}

/* Panels */
.panel {
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.panel__title {
  margin-top: 0;
}

.muted {
  color: #4d4d4d;
}

/* Mood buttons */
.moods {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.moods__button {
  background-color: var(--color-gold);
  color: var(--color-black);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
}

.moods__button:hover {
  transform: translateY(-1px);
}

/* Search section */
.search {
  margin-top: 20px;
}

.search__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.search__row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.search__input {
  flex: 1;
  padding: 0.9rem 1rem;
  border: 2px solid var(--color-lavender); /* purple border */
  border-radius: 10px;
  font-size: 1rem;
  font-family: Inter, sans-serif;
  background-color: #ffffff; /* keep background clean */
  color: #2d1b2e;
}

.search__input::placeholder {
  color: #333;
}
.search__input:focus {
  outline: none;
  border-color: #6f3f8c; /* darker purple */
  box-shadow: 0 0 0 3px rgba(140, 95, 168, 0.2);
}

.search__button {
  background-color: var(--color-gold);
  color: var(--color-black);
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
}

/* Status */
.status {
  margin-top: 16px;
  padding: 12px;
  min-height: 44px;
  border: 1px dashed var(--color-border);
  border-radius: 10px;
  background-color: #fff;
}

/* Grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
}

/* Cards */
.card {
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card--results {
  background-color: var(--color-gold);
}

.card--saved {
  background-color: var(--color-soft-pink);
}

.card__image {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: white;
}

.card__title {
  margin: 0;
  font-size: 1.1rem;
}

.card__summary {
  font-size: 0.95rem;
}

.card__meta {
  font-size: 0.9rem;
  font-weight: bold;
  padding-top: 10px;
}

.card__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card__button {
  background-color: var(--color-soft-pink);
  color: var(--color-black);
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.card__select {
  background-color: var(--color-gold);
  color: var(--color-black);
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 600;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  background-color: var(--color-lavender);
  color: var(--color-black);
  padding: 18px 0;
}

.site-footer {
  background-color: var(--color-lavender);
  color: var(--color-black);
  margin-top: 3rem;
  padding: 2rem 1rem;
}

.site-footer__content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer__brand h3 {
  font-family: "Playfair Display", serif;
  margin-bottom: 0.5rem;
}

.site-footer__brand p {
  max-width: 250px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 15px;
}

.site-footer__links a {
  color: #f8f3eb;
  text-decoration: none;
  font-weight: 600;
}

.site-footer__links a:hover {
  text-decoration: underline;
}

.site-footer__meta {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .site-header__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .search__row {
    flex-direction: column;
  }

  .search__button,
  .search__input {
    width: 100%;
  }

  .book-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .site-header__logo {
    width: 90px;
  }

  .site-header__title {
    font-size: 1.6rem;
  }

  .site-footer__content {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}