/* ======================================================================
   Kyoto Red Data Book Template - edit.css
   Project: Kyoto Prefecture Red Data Book (Kyoto RDB)
   Purpose: テンプレート共通の本文エリアスタイル（PC版）
   Placement: /shared/templates/[テンプレートID]/style/edit.css
   ====================================================================== */

@charset "utf-8";

/* ------------------------------
   Common Section Styles
   ------------------------------ */
/* Subtle gradient banner with adequate contrast for overlaid text */
.rdb2026-gradient-bg {
  background: linear-gradient(90deg, var(--color-kyoto-purple-100), #ffffff);
  border-bottom: 1px solid var(--color-border);
}

/* Main wrapper */
.section {
  padding: clamp(32px, 6vw, 72px) 0;
}

/* A contained section style, like a large card */
.section--contained {
  background: var(--color-surface);
  border: 1px solid var(--krb-line);
  border-radius: calc(var(--krb-radius) * 1.2);
  padding: clamp(28px, 4vw, 48px);
}

.section--contained .h2 {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--krb-line);
}

/* ------------------------------
   Cards
   ------------------------------ */
.rdb2026-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border-darker);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.card {
  background: var(--krb-surface);
  border: 1px solid var(--color-border-darker);
  border-radius: var(--krb-radius);
  box-shadow: var(--krb-shadow);
}

.card__head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--krb-line);
}

.card__body {
  padding: 1rem;
}

.rdb2026-intro-card p {
  margin: 0 0 var(--space-3);
  font-size: 1rem;
}

/* ------------------------------
   Section Titles
   ------------------------------ */
/* Section title with accent underline */
.rdb2026-section-title {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-3);
  padding-bottom: 0.35rem;
  border-bottom: 4px solid var(--color-kyoto-purple-700);
}

/* Category card contents */
.rdb2026-category-title {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.25rem;
}

.rdb2026-category-desc {
  font-size: 0.9375rem;
  color: var(--color-muted-text);
}

/* ------------------------------
   Status Badge
   ------------------------------ */
/* Coming soon badge */
.rdb2026-status {
  /* The margin is now applied directly here instead of inline style */
  margin-top: 0.5rem;
}

.cat-item .rdb2026-status {
  display: inline-block;
  margin-top: var(--space-2);
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
  border-radius: 999px;
  background: var(--color-rdb-red-100);
  color: var(--color-rdb-red-700);
}

/* ------------------------------
   Buttons
   ------------------------------ */
.btn {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--krb-radius);
  text-decoration: none;
}

.btn--primary {
  background: var(--color-kyoto-purple-700);
  color: #fff;
  box-shadow: var(--krb-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn--primary:visited {
  color: #fff;
  /* visited状態でも白テキストを維持 */
}

.btn--ghost {
  background: transparent;
  color: var(--color-kyoto-purple-700);
  border: 1px solid var(--color-kyoto-purple-200);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Link style button */
.rdb2026-link-btn {
  display: inline-block;
  padding: 0.625rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--color-kyoto-purple-700);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  background: #fff;
}

.rdb2026-link-btn:hover,
.rdb2026-link-btn:focus-visible {
  background: var(--color-kyoto-purple-100);
}

/* Add margin for adjacent link buttons */
.rdb2026-link-btn+.rdb2026-link-btn {
  margin-top: var(--space-2);
}

/* ------------------------------
   Hero (トップページ用)
   ------------------------------ */
.hero {
  position: relative;
  isolation: isolate;
  border-radius: calc(var(--krb-radius) * 1.2);
  overflow: hidden;
  background: linear-gradient(180deg, var(--color-kyoto-purple-100), #fff);
  border: 1px solid var(--color-kyoto-purple-200);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: min(5vw, 50px);
  align-items: center;
  padding: clamp(28px, 4.5vw, 72px);
}

.hero__media {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--krb-radius);
  overflow: hidden;
  background: var(--color-kyoto-purple-200);
}

.hero__media .slide-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend: multiply;
  filter: saturate(0.9);
  opacity: 0;
  animation: hero-image-fade 20s infinite;
}

/* Stagger animation delays for each slide item */
.hero__media .slide-item:nth-child(2) {
  animation-delay: -15s;
}

.hero__media .slide-item:nth-child(3) {
  animation-delay: -10s;
}

.hero__media .slide-item:nth-child(4) {
  animation-delay: -5s;
}

@keyframes hero-image-fade {
  0% {
    opacity: 0;
  }

  12.5% {
    opacity: 1;
  }

  /* Fade in */
  25% {
    opacity: 1;
  }

  /* Hold */
  37.5% {
    opacity: 0;
  }

  /* Fade out */
  100% {
    opacity: 0;
  }
}

.hero__lead {
  margin-top: 1rem;
}

.hero__actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ------------------------------
   Category Grid (トップページ用)
   ------------------------------ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.cat-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--krb-radius);
  padding: var(--space-5) var(--space-3);
  border: 1px solid var(--krb-line);
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.2s ease;
}

.cat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--krb-shadow);
}

.cat-item:hover .cat-item__icon {
  transform: scale(1.1);
}

.cat-item__icon {
  margin-bottom: var(--space-3);
  transition: transform 0.2s ease-out;
}

