/* Reset and Base Styling */
body {
  font-family: 'Georgia', serif;
  background-color: #fafafa;
  color: #222;
  margin: 0;
  padding: 0;
  line-height: 1.6; /* Added for better readability */
}

a {
  color: inherit; /* Reverted to inherit color */
  text-decoration: none;
  transition: color 0.2s ease-in-out; /* Smooth color transition for hover */
}

.container {
  max-width: 900px;
  margin: auto;
  padding: 2rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem; /* Added padding */
  border-bottom: 1px solid #e0e0e0; /* Subtle separator */
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.1rem;
  color: #666;
}

/* Poet Grid */
.poet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .poet-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.poet-card {
  background-color: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.poet-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

/* Round Thumbnails */
.poet-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 2px solid #ddd;
  display: block;
  margin-left: auto;
  margin-right: auto;
  background-color: #eee;
}

/* Typography in Cards */
.poet-card h2 {
  font-size: 1.2rem;
  margin: 0.5rem 0 0.25rem;
}

.poet-card p {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
}

/* Poet Page Styling (poet.html) */
#search-box {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
  margin: 1rem 0 2rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.poem {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ccc; /* Made border solid and slightly darker */
}

.poem h2 {
  margin-bottom: 0.25rem;
  color: #444;
}

.poem p {
  white-space: pre-wrap;
  line-height: 1.6;
}

/* Main page tools */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

#search-input {
  flex: 1 1 250px;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.2s, box-shadow 0.2s; /* Transition for focus */
}

#search-input:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25); /* Focus indicator */
}

#sort-select {
  flex: 0 0 220px;
  padding: 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border-color 0.2s, box-shadow 0.2s; /* Transition for focus */
}

#sort-select:focus {
  border-color: #0056b3;
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25); /* Focus indicator */
}

/* Poem list */
.poem-list {
  list-style: none;
  padding: 0;
  margin-top: 2rem;
}

.poem-list li {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.poem-list a {
  /* color: #0055aa; */ /* Will inherit the new global 'a' color or can be overridden if needed */
  text-decoration: none;
}

.poem-list a:hover {
  color: #003d80; /* Darker shade on hover */
  text-decoration: underline; /* Keep underline for list links on hover */
}

/* Poem page */
.poem-content {
  display: flex;
  flex-direction: column; /* Stack children vertically */
  /* justify-content: space-between; Remove or keep based on desired vertical spacing */
  gap: 2rem;
}

.poem-english, .poem-farsi {
  width: 100%;
}

.poem-farsi pre {
  text-align: right;
  direction: rtl;
  font-family: 'Vazir', 'Tahoma', sans-serif; /* example Persian font */
}

pre {
  white-space: pre; /* Preserve line breaks from source, do not wrap long lines */
  overflow-x: auto; /* Add horizontal scrollbar if content overflows */
  font-size: 1rem;
  line-height: 1.5;
}

#poem-english-text {
  font-family: 'Garamond', serif; 
  font-size: 1em; /* Adjust size as needed */
}

/* Example: Set a specific font for the Farsi poem content */
#poem-farsi-text {
  font-family: 'Tahoma', sans-serif; 
  font-size: 1em; /* Adjust size as needed */
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
  font-size: 0.9rem;
  color: #666;
}

/* Visually Hidden Class for Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}