/*
Theme Name: Astra Child – 日台稲門会
Theme URI: https://nittai-toumonkai.com/
Template: astra
Author: PJ-T&C合同会社
Description: 日台稲門会公式サイト用 Astra 子テーマ。配色・書体・投稿／固定ページのレイアウト調整を担います。
Version: 1.0.9
Text Domain: astra-child-nittai
*/

/* ==========================================================================
   デザイントークン
   Astra のグローバルカラーは functions.php 側で定義（--ast-global-color-0〜8）。
   0: えんじ（早稲田） 1: 濃えんじ 2: 墨紺 3: 本文 4: 生成り（背景） 5: 白 6: 砂（罫線） 7: 灰（補助文字） 8: 金（アクセント）
   ========================================================================== */
:root {
  --nt-enji: var(--ast-global-color-0, #8e1728);
  --nt-enji-dark: var(--ast-global-color-1, #5e0f1b);
  --nt-navy: var(--ast-global-color-2, #1f2a44);
  --nt-ink: var(--ast-global-color-3, #222222);
  --nt-paper: var(--ast-global-color-4, #f8f6f2);
  --nt-white: var(--ast-global-color-5, #ffffff);
  --nt-sand: var(--ast-global-color-6, #e8e2d6);
  --nt-muted: var(--ast-global-color-7, #6b6b6b);
  --nt-gold: var(--ast-global-color-8, #c8a24a);
  --nt-radius: 12px;
  --nt-shadow: 0 8px 30px rgba(31, 42, 68, 0.08);
}

body {
  background: var(--nt-paper);
  font-feature-settings: "palt";
  letter-spacing: 0.02em;
}

/* 見出し：明朝で品格を */
h1, h2, h3, h4, .entry-title, .ast-archive-title, .site-title {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.site-title a { letter-spacing: 0.12em; }

/* ヘッダー */
.ast-primary-header-bar { border-bottom: 1px solid var(--nt-sand); }
.main-header-menu .menu-link { font-size: 0.95rem; letter-spacing: 0.06em; }
.main-header-menu .current-menu-item > .menu-link { color: var(--nt-enji); }
/* メニュー11項目がノートPC幅で折り返さないように */
@media (min-width: 922px) and (max-width: 1400px) { .main-header-menu .menu-link { font-size: 0.86rem; letter-spacing: 0.02em; padding-left: 0.55em; padding-right: 0.55em; } }

/* ==========================================================================
   投稿（シンプルな読み物レイアウト）
   ========================================================================== */
.single-post .ast-article-single {
  background: var(--nt-white);
  border: 1px solid var(--nt-sand);
  border-radius: var(--nt-radius);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1.25rem, 5vw, 3.5rem);
}
.single-post .entry-title { font-size: clamp(1.45rem, 2.6vw, 2rem); line-height: 1.5; }
.single-post .entry-meta { font-size: 0.85rem; color: var(--nt-muted); margin-bottom: 1.5rem; }
.single-post .entry-meta a { color: var(--nt-muted); }
.single-post .entry-content { font-size: 1.02rem; line-height: 2; }
.single-post .entry-content p { margin-bottom: 1.4em; }
.single-post .entry-content img { max-width: 100%; height: auto; border-radius: 6px; }
/* 旧記事に残る table / 固定幅の指定を柔らかく */
.entry-content table { width: 100% !important; font-size: 0.95rem; }
.entry-content td, .entry-content th { padding: 0.6em 0.8em; border-color: var(--nt-sand); vertical-align: top; }
.entry-content [style*="width"] { max-width: 100%; }
/* 前後記事ナビ */
.ast-single-post-navigation-wrapper { margin-top: 2rem; }
.ast-single-post-navigation-wrapper .nav-links a { color: var(--nt-navy); }

/* カテゴリ一覧（子テーマ template-parts/content-blog.php と対） */
.archive .ast-archive-description, .blog .ast-archive-description { padding: 2.5rem 0 0.5rem; text-align: left; }
.archive .ast-archive-title, .blog .ast-archive-title { font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin-bottom: 0.2em; }
.archive .ast-archive-title::before { content: ""; display: inline-block; width: 0.5em; height: 0.5em; background: var(--nt-enji); border-radius: 2px; margin-right: 0.6em; vertical-align: middle; }
.archive .ast-row, .blog .ast-row, .search .ast-row { display: block; margin: 0; }
.archive .ast-row > *, .blog .ast-row > *, .search .ast-row > * { width: 100%; max-width: 100%; padding: 0; margin: 0 0 1rem; float: none; }
.ast-separate-container .ast-article-post, .ast-article-post { background: transparent; border: 0; padding: 0; margin-bottom: 1rem; box-shadow: none; }
.archive article.nt-post-card, .blog article.nt-post-card, .search article.nt-post-card { width: 100% !important; max-width: 100% !important; float: none; margin-left: 0 !important; margin-right: 0 !important; }
.archive .ast-grid-2 .nt-post-card, .archive .ast-grid-3 .nt-post-card, .archive .ast-grid-4 .nt-post-card { width: 100% !important; }
.nt-post-card { background: var(--nt-white); border: 1px solid var(--nt-sand); border-radius: var(--nt-radius); padding: 1.4rem 1.75rem 1.3rem; transition: box-shadow 0.2s, transform 0.2s; }
.nt-post-card:hover { box-shadow: var(--nt-shadow); transform: translateY(-1px); }
.nt-post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.78rem; color: var(--nt-muted); letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.nt-post-card__cat { color: var(--nt-enji); text-decoration: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.05em 0.7em; font-size: 0.72rem; }
.nt-post-card__pdf { color: var(--nt-navy); background: #eef0f5; border-radius: 4px; padding: 0.05em 0.5em; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; }
.nt-post-card__title { font-size: 1.12rem; line-height: 1.6; margin: 0 0 0.4rem; }
.nt-post-card__title a { color: var(--nt-ink); text-decoration: none; }
.nt-post-card__title a:hover { color: var(--nt-enji); }
.nt-post-card__excerpt { font-size: 0.92rem; color: #4a4a4a; line-height: 1.85; margin: 0 0 0.6rem; }
.nt-post-card__more { font-size: 0.82rem; color: var(--nt-enji); text-decoration: none; font-weight: 600; letter-spacing: 0.06em; }
.nt-post-card__more:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.ast-pagination { margin-top: 1.5rem; }
.ast-pagination .page-numbers { border-radius: 999px; }

/* ==========================================================================
   固定ページ共通
   ========================================================================== */
.page .ast-article-single { background: transparent; border: 0; padding: 0; }
.page .entry-header { display: none; } /* ヒーロー内でタイトルを出す */

/* 固定ページ：記事ラッパーの余白を外し、ヒーローを天地左右いっぱいに。本文側に同じ余白を付け直す */
.page .site-main article.page { padding: 0 !important; }
.page .entry-content > :not(.alignfull) { padding-left: 20px; padding-right: 20px; }

/* ヒーロー（カバー）共通 */
.nt-hero { border-radius: 0; overflow: hidden; }
.nt-hero.wp-block-cover { margin-top: 0 !important; }
.nt-hero .wp-block-cover__inner-container { max-width: 1200px; }
body .wp-block-cover.nt-hero p.nt-hero__eyebrow, .nt-hero .nt-hero__eyebrow { font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--nt-gold); margin-bottom: 0.6rem; }
body .wp-block-cover.nt-hero h1, body .wp-block-cover.nt-hero h2, .nt-hero h1, .nt-hero h2 { color: #fff; line-height: 1.35; margin: 0; text-shadow: 0 2px 20px rgba(0,0,0,0.25); }
body .wp-block-cover.nt-hero .wp-block-cover__inner-container p, .nt-hero p { color: rgba(255,255,255,0.95); font-size: clamp(0.95rem, 1.4vw, 1.1rem); line-height: 2; max-width: 46em; }

/* HOME：写真ヒーロー。文字は右下に寄せ、写真（台北101）を左に見せる */
.nt-hero--home { min-height: 72vh; }
.nt-hero--home h1 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); margin-bottom: 0.6rem; text-shadow: 0 2px 12px rgba(0,0,0,0.55), 0 0 40px rgba(0,0,0,0.35); }
.nt-hero--home .wp-block-cover__inner-container, .wp-block-cover.has-custom-content-position.has-custom-content-position.nt-hero--home .wp-block-cover__inner-container { text-align: left; width: 50%; max-width: none; margin: 0 0 0 50% !important; padding-right: 20px; }
.nt-hero--home .wp-block-cover__inner-container p { margin-left: 0; margin-right: auto; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.nt-hero--home .nt-hero__eyebrow { text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.nt-hero--home .wp-block-cover__inner-container > * { margin-left: 0 !important; padding-left: 0 !important; text-indent: 0; }

/* トップ：最新記事まわりの余白 */
.page .nt-home-latest { padding-top: clamp(3.5rem, 6vw, 5rem) !important; padding-bottom: clamp(3rem, 5vw, 4.5rem) !important; }
.nt-home-latest .nt-section__lead { margin-bottom: 2.5rem !important; }
.nt-latest .wp-block-post + .wp-block-post { margin-top: 1.1rem !important; }
.nt-home-latest .wp-block-buttons { margin-top: 2.5rem !important; }
@media (max-width: 767px) {
  .nt-hero--home { min-height: 64vh; }
  .nt-hero--home.wp-block-cover { padding: 1.5rem 20px 2rem; align-items: flex-end; }
  .wp-block-cover.has-custom-content-position.has-custom-content-position.nt-hero--home .wp-block-cover__inner-container { width: 100%; margin: 0 !important; padding-right: 0; }
}

/* 下層ページ：淡い空色→生成りの低い帯（さわやか系）。見出しは左揃え・墨紺 */
.nt-hero--band { min-height: 255px; border-bottom: 1px solid var(--nt-sand); }
.nt-hero--band.is-light h1, body .wp-block-cover.nt-hero--band h1 { color: var(--nt-navy); text-shadow: none; }
body .wp-block-cover.nt-hero--band p.nt-hero__eyebrow { color: var(--nt-enji); }
.nt-hero--band.wp-block-cover { padding: 1.6rem 20px; }
.nt-hero--band .wp-block-cover__inner-container { text-align: left !important; width: 100%; max-width: 1200px; margin-left: auto !important; margin-right: auto !important; }
.nt-hero--band h1, .nt-hero--band p { text-align: left !important; }
.nt-hero--band .wp-block-cover__inner-container > p, .nt-hero--band .wp-block-cover__inner-container > h1 { margin-left: 0 !important; margin-right: 0 !important; max-width: none; }
.wp-block-cover.has-custom-content-position.has-custom-content-position.nt-hero--band .wp-block-cover__inner-container { width: 100%; max-width: 1200px; margin: 0 auto; }
.nt-hero--band h1 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); text-shadow: none; }
.nt-hero--band .nt-hero__eyebrow { margin-bottom: 0.4rem; }
@media (max-width: 921px) { .nt-hero--band.wp-block-cover { min-height: 225px !important; } }
@media (max-width: 544px) { .nt-hero--band.wp-block-cover { min-height: 210px !important; padding: 1.4rem 20px; } }

/* 一覧・投稿ページのコンテンツ幅を固定ページ（1200px）に揃える */
.archive .site-content .ast-container > #primary, .blog .site-content .ast-container > #primary, .search .site-content .ast-container > #primary,
.single-post .site-content .ast-container > #primary { max-width: 100% !important; width: 100% !important; flex: 0 0 100% !important; }
.archive .site-content > .ast-container, .blog .site-content > .ast-container, .search .site-content > .ast-container, .single-post .site-content > .ast-container { max-width: 1240px !important; }

/* 本文の読みやすい幅 */
.nt-prose { max-width: 760px; margin-left: auto; margin-right: auto; line-height: 2; font-size: 1.02rem; }
.nt-prose h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin: 2.5em 0 1em; padding-left: 0.7em; border-left: 4px solid var(--nt-enji); line-height: 1.5; }
.nt-prose h3 { font-size: 1.15rem; margin: 2em 0 0.8em; color: var(--nt-navy); }
.nt-prose p { margin-bottom: 1.5em; }
.nt-prose ol, .nt-prose ul { padding-left: 1.6em; margin-bottom: 1.5em; }
.nt-prose li { margin-bottom: 0.5em; }
.nt-prose a { color: var(--nt-enji); text-decoration: underline; text-underline-offset: 0.2em; }

/* セクション */
.nt-section { padding: clamp(3rem, 7vw, 6rem) 0; }
.nt-section--paper { background: var(--nt-paper); }
.nt-section--white { background: var(--nt-white); }
.nt-section--navy { background: var(--nt-navy); color: #fff; }
.nt-section--navy h2, .nt-section--navy h3, .nt-section--navy p { color: #fff; }
.nt-section--navy .wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link, .nt-section--navy .is-style-outline .wp-block-button__link { color: #fff; border-color: rgba(255,255,255,0.85); background: transparent; }
.nt-section--navy .wp-block-buttons .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #fff; color: var(--nt-navy); }
.nt-section__title { text-align: center; font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin-bottom: 0.4em; }
.nt-section__lead { text-align: center; color: var(--nt-muted); font-size: 0.85rem; letter-spacing: 0.25em; text-transform: uppercase; margin-bottom: 2.5rem; }
.nt-section__title + .nt-section__lead { margin-top: -0.2rem; }

/* 会則：条文カード */
.nt-article { display: grid; grid-template-columns: 7.5em 1fr; gap: 0.5rem 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--nt-sand); }
.nt-article:last-child { border-bottom: 0; }
.nt-article__num { font-family: "Noto Serif JP", serif; color: var(--nt-enji); font-weight: 600; letter-spacing: 0.08em; }
.nt-article__head { font-weight: 600; color: var(--nt-navy); margin: 0 0 0.3rem; }
.nt-article__body p { margin: 0 0 0.6em; line-height: 1.9; }
@media (max-width: 600px) { .nt-article { grid-template-columns: 1fr; gap: 0.2rem; } }

/* 沿革：年表ライン */
.nt-history p { position: relative; padding-left: 1.6rem; }
.nt-history p::before { content: ""; position: absolute; left: 0; top: 0.95em; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--nt-gold); box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--nt-sand); }
.nt-history h2 { margin-top: 3em; }

/* カード（トップの導線・入会手続きの案内） */
.nt-card { background: var(--nt-white); border: 1px solid var(--nt-sand); border-radius: var(--nt-radius); padding: 1.75rem 1.75rem 1.5rem; height: 100%; box-shadow: 0 1px 0 rgba(0,0,0,0.02); transition: box-shadow 0.2s, transform 0.2s; }
.nt-card:hover { box-shadow: var(--nt-shadow); transform: translateY(-2px); }
.nt-card h3 { font-size: 1.15rem; margin: 0 0 0.6rem; }
.nt-card p { font-size: 0.95rem; color: #444; margin: 0 0 1rem; line-height: 1.9; }
.nt-card .wp-block-button__link { font-size: 0.9rem; }
.nt-card__kicker { display: inline-block; font-size: 0.72rem; letter-spacing: 0.25em; color: var(--nt-enji); margin-bottom: 0.6rem; text-transform: uppercase; }

/* 定義テーブル（入会手続き） */
.nt-dl { width: 100%; border-collapse: collapse; background: var(--nt-white); border-radius: var(--nt-radius); overflow: hidden; border: 1px solid var(--nt-sand); }
.nt-dl th, .nt-dl td { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--nt-sand); text-align: left; vertical-align: top; line-height: 1.9; }
.nt-dl th { width: 11em; background: #f3efe8; color: var(--nt-navy); font-weight: 600; white-space: normal; }
.nt-dl tr:last-child th, .nt-dl tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) { .nt-dl th, .nt-dl td { display: block; width: 100%; } .nt-dl th { padding-bottom: 0.4rem; } .nt-dl td { padding-top: 0.4rem; } }

/* ボタン */
.wp-block-button__link, .ast-button { border-radius: 999px; letter-spacing: 0.08em; padding: 0.8em 1.8em; }
.is-style-outline .wp-block-button__link { border-width: 1.5px; }

/* 最新記事（クエリーループ） */
.nt-latest .wp-block-post-template { padding: 0; margin: 0; }
.nt-latest .wp-block-post { background: var(--nt-white); border: 1px solid var(--nt-sand); border-radius: var(--nt-radius); padding: 1.4rem 1.6rem; transition: box-shadow 0.2s, transform 0.2s; }
.nt-latest .wp-block-post:hover { box-shadow: var(--nt-shadow); transform: translateY(-2px); }
.nt-latest .wp-block-post-date { font-size: 0.78rem; color: var(--nt-muted); letter-spacing: 0.08em; margin-bottom: 0.3rem; }
.nt-latest .wp-block-post-title { font-size: 1.05rem; line-height: 1.6; margin: 0 0 0.5rem; }
.nt-latest .wp-block-post-title a { color: var(--nt-ink); text-decoration: none; }
.nt-latest .wp-block-post-title a:hover { color: var(--nt-enji); }
.nt-latest .wp-block-post-excerpt { font-size: 0.9rem; color: #555; line-height: 1.8; }
.nt-latest .wp-block-post-excerpt__more-text { display: none; }
.nt-latest .wp-block-post-terms { font-size: 0.72rem; letter-spacing: 0.1em; }
.nt-latest .wp-block-post-terms a { color: var(--nt-enji); text-decoration: none; border: 1px solid currentColor; border-radius: 999px; padding: 0.1em 0.7em; }
.nt-latest .wp-block-post-terms .wp-block-post-terms__separator { display: none; }
/* 最新記事カード：カード全体をクリック可能に見せる（ホバーで反転） */
.nt-latest .wp-block-post { position: relative; cursor: pointer; }
.nt-latest .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.nt-latest .wp-block-post:hover { background: var(--nt-navy); border-color: var(--nt-navy); box-shadow: var(--nt-shadow); }
.nt-latest .wp-block-post:hover .wp-block-post-title a, .nt-latest .wp-block-post:hover .wp-block-post-excerpt, .nt-latest .wp-block-post:hover .wp-block-post-date, .nt-latest .wp-block-post:hover .wp-block-post-date a { color: #fff; }
.nt-latest .wp-block-post:hover .wp-block-post-terms a { color: #fff; border-color: rgba(255,255,255,0.7); position: relative; z-index: 1; }
.nt-latest .wp-block-post-title a:focus-visible::after { outline: 3px solid var(--nt-gold); }
/* 同じく投稿一覧カード */
.nt-post-card { position: relative; cursor: pointer; }
.nt-post-card__title a::after { content: ""; position: absolute; inset: 0; }
.nt-post-card:hover { background: var(--nt-navy); border-color: var(--nt-navy); }
.nt-post-card:hover .nt-post-card__title a, .nt-post-card:hover .nt-post-card__excerpt, .nt-post-card:hover .nt-post-card__date, .nt-post-card:hover .nt-post-card__more { color: #fff; }
.nt-post-card:hover .nt-post-card__cat { color: #fff; border-color: rgba(255,255,255,0.7); position: relative; z-index: 1; }
.nt-post-card:hover .nt-post-card__pdf { background: rgba(255,255,255,0.15); color: #fff; }
/* トップの入口カード：4枚 */
@media (max-width: 921px) { .nt-home-cards.wp-block-columns { flex-wrap: wrap !important; } .nt-home-cards .wp-block-column { flex-basis: calc(50% - 0.5em) !important; } }

/* フッター */
.site-footer { border-top: 1px solid var(--nt-sand); }
.ast-footer-copyright { font-size: 0.8rem; letter-spacing: 0.05em; }

/* フォーム（CF7） */
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea, .wpcf7 select { width: 100%; border: 1px solid var(--nt-sand); border-radius: 8px; padding: 0.8em 1em; background: #fff; }
.wpcf7 input[type="submit"] { background: var(--nt-enji); color: #fff; border: 0; border-radius: 999px; padding: 0.9em 2.4em; letter-spacing: 0.1em; cursor: pointer; }
.wpcf7 input[type="submit"]:hover { background: var(--nt-enji-dark); }
.wpcf7 label { font-weight: 600; color: var(--nt-navy); }
.wpcf7 p { margin-bottom: 1.2em; }

/* ユーティリティ */
.nt-note { font-size: 0.85rem; color: var(--nt-muted); }
.nt-divider { width: 48px; height: 3px; background: var(--nt-gold); margin: 0 auto 2.5rem; border-radius: 2px; }

/* 旧投稿の空白連打による右寄せ・字下げ（スマホではみ出さない幅に制限） */
.nt-gap { display: inline-block; width: min(14em, 35%); }
.single-post .entry-content { overflow-wrap: anywhere; }

/* スマホ：投稿ページの上部に余白 */
@media (max-width: 921px) { .single-post .site-content > .ast-container { padding-top: 1.5rem; } }