.cat-item__icon svg {
  stroke-width: 1.5;
}

.cat-item__title {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-regular);
  /* 400 */
  margin-bottom: 0.5rem;
}

.cat-item--animal {
  background: var(--cat-animal-weak);
}

.cat-item--animal:hover {
  background: #e9dccc;
}

.cat-item--animal .cat-item__icon {
  color: var(--cat-animal-text);
}

.cat-item--geo {
  background: var(--cat-geo-weak);
}

.cat-item--geo:hover {
  background: #dbe1e7;
}

.cat-item--geo .cat-item__icon {
  color: var(--cat-geo-text);
}

.cat-item--flora {
  background: var(--cat-flora-weak);
}

.cat-item--flora:hover {
  background: #d5e2d8;
}

.cat-item--flora .cat-item__icon {
  color: var(--cat-flora-text);
}

.cat-item--eco {
  background: var(--cat-eco-weak);
}

.cat-item--eco:hover {
  background: #cce2e8;
}

.cat-item--eco .cat-item__icon {
  color: var(--cat-eco-text);
}

/* ------------------------------
   Category Badge
   ------------------------------ */
.badge {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(0, 0, 0, 0.02);
}

.badge--animal {
  color: var(--cat-animal-text);
}

.badge--geo {
  color: var(--cat-geo-text);
}

.badge--flora {
  color: var(--cat-flora-text);
}

.badge--eco {
  color: var(--cat-eco-text);
}

/* ------------------------------
   Tabs (JS連動用)
   ------------------------------ */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--color-kyoto-purple-200);
  cursor: pointer;
}

.tab[aria-selected="true"],
.tab.is-active {
  background: var(--color-kyoto-purple-700);
  color: #fff;
  border-color: transparent;
}

/* ------------------------------
   Kyoto RDB Category Grid (トップページ用)
   ------------------------------ */
:root {
  /* category color pairs */
  --rdb-wildlife-dark: #6e4c2e;
  --rdb-wildlife-light: #efe4d8;

  --rdb-geo-dark: #5a6473;
  --rdb-geo-light: #e4e8ee;

  --rdb-flora-dark: #2f6e3b;
  --rdb-flora-light: #dfe9e2;

  --rdb-eco-dark: #2c6a7b;
  --rdb-eco-light: #d8e9ee;

  /* common */
  --rdb-ink: #333638;
  --rdb-ink-soft: #5c665d;
  --rdb-paper: #fdfcf7;
  --rdb-radius: 20px;
  --rdb-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  --rdb-shadow-hover: 0 10px 36px rgba(0, 0, 0, 0.12);
}

.rdb-cats {
  padding: clamp(24px, 4vw, 48px) 20px;
  background: var(--rdb-paper);
  margin-top: 40px;
  border-radius: var(--rdb-radius);
}

.rdb-cats__title {
  font-family: var(--font-sans);
  font-size: clamp(22px, 2.6vw, 28px);
  text-align: center;
  margin: 0 0 25px;
  color: var(--rdb-ink);
}

.rdb-search {
  max-width: 600px;
  margin: 24px auto 32px;
}

/* 検索フォームの上の余白を調整 (トップページ用) */
.rdb2026 .rdb-search {
  margin-top: 1rem;
}

.rdb-search__form {
  display: flex;
  border: 1px solid var(--color-kyoto-purple-200);
  border-radius: var(--krb-radius);
  overflow: hidden;
  box-shadow: var(--krb-shadow);
  background-color: #fff;
}

.rdb-search__input {
  flex-grow: 1;
  border: none;
  padding: 12px 16px;
  font-size: 16px;
  background: transparent;
  color: var(--rdb-ink);
  min-width: 0;
}

.rdb-search__input:focus {
  outline: none;
}

.rdb-search__button {
  border: none;
  background-color: var(--color-kyoto-purple-700);
  color: white;
  padding: 0 24px;
  font-size: 16px;
  cursor: pointer;
  font-weight: 500;
}

.rdb-cats__grid {
  --gap: clamp(14px, 2vw, 20px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  padding: 0;
  margin: 0 auto;
  list-style: none;
  max-width: 1100px;
}

.rdb-card {
  position: relative;
  border-radius: var(--rdb-radius);
  overflow: visible;
  box-shadow: var(--rdb-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  background: linear-gradient(180deg,
      rgba(255, 255, 255, 0.75),
      rgba(255, 255, 255, 0.95));
  isolation: isolate;
}

.rdb-card:focus-within,
.rdb-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rdb-shadow-hover);
}

.rdb-card__link {
  position: relative;
  display: flex;
  flex-direction: column;
  /* justify-content: center; */
  /* Remove vertical centering */
  min-height: 120px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.rdb-card__icon {
  position: absolute;
  left: -8px;
  top: -16px;
  transform: none;
  width: 72px;
  height: 72px;
  margin: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.rdb-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rdb-card__body {
  position: relative;
  padding-left: 48px;
}

.rdb-card__title {
  font-family: var(--font-sans);
  font-size: clamp(18px, 2.1vw, 22px);
  margin: 0 0 6px;
  line-height: 1.3;
}

.rdb-card__desc {
  font-size: 14px;
  color: var(--rdb-ink-soft);
  margin: 0;
  line-height: 1.6;
}

.rdb-card__badge {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  padding: 0.35em 0.7em;
  border-radius: 0;
  background: #222;
  color: #fff;
}

/* --- category accents (left border ribbon + soft wash) --- */
.rdb-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cat-wash, transparent);
  opacity: 0.28;
  pointer-events: none;
}

