/* Book Review Site - Modern Styles */

/* CSS Reset and Base Styles */
:root {
  --primary-bg: #181a20;
  --secondary-bg: #23252b;
  --accent-color: #f7c873;
  --text-primary: #fff;
  --text-secondary: #888;
  --text-third: #9fd8cb;
  --border-color: #4f6d7a;
  --shadow-color: rgba(0, 0, 0, 0.18);
  --font-family: 'Verdana', Arial, sans-serif;
  --border-radius: 12px;
  --transition-speed: 0.2s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--primary-bg);
  color: var(--text-primary);
  line-height: 1.6;
  margin: 0;
}

/* Header and Navigation */
header {
  background-color: var(--secondary-bg);
  box-shadow: 0 2px 8px var(--shadow-color);
  padding: 1.5rem 0 1rem 0;
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 1px;
  color: var(--accent-color);
  text-shadow: 0 2px 8px var(--primary-bg);
}

nav {
  margin-top: 1rem;
}

.nav-btn {
  background-color: var(--secondary-bg);
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1.5rem;
  margin: 0 0.5rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-btn.active,
.nav-btn:hover {
  background-color: var(--border-color);
  color: var(--accent-color);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}



.welcome-section h2 {
  color: var(--accent-color);
  margin-bottom: 1rem;
}

/* Search Section */
.search-section {
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px var(--shadow-color);
  max-width: 600px;
  margin: 2rem auto;
  padding: 2rem;
}

.search-section h2 {
  margin-top: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-color);
}

#search {
  width: 100%;
  padding: 0.7rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  background-color: var(--primary-bg);
  color: var(--text-primary);
}

#search::placeholder {
  color: var(--text-secondary);
}

.tag-list {
  margin-bottom: 0.5rem;
}

.tag-btn {
  background-color: var(--secondary-bg);
  border: none;
  border-radius: 16px;
  font-weight: 700; /* make all buttons bold */
  padding: 0.3rem 1rem;
  margin: 0.2rem 0.2rem 0.2rem 0;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--accent-color);
  transition: background-color var(--transition-speed), color var(--transition-speed);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tag-btn:hover {
  background-color: var(--border-color);
  color: #fff;
}

.tag-btn.active {
  background-color: var(--accent-color);
  color: var(--secondary-bg);
}

.clear-tags {
  background-color: #6c3c3c;
  color: #fff;
}

.clear-tags:hover {
  background-color: #8b4c4c;
}

.posts-wrapper {
  display: flex;
  justify-content: center;
}

/* Posts Container */
.posts-container {

  display: grid;  
  justify-content: center; /* center the grid content */
  grid-template-columns: repeat(auto-fit, minmax(500px, max-content));
  gap: 2rem;
  max-width: 1600px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}

/* Post Cards */
.post-card {
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 12px var(--shadow-color);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  transition: box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-width: 500px;
}

.post-card:hover {
  box-shadow: 0 4px 18px rgba(247, 200, 115, 0.13);
}

.post-card:focus-within {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.post-card h2 {
  margin: 0 0 0.3rem 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-color);
}

