/* =============================================================
 * INNOVACTORY Block Theme - components.css
 *
 * クラシック版とほぼ同一。
 * ブロックテーマ追加: wp:group セクションのパディング・wp:post-content 内スタイル
 * ============================================================= */

/* =============================================================
 * 共通セクション
 *
 * 元サイトに倣い、セクション間に「呼吸」のある余白(--sp-2xl)を確保。
 * 各セクションは英字ラベル(主役) + 日本語サブ見出し(脇役) の2段構成。
 * ============================================================= */
.section {
    padding-block: var(--sp-2xl);
    padding-inline: var(--container-padding-inline);
}
/* wp:group ブロックとして使われる場合の余白リセット */
.section.wp-block-group { margin: 0; }

.section-bg-light { background: var(--color-bg-light); }
.section-bg-dark  { background: var(--color-dark); color: var(--color-white); }

/* 英字ラベル: 元サイトの SERVICE / COMPANY / NEWS のような大きな英字主役。
 * 28px / weight 600 / line-height 1.2 で「見出しそのもの」として機能させる。 */
.section-label {
    display: block;
    font-size: var(--font-size-en-label);
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: var(--line-height-tight);
    color: var(--color-primary);
    margin-bottom: 4px;
}
.section-bg-dark .section-label { color: rgba(255,255,255,0.85); }
/* ピンクアクセント版（元サイト SERVICE / WORK の英字ラベル色） */
.section-label--pink { color: var(--color-accent-pink); }
/* グレー版（元サイト CAREERS の英字ラベル色） */
.section-label--muted { color: var(--color-text-muted); }

/* 日本語サブ見出し: 英字ラベルの下に置く小さな日本語タイトル。
 * 元サイト構成: 32px英字 + 16px日本語。後者に相当する役割。 */
.section-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.04em;
    margin-bottom: var(--sp-md);
    line-height: var(--line-height-tight);
}
.section-bg-dark .section-title { color: rgba(255,255,255,0.9); }

.section-body {
    font-size: var(--font-size-sm);
    line-height: var(--line-height);
    color: var(--color-text);
    max-width: 640px;
}
.section-bg-dark .section-body { color: rgba(255,255,255,0.95); }

/* ボタン類
 * CTA (.btn-more, .arrow-btn) は基本的に本文(.top-message / .top-subtext /
 * .section-body 等)の直後に置かれる。inline-flex で表示されるが、
 * 直前のテキストに近接しすぎないよう自身に上マージンを持つ。 */
.btn-more {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--color-primary);
    font-size: var(--font-size-sm); font-weight: 600;
    letter-spacing: 0.05em;
    margin-top: var(--sp-lg);
    text-decoration: none;
    transition: gap var(--transition);
}
.btn-more::after { content: '→'; }
.btn-more:hover { gap: 12px; }

.btn-primary {
    display: inline-block;
    background: var(--color-primary); color: var(--color-white);
    font-size: var(--font-size-sm); font-weight: 600;
    letter-spacing: 0.08em;
    padding: 13px 36px;
    border-radius: 4px;
    text-decoration: none;
    border: none; cursor: pointer;
    transition: background var(--transition);
}
.btn-primary:hover { background: var(--color-primary-dark); color: var(--color-white); }

.btn-outline {
    display: inline-block;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-size: var(--font-size-sm); font-weight: 600;
    letter-spacing: 0.06em;
    padding: 11px 28px;
    border-radius: 24px;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.btn-outline:hover {
    background: var(--color-primary); color: var(--color-white);
}

/* 丸矢印ボタン: 本文(.top-subtext / .top-message)直後に置かれる CTA。
 * div でラップされているだけで余白指定がないため、ボタン自身に上マージンを持つ。 */
.arrow-btn {
    display: inline-flex; align-items: center; gap: 15px;
    margin-top: var(--sp-lg);
    text-decoration: none;
    color: inherit;
}
/* 画像グリッド (.top-service-grid, .top-careers-grid) 内では
 * グリッドの gap が余白を担保するためボタン自身のマージンは不要。 */
.top-service-grid .arrow-btn,
.top-careers-grid .arrow-btn { margin-top: var(--sp-md); }
.arrow-btn-circle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px;
    border: 1px solid var(--color-dark);
    border-radius: 50%;
    background: var(--color-white);
    transition: transform 0.3s;
    flex-shrink: 0;
}
.arrow-btn-circle::after { content: '→'; font-size: 16px; color: var(--color-dark); }
.arrow-btn:hover .arrow-btn-circle { transform: scale(1.3); }
.arrow-btn-text { font-size: 16px; font-weight: 500; color: var(--color-text); }