.rdb-card::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 8px;
  border-radius: 0 0 0 var(--rdb-radius);
  background: var(--cat-dark, #0003);
  pointer-events: none;
  /* Add this to allow clicks to pass through */
  opacity: 0.85;
}

/* wildlife */
.rdb-card--wildlife {
  --cat-dark: var(--rdb-wildlife-dark);
  --cat-light: var(--rdb-wildlife-light);
  --cat-wash: radial-gradient(120% 100% at 20% 20%,
      var(--rdb-wildlife-light),
      transparent 60%);
}

.rdb-card--wildlife .rdb-card__title {
  color: var(--rdb-wildlife-dark);
}

/* geology */
.rdb-card--geo {
  --cat-dark: var(--rdb-geo-dark);
  --cat-light: var(--rdb-geo-light);
  --cat-wash: radial-gradient(120% 100% at 20% 20%,
      var(--rdb-geo-light),
      transparent 60%);
}

.rdb-card--geo .rdb-card__title {
  color: var(--rdb-geo-dark);
}

/* flora & fungi */
.rdb-card--flora {
  --cat-dark: var(--rdb-flora-dark);
  --cat-light: var(--rdb-flora-light);
  --cat-wash: radial-gradient(120% 100% at 20% 20%,
      var(--rdb-flora-light),
      transparent 60%);
}

.rdb-card--flora .rdb-card__title {
  color: var(--rdb-flora-dark);
}

/* ecosystem */
.rdb-card--eco {
  --cat-dark: var(--rdb-eco-dark);
  --cat-light: var(--rdb-eco-light);
  --cat-wash: radial-gradient(120% 100% at 20% 20%,
      var(--rdb-eco-light),
      transparent 60%);
}

.rdb-card--eco .rdb-card__title {
  color: var(--rdb-eco-dark);
}

/* keyboard focus */
.rdb-card__link:focus-visible {
  outline: 2px solid var(--cat-dark);
  outline-offset: 3px;
  border-radius: calc(var(--rdb-radius) - 2px);
}

.rdb-cats__grid li:nth-child(11) .rdb-card__link {
  --icon: url("/images/rdb/icons/seawater-shell.svg");
}

/* ------------------------------
   Forms (do not style `form` tag directly per CMS notes)
   ------------------------------ */
.rdb-form-control {
  width: 100%;
  max-width: 36rem;
}

.rdb-input,
.rdb-select,
.rdb-textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #cfcfd6;
  border-radius: 0.5rem;
  background: #fff;
  font: inherit;
}

.rdb-input:focus-visible,
.rdb-select:focus-visible,
.rdb-textarea:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

.rdb-help {
  display: block;
  font-size: 0.875rem;
  color: var(--color-muted-text);
  margin-top: 0.25rem;
}

/* ------------------------------
   Editable Region Styles (#tmp_contents)
   ------------------------------ */
/* --- Homepage Hero --- */
#tmp_contents .hero {
  /* This selector is already defined above, so it's removed from here. */
}

/* --- Sub-page Intro Banner --- */
#tmp_contents .intro-banner {
  position: relative;
  padding: clamp(2.5rem, 6vw, 4rem) var(--space-4);
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  text-align: left;
  /* テキストを左寄せに変更 */
  isolation: isolate;
}

/* Dark overlay for text readability */
#tmp_contents .intro-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  /* カバーを削除 */
  background: none;
  z-index: -1;
}

#tmp_contents .intro-banner__content {
  max-width: 680px;
  margin: 0 auto 0 0;
  /* コンテンツブロックを左に配置 */
}

#tmp_contents .intro-banner__title {
  font-family: var(--font-sans);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 var(--space-3);
}

#tmp_contents .intro-banner__text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
  /* 説明文だけを黒色で上書き */
  margin: 0;
}

/* --- Animal Category Theme --- */
.cat-animal .intro-banner {
  background-image: url("/shared/site_rdb/images/01_animals/top-banner.jpg");
  color: var(--cat-animal-text);
}

/* --- Ecosystem Category Theme --- */
.cat-eco .intro-banner {
  background-color: var(--cat-eco-weak);
  color: var(--cat-eco-text);
}

.cat-eco .intro-banner__title {
  color: var(--cat-eco-text);
}

/* --- Sub-category Grid --- */
#tmp_contents .category-nav {
  margin-top: 2.5rem;
  /* 40px: 上のバナーとの間隔を調整 */
  margin-bottom: 3.5rem;
  /* 56px: 下のフッターとの間隔を調整 */
}

#tmp_contents .category-nav .h2 {
  text-align: center;
  margin-bottom: var(--space-5);
}

