/* Dream Dictionary Styles */

/* ── Container ── */
.dream-dict-page-content {
  padding: 2.5rem 3rem;
}

/* ── Index: intro text ── */
.dream-dict-intro {
  color: #c4b5fd;
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 700px;
}

/* ── Letter Navigation ── */
.dream-dict-letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  padding: 1.5rem 0;
  margin-bottom: 2.5rem;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.dream-dict-letter-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.dream-dict-letter-link.active {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.dream-dict-letter-link.active:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(168, 85, 247, 0.4));
  color: #fff;
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
  transform: translateY(-1px);
}

.dream-dict-letter-link.disabled {
  color: rgba(139, 92, 246, 0.2);
  cursor: default;
}

/* ── Index: Letter Card Grid ── */
.dream-dict-letter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.dream-dict-letter-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(160deg, rgba(30, 20, 60, 0.7), rgba(45, 27, 105, 0.4));
  border: 1px solid rgba(139, 92, 246, 0.2);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dream-dict-letter-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dream-dict-letter-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: linear-gradient(160deg, rgba(40, 30, 80, 0.8), rgba(55, 35, 120, 0.5));
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(139, 92, 246, 0.2),
              0 0 0 1px rgba(139, 92, 246, 0.1);
}

.dream-dict-letter-card:hover::before {
  opacity: 1;
}

.dream-dict-letter-card-empty {
  opacity: 0.3;
  cursor: default;
}

.dream-dict-letter-card-letter {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #e9d5ff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.dream-dict-letter-card-count {
  color: #a89cc4;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Letter Nav: Current Letter ── */
.dream-dict-letter-link.current {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(168, 85, 247, 0.4));
  color: #fff;
  border: 1px solid rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.3);
}

/* ── Letter Sections ── */
.dream-dict-letter-section {
  margin-bottom: 3rem;
}

.dream-dict-letter-heading {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #e9d5ff, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid rgba(139, 92, 246, 0.2);
  letter-spacing: 0.02em;
}

/* ── Symbol Grid ── */
.dream-dict-symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.dream-dict-symbol-card {
  background: linear-gradient(160deg, rgba(30, 20, 60, 0.7), rgba(45, 27, 105, 0.4));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dream-dict-symbol-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dream-dict-symbol-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: linear-gradient(160deg, rgba(40, 30, 80, 0.8), rgba(55, 35, 120, 0.5));
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.15),
              0 0 0 1px rgba(139, 92, 246, 0.1);
}

.dream-dict-symbol-card:hover::before {
  opacity: 1;
}

.dream-dict-symbol-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.dream-dict-symbol-name {
  color: #f0e6ff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.625rem 0;
  letter-spacing: 0.01em;
}

.dream-dict-symbol-excerpt {
  color: #a89cc4;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Detail: Breadcrumbs ── */
.dream-dict-breadcrumbs {
  margin-bottom: 1.75rem;
  padding: 0 0.5rem;
}

.dream-dict-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.dream-dict-breadcrumbs li {
  color: #a78bfa;
}

.dream-dict-breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: rgba(139, 92, 246, 0.4);
}

.dream-dict-breadcrumbs a {
  color: #c4b5fd;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dream-dict-breadcrumbs a:hover {
  color: #e9d5ff;
  text-decoration: underline;
}

.dream-dict-breadcrumbs li[aria-current="page"] {
  color: #e9d5ff;
  font-weight: 500;
}

/* ── Detail: Category Badge ── */
.dream-dict-category-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(168, 85, 247, 0.15));
  color: #c4b5fd;
  padding: 0.3rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* ── Detail: Main content area ── */
.dream-dict-page-content .post-detail-content {
  color: #d1c4e9;
  font-size: 1.05rem;
  line-height: 1.85;
  padding: 0 0.5rem;
}

.dream-dict-page-content .post-detail-content p {
  margin-bottom: 1.25rem;
}

/* ── Section divider (shared by FAQ, related, posts) ── */
.dream-dict-section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.35), transparent);
  border: none;
  margin: 0;
}

/* ── Detail: FAQ Section ── */
.dream-dict-faq {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem 0.5rem;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.dream-dict-faq h2 {
  color: #e9d5ff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dream-dict-faq h2::before {
  content: '?';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.3);
  font-size: 0.9rem;
  font-weight: 800;
  color: #c4b5fd;
  flex-shrink: 0;
}

