/* ================================
   PlanIter8 Child — Academic layout
   ================================ */

/* Narrow centered content container */
.pi-content{
  max-width: 720px;             /* 640–800px 皆可，依喜好微調 */
  margin: 0 auto;
  padding: 40px 20px;
  font-family: "Playfair Display", ui-serif, Georgia, "Times New Roman", serif;
  line-height: 1.65;
  font-size: 18px;
  color: #111;
  background: transparent;
}

/* Headings: centered, bolder, academic vibe */
.pi-content h1,
.pi-content h2{
  text-align: center;
  font-weight: 700;
  margin: 0 0 24px 0;
}

/* Paragraph rhythm */
.pi-content p{ margin: 0 0 16px 0; }

/* Section divider (RIOT-like thin rule) */
.pi-section{
  border-top: 1px solid #111;
  margin-top: 40px;
  padding-top: 24px;
}

/* Optional small-caps helper */
.pi-sc{ font-variant-caps: small-caps; letter-spacing: .02em; }

/* Blockquote style */
.pi-content blockquote{
  border-left: 1px solid #111;
  margin: 24px 0;
  padding: 8px 16px;
  font-style: italic;
}

/* =========================================
   Global image rules — unified medium size
   =========================================
   目標：所有文章/頁面插入的圖片都「置中」，
        並限制為中等大小（寬度上限 768px，高度上限 1024px），
        同時避免被放大超過原始尺寸。
*/
.pi-content img,
.wp-block-image img,
.entry-content img{
  display: block;
  margin: 16px auto;                 /* 置中 */
  max-width: min(768px, 100%);       /* 不超出容器，且不超過 768px */
  height: auto;                      /* 維持比例 */
  max-height: 1024px;                /* 高度上限 */
  object-fit: contain;               /* 超高圖片也能在上限內完整顯示 */
}

/* Gutenberg figure 與 Classic 對齊輔助 */
.wp-block-image{ text-align: center; }
.aligncenter{ display:block; margin-left:auto; margin-right:auto; }

/* 圖片標題（可選，偏出版風） */
.wp-block-image figcaption,
.pi-content figcaption{
  text-align: center;
  font-size: 0.9em;
  color: #444;
  margin-top: 6px;
}

/* Responsive tweaks */
@media (max-width: 640px){
  .pi-content{ padding: 28px 16px; font-size: 17px; }
}

/* ======= Top logo bar ======= */
.pi-toplogo{
  padding: 18px 16px 8px;
}
.pi-toplogo__grid{
  /* 三欄：左(空) / 中(Logo) / 右(連結) */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}
.pi-toplogo__brand{
  grid-column: 2;              /* 中間欄 */
  justify-self: center;
  text-decoration: none;
}
.pi-logo{
  width: 260px;                /* 視需要調整大小 */
  height: auto;
  display: block;
}

/* 右上角連結 */
.pi-toplogo__nav{
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  gap: 18px;
  margin-top: 6px;
}
.pi-toplogo__nav a{
  font-family: "Playfair Display", ui-serif, Georgia, "Times New Roman", serif;
  font-size: 18px;
  color: #111;
  text-decoration: none;
}
.pi-toplogo__nav a:hover{ text-decoration: underline; }

/* 讓整體風格更接近出版感，保留窄欄內文 */
.pi-content{ max-width: 720px; margin: 0 auto; padding: 40px 20px; }


/* 樹狀圖文字 → Inter Light 300 */
.pi-diagram text,
.pi-tree-links a {
  font-family: 'Inter', sans-serif !important;
  font-weight: 300;
}

/* 全站左右邊界（gutter） */
:root{ --pi-gutter: 20px; }
@media (min-width: 1024px){ :root{ --pi-gutter: 40px; }}

/* Block 主題（如 Twenty Twenty-Four）的整體容器 */
.wp-site-blocks{
  padding-left: var(--pi-gutter);
  padding-right: var(--pi-gutter);
}