/* =============================================================
 * TOPページ: セクション別スタイル
 * ============================================================= */
.top-head { font-size: 32px; font-weight: 600; line-height: 1.7; }
.top-head--service { color: #D9AED0; }
.top-head--company { color: var(--color-primary); }
.top-head--careers { color: var(--color-text-muted); }
.top-head--record  { color: var(--color-white); }

.top-subhead { font-size: 16px; font-weight: 600; color: var(--color-text); margin-top: 8px; }

.top-message { font-size: 32px; font-weight: 600; line-height: 1.7; color: var(--color-text); margin-top: 16px; }
.top-subtext  { font-size: 14px; font-weight: 400; line-height: 1.7; color: var(--color-text); margin-top: 40px; }
/* CAREERS セクション内のリードは元サイト準拠で 24px に控えめ。
 * 画像と並ぶ 2 カラムレイアウトのため、デフォルト 32px だと右カラム本文と高さが噛み合わない。 */
.top-careers-grid .top-message { font-size: 24px; }

/* ダーク背景セクション内では本文系を白系で統一（暗色テキストが暗背景に埋もれるのを防ぐ） */
.section-bg-dark .top-subhead,
.section-bg-dark .top-message,
.section-bg-dark .top-subtext { color: var(--color-white); }
.section-bg-dark .top-subhead { color: rgba(255,255,255,0.85); }
.section-bg-dark .result-card-title { color: var(--color-white); }
.section-bg-dark .result-card-desc  { color: rgba(255,255,255,0.92); }
.section-bg-dark .btn-more          { color: var(--color-white); }

.arrow-btn-circle--pink { background: #D9AED0; border-color: #D9AED0; }
.arrow-btn-circle--pink::after { color: var(--color-white); }
.arrow-btn-circle--blue { background: var(--color-primary); border-color: var(--color-primary); }
.arrow-btn-circle--blue::after { color: var(--color-white); }

.top-service-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
    /* 中央揃え(center)だと画像が縦長のとき左カラム下に大きな空白が生まれるため、
     * 上端揃え(start)で「ヘッダー → 本文 → CTA」が自然に上から並ぶ構成にする。 */
    align-items: start;
    margin-top: var(--sp-md);
}
.top-service-img {
    aspect-ratio: 4/3;
    border-radius: 8px; overflow: hidden;
    background: var(--color-bg-light);
}
.top-service-img img { width: 100%; height: 100%; object-fit: cover; }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--sp-md);
    margin-top: var(--sp-md);
}
/* TOP COMPANY セクション末尾の画像ラッパー。CTA(矢印ボタン)とのあいだに
 * --sp-md の余白を確保。以前は post_content に inline style を持っていたが
 * 設計と内容の分離のためクラス化した。 */
.top-company-img-area { margin-top: var(--sp-md); }
/* TOP TRACK RECORD 末尾の補足テキスト + 「事業支援のご依頼…」CTA ラッパー。
 * .results-grid との間に --sp-md の余白を確保。同様の理由でクラス化。 */
.top-record-cta-area { margin-top: var(--sp-md); }
.result-card { border-radius: 6px; overflow: hidden; background: rgba(255,255,255,0.08); }
.result-card-img { aspect-ratio: 16/10; background: rgba(255,255,255,0.05); overflow: hidden; }
.result-card-img img { width: 100%; height: 100%; object-fit: cover; }
.result-card-body { padding: var(--sp-sm); }
.result-card-title { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-white); margin-bottom: 6px; line-height: 1.4; }
.result-card-desc  { font-size: var(--font-size-xs); color: rgba(255,255,255,0.85); line-height: 1.6; }