#tmp_contents .subcat-grid {
  display: grid;
  grid-template-columns: repeat(4,
      minmax(0, 240px));
  /* PCで4列表示、ただしカード幅が広がりすぎないように制限 */
  justify-content: center;
  /* 最後の行のアイテムを中央揃えにする */
  gap: 3rem var(--space-5);
  /* 上下の間隔を48pxに、左右の間隔を24pxに設定 */
  list-style: none;
  padding: 0;
  margin: 0;
}

#tmp_contents .subcat-card {
  display: flex;
  flex-direction: column;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

#tmp_contents .subcat-card:hover,
#tmp_contents .subcat-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: var(--color-text);
  outline: none;
}

#tmp_contents .subcat-card__icon {
  width: 1em;
  height: 1em;
  margin-left: 0.2em;
  /* タイトルと矢印の間のスペース */
  flex-shrink: 0;
  background-color: currentColor;
  /* 親要素のcolorを継承するように変更 */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'%3E%3C/path%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'%3E%3C/path%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#tmp_contents .subcat-card:hover .subcat-card__icon {
  transform: translateX(2px);
  background-color: var(--color-link);
}

#tmp_contents .subcat-card__icon--top {
  width: 100%;
  aspect-ratio: 14 / 1;
  /* カード幅に合わせて高さを調整 */
  margin: 0;
  border-bottom: 1px solid var(--color-border);
  transition: transform 0.2s ease;
}

#tmp_contents .subcat-card__icon--top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 画像がコンテナを覆うように調整 */
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#tmp_contents .subcat-card:hover .subcat-card__icon--top {
  transform: scale(1.1);
}

#tmp_contents .subcat-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-4) var(--space-3);
}

#tmp_contents .subcat-card__title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  /* カードサイズに合わせて調整 */
  font-weight: 600;
  margin: 0;
}

/* --- Animal Category Theme --- */
.cat-animal .subcat-card__title,
.cat-animal .subcat-card__title-wrapper {
  color: var(--cat-animal-text);
}

.cat-animal .related-links__icon {
  background-color: var(--cat-animal);
}

/* --- Flora Category Theme --- */
.cat-flora .intro-banner {
  background-image: url("/shared/site_rdb/images/02_plants-fungi/plants-fungi-banner.png");
  /* 植物・菌類ページ用のバナー画像 */
  color: var(--cat-flora-text);
}

.cat-flora .intro-banner__title {
  color: var(--cat-flora-text);
}

.cat-flora .subcat-card__title,
.cat-flora .subcat-card__title-wrapper,
.cat-flora .related-links__icon {
  color: var(--cat-flora-text);
}

.cat-flora .related-links__icon {
  background-color: var(--cat-flora);
}

.cat-eco .related-links__icon {
  background-color: var(--cat-eco);
}

#tmp_contents .subcat-card__desc {
  font-size: 0.8125rem;
  /* 説明文のフォントサイズを調整 */
  color: var(--color-muted-text);
  line-height: 1.6;
  margin: 0;
}

#tmp_contents .subcat-card__title-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: var(--space-3);
  /* 画像との間に余白を追加 */
  gap: 0.4em;
}

/* --- Related Links Section --- */
#tmp_contents .related-links {
  position: relative;
  z-index: 1;
  /* パネル化してセクションを明確にする */
  margin-top: var(--space-6);
  padding: var(--space-5);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-darker);
}

#tmp_contents .related-links__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
}

#tmp_contents .related-links__card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface-alt);
  border: 1px solid var(--color-border-darker);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative; /* バッジの絶対位置基準 */
}

#tmp_contents .related-links__card:hover,
#tmp_contents .related-links__card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  /* ホバー時の影を少し強調 */
  color: var(--color-link);
  outline: none;
}

#tmp_contents .related-links__icon {
  flex-shrink: 0;
  width: 2em;
  height: 2em;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Icon definitions */
#tmp_contents .related-links__icon[data-icon="document"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'%3E%3C/path%3E%3Cpolyline points='14 2 14 8 20 8'%3E%3C/polyline%3E%3C/svg%3E");
}

#tmp_contents .related-links__icon[data-icon="list"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='8' y1='18' x2='21' y2='18'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'%3E%3C/line%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='8' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='8' y1='18' x2='21' y2='18'%3E%3C/line%3E%3Cline x1='3' y1='6' x2='3.01' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='3.01' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='3.01' y2='18'%3E%3C/line%3E%3C/svg%3E");
}

/* バッジはカードのレイアウトに関与させず、カード下端に重ね貼り */
#tmp_contents .related-links__text {
  display: block;
}

#tmp_contents .related-links__card .rdb-card__badge {
  position: absolute;
  bottom: -0.9rem;   /* カードの枠の外側（下端）に張り出す */
  left: 50%;
  transform: translateX(-50%);
  top: auto;
  margin: 0;
  white-space: nowrap;
  z-index: 1;
}

#tmp_contents .related-links__icon[data-icon="book"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'%3E%3C/path%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'%3E%3C/path%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'%3E%3C/path%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'%3E%3C/path%3E%3C/svg%3E");
}

/* ======================================================================
   List Page Styles (from list-page.css)
   Styles for species list pages (tables, etc.)
   ====================================================================== */

