/* アクセシビリティ: 文字サイズ大 */
html.text-large {
  font-size: 125%; /* 16px -> 20px base */
}

/* アクセシビリティ: 色反転 (ダークモードとは別に強制反転) */
html.inverted {
  filter: invert(1) hue-rotate(180deg);
  background-color: #333; /* 反転時の背景補正 */
}

html.inverted img, 
html.inverted video,
html.inverted .bg-aso-green, /* ブランドカラーの背景も反転対象外にするか調整 */
html.inverted .bg-aso-dark {
  /* 画像などは再反転して元に戻す */
  filter: invert(1) hue-rotate(180deg);
}

/* 印刷用調整 */
@media print {
  .no-print {
    display: none;
  }
}

/* 記事内画像のスタイル */
/* 記事内画像のスタイル (横並び・左寄せ) */
.prose img {
  max-width: 100%;
  height: auto;
  margin: 0.5rem 1rem 0.5rem 0; /* 右と下に余白 */
  display: inline-block; /* 横並びにするため */
  vertical-align: top;
  border-radius: 4px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  cursor: zoom-in; /* クリック可能であることを示す */
  transition: transform 0.2s ease;
}

.prose img:hover {
  transform: scale(1.02);
}

/* Viewer.js will handle the modal styles */

/* =========================================
   Base Styles (from header.php)
   ========================================= */
body {
  font-family: "Noto Sans JP", sans-serif;
  background-color: #fbf9f6;
  color: #2c2c2c;
  line-height: 2;
  letter-spacing: 0.05em;
}

h1,
h2,
h3,
.en-font {
  font-family: "Noto Sans JP", sans-serif;
}

/* =========================================
   Utility Classes
   ========================================= */
/* Font Families */
.font-arno {
  font-family: "arno-pro", serif;
}

.font-lusitana {
  font-family: "Lusitana", serif;
}

/* =========================================
   Animations (from header.php)
   ========================================= */
/* Scroll Reveal Animation */
.js-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 1.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   Article Styles (from article.php)
   ========================================= */
/* Auto-link styling */
a.auto-link {
  text-decoration: none;
  border-bottom: 1px dashed #204233;
  /* Aso Green Dashed */
  color: #14437d;
  transition:
    color 0.3s,
    border-color 0.3s;
}

a.auto-link:hover {
  color: #204233;
  border-bottom-style: solid;
}

/* General Link Styling (Manual links) */
.article-content a:not(.auto-link):not([class*="btn"]) {
  color: #14437d;
  text-decoration: underline;
  transition: color 0.3s;
}

.article-content a:not(.auto-link):not([class*="btn"]):hover {
  color: #204233;
}

/* Article Content Typography */
.article-content h2 {
  margin-top: 2.5rem !important;
  margin-bottom: 1.5rem !important;
  padding-left: 1rem;
  padding-bottom: 0.5rem;
  border-left: 10px solid #204233;
  /* Aso Green Box */
  border-bottom: 1px solid #ddd;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.4;
}

.article-content h3 {
  margin-top: 2rem !important;
  margin-bottom: 1rem !important;
  padding-left: 0.75rem;
  padding-bottom: 0.25rem;
  border-left: 5px solid #c5a059;
  /* Aso Gold Line */
  border-bottom: 1px dashed #ddd;
  /* Dashed underline */
  font-size: 1.25rem;
  font-weight: 700;
}

.article-content h4 {
  margin-top: 1.5rem !important;
  margin-bottom: 0.75rem !important;
  padding: 0.5rem 0.75rem;
  background-color: #f9fafb;
  /* Light Gray Bg */
  border-left: 4px solid #9ca3af;
  font-size: 1.1rem;
  font-weight: 700;
}

.article-content p {
  padding-left: 1rem;
  margin-bottom: 1rem;
}

/* Reset indent for metadata */
.article-content p#topicPath,
.article-content p#lastModified {
  padding-left: 0;
}

/* Style topicPath */
.article-content p#topicPath {
  font-size: 0.85rem;
  margin-bottom: 2rem !important;
  opacity: 0.8;
}

/* Responsive Video/Iframe */
.article-content iframe,
.article-content video {
  width: 100% !important;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto !important;
}

/* Table Styles */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  background-color: #fff;
}

.article-content th,
.article-content td {
  border: 1px solid #e5e7eb;
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background-color: #f3f4f6;
  color: #204233;
  /* Aso Green */
  font-weight: 700;
  white-space: nowrap;
}

.article-content tr:nth-child(even) {
  background-color: #f9fafb;
}

/* Mobile scroll for tables */
.article-content table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .article-content table {
    display: table;
    white-space: normal;
  }
}
