/* ===================================================================
   Glossary Index Page Styles
   =================================================================== */

.glossary-index {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.glossary-index > h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #212529;
  text-align: center;
}

.glossary-intro {
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: white;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
}

.glossary-intro p {
  color: white;
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0;
}

.glossary-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.glossary-card {
  background: white;
  border: none;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glossary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.glossary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.glossary-card:hover::before {
  transform: scaleY(1);
}

.glossary-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.glossary-card-title a {
  color: #212529;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s;
}

.glossary-card-title a:hover {
  color: #667eea;
}

.glossary-card-definition {
  color: #6c757d;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glossary-card-meta {
  display: flex;
  gap: 1.25rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f3f5;
  font-size: 0.9rem;
  color: #868e96;
}

.glossary-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.glossary-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.glossary-category-tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background-color: #f8f9fa;
  color: #495057;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.glossary-category-tag:hover {
  background-color: #e9ecef;
  transform: translateY(-1px);
}

/* Category Filters */
.glossary-filters {
  margin: 3rem 0;
  padding: 2rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.glossary-filters-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #212529;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.glossary-filters-title::before {
  content: '🔍';
  font-size: 1.4rem;
}

.glossary-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.glossary-filter-btn {
  padding: 0.65rem 1.25rem;
  background-color: #f8f9fa;
  border: 2px solid transparent;
  border-radius: 24px;
  color: #495057;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glossary-filter-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.glossary-filter-btn:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
  transform: translateY(-2px);
}

.glossary-filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.glossary-filter-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.glossary-filter-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.glossary-card.hidden {
  display: none;
}

/* ===================================================================
   Glossary Term Page Styles
   =================================================================== */

.glossary-term {
  max-width: 800px;
  margin: 0 auto;
    padding-top: 3rem;
}

.glossary-term-header {
    margin-bottom: 3.5rem;
    padding: 0 0 2.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.glossary-term-title {
    font-size: 2.5rem;
  font-weight: 700;
    margin-bottom: 1.25rem;
    color: #111827;
    line-height: 1.2;
    letter-spacing: -0.025em;
    padding-bottom: 1rem;
    position: relative;
}

.glossary-term-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.glossary-term-short {
    font-size: 1.125rem;
    color: #6b7280;
    line-height: 1.75;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.glossary-term-meta {
  display: flex;
  flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 1.5rem;
}

.glossary-synonyms {
    margin-top: 1.5rem;
    padding: 0;
    background-color: transparent;
    border: none;
    font-size: 0.875rem;
    color: #6b7280;
}

.glossary-synonyms strong {
    color: #374151;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Category tags in header */
.glossary-term-header .glossary-categories {
    margin-top: 1.5rem;
}

.glossary-term-header .glossary-category-tag {
    background-color: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.glossary-term-header .glossary-category-tag:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    transform: none;
}

/* Tags */
.glossary-tags {
    margin-top: 1.5rem;
    padding: 0;
    background-color: transparent;
    border: none;
    font-size: 0.875rem;
    color: #6b7280;
}

.glossary-tags strong {
    color: #374151;
    font-weight: 600;
    margin-right: 0.5rem;
}

.glossary-tag {
    display: inline-block;
    padding: 0.375rem 1rem;
    background-color: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8125rem;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.glossary-tag:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.glossary-body {
  margin-top: 2rem;
}

.glossary-block {
    margin-bottom: 3rem;
}

.glossary-block-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-left: 1rem;
    padding-bottom: 0.75rem;
    border-left: 4px solid #667eea;
    color: #2c3e50;
    position: relative;
}

.glossary-block-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, #dee2e6 0%, transparent 100%);
}

/* H2 - メインセクション見出し（最も目立つ） */
.glossary-h2 {
    font-size: 1.5rem;
    font-weight: 700;
    border-left: 4px solid #667eea;
    color: #1e293b;
    margin-top: 2.5rem;
}

/* H3 - サブセクション見出し */
.glossary-h3 {
    font-size: 1.25rem;
    font-weight: 600;
    border-left: 3px solid #764ba2;
    color: #334155;
    margin-top: 2rem;
    padding-left: 0.875rem;
}

.glossary-h3::after {
    background: linear-gradient(to right, #cbd5e1 0%, transparent 100%);
}

/* H4 - 小見出し */
.glossary-h4 {
    font-size: 1.1rem;
    font-weight: 600;
    border-left: 2px solid #94a3b8;
    color: #475569;
    margin-top: 1.5rem;
    padding-left: 0.75rem;
}

.glossary-h4::after {
    background: linear-gradient(to right, #e2e8f0 0%, transparent 100%);
}

.glossary-definition,
.glossary-details {
  line-height: 1.8;
}

.glossary-formula {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.glossary-sources {
  margin-top: 1rem;
}

.glossary-source-item {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
}

.glossary-source-item a {
  color: #0d6efd;
  text-decoration: none;
}

.glossary-source-item a:hover {
  text-decoration: underline;
}

/* Image Styles */
.glossary-image {
  margin: 2rem 0;
}

.glossary-image.full {
  width: 100%;
}

.glossary-image.left {
  float: left;
  margin-right: 1rem;
  max-width: 50%;
}

.glossary-image.right {
  float: right;
  margin-left: 1rem;
  max-width: 50%;
}

.glossary-image.center {
  text-align: center;
}

.glossary-image img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.glossary-image-caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #6c757d;
  text-align: center;
}

.glossary-image-credit {
  font-size: 0.8rem;
  color: #868e96;
}

/* Related Content */
.glossary-related-content {
    margin-top: 4rem;
    padding: 2.5rem 0 0 0;
    border-top: 1px solid #e5e7eb;
}

.glossary-related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #111827;
    letter-spacing: -0.015em;
}

.glossary-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.glossary-related-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    position: relative;
}

.glossary-related-card::after {
    content: '→';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.25rem;
    color: #667eea;
    opacity: 1;
    transition: all 0.2s ease;
}

.glossary-related-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.glossary-related-card:hover::after {
    transform: translateX(4px);
}

.glossary-related-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.5;
    padding-right: 2rem;
}

.glossary-related-card-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.15s;
}

.glossary-related-card-title a:hover {
    color: #667eea;
}

.glossary-related-card-description {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
}

.glossary-back-link {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #dee2e6;
}

.glossary-back-link a {
  color: #0d6efd;
  text-decoration: none;
  font-size: 0.95rem;
}

.glossary-back-link a:hover {
  text-decoration: underline;
}

/* ===================================================================
   Responsive Design
   =================================================================== */

@media (max-width: 768px) {
    .glossary-list {
        grid-template-columns: 1fr;
    }

    .glossary-term {
        padding: 2rem 1rem 0 1rem;
    }

    .glossary-term-header {
        padding: 0 0 2rem 0;
  }

    .glossary-term-title {
        font-size: 2rem;
    }

    .glossary-term-short {
        font-size: 1rem;
    }

    .glossary-block-title {
        font-size: 1.2rem;
  }

    /* モバイル表示での見出しサイズ調整 */
    .glossary-h2 {
        font-size: 1.3rem;
        margin-top: 2rem;
    }

    .glossary-h3 {
        font-size: 1.15rem;
        margin-top: 1.5rem;
    }

    .glossary-h4 {
        font-size: 1.05rem;
        margin-top: 1.25rem;
    }

  .glossary-image.left,
  .glossary-image.right {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }

    .glossary-related-content {
        padding: 2rem 0 0 0;
    }

    .glossary-related-title {
        font-size: 1.25rem;
    }

    .glossary-related-list {
        grid-template-columns: 1fr;
    }
}