/* --- Page Header for List Pages --- */
#tmp_contents .page-header {
  /* Flexboxを使用して横並びレイアウトに変更 */
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
  /* パネル風のデザインにする */
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  text-align: left;
  /* テキストを左揃えに */
}

/* カテゴリテーマカラーを背景に適用 */
.cat-animal #tmp_contents .page-header {
  background-color: var(--cat-animal-weak);
}

.cat-flora #tmp_contents .page-header {
  background-color: var(--cat-flora-weak);
}

#tmp_contents .page-header__icon-wrapper {
  flex-shrink: 0;
  /* アイコンが縮まないようにする */
  width: 90px;
  height: 90px;
  padding: 16px;
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-md);
  margin-bottom: 0;
  /* 縦並び用のマージンをリセット */
}

#tmp_contents .page-header__icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

/* テキストアイコン（地域生態系など）のカラー */
.cat-eco #tmp_contents .icon-glyph {
  color: var(--cat-eco-text);
}

/* アイコンをmask-image方式でカテゴリカラーに着色 */
#tmp_contents .page-header__icon-mask {
  width: 100%;
  height: 100%;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.cat-animal #tmp_contents .page-header__icon-mask {
  background-color: var(--cat-animal);
}
.cat-flora #tmp_contents .page-header__icon-mask {
  background-color: var(--cat-flora);
}
.cat-eco #tmp_contents .page-header__icon-mask {
  background-color: var(--cat-eco);
}

#tmp_contents .page-header__text {
  /* 何も指定しない */
}

#tmp_contents .page-header__title {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 5vw, 2.5rem);
  margin: 0;
}

/* カテゴリテーマカラーを見出しに適用（テキストは黒で統一） */
.cat-animal #tmp_contents .page-header__title,
.cat-flora #tmp_contents .page-header__title,
.cat-eco #tmp_contents .page-header__title {
  color: var(--color-text);
}

#tmp_contents .page-header__lead {
  font-size: 1.125rem;
  color: var(--color-muted-text);
  margin: 0;
}

/* --- List Section --- */
#tmp_contents .list-section {
  margin-top: var(--space-6);
}

#tmp_contents .list-section .h2,
#tmp_contents .list-section .h3 {
  font-family: var(--font-sans);
  text-align: center;
  margin-bottom: var(--space-5);
}

/* --- Data Table --- */
#tmp_contents .table-container {
  overflow-x: auto;
  /* テーブルが画面幅を超える場合に横スクロールを可能にする */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-border-darker);
}

#tmp_contents .data-table {
  width: 100%;
  border-collapse: separate;
  /* セル間の線を引くために変更 */
  border-spacing: 0;
  font-size: 0.875rem;
  /* 14px - よりコンパクトに */
  line-height: 1.4;
  /* 行間を調整 */
}

#tmp_contents .data-table th,
#tmp_contents .data-table td {
  /* 一覧で情報量が多いため、パディングを詰めて表示密度を上げる */
  padding: 0.5rem 0.75rem;
  /* 上下0.5rem、左右0.75rem */
  text-align: center;
  vertical-align: middle;
  /* topからmiddleに変更して高さを抑える */
  /* 縦線と横線を追加 */
  border-bottom: 1px solid var(--krb-line);
  /* 下線は常に引く */
  border-left: 1px solid var(--krb-line);
  /* 左線を基本とする */
}

/* --- 列幅の調整 --- */
/* colgroupで指定したクラス名で列幅を管理する */
#tmp_contents .data-table .col-species {
  width: 18%;
  /* 「種名」を少し縮小 */
  border-left: none !important;
  /* 左端の線を二重にしない */
}

#tmp_contents .data-table .col-class,
#tmp_contents .data-table .col-order {
  width: 9%;
  /* 分類・目名を少し縮小 */
  white-space: nowrap;
}

#tmp_contents .data-table .col-family {
  width: 10%;
  /* 「科名」を少し縮小 */
  white-space: nowrap;
}

#tmp_contents .data-table .col-sciname {
  width: 22%;
  /* 「学名」を拡大して複数行を減らす */
  word-break: break-word;
  /* 長い学名を適切に折り返す */
  hyphens: auto;
  /* ハイフンで折り返しを改善 */
}

#tmp_contents .data-table .col-cat-2026,
#tmp_contents .data-table .col-cat-2015 {
  width: 6%;
  /* 京都府カテゴリー（2026/2015/2002）を少し縮小 */
  white-space: nowrap;
}

#tmp_contents .data-table .col-cat-env {
  width: 20%;
  /* 「環境省カテゴリー」を拡大して複数行を減らす */
  word-break: break-word;
  /* 長いテキストを適切に折り返す */
}

#tmp_contents .data-table thead th {
  font-weight: 600;
  white-space: nowrap;
  /* ヘッダーが折り返さないようにする */
  position: sticky;
  /* スクロール時にヘッダーを固定 */
  top: 0;
  z-index: 1;
}

#tmp_contents .data-table tbody th {
  font-weight: 500;
}

/* ゼブラストライプ（一行おきに色を変える） */
#tmp_contents .data-table tbody tr:nth-child(even) {
  background-color: var(--color-surface-alt);
}

