/* DESIGN web-2026-11-02. Scoped to the foundations series. */
.renewal-page:has(.kigaku-foundations) {max-width:1180px;margin-inline:auto;}
.renewal-page .tone-document:has(.kigaku-foundations) {background:#fff;box-shadow:none;border:0;padding:0;}
.renewal-page .tone-document:has(.kigaku-foundations)::before,
.renewal-page .tone-document:has(.kigaku-foundations)::after {content:none;}
.renewal-page .kigaku-foundations,.foundations-shell > article > .foundation-header,.foundation-breadcrumb {max-width:760px;margin-inline:auto;}
.renewal-page .kigaku-foundations {font-family:var(--kigaku-font-body,"Yu Gothic","YuGothic","Hiragino Kaku Gothic ProN","Meiryo",sans-serif);font-size:18px;line-height:1.9;color:#444;font-weight:500;letter-spacing:normal;overflow-wrap:anywhere;}
.renewal-page .foundation-header {padding:0;margin-top:24px;margin-bottom:32px;background:none;border:0;}
.renewal-page .foundation-header h1 {font-family:var(--kigaku-font-heading,"Yu Mincho","YuMincho","Hiragino Mincho ProN",serif);font-size:36px!important;line-height:1.5!important;font-weight:400!important;letter-spacing:normal;color:#222;margin:0!important;text-wrap:balance;}
.renewal-page .kigaku-foundations p,.renewal-page .kigaku-foundations li,.renewal-page .kigaku-foundations td,.renewal-page .kigaku-foundations th {font-family:inherit;font-size:18px!important;line-height:1.9!important;color:#444;font-weight:500;letter-spacing:normal;}
.renewal-page .kigaku-foundations p {margin:0 0 24px;padding:0;}
.renewal-page .kigaku-foundations section {margin:56px 0 0;scroll-margin-top:24px;}
.renewal-page .kigaku-foundations h2 {font-family:var(--kigaku-font-heading,"Yu Mincho","YuMincho","Hiragino Mincho ProN",serif);font-size:28px!important;line-height:1.5!important;font-weight:500!important;color:#222;background:none!important;border:0!important;padding:0!important;margin:0 0 24px!important;letter-spacing:normal;}
.renewal-page .kigaku-foundations h3 {font-family:var(--kigaku-font-heading,"Yu Mincho","YuMincho","Hiragino Mincho ProN",serif);font-size:22px!important;line-height:1.5!important;font-weight:500!important;background:none;border:0;padding:0;margin:32px 0 16px;}
.renewal-page .kigaku-foundations a:not([data-link-role="action"]){font-size:inherit;color:#333;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px;}
.renewal-page .kigaku-foundations a[data-link-role="action"],.foundation-breadcrumb a {font-size:16px!important;line-height:1.6!important;min-height:44px;min-width:44px;display:inline-flex;align-items:center;max-width:100%;padding:8px 0;color:#333;white-space:normal;text-decoration:none;}
.renewal-page .kigaku-foundations a[data-link-role="action"]:hover,.foundation-breadcrumb a:hover {text-decoration:underline;}
.renewal-page .kigaku-foundations a:focus-visible,.foundation-breadcrumb a:focus-visible {outline:2px solid #444;outline-offset:3px;background:#f6f4ef;text-decoration:underline dotted!important;}
.renewal-page .foundation-toc {border-block:1px solid #d0cbc3;padding:24px 0;margin:32px 0 40px;}
.renewal-page .foundation-toc p {font-size:16px!important;line-height:1.6!important;margin:0 0 8px;font-weight:600;}
.renewal-page .foundation-toc ul {list-style:none;display:grid;grid-template-columns:1fr 1fr;gap:0 24px;padding:0;margin:0;}
.renewal-page .foundation-toc li {margin:0;padding:0;}
.renewal-page .foundation-toc a {display:flex!important;width:100%;}
.renewal-page .foundation-links {list-style:none;margin:0;padding:0;}
.renewal-page .foundation-links li {border-bottom:1px solid #d0cbc3;margin:0;padding:8px 0;}
.renewal-page .foundation-links a {display:flex!important;width:100%;}
.renewal-page .foundation-related {margin-top:48px;}
.renewal-page .foundation-table {width:100%;border-collapse:collapse;table-layout:fixed;margin:24px 0;border:0;background:#fff;}
.renewal-page .foundation-table th,.renewal-page .foundation-table td {border:0;border-bottom:1px solid #d0cbc3;padding:16px 12px;text-align:left;vertical-align:top;background:transparent;word-break:normal;}
.renewal-page .foundation-table th {font-weight:600;background:#f6f4ef;}
.renewal-page .foundation-reading {display:block;font-size:14px;line-height:1.6;color:#666;}
.renewal-page .foundation-board {margin:32px 0;max-width:100%;}
.renewal-page .foundation-board figcaption {font-size:16px;line-height:1.6;margin:0 0 16px;color:#444;}
.renewal-page .foundation-grid {display:grid;grid-template-columns:repeat(3,1fr);width:min(264px,100%);border-top:1px solid #d0cbc3;border-left:1px solid #d0cbc3;margin-bottom:16px;}
.renewal-page .foundation-grid span {display:flex;align-items:center;justify-content:center;aspect-ratio:1;border-bottom:1px solid #d0cbc3;border-right:1px solid #d0cbc3;font-family:var(--kigaku-font-heading,serif);font-size:28px;line-height:1.5;background:#fff;color:#333;}
.renewal-page .foundation-grid span:nth-child(5) {background:#c8534a;color:#fff;}
.foundation-breadcrumb {display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:14px;}
@media(max-width:640px){
 .renewal-page:has(.kigaku-foundations){padding-inline:20px!important;}
 .renewal-page .foundation-header h1{font-size:28px!important;}
 .renewal-page .kigaku-foundations h2{font-size:24px!important;}
 .renewal-page .foundation-toc ul{grid-template-columns:1fr;}
 .renewal-page .kigaku-foundations section{margin-top:40px;}
 .renewal-page .foundation-table thead{position:absolute;clip-path:inset(50%);height:1px;width:1px;overflow:hidden;}
 .renewal-page .foundation-table,.renewal-page .foundation-table tbody,.renewal-page .foundation-table tr{display:block;width:100%;}
 .renewal-page .foundation-table tr{border-bottom:1px solid #d0cbc3;padding:16px 0;}
 .renewal-page .foundation-table td{display:block;width:100%;border:0;padding:4px 0;}
 .renewal-page .foundation-table td::before{content:attr(data-label);display:block;font-size:14px;line-height:1.6;color:#666;}
 .renewal-page .foundation-table td:first-child::before{display:none;}
 .renewal-page .foundation-table td:first-child{font-weight:600;}
}

/* Preserve semantic heading phrases at PC and mobile widths. */
.renewal-page .foundation-header h1 .foundation-title-main {display:block;}
.renewal-page .foundation-header h1 .foundation-title-phrase {display:inline-block;white-space:nowrap;}

/* Foundations visual components, 2026-11-26. Article text width stays 760px. */
.renewal-page .kigaku-foundations .foundation-octagon {margin:32px 0;max-width:480px;}
.renewal-page .kigaku-foundations .foundation-octagon svg {display:block;width:100%;height:auto;max-width:480px;}
.renewal-page .kigaku-foundations .foundation-octagon figcaption {font-size:14px;line-height:1.6;color:#666;margin-top:12px;}
.renewal-page .kigaku-foundations .foundation-center-note {display:block;margin-top:8px;}
.renewal-page .kigaku-foundations .foundation-board-legend {display:flex;gap:8px;align-items:center;font-size:16px;line-height:1.6;margin-top:8px;}
.renewal-page .kigaku-foundations .foundation-board-swatch {display:inline-block;flex:0 0 16px;height:16px;background:#F2C94C;border:1px solid #AAAAAA;}
.renewal-page .kigaku-foundations .foundation-hakke {max-width:480px;table-layout:fixed;}
.renewal-page .kigaku-foundations .foundation-hakke th:first-child {width:20%;}
.renewal-page .kigaku-foundations .foundation-hakke th:nth-child(2) {width:50%;}
.renewal-page .kigaku-foundations .foundation-hakke th:nth-child(3) {width:30%;}
.renewal-page .kigaku-foundations .foundation-hakke th {font-size:14px!important;line-height:1.6!important;color:#666;padding:8px;}
.renewal-page .kigaku-foundations .foundation-hakke td {padding:8px;vertical-align:middle;}
.renewal-page .kigaku-foundations .foundation-hakke td:first-child {text-align:center;}
.renewal-page .kigaku-foundations .foundation-trigram {font-size:32px;line-height:1;}
.renewal-page .kigaku-foundations .foundation-related {display:block!important;border-top:1px solid #D0CBC3;padding-top:24px;}
.renewal-page .kigaku-foundations .foundation-related .foundation-links {display:block;width:100%;margin:0;padding:0;}
.renewal-page .kigaku-foundations .foundation-related .foundation-links li {padding:16px 0;}
.renewal-page .kigaku-foundations .foundation-related .foundation-links a {display:inline-flex!important;width:auto;min-width:44px;min-height:44px;font-size:18px!important;line-height:1.6!important;padding:0;text-decoration:underline!important;text-underline-offset:3px;}
.renewal-page .kigaku-foundations .foundation-related-desc {display:block;font-size:14px!important;line-height:1.6!important;color:#666;margin-top:4px;}
@media(max-width:640px){
 .renewal-page .kigaku-foundations .foundation-trigram {font-size:28px;}
 .renewal-page .kigaku-foundations .foundation-hakke {display:table;}
 .renewal-page .kigaku-foundations .foundation-hakke thead {display:table-header-group;position:static;clip-path:none;height:auto;width:auto;overflow:visible;}
 .renewal-page .kigaku-foundations .foundation-hakke tbody {display:table-row-group;}
 .renewal-page .kigaku-foundations .foundation-hakke tr {display:table-row;padding:0;}
 .renewal-page .kigaku-foundations .foundation-hakke td {display:table-cell;width:auto;border-bottom:1px solid #D0CBC3;padding:6px;}
 .renewal-page .kigaku-foundations .foundation-hakke td::before {display:none!important;}
}

/* Foundations landing page. Keep prose sections at the series reading width. */
.renewal-page .kigaku-foundations[data-foundation="01"] {
  max-width: none;
}

.renewal-page .kigaku-foundations[data-foundation="01"] > section {
  max-width: 760px;
  margin-inline: auto;
}

.renewal-page .kigaku-foundations[data-foundation="01"] > .foundation-header {
  max-width: none;
  position: relative;
  isolation: isolate;
  padding-block: clamp(24px, 4vw, 48px);
}

.renewal-page .kigaku-foundations[data-foundation="01"] > .foundation-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/wp-content/themes/kigaku-renewal-20261103/assets/journey-preview/timeflow.png") right center / cover no-repeat;
  opacity: .24;
  mask-image: linear-gradient(90deg, transparent 12%, #000 72%);
}

/* Seven history and comparison articles. The newer introductory article is separate. */
.renewal-page .kigaku-foundations:is([data-foundation="02"], [data-foundation="03"], [data-foundation="04"], [data-foundation="05"], [data-foundation="06"], [data-foundation="07"], [data-foundation="08"]),
.foundations-shell:has(.kigaku-foundations:is([data-foundation="02"], [data-foundation="03"], [data-foundation="04"], [data-foundation="05"], [data-foundation="06"], [data-foundation="07"], [data-foundation="08"])) :is(.foundation-header, .foundation-breadcrumb) {
  max-width: none;
}

.renewal-page .kigaku-foundations:is([data-foundation="02"], [data-foundation="03"], [data-foundation="04"], [data-foundation="05"], [data-foundation="06"], [data-foundation="07"], [data-foundation="08"]) > :not(.foundation-intro, .foundation-toc) {
  max-width: 760px;
  margin-inline: auto;
}

.foundations-shell:has(.kigaku-foundations:is([data-foundation="02"], [data-foundation="03"], [data-foundation="04"], [data-foundation="05"], [data-foundation="06"], [data-foundation="07"], [data-foundation="08"])) .foundation-header {
  position: relative;
  isolation: isolate;
  padding-block: clamp(24px, 4vw, 48px);
}

.foundations-shell:has(.kigaku-foundations:is([data-foundation="02"], [data-foundation="03"], [data-foundation="04"], [data-foundation="05"], [data-foundation="06"], [data-foundation="07"], [data-foundation="08"])) .foundation-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/wp-content/themes/kigaku-renewal-20261103/assets/journey-preview/timeflow.png") right center / cover no-repeat;
  opacity: .24;
  mask-image: linear-gradient(90deg, transparent 12%, #000 72%);
}

/* 九星気学とは：既存の星別カード背景を現在の紹介に使う。 */
body.renewal-site .kigaku-foundations #stars > .foundation-star-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

body.renewal-site .kigaku-foundations #stars .foundation-star-grid > .star-card {
  min-width: 0;
  padding: 16px;
  list-style: none;
}

body.renewal-site .kigaku-foundations #stars .star-card .foundation-star-name,
body.renewal-site .kigaku-foundations #stars .star-card :is(.foundation-reading, .foundation-star-element, .foundation-star-meaning) {
  margin: 0;
}

body.renewal-site .kigaku-foundations #stars .star-card .foundation-star-name a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 22px;
  line-height: 1.4;
}

body.renewal-site .kigaku-foundations #stars .star-card .foundation-star-name a::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
}

body.renewal-site .kigaku-foundations #stars .star-card:focus-within {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

body.renewal-site .kigaku-foundations #stars .star-card :is(.foundation-reading, .foundation-star-element) {
  display: block;
  font-size: 14px;
  line-height: 1.5;
}

body.renewal-site .kigaku-foundations #stars .star-card .foundation-star-element {
  margin-top: 8px;
}

body.renewal-site .kigaku-foundations #stars .star-card .foundation-star-meaning {
  margin-top: 6px;
  font-size: 18px;
  line-height: 1.65;
}

@media (max-width: 1099px) {
  body.renewal-site .kigaku-foundations #stars > .foundation-star-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body.renewal-site .kigaku-foundations #stars > .foundation-star-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Center the basic nine-palace board within the reading column. */
.renewal-page .kigaku-foundations #structure .foundation-entry-board {
  margin-inline: auto;
}
.renewal-page .kigaku-foundations #structure .foundation-entry-board figcaption {
  margin: 0;
  text-align: center;
  font-size: 16px;
}
.renewal-page .kigaku-foundations #structure .foundation-entry-board p {
  margin-bottom: 0;
}
