/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background-color: #f5f0e8;
  color: #333;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #333;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Header ===== */
.site-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.site-logo {
  display: inline-block;
  text-decoration: none;
}

.site-logo:hover {
  text-decoration: none;
}

.robot-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.25rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  color: #333;
  margin-bottom: 1rem;
}

/* ===== Navigation ===== */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  color: #333;
  padding: 0.15rem 0;
}

.nav-link:hover,
.nav-link.active {
  text-decoration: underline;
}

/* ===== Search ===== */
.search-container {
  display: flex;
  max-width: 900px;
  margin: 0 auto 1rem;
  padding: 0 1rem;
}

.search-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 0.9rem;
  background: #fff;
}

.search-button {
  padding: 0.5rem 1.25rem;
  background: #333;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.search-button:hover {
  background: #555;
}

.search-results {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 1rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid #ddd;
}

.search-result-title {
  font-weight: bold;
  display: block;
}

.search-result-desc {
  font-size: 0.85rem;
  color: #666;
  display: block;
}

.no-results {
  text-align: center;
  color: #888;
  padding: 1rem;
  font-style: italic;
}

/* ===== Main Content ===== */
.site-main {
  flex: 1;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* ===== Homepage ===== */
.homepage-content {
  text-align: center;
}

.homepage-content h2 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
}

.homepage-content p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  text-align: left;
}

.homepage-content em {
  font-style: italic;
}

/* ===== List Pages (Category & Subtopic) ===== */
.page-title {
  text-align: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.page-intro {
  text-align: center;
  margin-bottom: 2rem;
  font-style: italic;
  color: #555;
}

.page-intro p {
  margin-bottom: 0.5rem;
}

.subtopic-list,
.poem-list {
  display: grid;
  gap: 1rem;
}

.subtopic-card,
.poem-card {
  display: block;
  padding: 1.25rem;
  background: #fff;
  border: 1px solid #e0dcd4;
  transition: box-shadow 0.2s;
}

.subtopic-card:hover,
.poem-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
}

.subtopic-card h3,
.poem-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.subtopic-card p,
.poem-card p {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.35rem;
}

.poem-count {
  font-size: 0.8rem;
  color: #999;
}

.poem-card blockquote {
  font-style: italic;
  color: #777;
  font-size: 0.9rem;
  border-left: 2px solid #ddd;
  padding-left: 0.75rem;
  margin-top: 0.5rem;
}

/* ===== Poem Form Tags ===== */
.poem-form {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  background: #eee;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-bottom: 1.5rem;
}

.poem-form-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  background: #f0ede6;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-top: 0.25rem;
}

/* ===== Single Poem Page ===== */
.poem-page {
  text-align: center;
}

.poem-title {
  font-size: 1.4rem;
  margin-bottom: 2rem;
}

.poem-body {
  text-align: left;
  margin-bottom: 2rem;
}

.poem-body p {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.poem-meta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
}

.back-link {
  font-size: 0.9rem;
  color: #666;
}

.back-link:hover {
  color: #333;
}

/* ===== Footer ===== */
.site-footer {
  background: #333;
  color: #ccc;
  padding: 2rem 1rem;
  margin-top: auto;
}

.footer-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.footer-title {
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.footer-tagline {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.footer-links a {
  color: #ccc;
  font-size: 0.85rem;
  text-decoration: underline;
}

.footer-links a:hover {
  color: #fff;
}

.footer-copyright {
  font-size: 0.75rem;
  color: #888;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .site-nav {
    gap: 0.15rem 0.5rem;
  }

  .nav-link {
    font-size: 0.8rem;
  }

  .site-title {
    font-size: 1.25rem;
  }

  .site-main {
    padding: 1.5rem 1rem;
  }
}