.top-careers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-xl);
    align-items: start;
    margin-top: var(--sp-md);
}
.top-careers-img { aspect-ratio: 4/3; border-radius: 8px; overflow: hidden; background: var(--color-bg-light); }
.top-careers-img img { width: 100%; height: 100%; object-fit: cover; }

.top-news-head-area { display: flex; justify-content: space-between; align-items: flex-end; }
.top-news-head { font-size: 32px; font-weight: 600; color: var(--color-dark); }
.top-news-more {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: var(--font-size-sm); font-weight: 500; color: var(--color-dark);
}
.top-news-more::before { content: '→'; font-size: 16px; }
.top-news-more:hover { opacity: 0.7; }
.top-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--sp-md);
    margin-top: 33px;
}

/* 認証・パートナーセクション */
.top-trust-head-area { text-align: center; margin-bottom: var(--sp-md); }
.top-trust-head { font-size: 28px; font-weight: 600; color: var(--color-dark); }
.top-trust-subhead { font-size: var(--font-size-sm); color: var(--color-text-muted); letter-spacing: 0.12em; margin-top: 4px; }
.top-trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--sp-md);
    margin-top: var(--sp-md);
    align-items: stretch;
    justify-items: center;
}
.top-trust-item {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    gap: 12px; width: 100%; max-width: 220px; min-height: 200px; padding: 20px 16px;
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: 8px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.top-trust-item:hover { transform: translateY(-2px); border-color: var(--color-primary); box-shadow: 0 6px 20px rgba(0,80,155,0.08); }
.top-trust-item .top-trust-logo { width: 140px; height: 72px; display: flex; align-items: center; justify-content: center; }
.top-trust-item .top-trust-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.top-trust-item .top-trust-logo--isms img { max-height: 70px; }
.top-trust-item .top-trust-logo--aws  img { max-height: 44px; }
.top-trust-item .top-trust-logo--azure img { max-height: 36px; }
.top-trust-item .top-trust-logo--gcp  img { max-height: 28px; }
.top-trust-placeholder {
    width: 140px; height: 72px; border-radius: 6px;
    background: linear-gradient(135deg, rgba(0,80,155,0.06) 0%, rgba(0,80,155,0.02) 100%);
    border: 1px dashed rgba(0,80,155,0.25); position: relative;
}
.top-trust-placeholder::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%); width: 28px; height: 28px;
    border-radius: 50%; background: rgba(0,80,155,0.1); border: 2px solid rgba(0,80,155,0.2);
}
.top-trust-label { font-size: var(--font-size-xs); font-weight: 600; color: var(--color-text); text-align: center; letter-spacing: 0.02em; }
.top-trust-name  { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text); text-align: center; letter-spacing: 0.02em; }
.top-trust-role  { font-size: var(--font-size-xs); color: var(--color-text-muted); text-align: center; line-height: 1.4; margin-top: -6px; }

/* -------------------------------------------------------------
 * ボトムボタン（ABOUT US / CONTACT）
 * ------------------------------------------------------------- */
.bottom-btn { margin-top: 120px; }
.bottom-btn-area { display: flex; }
.bottom-btn-left,
.bottom-btn-right {
    width: 50%; height: 325px; text-align: center; position: relative;
    overflow: hidden; text-decoration: none; display: flex;
    align-items: center; justify-content: center; background: var(--color-bg-light);
}
.bottom-btn-right { background: var(--color-white); box-shadow: inset 1px 0 0 var(--color-border); }
.bottom-btn-text-area { position: relative; z-index: 3; color: var(--color-dark); }
.bottom-btn-head {
    font-size: 26px; font-weight: 700; line-height: 1.2;
    letter-spacing: 0.08em; padding-bottom: 24px; position: relative;
}
.bottom-btn-head::after {
    content: ""; position: absolute; background: var(--color-dark);
    height: 1px; width: 96px; bottom: 0; left: 50%; transform: translateX(-50%);
}
.bottom-btn-subhead { font-size: 16px; font-weight: 600; line-height: 24px; margin-top: 24px; }
.bg-slide::before {
    content: ""; position: absolute; top: 0; left: 0; z-index: 2;
    background: #D9D9D9; width: 100%; height: 100%;
    transform-origin: right top; transform: scale(0, 1);
    transition: transform 0.6s cubic-bezier(0.8, 0, 0.2, 1);
}
.bg-slide:hover::before { transform-origin: left top; transform: scale(1, 1); }
.bg-slide:hover .bottom-btn-text-area { color: var(--color-white); }
.bg-slide:hover .bottom-btn-head::after { background: var(--color-white); }

