/* ==========================================================
   本文・ブロック
   固定ページ（.page-content）と記事（.entry .entry-content）、編集画面で共通
   ========================================================== */

.entry-content::after { content: ""; display: table; clear: both; }

.entry-content img { max-width: 100%; height: auto; }

.entry-content iframe {
  display: block;
  max-width: 100%;
  border: 0;
}

/* Google マップなどの埋め込み */
.entry-content iframe[src*="google.com/maps"] {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 7;
  margin: 24px 0;
  border: 1px solid var(--c-gray, #ccc);
}

@media (max-width: 599px) {
  .entry-content iframe[src*="google.com/maps"] { aspect-ratio: 4 / 3; }
}

.entry-content ul,
.entry-content ol { padding-left: 1.5em; }

.entry-content hr,
.entry-content .wp-block-separator {
  margin: 32px 0;
  border: 0;
  border-top: 1px solid var(--c-gray, #ccc);
}

/* ---------- 固定ページ：見出し ---------- */
.page-content h2,
.editor-styles-wrapper h2.wp-block-heading {
  margin: 0 0 24px;
  padding: 2px 0 4px 12px;
  border-left: 10px solid var(--c-red, #f26649);
  border-bottom: 2px solid var(--c-red, #f26649);
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.4;
}

.page-content h3,
.is-style-kojima-sub,
.editor-styles-wrapper h3.wp-block-heading {
  margin: 32px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--c-blue, #659ad2);
  font-size: 20px;
  line-height: 1.5;
}

.page-content .box-content > h3:first-child,
.page-content .box-content > h2 + h3 { margin-top: 0; }

.page-content .box-content > :last-child { margin-bottom: 0; }

/* ---------- 表 ---------- */
.entry-content .wp-block-table { margin: 0 0 1.5em; overflow-x: auto; }

.entry-content .wp-block-table table,
.entry-content > table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .9em;
}

.entry-content .wp-block-table th,
.entry-content .wp-block-table td {
  padding: 14px 16px;
  border: 1px solid var(--c-gray, #ccc);
  text-align: left;
  vertical-align: top;
}

.entry-content .wp-block-table th { background: #eef4fb; }

/* 項目表：左の列を見出しにする（固定ページの表は既定でこの見た目） */
.page-content .wp-block-table:not(.is-style-kojima-timeline):not(.is-style-stripes) td:first-child,
.is-style-kojima-info td:first-child {
  width: 32%;
  background: #eef4fb;
  font-weight: 700;
}

@media (max-width: 599px) {
  .page-content .wp-block-table:not(.is-style-kojima-timeline):not(.is-style-stripes) td,
  .is-style-kojima-info td {
    display: block;
    width: 100% !important;
    border-top: 0;
  }
  .page-content .wp-block-table:not(.is-style-kojima-timeline):not(.is-style-stripes) tr:first-child td:first-child,
  .is-style-kojima-info tr:first-child td:first-child { border-top: 1px solid var(--c-gray, #ccc); }
  .page-content .wp-block-table:not(.is-style-kojima-timeline):not(.is-style-stripes) td:first-child,
  .is-style-kojima-info td:first-child { padding: 8px 12px; }
}

/* 沿革（年表）：表を縦の年表に見せる */
.is-style-kojima-timeline table {
  background: transparent !important;
  font-size: 1em !important;
}

.is-style-kojima-timeline tr {
  position: relative;
  display: grid;
  grid-template-columns: 11em 1fr;
  gap: 4px 24px;
  padding: 0 0 24px 28px;
}

.is-style-kojima-timeline tr::before {
  content: "";
  position: absolute;
  left: 5px;
  top: .5em;
  bottom: -.5em;
  width: 2px;
  background: var(--c-gray, #ccc);
}

.is-style-kojima-timeline tr:last-child { padding-bottom: 0; }
.is-style-kojima-timeline tr:last-child::before { display: none; }

.is-style-kojima-timeline tr::after {
  content: "";
  position: absolute;
  left: 0;
  top: .45em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-blue, #659ad2);
}

.is-style-kojima-timeline td {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.is-style-kojima-timeline td:first-child {
  font-weight: 700;
  color: var(--c-blue-dark, #3f73ab);
}

@media (max-width: 599px) {
  .is-style-kojima-timeline tr { grid-template-columns: 1fr; }
}

/* ---------- 段落 ---------- */
.is-style-kojima-philosophy {
  margin: 0;
  padding: clamp(24px, 4vw, 40px) 12px;
  border-top: 2px solid var(--c-red, #f26649);
  border-bottom: 2px solid var(--c-red, #f26649);
  background: #fff;
  font-size: clamp(16px, 2.6vw, 24px);
  font-weight: 700;
  letter-spacing: clamp(0em, .5vw, .08em);
  line-height: 2;
  text-align: center;
}

.is-style-kojima-signature {
  margin-top: 24px;
  text-align: right;
  font-weight: 700;
}

.is-style-kojima-lead {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--c-blue-dark, #3f73ab);
}

/* ---------- 画像 ---------- */
.is-style-kojima-shadow img,
.page-content .wp-block-columns .wp-block-image img {
  box-shadow: 6px 6px 0 var(--c-gray, #ccc);
}

/* ---------- 段組み ---------- */
.entry-content .wp-block-columns {
  gap: 32px;
  align-items: flex-start;
  margin-bottom: 1.5em;
}

.entry-content .wp-block-column > :first-child { margin-top: 0; }

/* ---------- ボタン ---------- */
.entry-content .wp-block-button__link,
.is-style-kojima-button .wp-block-button__link {
  border-radius: 0;
  background: var(--c-red-dark, #c8432a);
  box-shadow: .2rem .2rem 0 .1rem var(--c-gray, #ccc);
  color: #fff;
  font-weight: 700;
}

.entry-content .wp-block-button__link:hover {
  background: var(--c-red-deep, #a93822);
  color: #fff;
}

/* ---------- グループ ---------- */
.is-style-kojima-box {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--c-box, #f7fcfe);
}

.is-style-kojima-info-box {
  margin-bottom: 1.2em;
  padding: 16px 20px;
  border-left: 6px solid var(--c-blue, #659ad2);
  background: var(--c-box, #f7fcfe);
}

.is-style-kojima-info-box > :last-child,
.is-style-kojima-info-box > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }

.is-style-kojima-notice {
  padding: clamp(24px, 5vw, 48px) 20px;
  border: 2px solid var(--c-gray, #ccc);
  background: #fff;
  text-align: center;
}

.is-style-kojima-notice > *,
.is-style-kojima-notice > .wp-block-group__inner-container > * { margin: 0 0 .5em; }
.is-style-kojima-notice > :first-child,
.is-style-kojima-notice > .wp-block-group__inner-container > :first-child { font-size: 1.15em; font-weight: 700; }
.is-style-kojima-notice > :last-child,
.is-style-kojima-notice > .wp-block-group__inner-container > :last-child { margin-bottom: 0; }

/* ---------- 資材カード ---------- */
/* クラシックテーマではグループの中に .wp-block-group__inner-container が入るため、そちらを並べる */
.is-style-kojima-material-grid,
.is-style-kojima-material-grid > .wp-block-group__inner-container {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.is-style-kojima-material-grid:has(> .wp-block-group__inner-container) { display: block !important; }

.is-style-kojima-material-grid > *,
.is-style-kojima-material-grid > .wp-block-group__inner-container > * { margin: 0 !important; }

@media (max-width: 899px) {
  .is-style-kojima-material-grid,
  .is-style-kojima-material-grid > .wp-block-group__inner-container { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

.is-style-kojima-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--c-gray, #ccc);
  background: #fff;
  box-shadow: 0 4px 0 var(--c-gray, #ccc);
}

.is-style-kojima-card > *,
.is-style-kojima-card > .wp-block-group__inner-container > * { margin: 0 !important; }

.is-style-kojima-card > .wp-block-group__inner-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.is-style-kojima-card .wp-block-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: none !important;
}

.is-style-kojima-card h3,
.page-content .is-style-kojima-card h3 {
  margin: 0;
  padding: 12px 16px 8px;
  border: 0;
  border-bottom: 3px solid var(--c-blue, #659ad2);
  font-size: 16px;
  line-height: 1.5;
}

.is-style-kojima-card p {
  padding: 12px 16px 16px;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 479px) {
  .is-style-kojima-material-grid,
  .is-style-kojima-material-grid > .wp-block-group__inner-container { gap: 12px; }
  .is-style-kojima-card h3,
  .page-content .is-style-kojima-card h3 { padding: 8px 10px 6px; font-size: 14px; }
  .is-style-kojima-card p { padding: 8px 10px 12px; font-size: 12px; }
}

/* ---------- 旧テーマで作った資材カード（移行前の表示用） ---------- */
.card-container {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--c-gray, #ccc);
  background: #fff;
  box-shadow: 0 4px 0 var(--c-gray, #ccc);
}

.card_title {
  margin: 0 !important;
  padding: 12px 16px 8px;
  border-bottom: 3px solid var(--c-blue, #659ad2);
  font-weight: 700;
}

.card_thumbnail,
.card_thumbnai { margin: 0; }

img.card_image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card_text {
  margin: 0 !important;
  padding: 12px 16px 16px;
  font-size: 14px;
}