#tmp_contents .data-table tbody tr:hover {
  background-color: var(--color-kyoto-purple-100);
}

/* カテゴリ別ホバー行色 */
.cat-animal #tmp_contents .data-table tbody tr:hover {
  background-color: #ffe6ec;
}
.cat-flora #tmp_contents .data-table tbody tr:hover {
  background-color: #e6f4e6;
}
.cat-eco #tmp_contents .data-table tbody tr:hover {
  background-color: #e6f2f4;
}

#tmp_contents .data-table tbody tr:last-child th,
#tmp_contents .data-table tbody tr:last-child td {
  border-bottom: none;
  /* テーブルの一番下の行の横線は不要 */
}

#tmp_contents .data-table em {
  font-family: var(--font-serif);
  font-style: italic;
  line-height: 1.3;
  /* 学名の行間をさらに詰める */
}

/* 学名と環境省カテゴリーのセル内のテキストを最適化 */
#tmp_contents .data-table .col-sciname,
#tmp_contents .data-table .col-cat-env {
  font-size: 0.875rem;
  line-height: 1.35;
  /* 行間を調整 */
}

/* 写真ありアイコン */
#tmp_contents .icon-photo {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.4em;
  vertical-align: -0.1em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'%3E%3C/circle%3E%3Cpolyline points='21 15 16 10 5 21'%3E%3C/polyline%3E%3C/svg%3E");
}

/* ======================================================================
   Category-specific styles for list pages
   ====================================================================== */

/* --- Animal Category Theme --- */
.cat-animal #tmp_contents .list-section .h2,
.cat-animal #tmp_contents .list-section .h3,
.cat-flora #tmp_contents .list-section .h2,
.cat-flora #tmp_contents .list-section .h3,
.cat-eco #tmp_contents .list-section .h2,
.cat-eco #tmp_contents .list-section .h3 {
  color: var(--color-text);
}

.cat-animal #tmp_contents .data-table thead th {
  background-color: color-mix(in oklab, var(--cat-animal) 65%, #000);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.cat-flora #tmp_contents .data-table thead th {
  background-color: color-mix(in oklab, var(--cat-flora) 65%, #000);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.cat-eco #tmp_contents .data-table thead th {
  background-color: color-mix(in oklab, var(--cat-eco) 65%, #000);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* 地域生態系: 名称セル（rowspan）の縦位置・境界線 */
#tmp_contents .data-table td.regional-name-cell {
  vertical-align: middle;
  font-weight: 500;
}

/* 地域生態系サブ行: td:first-child の強調色を打ち消す（.cat-eco より詳細度を上げてオーバーライド） */
.cat-eco #tmp_contents .data-table tbody tr.regional-subrow > td:first-child {
  background-color: transparent;
}

/* ======================================================================
   地域生態系テーブル（.regional-eco-table）専用: グループ単位の交互着色
   tr レベルで色を設定し td は透明にすることで、rowspan 名称セルを含む
   全行が完全に同じ色になる。他ページへの影響なし。
   ====================================================================== */

/* 奇数グループ（デフォルト）: tr に薄い eco 基調色（nth-child 等を上書き） */
.cat-eco #tmp_contents .regional-eco-table tbody tr {
  background-color: rgba(187, 161, 203, 0.07) !important;
}
/* 偶数グループ（group-alt）: tr に少し濃い eco 基調色 */
.cat-eco #tmp_contents .regional-eco-table tbody tr.group-alt {
  background-color: rgba(187, 161, 203, 0.18) !important;
}
/* 全 td/th は透明にして tr の色を透過させる
   td:first-child 汎用ルール・regional-subrow ルールをすべて無効化 */
.cat-eco #tmp_contents .regional-eco-table tbody tr td,
.cat-eco #tmp_contents .regional-eco-table tbody tr th {
  background-color: transparent !important;
}

/* 種名列（tbody 第1列）を強調（opacity を上げてより視認しやすく） */
.cat-animal #tmp_contents .data-table tbody tr > td:first-child,
.cat-animal #tmp_contents .data-table tbody tr > th:first-child {
  background-color: rgba(238, 134, 161, 0.2);
}
.cat-flora #tmp_contents .data-table tbody tr > td:first-child,
.cat-flora #tmp_contents .data-table tbody tr > th:first-child {
  background-color: rgba(174, 206, 133, 0.2);
}
.cat-eco #tmp_contents .data-table tbody tr > td:first-child,
.cat-eco #tmp_contents .data-table tbody tr > th:first-child {
  background-color: rgba(187, 161, 203, 0.2);
}

/* 「PDFを生成」ボタンのテキストカラーを黒に */
#tmp_contents .btn--ghost {
  color: var(--color-text);
}

/* テーブルコンテナの枠線の色をご指定の色に変更 */
.cat-animal #tmp_contents .table-container {
  border-color: var(--cat-animal);
  border-left: none;
}

/* テーブル全体の線の色をご指定の色に変更 */
.cat-animal #tmp_contents .data-table th,
.cat-animal #tmp_contents .data-table th,
.cat-animal #tmp_contents .data-table td {
  border-bottom: 1px solid var(--cat-animal);
  border-left: 1px solid var(--cat-animal);
}