/* =============================================================
 * SERVICE ページ末尾 CTA・ロゴセクション
 * ============================================================= */
.entry-content .service-note { margin-top: 60px; text-align: center; font-size: 14px; font-weight: 400; line-height: 24px; }
.entry-content .btn-cta-wrap { text-align: center; margin-top: 32px; }
.entry-content .btn-cta {
    display: inline-block; width: 333px; max-width: 100%; padding: 16px 0;
    color: var(--color-white); background: var(--color-primary); border-radius: 8px;
    font-size: 14px; font-weight: 500; text-align: center; text-decoration: none;
    transition: background-color 450ms;
}
.entry-content .btn-cta:hover { background-color: rgba(0,96,176,0.3); color: var(--color-white); }
.entry-content .btn-cta span { position: relative; padding-right: 56px; }
.entry-content .btn-cta span::after {
    content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'><path d='M5 12h14M13 6l6 6-6 6'/></svg>") no-repeat center / contain;
}
.entry-content .clients-services {
    display: flex; justify-content: center; gap: 80px;
    margin: 96px auto 0; max-width: 760px; font-size: 14px; line-height: 1.85;
}
.entry-content .clients-services > div { flex: 0 0 auto; }
.entry-content .clients-services p { margin: 0; padding: 2px 0; color: var(--color-text); }
.entry-content .clients-logos {
    display: grid; grid-template-columns: repeat(5, 1fr);
    align-items: center; justify-items: center;
    column-gap: 32px; row-gap: 36px;
    margin: 80px auto 0; max-width: 760px; padding: 0 16px;
}
.entry-content .clients-logos-secondary {
    display: grid; grid-template-columns: repeat(9, 1fr);
    align-items: center; justify-items: center;
    column-gap: 24px; row-gap: 28px;
    margin: 48px auto 0; max-width: 760px; padding: 0 16px;
}
/* ロゴ画像サイズの統制: 元サイトに合わせて primary は ~44px、
 * 言語ロゴ secondary は ~36px に揃える。 */
.entry-content .clients-logos .clients-logo-item img { max-height: 44px; width: auto; }
.entry-content .clients-logos-secondary .clients-logo-item img { max-height: 36px; width: auto; }
.entry-content .clients-logo-item { display: flex; align-items: center; justify-content: center; }
.entry-content .clients-logo-item img { max-width: 100%; height: auto; }

@media (max-width: 767px) {
    .entry-content .clients-services { flex-direction: column; gap: 24px; margin-top: 65px; }
    .entry-content .clients-logos { grid-template-columns: repeat(3, 1fr); margin-top: 63px; row-gap: 20px; }
    .entry-content .clients-logos-secondary { grid-template-columns: repeat(3, 1fr); margin-top: 40px; row-gap: 20px; }
}

/* =============================================================
 * プレースホルダー画像スタイル
 * ============================================================= */
