/*
Theme Name: 9raphic
Theme URI: https://9raphic.jp/
Author: 9raphic合同会社
Description: 9raphic合同会社のためのブロックテーマ。雑誌の誌面のような落ち着いた紺と金の配色、明朝体の見出しで、編集・執筆・撮影の仕事を伝えます。
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: g9
*/

/* ---------- 基本 ---------- */
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.wp-site-blocks { padding: 0; }
main.g-main { margin-block-start: 0 !important; }
.g-main .entry-content > *:first-child,
.g-main .wp-block-post-content > *:first-child { margin-block-start: 0; }
.g-main .wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }

/* ---------- セクション(帯) ---------- */
.g-band { padding: 104px 32px; box-sizing: border-box; }
.g-band.g-tight-bottom { padding-bottom: 24px; }
.g-band.g-tight-top { padding-top: 24px; }
.g-sand { background: #F2EFE7; }
.g-navy { background: #1F3B57; color: #FFFFFF; }
.g-navy :where(h1, h2, h3, h4) { color: #FFFFFF; }
.g-navy .g-eyebrow { color: #D9B970; }
.g-navy .g-lead, .g-navy .g-text { color: #DCE3EA; }
.g-navy a:not(.wp-block-button__link) { color: #D9B970; }
.g-band > * + * { margin-block-start: 48px; }
.g-band > .g-head + * { margin-block-start: 48px; }

/* 見出しまわり */
.g-head > * { margin: 0; }
.g-head > * + * { margin-block-start: 12px; }
.g-head.g-center { text-align: center; }
.g-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; color: #85631F; margin: 0; }
.g-lead { font-size: 17px; color: #3C414A; max-width: 720px; }
.g-center .g-lead { margin-inline: auto; }
.g-text { color: #3C414A; }
.g-small { font-size: 14px; }
.g-muted { color: #5A5F68; font-size: 13px; }
.g-tagline { font-family: 'Shippori Mincho', serif; font-weight: 500; font-size: 20px; line-height: 1.8; }
.g-statement { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 22px; line-height: 1.7; text-align: center; }
.g-breadcrumb { font-size: 13px; color: #5A5F68; }
.g-breadcrumb a { color: #5A5F68; }

/* ヒーロー */
.g-hero { align-items: center; gap: 56px !important; }
.g-hero .wp-block-column > * { margin-block: 0; }
.g-hero .wp-block-column > * + * { margin-block-start: 24px; }
.g-hero h1 { line-height: 1.45; letter-spacing: 0.04em; }
.g-trust { display: flex; flex-wrap: wrap; gap: 6px 24px; padding-top: 20px; border-top: 1px solid #E4E0D6; font-size: 13px; color: #5A5F68; }
.g-trust p { margin: 0 !important; }

/* 写真(未設定のときは仮の枠を表示) */
.g-photo { margin: 0; background: #EFEBE2; min-height: 200px; position: relative; }
.g-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-photo img:not([src]), .g-photo img[src=""] { display: none; }
.g-photo:has(img:not([src])), .g-photo:has(img[src=""]) { border: 1px dashed #B9B2A2; min-height: 360px; }
.g-photo:has(img:not([src]))::after, .g-photo:has(img[src=""])::after {
	content: "写真を設定してください"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #5A5F68; font-size: 14px;
}
.g-photo.g-tall { min-height: 480px; }
.g-photo.g-tall img { min-height: 480px; }

/* グリッドとカード */
.g-grid { gap: 20px; }
.g-grid.g-gap-wide { gap: 48px; }
.g-card { background: #FFFFFF; border: 1px solid #E4E0D6; padding: 32px 28px; box-sizing: border-box; color: #1E2229; }
.g-card > * { margin-block: 0; }
.g-card > * + * { margin-block-start: 14px; }
.g-card h3 { font-size: 21px; }
.g-card.g-top { border: 0; border-top: 3px solid #1F3B57; }
.g-card.g-featured { border: 2px solid #1F3B57; }
.g-navy .g-card { color: #1E2229; }
.g-navy .g-card :where(h3, h4) { color: #1E2229; }
.g-navy .g-card .g-text, .g-navy .g-card p { color: #3C414A; }
.g-navy .g-card .g-eyebrow, .g-navy .g-card .g-label { color: #85631F; }
.g-card .g-price { padding-top: 16px; border-top: 1px solid #E4E0D6; margin-top: auto; }
.g-card.g-flex { display: flex; flex-direction: column; }
.g-card.g-flex > * + * { margin-top: 14px; }
.g-label { font-size: 12px; font-weight: 700; color: #85631F; letter-spacing: 0.04em; }
.g-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 12px; background: #F2EFE7; color: #3C414A; }
.g-plain > * { margin-block: 0; }
.g-plain > * + * { margin-block-start: 14px; }
.g-num { font-family: 'Shippori Mincho', serif; font-size: 48px; line-height: 1; color: #85631F; }
.g-navy .g-num { color: #D9B970; }
.g-price { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 18px; }
.g-price-big { font-family: 'Shippori Mincho', serif; font-weight: 700; font-size: 40px; line-height: 1.3; }
.g-price-big small, .g-price small { font-size: 0.5em; font-weight: 500; }
.g-def p { margin: 0; font-size: 14px; color: #3C414A; }
.g-def p strong { display: block; color: #1E2229; }
.g-def > p + p { margin-block-start: 12px; }
.g-def.g-rows p strong { display: inline-block; width: 6em; }
.g-def.g-rows { border-top: 1px solid #E4E0D6; padding-top: 16px; }
.g-def.g-rows > p + p { margin-block-start: 8px; }

/* チェック付きリスト */
.g-check { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.g-check li { background: #FFFFFF url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%231F3B57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") no-repeat 24px 26px; border: 1px solid #E4E0D6; padding: 22px 24px 22px 60px; }
.g-check.g-compact { display: block; }
.g-check.g-compact li { background-color: transparent; border: 0; padding: 4px 0 4px 32px; background-position: 0 9px; background-size: 18px; }

/* 課題カード */
.g-issues { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.g-issues li { background: #FFFFFF; border-top: 3px solid #1F3B57; padding: 32px 28px; font-weight: 700; font-size: 17px; line-height: 1.7; }

/* 進め方(ステップ) */
.g-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; counter-reset: g-step; }
.g-steps li { counter-increment: g-step; border-top: 2px solid #1F3B57; padding-top: 20px; font-size: 14px; color: #3C414A; }
.g-steps li::before { content: "STEP " counter(g-step); display: block; font-family: 'Shippori Mincho', serif; font-size: 15px; font-weight: 700; color: #85631F; margin-bottom: 6px; }
.g-steps.g-numeric li::before { content: counter(g-step, decimal-leading-zero); }
.g-steps li strong { display: block; font-size: 17px; color: #1E2229; margin-bottom: 6px; }

/* よくある質問 */
.g-faq-list { border-top: 1px solid #E4E0D6; max-width: 880px; margin-inline: auto; }
.g-faq { border-bottom: 1px solid #E4E0D6; padding: 22px 0; }
.g-faq summary { font-weight: 700; cursor: pointer; list-style-position: outside; }
.g-faq summary::before { content: "Q. "; color: #85631F; }
.g-faq > p { margin: 10px 0 0; color: #3C414A; }
.g-faq > p::before { content: "A. "; font-weight: 700; color: #1F3B57; }

/* 引用(代表の言葉) */
.g-quote { background: #FFFFFF; border: 0; padding: 24px 28px; margin: 0; font-family: 'Shippori Mincho', serif; font-size: 19px; line-height: 1.8; font-weight: 500; }
.g-quote p { margin: 0; }

/* 人生特集号の枠 */
.g-feature-box { border: 1px solid #D8D1C2; background: #FFFFFF; gap: 0 !important; }
.g-feature-box > .wp-block-column:last-child { padding: 48px 44px; }
.g-feature-box > .wp-block-column:last-child > * { margin-block: 0; }
.g-feature-box > .wp-block-column:last-child > * + * { margin-block-start: 18px; }
.g-feature-box .g-photo { height: 100%; min-height: 360px; border: 0; }

/* 掲載実績 */
.g-media-card { background: #FFFFFF; padding: 24px; }
.g-media-card > * { margin: 0; }
.g-media-card > * + * { margin-top: 6px; }
.g-media-card .g-title { font-weight: 700; line-height: 1.6; }

/* note */
.g-note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.g-note-card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: #1E2229 !important; }
.g-note-card .g-note-thumb { aspect-ratio: 16 / 10; background: #EFEBE2; overflow: hidden; }
.g-note-card .g-note-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-note-card .g-note-date { font-size: 12px; color: #5A5F68; }
.g-note-card .g-note-title { font-weight: 700; line-height: 1.6; }
.g-note-card:hover .g-note-title { text-decoration: underline; }
.g-note-empty { padding: 24px; border: 1px dashed #B9B2A2; color: #5A5F68; font-size: 14px; }

/* ボタン */
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: #1F3B57; border: 1px solid #1F3B57; padding: 16px 31px; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #1F3B57; color: #FFFFFF; }
.g-navy .wp-block-button:not(.is-style-outline) > .wp-block-button__link { background: #FFFFFF; color: #1F3B57; }
.g-navy .wp-block-button.is-style-outline > .wp-block-button__link { color: #FFFFFF; border-color: #FFFFFF; }
.g-navy .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: #FFFFFF; color: #1F3B57; }
.g-link-arrow a { font-weight: 700; }

/* ヘッダー */
.g-header { border-bottom: 1px solid #E4E0D6; background: #FBFAF7; padding: 18px 32px; position: relative; z-index: 10; }
.g-header-inner { max-width: 1200px; margin-inline: auto; gap: 16px 32px; }
.g-logo { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.g-logo a { font-family: 'Shippori Mincho', serif; font-size: 28px; font-weight: 700; letter-spacing: 0.04em; color: #1E2229; text-decoration: none; }
.g-logo span { font-size: 12px; color: #5A5F68; }
.g-nav { font-size: 14px; font-weight: 500; gap: 8px 26px; }
.g-nav a { color: #1E2229; text-decoration: none; }
.g-nav a:hover { color: #85631F; }
.g-nav .g-nav-cta > a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px !important; background: #1F3B57; color: #FFFFFF !important; border-radius: 2px; }
.g-nav .g-nav-cta > a:hover { background: #15283B; }

/* フッター */
.g-footer { background: #15283B; color: #DCE3EA; font-size: 13px; padding: 48px 32px; }
.g-footer-inner { max-width: 1200px; margin-inline: auto; gap: 24px; }
.g-footer a { color: #DCE3EA; }
.g-footer .g-footer-name { font-family: 'Shippori Mincho', serif; font-size: 22px; font-weight: 700; color: #FFFFFF; margin: 0; }
.g-footer p { margin: 0; }
.g-footer-links { gap: 8px 24px; }
.g-footer-copy { max-width: 1200px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 12px; color: #A9B4C0; }

/* 通常ページ・ブログ */
.g-page { padding: 72px 32px 104px; }
.g-page .wp-block-post-title { margin-bottom: 40px; }
.g-post-list .wp-block-post { border-bottom: 1px solid #E4E0D6; padding: 24px 0; margin: 0; }
.g-post-list .wp-block-post-title { font-size: 20px; margin: 4px 0 0; }
.g-post-list .wp-block-post-title a { color: #1E2229; text-decoration: none; }
.g-post-list .wp-block-post-date { font-size: 13px; color: #5A5F68; }

/* お問い合わせフォーム(Contact Form 7) */
.wpcf7 { max-width: 760px; margin-inline: auto; }
.wpcf7 label { display: block; font-weight: 700; font-size: 15px; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"], .wpcf7 textarea, .wpcf7 select {
	width: 100%; box-sizing: border-box; margin-top: 6px; padding: 12px 14px; font: inherit; font-weight: 400; border: 1px solid #C9C4B8; border-radius: 2px; background: #FFFFFF;
}
.wpcf7 input:focus, .wpcf7 textarea:focus { outline: 2px solid #1F3B57; outline-offset: 1px; }
.wpcf7 .wpcf7-list-item { display: block; margin: 6px 0 0; font-weight: 400; }
.wpcf7 input[type="submit"] { background: #1F3B57; color: #FFFFFF; border: 0; border-radius: 2px; padding: 17px 48px; font: inherit; font-weight: 700; cursor: pointer; min-height: 56px; }
.wpcf7 input[type="submit"]:hover { background: #15283B; }
.g-form-note { font-size: 13px; color: #5A5F68; }
.g-req { display: inline-block; margin-left: 6px; padding: 0 6px; font-size: 11px; color: #FFFFFF; background: #8A3B2E; border-radius: 2px; vertical-align: 2px; }

/* スマートフォン */
@media (max-width: 781px) {
	.g-band { padding: 72px 20px; }
	.g-band.g-tight-bottom { padding-bottom: 16px; }
	.g-header, .g-footer { padding-inline: 20px; }
	.g-page { padding: 48px 20px 72px; }
	.g-hero { gap: 32px !important; }
	.g-feature-box > .wp-block-column:last-child { padding: 32px 24px; }
	.g-photo.g-tall, .g-photo.g-tall img { min-height: 280px; }
	.g-price-big { font-size: 34px; }
}

/* 追加 */
.g-navy .g-muted { color: #DCE3EA; }
.g-card.g-sand-card { background: #F2EFE7; border: 0; }
.g-card.g-sand-card > * + * { margin-block-start: 6px; }
.g-card h3 small { font-size: 0.75em; font-weight: 500; }
.has-text-align-center { text-align: center; }
.g-page-hero > * { margin-block: 0; }
.g-page-hero > * + * { margin-block-start: 22px; }
.g-col-side { flex-basis: 34% !important; flex-grow: 0 !important; }

/* 写真の枠(画像を未設定のときも枠を確保する) */
.g-photo-col { position: relative; min-height: 360px; }
.g-photo-col.g-tall-col { min-height: 480px; }
.g-photo-col:not(:has(img[src]:not([src=""]))) { background: #EFEBE2; border: 1px dashed #B9B2A2; box-sizing: border-box; }
.g-photo-col:not(:has(img[src]:not([src=""])))::after {
	content: "写真を設定してください"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #5A5F68; font-size: 14px;
}
.g-photo-col .g-photo { height: 100%; }
@media (min-width: 782px) {
	.g-hero > .wp-block-column.g-photo-col { flex: 0 0 40% !important; }
	.g-hero > .wp-block-column:not(.g-photo-col) { flex: 1 1 0 !important; }
	.g-feature-box > .g-photo-col { flex: 0 0 38% !important; }
}
.g-hero h1 { font-size: clamp(32px, 3.4vw, 50px); }
.g-band.g-band > * + * { margin-block-start: 48px; }
.g-band.g-band > .g-breadcrumb + *, .g-page-hero.g-page-hero > * + * { margin-block-start: 22px; }
.g-page-hero > .g-lead { max-width: 1136px; }
.g-feature-box > .g-photo-col { border: 0 !important; }
.g-note-empty { box-sizing: border-box; }
.g-footer .g-footer-copy { margin: 32px auto 0; }
h1, h2, h3, .g-statement, .g-tagline { word-break: auto-phrase; }
@media (max-width: 781px) {
	.g-photo-col, .g-photo-col.g-tall-col { min-height: 260px; }
	.g-feature-box > .g-photo-col { flex-basis: 100%; }
}
.wpcf7 fieldset { border: 0; padding: 0; margin: 0 0 4px; min-width: 0; }
.wpcf7 legend { padding: 0; font-weight: 700; font-size: 15px; margin-bottom: 2px; }