/* 植物・菌類用のテーブル枠線色 */
.cat-flora #tmp_contents .table-container {
  border-color: var(--cat-flora);
  border-left: none;
}

.cat-flora #tmp_contents .data-table th,
.cat-flora #tmp_contents .data-table td {
  border-bottom: 1px solid var(--cat-flora);
  border-left: 1px solid var(--cat-flora);
}

/* 自然生態系用のテーブル枠線色 */
.cat-eco #tmp_contents .table-container {
  border-color: var(--cat-eco);
  border-left: none;
}

.cat-eco #tmp_contents .data-table th,
.cat-eco #tmp_contents .data-table td {
  border-bottom: 1px solid var(--cat-eco);
  border-left: 1px solid var(--cat-eco);
}

/* テーブル左端の線がコンテナの線と重なって濃く見えるのを防ぐ */
.cat-animal #tmp_contents .table-container .data-table th.col-species,
.cat-animal #tmp_contents .table-container .data-table td.col-species {
  border-left: none !important;
  /* !importantで確実に適用 */
}

.cat-flora #tmp_contents .table-container .data-table th.col-species,
.cat-flora #tmp_contents .table-container .data-table td.col-species {
  border-left: none !important;
}

.cat-eco #tmp_contents .table-container .data-table th.col-species,
.cat-eco #tmp_contents .table-container .data-table td.col-species {
  border-left: none !important;
}

/* 地域生態系テーブル特有の列幅バランス調整（汎用の .col-cat-env や .col-cat-2015 などの上書き） */
#tmp_contents .regional-eco-table .col-species { width: 15%; }
#tmp_contents .regional-eco-table .col-class   { width: 8%; }
#tmp_contents .regional-eco-table .col-order   { width: 14%; } /* 群落 */
#tmp_contents .regional-eco-table .col-family:nth-child(4) { width: 18%; } /* 地点名 */
#tmp_contents .regional-eco-table .col-family:nth-child(5) { width: 18%; } /* 所在地（広く） */
#tmp_contents .regional-eco-table .col-cat-2026 { width: 9%; }
#tmp_contents .regional-eco-table .col-cat-2015 { width: 9%; }
#tmp_contents .regional-eco-table .col-cat-env  { width: 9%; } /* 2002年版 */

/* リンク下線：text-underline-offset を小さくして下線を文字に近づけ、セル下端の罫線との重なりを軽減 */
.cat-animal #tmp_contents .data-table a,
.cat-flora #tmp_contents .data-table a,
.cat-geo #tmp_contents .data-table a,
.cat-eco #tmp_contents .data-table a {
  color: var(--color-text, #222426);
  text-decoration: underline;
  text-decoration-color: var(--cat-animal-accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.04em;
  font-weight: 500;
}

.cat-flora #tmp_contents .data-table a {
  text-decoration-color: var(--cat-flora-accent);
}

.cat-geo #tmp_contents .data-table a {
  text-decoration-color: var(--cat-geo-accent);
}

.cat-eco #tmp_contents .data-table a {
  text-decoration-color: var(--cat-eco-accent);
}


/* ======================================================================
   Responsive: Card Layout for Mobile
   ====================================================================== */

/* カードコンテナ（スマホ用） */
#tmp_contents .species-cards-container {
  display: none;
  gap: 1rem;
  margin-top: 1.5rem;
}

#tmp_contents .species-card {
  background: #fff;
  border: 1px solid var(--color-border-darker, #beb8c2);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

#tmp_contents .species-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

#tmp_contents .species-card__header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border, #e5e1e8);
}

#tmp_contents .species-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

#tmp_contents .species-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

#tmp_contents .species-card__title a:hover {
  color: var(--color-kyoto-purple-700, #751485);
  text-decoration: underline;
}

#tmp_contents .species-card__scientific-name {
  font-family: var(--font-serif, serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--color-muted-text, #646a6e);
  margin: 0;
}

#tmp_contents .species-card__main-info {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
}

#tmp_contents .species-card__label {
  font-weight: 600;
  color: var(--color-muted-text, #646a6e);
}

#tmp_contents .species-card__value {
  color: var(--color-text, #222426);
}

#tmp_contents .species-card__category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

#tmp_contents .species-card__footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border, #e5e1e8);
}

#tmp_contents .species-card__detail-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1.5px solid var(--color-kyoto-purple-700, #751485);
  border-radius: 8px;
  color: var(--color-kyoto-purple-700, #751485);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  width: 100%;
  justify-content: center;
  box-sizing: border-box;
}

#tmp_contents .species-card__detail-link:hover {
  background: var(--color-kyoto-purple-100, #f6eef8);
  border-color: var(--color-kyoto-purple-800, #5e106a);
  color: var(--color-kyoto-purple-800, #5e106a);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(117, 20, 133, 0.15);
}

#tmp_contents .species-card__link-icon {
  width: 1em;
  height: 1em;
  transition: transform 0.3s ease;
}

#tmp_contents .species-card__detail-link:hover .species-card__link-icon {
  transform: translateX(4px);
}

/* カテゴリ別のカードスタイル */
.cat-animal #tmp_contents .species-card {
  border-color: var(--cat-animal, #6e4c2e);
}