.post-card h4 {
  margin: 0 0 0.3rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.post-card p {
  margin: 0.2rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.post-card img {
  border-radius: 8px;
  display: block;
  margin: 1rem auto;
  max-width: 90%;    /* limit the width to 70% max */
  max-height: 400px; /* limit the height */
  width: auto;       /* let width adjust automatically */
  height: auto;      /* keep height proportional */
}

/* Review Flex Layout */
.review-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.review-image {
  flex: 1 1 220px;
  min-width: 220px;
  max-width: 320px;
}

.review-image img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 12px var(--primary-bg);
}

.review-info {
  flex: 2 1 300px;
  min-width: 220px;
}

.review-title {
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.review-meta {
  margin-bottom: 1rem;
}

.review-rating {
  color: var(--accent-color);
  font-weight: bold;
}

.review-blurb-section {
  margin-top: 2rem;
  background-color: var(--secondary-bg);
  border-radius: 8px;
  padding: 1.5rem;
}

.review-quote {
  color: #fff;
  margin-bottom: 1rem;
}

.review-blurb-section h3 {
  margin-top: 0.5rem;
  color: var(--accent-color);
}

.review-blurb-section ul {
  margin-bottom: 0;
}

.review-blurb-section li {
  margin-bottom: 0.7em;
}

.review-desc-list {
  margin: 0 0 1rem 0;
  font-size: 1rem;
}

.review-desc-list dt {
  font-weight: bold;
  color: var(--accent-color);
  display: inline;
}

.review-desc-list dd {
  display: inline;
  margin: 0 1em 0 0;
  color: var(--text-primary);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(24, 26, 32, 0.97);
  z-index: 9999;
  overflow-y: auto;
}

.modal-content {
  max-width: 80vw;
  margin: 4rem auto;
  background-color: var(--secondary-bg);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 2px 24px var(--primary-bg);
  position: relative;
  color: var(--text-primary);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--border-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  cursor: pointer;
}

.close-modal:hover {
  background-color: var(--accent-color);
}

/* Responsive Design */
@media (max-width: 600px) {
  .posts-container {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .search-section,
  .welcome-section {
    padding: 1rem;
  }

  .modal-content {
    max-width: 95vw;
    margin: 2rem auto;
    padding: 1rem;
  }

  .nav-btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
  }

  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 400px) {
  .post-card {
    padding: 1rem;
  }

  .post-card img {
    width: 100%;
  }
}

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Loading States */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-secondary);
}

.skeleton {
  background: linear-gradient(90deg, var(--secondary-bg) 25%, var(--primary-bg) 50%, var(--secondary-bg) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Welcome Section */
.welcome-section {
  max-width: 700px;
  margin: 2rem auto;
  background-color: var(--secondary-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 2px 12px var(--shadow-color);
}


.welcome-section h2 {
  font-size: 2em;
  margin-bottom: 0.2em;
  color: #fff;
}

.welcome-section h3 {
  font-size: 1.4em;
  margin-bottom: 1em;
  color: #fff;
  font-weight: normal;
}

.feature-list {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-bottom: 1em;
}

.feature-list li {
  margin-bottom: 0.5em;
}

.metaphor {
  font-style: italic;
  color: #fff;
}

.btscenes-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 2em;
  font-family: 'Georgia', serif;
  line-height: 1.6;
}

.btscenes-section h2 {
  font-size: 2em;
  margin-bottom: 0.2em;
  color: #fff;
}

.btscenes-section .subtitle {
  color: #fff;
  font-size: 1em;
  margin-bottom: 1.5em;
}

.btscenes-section h3 {
  margin-top: 2em;
  font-size: 1.4em;
  color: #fff;
}

.btscenes-section ul {
  padding-left: 1.5em;
  margin-top: 0.5em;
}

.btscenes-section li {
  margin-bottom: 0.5em;
}

.read-not-reviewed a {
  color: var(--text-third);
  text-decoration: none; /* Optional: removes underline */
  margin-bottom: 10.5em;
}
.read-not-reviewed li {
  margin-bottom: 1.0em;
}

.read-not-reviewed li {
  margin-bottom: 1.0em;
}

.read-not-reviewed li em {
  font-size: 1.5em; /* Adjust the size as needed */
}

.read-not-reviewed a:hover {
  text-decoration: underline; /* Optional: adds hover effect */
}

.read-not-reviewed a {
  color: var(--text-third);
  text-decoration: none; /* Optional: removes underline */
  margin-bottom: 10.5em;
}

.review-blurb-section a:hover {
  text-decoration: underline; /* Optional: adds hover effect */
  color: var(--text-third);
}

.review-blurb-section a {
  color: var(--text-primary);
  text-decoration: none; /* Optional: removes underline */
  margin-bottom: 10.5em;
}