.dream-dict-faq-item {
  background: linear-gradient(160deg, rgba(30, 20, 60, 0.6), rgba(45, 27, 105, 0.3));
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 0.875rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.dream-dict-faq-item:hover {
  border-color: rgba(139, 92, 246, 0.35);
}

.dream-dict-faq-item[open] {
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
}

.dream-dict-faq-item summary {
  padding: 1.125rem 1.5rem;
  color: #e9d5ff;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.dream-dict-faq-item summary:hover {
  background: rgba(139, 92, 246, 0.08);
}

.dream-dict-faq-item summary::-webkit-details-marker {
  display: none;
}

.dream-dict-faq-item summary::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid #a78bfa;
  border-bottom: 2px solid #a78bfa;
  transform: rotate(-45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 0.125rem;
}

.dream-dict-faq-item[open] summary::before {
  transform: rotate(45deg);
}

.dream-dict-faq-item .dream-dict-faq-answer {
  padding: 0 1.5rem 1.25rem;
  color: #b8a8d4;
  line-height: 1.75;
  margin: 0;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
  padding-top: 1rem;
}

/* Fallback for plain <p> inside FAQ */
.dream-dict-faq-item p {
  padding: 0 1.5rem 1.25rem;
  color: #b8a8d4;
  line-height: 1.75;
  margin: 0;
}

/* ── Detail: Related Symbols ── */
.dream-dict-related {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem 1rem;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.dream-dict-related h2 {
  color: #e9d5ff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dream-dict-related h2::before {
  content: '✦';
  color: #a78bfa;
  font-size: 1rem;
}

.dream-dict-related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dream-dict-related-card {
  background: linear-gradient(135deg, rgba(30, 20, 60, 0.7), rgba(45, 27, 105, 0.4));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 9999px;
  padding: 0.625rem 1.25rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.dream-dict-related-card:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: linear-gradient(135deg, rgba(55, 35, 110, 0.8), rgba(80, 50, 150, 0.5));
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

.dream-dict-related-name {
  color: #c4b5fd;
  font-size: 0.9rem;
  font-weight: 500;
}

.dream-dict-related-card:hover .dream-dict-related-name {
  color: #e9d5ff;
}

/* ── Detail: Related Posts ── */
.dream-dict-related-posts {
  margin-top: 2rem;
  padding: 2rem 1.5rem 0.5rem;
  border-top: 1px solid rgba(139, 92, 246, 0.15);
}

.dream-dict-related-posts h2 {
  color: #e9d5ff;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dream-dict-related-posts h2::before {
  content: '📝';
  font-size: 1rem;
}

.dream-dict-related-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dream-dict-related-posts li {
  margin-bottom: 0.625rem;
}

.dream-dict-related-posts li a {
  display: block;
  color: #c4b5fd;
  text-decoration: none;
  padding: 0.75rem 1.125rem;
  border-radius: 0.75rem;
  background: rgba(30, 20, 60, 0.4);
  border: 1px solid rgba(139, 92, 246, 0.1);
  transition: all 0.25s ease;
  font-size: 0.95rem;
}

.dream-dict-related-posts li a:hover {
  color: #e9d5ff;
  background: rgba(45, 27, 105, 0.4);
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateX(4px);
}

/* ── Detail: Back Link ── */
.dream-dict-back {
  margin-top: 2.5rem;
  padding: 0 1.5rem 2.5rem;
  text-align: center;
}

.dream-dict-back-link {
  display: inline-block;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.15));
  color: #c4b5fd;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  text-decoration: none;
  border: 1px solid rgba(139, 92, 246, 0.3);
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.dream-dict-back-link:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(168, 85, 247, 0.3));
  color: #fff;
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .dream-dict-page-content {
    padding: 1.75rem 1.25rem;
  }

  .dream-dict-symbol-grid {
    grid-template-columns: 1fr;
  }

  .dream-dict-letter-link {
    width: 2.125rem;
    height: 2.125rem;
    font-size: 0.85rem;
  }

  .dream-dict-letter-heading {
    font-size: 1.5rem;
  }

  .dream-dict-faq,
  .dream-dict-related,
  .dream-dict-related-posts,
  .dream-dict-back {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dream-dict-faq h2,
  .dream-dict-related h2,
  .dream-dict-related-posts h2 {
    font-size: 1.2rem;
  }

  .dream-dict-symbol-card {
    padding: 1.25rem;
  }

  .dream-dict-letter-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
  }

  .dream-dict-letter-card {
    padding: 1.25rem 0.75rem;
  }

  .dream-dict-letter-card-letter {
    font-size: 2rem;
  }
}