.cat-animal #tmp_contents .species-card__title a:hover {
  color: var(--cat-animal-accent, #6e4c2e);
  text-decoration: underline;
  text-decoration-color: var(--cat-animal-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.cat-animal #tmp_contents .species-card__category {
  background: var(--cat-animal-weak, #efe4d8);
  color: var(--cat-animal, #6e4c2e);
}

.cat-animal #tmp_contents .species-card__detail-link {
  border-color: var(--cat-animal-accent, #6e4c2e);
  color: var(--cat-animal-accent, #6e4c2e);
}

.cat-animal #tmp_contents .species-card__detail-link:hover {
  background: var(--cat-animal-weak, #efe4d8);
  border-color: var(--cat-animal-accent, #6e4c2e);
  color: var(--cat-animal-accent, #6e4c2e);
}

.cat-flora #tmp_contents .species-card {
  border-color: var(--cat-flora, #2f6e3b);
}

.cat-flora #tmp_contents .species-card__title a:hover {
  color: var(--cat-flora-accent, #2f6e3b);
  text-decoration: underline;
  text-decoration-color: var(--cat-flora-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.cat-flora #tmp_contents .species-card__category {
  background: var(--cat-flora-weak, #dfe9e2);
  color: var(--cat-flora, #2f6e3b);
}

.cat-flora #tmp_contents .species-card__detail-link {
  border-color: var(--cat-flora-accent, #2f6e3b);
  color: var(--cat-flora-accent, #2f6e3b);
}

.cat-flora #tmp_contents .species-card__detail-link:hover {
  background: var(--cat-flora-weak, #dfe9e2);
  border-color: var(--cat-flora-accent, #2f6e3b);
  color: var(--cat-flora-accent, #2f6e3b);
}

.cat-geo #tmp_contents .species-card {
  border-color: var(--cat-geo, #5a6473);
}

.cat-geo #tmp_contents .species-card__title a:hover {
  color: var(--cat-geo-accent);
  text-decoration: underline;
  text-decoration-color: var(--cat-geo-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.cat-geo #tmp_contents .species-card__category {
  background: var(--cat-geo-weak, #e4e8ee);
  color: var(--cat-geo, #5a6473);
}

.cat-geo #tmp_contents .species-card__detail-link {
  border-color: var(--cat-geo-accent);
  color: var(--cat-geo-accent);
}

.cat-geo #tmp_contents .species-card__detail-link:hover {
  background: var(--cat-geo-weak, #e4e8ee);
  border-color: var(--cat-geo-accent);
  color: var(--cat-geo-accent);
}

.cat-eco #tmp_contents .species-card {
  border-color: var(--cat-eco, #2c6a7b);
}

.cat-eco #tmp_contents .species-card__title a:hover {
  color: var(--cat-eco-accent);
  text-decoration: underline;
  text-decoration-color: var(--cat-eco-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.cat-eco #tmp_contents .species-card__category {
  background: var(--cat-eco-weak, #d8e9ee);
  color: var(--cat-eco, #2c6a7b);
}

.cat-eco #tmp_contents .species-card__detail-link {
  border-color: var(--cat-eco-accent);
  color: var(--cat-eco-accent);
}

.cat-eco #tmp_contents .species-card__detail-link:hover {
  background: var(--cat-eco-weak, #d8e9ee);
  border-color: var(--cat-eco-accent);
  color: var(--cat-eco-accent);
}

/* レスポンシブ: スマホでテーブルを非表示、カードを表示 */
@media (max-width: 768px) {
  #tmp_contents .table-container {
    display: none;
  }

  #tmp_contents .species-cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #tmp_contents .page-header {
    flex-direction: column;
    text-align: center;
  }

  #tmp_contents .page-header__icon-wrapper {
    margin: 0 auto 1rem;
  }
}

/* ======================================================================
   地域生態系ページ用：群落単位のまとまりを視覚的に区別
   ====================================================================== */
/* 群落単位のまとまりを視覚的に区別するための軽めの強調 */
#tmp_contents .species-table tbody tr td {
  background-color: #fff;
  /* 既存の行ストライプを打ち消す */
}

#tmp_contents .species-table tbody tr.group-start td {
  /* border-top を削除（シャドウのように見えるため） */
  box-shadow: none;
  /* シャドウを明示的に削除 */
}


#tmp_contents .species-table tbody tr {
  box-shadow: none;
  /* テーブル行のシャドウを削除 */
}

#tmp_contents .species-table tbody tr td {
  box-shadow: none;
  /* テーブルセルのシャドウを削除 */
}

/* ======================================================================
   PDF生成用プログレスモーダル
   ====================================================================== */
#pdfProgressModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pdf-progress-modal__inner {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  min-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#progressText {
  margin: 0 0 12px 0;
  font-weight: bold;
}

.pdf-progress-modal__bar-wrap {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: var(--color-kyoto-purple-700, #751485);
  transition: width 0.3s;
}

#currentSpecies {
  margin: 0 0 4px 0;
  font-size: 0.9em;
  color: #333;
}

.pdf-progress-modal__count {
  margin: 0;
  font-size: 0.85em;
  color: #555;
}