/* 頁首/頁尾也一起留白 */
header, footer,
.wp-block-template-part{
  padding-left: var(--pi-gutter);
  padding-right: var(--pi-gutter);
  box-sizing: border-box;
}

/* 你的窄欄內容（保留） */
.pi-content{
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 首頁最近文章區域也不要貼邊（如果有） */
.pi-recent .pi-container,
.pi-map .pi-container{
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--pi-gutter);
  padding-right: var(--pi-gutter);
}

/* 全站字體 Inter Light 400 */
body, p, li, h1, h2, h3, h4, h5, h6, .site-header, .site-footer {
  font-family: 'Inter', sans-serif;
  font-weight: 400; /* Light */
}

/* 確保文章內容也套用 */
.entry-content, .page-content, .post-content {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* 如果有 blockquote / code / caption */
blockquote, figcaption {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}

/* ===== 頂部欄：置中 Logo + 右側 Index ===== */
.pi-toplogo{ padding: 18px 16px 8px; }
.pi-toplogo .site-container{ max-width: 1200px; margin: 0 auto; }
.pi-toplogo__grid{
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* 左空、中logo、右連結 */
  align-items: start;
}
.pi-toplogo__brand{
  grid-column: 2;
  justify-self: center;
  text-decoration: none;
}
.pi-logo{ width: 260px; height: auto; display: block; }

/* 右上角 Index */
.pi-toplogo__nav{
  grid-column: 3;
  justify-self: end;
  margin-top: 6px;
}
.pi-toplogo__nav a{
  font-family: "Inter", sans-serif; /* 或想改的字體 */
  font-weight: 400;
  font-size: 18px;
  color: #111;
  text-decoration: none;
}
.pi-toplogo__nav a:hover{ text-decoration: underline; }

/* 全站左右留白（避免貼邊） */
:root{ --pi-gutter: 20px; }
@media (min-width: 1024px){ :root{ --pi-gutter: 40px; } }
.wp-site-blocks,
header, footer, .wp-block-template-part{
  padding-left: var(--pi-gutter);
  padding-right: var(--pi-gutter);
  box-sizing: border-box;
}

/* 讓編輯器畫布也長得像前台 */
.editor-styles-wrapper .pi-content{
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}
.editor-styles-wrapper .entry-title{
  text-align: center;
  font-weight: 700;
  margin: 0 0 24px 0;
}

/* H1 頁面標題 → Cardo 400 */
.pi-content .entry-title,
.entry-title {
  font-family: 'Cardo', serif;
  font-weight: 400;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.25;
  text-align: center;
  margin: 20px 0 28px;
}

/* H2 / H3 子標題 → Cardo 400 */
.pi-content h2,
.pi-content h3,
.entry-content h2,
.entry-content h3 {
  font-family: 'Cardo', serif;
  font-weight: 400;
  line-height: 1.3;
  margin: 32px 0 16px;
}

.pi-content h2 { font-size: clamp(22px, 4vw, 32px); }
.pi-content h3 { font-size: clamp(18px, 3.5vw, 26px); }

/* 內文 / 列表 → Inter 400 */
.pi-content,
.entry-content,
.page-content,
.post-content,
.pi-content p,
.pi-content li,
.pi-index-list li {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  font-size: 18px;
}

/* 條列型目錄（Index） */
.pi-index-list{ list-style:none; margin:0; padding:0; }
.pi-index-list li{
  display:flex; justify-content:space-between; align-items:baseline;
  padding:8px 0; border-bottom:1px solid #eee;
}
.pi-index-list a{
  font-family:'Inter', sans-serif; font-weight:400; color:#111; text-decoration:none;
}
.pi-index-list a:hover{ text-decoration:underline; }
.pi-index-meta{
  font-family:'Inter', sans-serif; font-weight:400; font-size:.9em; color:#666;
  margin-left:12px; white-space:nowrap;
}