.img-placeholder {
    background: linear-gradient(135deg, #e8edf5 0%, #d0dae8 100%);
    display: flex; align-items: center; justify-content: center;
    color: var(--color-text-muted); font-size: var(--font-size-xs); letter-spacing: 0.1em;
}

/* =============================================================
 * entry-content: ブロックエディタのコンテンツスタイル
 *
 * 内部ページ(page-about/company/service/careers/contact 等)では
 * 本文を 900px 中央寄せにしたい。ところがホームページでは
 * wp:post-content が自動で `.entry-content.wp-block-post-content` の
 * ラッパーを出力するため、ヒーロー(.top-hero)と各 .section が
 * 900px 内に押し込められて画面右に大きな余白が出てしまう。
 *
 * 対策: ホームページ(body.home) のときだけ max-width 制限を解除する。
 * ============================================================= */
.entry-content {
    max-width: var(--content-max-width);
    margin-inline: auto;
    line-height: var(--line-height);
}
.entry-content.wp-block-group { margin: 0; padding: 0; }
.entry-content > * + * { margin-top: var(--sp-md); }

/* wp:post-content 直下の標準ブロックスタイル */
.entry-content .wp-block-post-content > * + * { margin-top: var(--sp-md); }

/* ホームページ: ヒーロー / セクションを full-width にする */
.home .site-main > .entry-content,
.home .site-main > .wp-block-post-content {
    max-width: none;
    margin-inline: 0;
    line-height: var(--line-height);
}
.home .site-main > .entry-content > * + *,
.home .site-main > .wp-block-post-content > * + * { margin-top: 0; }

.entry-content h2 {
    font-size: var(--font-size-xl); font-weight: 700; color: var(--color-text);
    letter-spacing: -0.01em; line-height: var(--line-height-tight);
    margin-top: var(--sp-lg); padding-bottom: var(--sp-xs);
    border-bottom: 2px solid var(--color-primary);
}
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 { font-size: var(--font-size-lg); font-weight: 600; color: var(--color-text); margin-top: var(--sp-md); }
.entry-content p { color: var(--color-text); }
.entry-content a { color: var(--color-primary); }
.entry-content a:hover { color: var(--color-primary-dark); }
.entry-content ul,
.entry-content ol { padding-left: 1.5em; list-style: revert; }
.entry-content li + li { margin-top: 0.5em; }
/* テーブル: 全周を本文色(--color-text)の枠線で囲み、内部の罫線も同色で統一。
 * WordPress core(wp-block-table) のデフォルト枠と二重線にならないよう、
 * figure と table 両方を制御する。 */
.entry-content .wp-block-table,
.entry-content figure.wp-block-table {
    margin-top: var(--sp-md);
    border: none;
    max-width: 700px;
}
.entry-content table {
    width: 100%; max-width: 700px;
    border-collapse: collapse;
    border: 1px solid var(--color-text);
    font-size: var(--font-size-sm);
    margin: 0;
}
.entry-content table th,
.entry-content table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--color-text);
    vertical-align: top;
}
/* 最終行は外枠と被るので下罫線を消す（二重線回避） */
.entry-content table tr:last-child th,
.entry-content table tr:last-child td { border-bottom: none; }
.entry-content table th {
    width: 180px; font-weight: 600;
    background: var(--color-bg-light);
    color: var(--color-text);
    white-space: nowrap;
    border-right: 1px solid var(--color-text);
}

/* =============================================================
 * NEWS カードスタイル
 * ============================================================= */
.news-card { display: block; text-decoration: none; color: inherit; }
.news-card-thumb { aspect-ratio: 16/10; border-radius: 4px; overflow: hidden; background: var(--color-bg-light); margin-bottom: var(--sp-sm); }
.news-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.news-card:hover .news-card-thumb img { transform: scale(1.04); }
.news-card-thumb-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--color-primary) 0%, #2A3240 100%); color: rgba(255,255,255,0.92); }
.news-card-thumb-fallback-label { font-size: 15px; font-weight: 700; letter-spacing: 0.18em; }
.news-card-title { font-size: var(--font-size-sm); font-weight: 600; color: var(--color-text); line-height: 1.5; margin-bottom: 8px; transition: color var(--transition); }
.news-card:hover .news-card-title { color: var(--color-primary); }
.news-card-meta { display: flex; align-items: center; gap: var(--sp-xs); flex-wrap: wrap; }
.news-card-category { display: inline-block; background: var(--color-bg-light); color: var(--color-text-muted); font-size: 11px; padding: 3px 10px; border-radius: 20px; }
.news-card-date { font-size: var(--font-size-xs); color: var(--color-text-muted); }

/* =============================================================
 * スクロールトップボタン
 * ============================================================= */
.to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 100;
    width: 48px; height: 48px; border: 1px solid var(--color-dark);
    border-radius: 50%; background: var(--color-white); color: var(--color-dark);
    font-size: 18px; cursor: pointer;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
.to-top.is-show { opacity: 1; visibility: visible; }
.to-top:hover { transform: scale(1.15); }
