/* ==============================
   Xcraft Custom Styles
   ============================== */

/* --- Typography System：「編集的クラフト知性」 ---
   構造の声 = Zen Kaku Gothic New（本文・見出し）
   思想の声 = Fraunces（英語ディスプレイ） × Zen Old Mincho（ステイトメント・タグライン）
   データの声 = IBM Plex Mono（ラベル・番号・日付）

   ▼ 旧設定に戻す場合は、下の変数をこの値に差し替えるだけでよい：
   --font-sans:       Inter, 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
   --font-heading:    'Familjen Grotesk', 'Noto Sans JP', sans-serif;
   --font-display-en: 'Familjen Grotesk', 'Noto Sans JP', sans-serif;
   --font-serif-jp:   'Noto Serif JP', serif;
   --font-mono:       'Familjen Grotesk', sans-serif;
   --font-logo:       'Familjen Grotesk', sans-serif;
*/
:root {
    --font-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Noto Sans JP', sans-serif;
    --font-display-en: 'Fraunces', 'Zen Old Mincho', 'Noto Serif JP', serif;
    --font-serif-jp: 'Zen Old Mincho', 'Noto Serif JP', serif;
    --font-mono: 'IBM Plex Mono', 'Menlo', monospace;
    --font-logo: 'Familjen Grotesk', sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* html を visible 以外にしておかないと、body の overflow が
   ビューポートへ「伝播」してしまい、body 自身は visible 扱いになる。
   その状態だと下の body の clip がブロブに効かない */
html {
    overflow-x: clip;
}

body {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* ブロブ（.page-header-blob）は position:absolute で右にはみ出す。
       position:relative で body をブロブの位置の基準にし、
       overflow-x: clip ではみ出しを切り取る。
       上の html の指定とあわせて3つでひと組。どれか欠けると効かない */
    position: relative;
    overflow-x: clip;
}

/* --- Navigation --- */
/* キーボード操作の人がナビ全項目をタブで通過せずに本文へ飛べるようにする。
   通常は画面外に逃がし、フォーカスが当たったときだけ現れる */
.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 1200;
    padding: 0.75rem 1.25rem;
    background: #a8e6cf;
    color: #1a1a1a;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 2px;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* スキップ先。プログラムから当てるフォーカスなので枠は出さない */
main:focus {
    outline: none;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}

.site-header.scrolled {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom-color: #333;
}

.site-header .logo {
    /* 画像をインラインのまま置くと、文字のディセンダ分の余白が画像の下に入り、
       その余白ごと中央寄せされるためロゴが上にずれて見える。
       flex にして画像の高さ＝リンクの高さに揃える */
    display: flex;
    align-items: center;
    font-family: var(--font-logo);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.05em;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-header nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.site-header nav a:hover,
.site-header nav .nav-dropdown:hover > .nav-dropdown-toggle {
    color: #a8e6cf;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid #fff;
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    background: transparent;
    cursor: pointer;
}

.btn-outline:hover {
    background: #fff;
    color: #1a1a1a;
}

.btn-accent {
    background: #a8e6cf;
    color: #1a1a1a;
    border: 1px solid #a8e6cf;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-accent:hover {
    background: #8fd4b8;
}

/* Button arrow icon */
.btn-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 0.75rem;
    line-height: 1;
}

/* Service card icons */
.service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    color: #999;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #fff;
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    /* 矢印を文字の中心に揃えるため flex にする。
       inline-block のままだと矢印が文字のベースライン（下端）に乗り、
       45度回転した分だけ下にはみ出す */
    display: inline-flex;
    align-items: center;
}

/* 子メニューがあることを示す下向き三角。
   フォントの記号「▾」はサイズを上げると位置がずれ、下げると潰れるため、
   border を使って図形として描く。サイズと位置を正確に制御できる */
.nav-dropdown-toggle::after {
    content: '';
    width: 0;
    height: 0;
    margin-left: 0.5em;
    /* 三角は上辺が広く下が尖るため、視覚的な重心は上寄りになる。
       1px下げて文字の中心に合わせる */
    margin-top: 1px;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    opacity: 0.7;
    transition: opacity 0.25s ease;
    flex: none;
}

/* 子メニューが開くのは .nav-dropdown（外側の箱）に反応している。
   矢印と文字色も同じ箱を基準にしないと、箱に入ってから文字に触れるまでの
   わずかな間に変化のタイミングがずれる */
.nav-dropdown:hover .nav-dropdown-toggle::after {
    opacity: 1;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #2a2a2a;
    min-width: 180px;
    padding: 0.5rem 0;
    border: 1px solid #404040;
    z-index: 1001;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

/* サービス名は長いので折り返さない幅を確保する */
.nav-dropdown-menu--wide {
    min-width: 260px;
}

.nav-dropdown-menu--wide a {
    white-space: nowrap;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: #ccc;
    text-decoration: none;
}

.nav-dropdown-menu a:hover {
    background: #333;
    color: #fff;
}

/* --- ヘッダーナビ／ハンバーガー ---
   広い画面：.site-nav は display:contents。箱としては存在せず、中の nav と
   .header-actions がヘッダー直下のフレックス要素になるので、
   ロゴ｜ナビ｜ボタン の3分割がそのまま保たれる。
   狭い画面：.site-nav を箱に戻して、右からのスライドインパネルにする。 */

.site-nav {
    display: contents;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-toggle,
.nav-close,
.nav-backdrop {
    display: none;
}

@media (max-width: 900px) {
    /* ハンバーガー */
    .nav-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0 10px;
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 1102;
    }

    .nav-toggle span {
        display: block;
        height: 1.5px;
        background: #fff;
        border-radius: 1px;
        transition: transform 0.3s ease, opacity 0.2s ease;
    }

    /* 開いている間は × に変形させる */
    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }

    .nav-toggle:focus-visible {
        outline: 2px solid #a8e6cf;
        outline-offset: 2px;
    }

    /* パネル本体。資料ダウンロードのドロワーと同じ作法で出し入れする */
    /* .site-header.scrolled が backdrop-filter を持つため、ヘッダーが
       position:fixed の含みブロックになる。bottom:0 だとヘッダーの高さ64pxに
       収まってしまい先頭項目しか出ないので、高さはビューポート基準で指定する */
    .site-nav {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1101;
        height: 100vh;
        height: 100dvh;
        width: min(360px, 85%);
        padding: 5.5rem 2rem 3rem;
        background: #1a1a1a;
        border-left: 1px solid #333;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.4s;
    }

    .site-nav.is-open {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s;
    }

    .nav-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        z-index: 1100;
        background: rgba(0, 0, 0, 0.55);
        -webkit-backdrop-filter: blur(6px);
        backdrop-filter: blur(6px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0s linear 0.35s;
        cursor: pointer;
    }

    .nav-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        transition: opacity 0.35s ease, visibility 0s;
    }

    .nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        cursor: pointer;
    }

    .nav-close svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.5;
        stroke-linecap: round;
    }

    .nav-close:focus-visible {
        outline: 2px solid #a8e6cf;
        outline-offset: 2px;
    }

    /* パネル内のナビは縦積み */
    .site-header nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    /* .nav-dropdown-toggle 単独だと .site-header nav a に詳細度で負けて
       0.875rem のままになるため、nav を含めた形で指定する */
    .site-header nav > a,
    .site-header nav .nav-dropdown-toggle {
        padding: 0.9rem 0;
        font-size: 0.875rem;
        border-bottom: 1px solid #2e2e2e;
    }

    .nav-dropdown {
        display: flex;
        flex-direction: column;
    }

    /* タッチではホバーが無いので、子メニューは常に開いた状態で並べる */
    .nav-dropdown-menu,
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
        position: static;
        min-width: 0;
        padding: 0.25rem 0 0.5rem;
        background: transparent;
        border: none;
    }

    .nav-dropdown-menu a {
        padding: 0.6rem 0 0.6rem 1rem;
        font-size: 0.8125rem;
        color: #999;
    }

    .nav-dropdown-menu--wide a {
        white-space: normal;
    }

    .nav-dropdown-menu a:hover {
        background: transparent;
        color: #a8e6cf;
    }

    /* スマホでは子メニューを常に開いて並べるため矢印は不要。
       図形で描くようになったので content:'' では消えない。display で消す */
    .nav-dropdown-toggle::after {
        display: none;
    }

    /* ボタン2つはパネル下部に縦積みで置く */
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-top: 2rem;
    }

    .header-actions .btn-outline,
    .header-actions .btn-accent {
        justify-content: center;
        padding: 0.75rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-nav,
    .nav-backdrop,
    .nav-toggle span {
        transition: none;
    }
}

/* --- Hero Section --- */
/* Heroは画面に固定され、後続コンテンツが1枚のシートのように上へ滑り込んで覆っていく。
   ページ最下部では半透過フッターの奥にふたたび背景が透けて見える */
.hero {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    margin-top: 0;
}

/* fixed化したHeroのぶんの高さを流し込むスペーサー */
.hero-spacer {
    height: 100vh;
    height: 100svh;
}

/* 覆いかぶさるコンテンツ側 */
.section {
    position: relative;
    z-index: 1;
}

/* Hero直後のセクション上端に浅い影を落とし、シートの重なりを感じさせる */
.hero-spacer + .section {
    box-shadow: 0 -40px 80px rgba(0, 0, 0, 0.45);
}

/* フッターは全ページ半透過。トップでは最後まで行くと背景が透けて見える */
.site-footer {
    background: rgba(17, 17, 17, 0.55) !important;
    position: relative;
    z-index: 1;
}

/* 最上部ではヘッダーを隠し、スクロールした瞬間に現す */
.site-header {
    transition: transform 0.4s ease, background 0.3s ease, border-bottom-color 0.3s ease;
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

/* メニューを開いている間はヘッダーを動かさない。
   transform が入るとパネル（position:fixed）が一緒にずれるため */
html.is-drawer-open .site-header {
    transform: none;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* 生成的ビジュアル（菌糸・生態系ネットワーク）用キャンバス */
.hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #141414;
    display: block;
}


.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
    will-change: opacity, transform, filter;
}

.hero h1 {
    font-family: var(--font-display-en);
    /* 各行の長さをブラウザに均等配分させる。
       「chains,」のように1語だけ取り残される行が出なくなる。
       未対応ブラウザでは通常の折り返しになるだけで害はない */
    text-wrap: balance;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero p {
    font-size: 0.875rem;
    color: #ccc;
    max-width: 600px;
    margin: 0 auto;
}

/* Hero → About リンク（動く矢印） */
/* Hero と「わたしたちについて」で共用する、矢印つきのテキストリンク */
.arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    color: #a8e6cf;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.arrow-link:hover {
    opacity: 0.85;
}

.arrow-link-icon {
    display: inline-block;
    width: 40px;
    height: 16px;
    overflow: hidden;
}

.arrow-link-icon svg {
    width: 100%;
    height: 100%;
}

/* ホバー時だけ矢印がすっと抜けて再登場 */
.arrow-link:hover .arrow-link-icon svg {
    animation: arrow-through 0.6s ease forwards;
}

@keyframes arrow-through {
    0%   { transform: translateX(0); opacity: 1; }
    49%  { transform: translateX(44px); opacity: 0; }
    50%  { transform: translateX(-44px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* PC幅でだけ効く改行。狭い画面では自然に流して、
   「わせ、」のような短い行が取り残されるのを防ぐ */
@media (max-width: 768px) {
    br.br-wide {
        display: none;
    }
}

/* 完了ページの見出し。PCは中央、スマホは左寄せ。
   WordPress の has-text-align-center と詳細度が並ぶのを避けるため、
   配置はこのクラスだけで持たせている */
/* .article-content h2 が margin を持っていて、クラス1つでは詳細度で負ける。
   .article-content を含めた形で指定する（下の .thanks-actions と同じ余白にして、
   見出しの上下を対称に見せる） */
.article-content .thanks-heading {
    text-align: left;
    margin-top: 0;
    margin-bottom: 5rem;
}

/* 完了ページのボタン。本文との間をしっかり空けて、縦にゆとりを持たせる */
.thanks-actions {
    margin-top: 5rem;
    text-align: center;
}

@media (max-width: 768px) {
    .article-content .thanks-heading {
        margin-bottom: 3.5rem;
    }

    .thanks-actions {
        margin-top: 3.5rem;
    }
}

/* 逆に、狭い画面でだけ効く改行。日本語は語の途中でも折り返されるため、
   「ありがと／うございます」のような割れ方を防ぐのに使う */
br.br-narrow {
    display: none;
}

@media (max-width: 768px) {
    br.br-narrow {
        display: inline;
    }
}

/* --- Section --- */
.section {
    padding: 6rem 2rem;
}

.section-dark {
    background: #1a1a1a;
}

.section-darker {
    background: #111;
}

.section.section-dark,
.section.section-darker {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
}

/* --- Service Cards (Top Page) --- */
.service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    padding: 1.5rem 0;
    border-top: 1px solid #404040;
    text-decoration: none;
    color: #fff;
    display: block;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    opacity: 0.8;
}

.service-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.service-card-en {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: #a8e6cf;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}

.service-card-icon {
    display: block;
    width: 40px;
    height: 40px;
    color: #a8e6cf;
    margin-bottom: 1.25rem;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.service-card-icon svg {
    width: 100%;
    height: 100%;
}

.service-card:hover .service-card-icon {
    opacity: 1;
    transform: translateY(-2px);
}

@media (max-width: 840px) {
    .service-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .service-grid-4 {
        grid-template-columns: 1fr;
    }
}

.service-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
    filter: grayscale(30%);
    transition: filter 0.3s ease;
}

.service-card:hover .service-card-img {
    filter: grayscale(0%);
}

.service-card h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 説明文は「わたしたちについて」のリード文（.about-preview-lead）と
   同じ級数・行間に揃える */
.service-card p {
    font-size: 0.875rem;
    color: #999;
    line-height: 1.8;
}

/* --- About Preview --- */
/* 左半分を画像で埋めきるため、このセクションだけ .section の padding を外す。
   画像はビューポート左端・セクション上下端にぴったり付く */
/* .section の padding は後方の @media でも上書きされるため、
   クラス2つ分の詳細度で確実に殺す */
.section.about-preview-section {
    padding: 0;
    overflow: hidden;
}

.about-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: none;
    margin: 0;
    align-items: stretch;
}

.about-preview-visual {
    position: relative;
    /* テキストが短いときでも画像が潰れないための下限 */
    min-height: 560px;
}

.about-preview-visual img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* 画像自体はグレースケール書き出し済み。ここは明るさの調整つまみ。
       brightness の数字を下げるほど暗くなる */
    filter: brightness(0.72) contrast(1.08);
}

/* 右の余白は「他セクションの1200pxコンテナの右端」に揃える。
   50vw - 600px がその外側の余白ぶん */
.about-preview-body {
    align-self: center;
    padding: 6rem max(2rem, calc(50vw - 600px)) 6rem 4rem;
}

/* リード文が下マージンを持っているので、ここでは上マージンを打ち消す */
.about-preview-body .arrow-link {
    margin-top: 0;
}

.about-preview-lead {
    font-size: 0.875rem;
    color: #ccc;
    line-height: 1.8;
    margin-bottom: 2rem;
}

@media (max-width: 900px) {
    .about-preview {
        grid-template-columns: 1fr;
    }

    .about-preview-visual {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .about-preview-body {
        padding: 3rem 2rem 4rem;
    }
}

@media (max-width: 540px) {
    .about-preview-body {
        padding: 2.5rem 1rem 3rem;
    }
}

/* --- Blog Cards --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: #2a2a2a;
    overflow: hidden;
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card-content {
    padding: 1.25rem;
}

/* 関連するプロジェクト事例。
   .blog-card img は height:200px 固定なので、カード幅が伸びるほど横長になる
   （3カラムで約1.9:1）。事例カード（16:10）と比率を揃える */
.related-works-grid .blog-card img {
    height: auto;
    aspect-ratio: 16 / 10;
}

.blog-card-content .category {
    font-size: 0.625rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-card-content h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 0.5rem 0;
    line-height: 1.4;
}

.blog-card-content p {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.5;
}

/* --- News List --- */
.news-list {
    max-width: 1200px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #333;
    align-items: center;
}

.news-date {
    font-size: 2rem;
    font-weight: 700;
    min-width: 60px;
}

.news-date small {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: #999;
}

.news-item h3 {
    font-size: 0.875rem;
    font-weight: 500;
}

/* 狭い画面では日付欄の最小幅(60px)と間隔(2rem)で約92px空き、
   タイトルが遠く見える。内容なりの幅に任せて間隔も詰める */
@media (max-width: 768px) {
    .news-item {
        gap: 1rem;
    }

    .news-date {
        min-width: 0;
    }
}

/* --- Footer --- */
.site-footer {
    background: #111;
    padding: 4rem 2rem 2rem;
}

.footer-cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid #333;
}

.footer-cta-item h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.footer-cta-item p {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto 4rem;
}

.footer-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #a8e6cf;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
}

.footer-logo {
    font-family: var(--font-logo);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.footer-copyright {
    font-size: 0.75rem;
    color: #8a8a8a;
}

/* ヘッダーと同じ理由。インライン画像だと下にディセンダ分の余白が入る */
.footer-bottom-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* 狭い画面ではロゴ(147px)とコピーライト(約190px)が横に並びきらず窮屈になる。
   縦に積んで余裕を持たせる */
@media (max-width: 540px) {
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
}

/* --- Page Header（全ページ統一・英語タイトル＋日本語サブラベル） --- */
/* max-width は「中身1200px + 左右padding 2rem」の合計。
   .section 内の max-width:1200px やフッターと左端を揃えるための値。 */
.page-header {
    padding: 8rem 2rem 3rem;
    max-width: 1264px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* 大きい英語ラベル。もとは <h1> だったが、日本語ページの h1 が英語だと
   タイトル・本文とテーマがずれるため、h1 は下の日本語側に移した。
   表示を変えないよう、h1 の既定の上マージン(0.67em)をここで明示する */
.page-header-en {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 0.67em;
    margin-bottom: 0.75rem;
}

/* こちらが h1。もとは <p> だったので、p の既定マージン(1em)を明示して
   見た目を据え置く */
.page-header-ja {
    margin: 1em 0;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: #999;
}

/* ページ右上で不規則に形を変え続ける線だけの円。
   body直下に置き、どの親要素の overflow / stacking にも制限されない。
   上端と右端が画面の縁から少しはみ出し、下端まで欠けずに見える。
   極薄の線＋pointer-events:none なのでコンテンツの上に重ねても邪魔しない */
.page-header-blob {
    position: absolute;
    top: -120px;
    right: -120px;
    width: min(680px, 80vw);
    height: min(680px, 80vw);
    pointer-events: none;
    z-index: 2; /* section(z:1)より手前、site-headerより奥 */
}

@media (max-width: 768px) {
    .page-header-blob {
        width: 340px;
        height: 340px;
        top: -70px;
        right: -70px;
    }
}

.page-header-lead {
    max-width: 640px;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    line-height: 2;
    color: #aaa;
}

.page-header-count {
    margin-top: 1.75rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: var(--color-mint, #a8e6cf);
}

.page-header .subtitle {
    font-size: 0.875rem;
    color: #999;
}

/* --- Service Detail (Service Page) --- */
.service-section {
    padding: 4rem 0;
    border-top: 1px solid #333;
    max-width: 1200px;
    margin: 0 auto;
}

.service-section-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.service-number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #8a8a8a;
    font-weight: 500;
}

.service-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.service-section h3 {
    font-size: 0.875rem;
    color: #999;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.service-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.service-content p {
    font-size: 0.875rem;
    color: #ccc;
    line-height: 1.8;
}

.service-content img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* --- About Page --- */
.mission-statement {
    font-family: var(--font-serif-jp);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    text-align: center;
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.team-member {
    text-align: center;
}

.team-member img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
}

.team-member h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.team-member p {
    font-size: 0.75rem;
    color: #999;
}

.partner-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: center;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 0;
}

.partner-logos img {
    height: 40px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.partner-logos img:hover {
    opacity: 1;
}

/* 左に会社概要、右に地図の2カラム */
.company-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    margin-top: 2rem;
}

.company-map iframe {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 1px solid #333;
    /* 明るい地図をダーク基調のページになじませる */
    filter: grayscale(1) invert(0.92) contrast(0.85);
}

.company-info table {
    width: 100%;
    border-collapse: collapse;
}

.company-info th,
.company-info td {
    padding: 1rem 0;
    border-bottom: 1px solid #333;
    font-size: 0.875rem;
    text-align: left;
}

.company-info th {
    width: 140px;
    color: #999;
    font-weight: 400;
}

/* --- Contact Form --- */
.contact-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: #fff;
    border: none;
    /* iOS Safari は 16px 未満の入力欄にフォーカスすると画面を自動拡大し、
       元の倍率に戻らない。入力欄だけは 1rem を下回らせない */
    font-size: 1rem;
    font-family: inherit;
    color: #333;
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.form-group .radio-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.form-group .radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.form-consent {
    margin: 1.5rem 0;
    font-size: 0.75rem;
}

.form-consent a {
    color: #a8e6cf;
}

/* --- 資料ダウンロード ドロワー（右からスライドイン） ---
   .site-header が z-index:1000 なので、その上に重ねる。
   display の切り替えはトランジションできないため visibility で出し入れする */

.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    /* 閉じるときは透明になりきってから visibility を落とす */
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    cursor: pointer;
}

.drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease, visibility 0s;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1101;
    width: min(600px, 100%);
    background: #1a1a1a;
    border-left: 1px solid #333;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s linear 0.4s;
}

.drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0s;
}

.drawer-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s;
}

.drawer-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.drawer-close:focus-visible {
    outline: 2px solid #a8e6cf;
    outline-offset: 2px;
}

.drawer-close svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.drawer-inner {
    padding: 4rem 3.5rem 4rem;
}

.drawer-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 1.5rem;
}

.drawer-lead {
    font-size: 0.8125rem;
    color: #bbb;
    line-height: 2;
    margin: 0 0 3rem;
}

/* 必須マーク。ドロワーとお問い合わせページの両方で使う */
.form-req {
    color: #a8e6cf;
    margin-left: 0.25rem;
}

.drawer-form .btn-outline {
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .drawer-inner {
        padding: 4rem 1.5rem 3rem;
    }

    .drawer-title {
        font-size: 1.5rem;
    }

    .drawer-lead {
        margin-bottom: 2rem;
    }
}

/* ドロワーを開いている間は背後をスクロールさせない */
html.is-drawer-open,
html.is-drawer-open body {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .drawer,
    .drawer-backdrop {
        transition: none;
    }
}

/* --- Contact Form 7 をテーマの見た目に寄せる ---
   入力欄そのものは既存の .form-group のルールが当たる（CF7は
   .wpcf7-form-control-wrap で包むだけなので子孫セレクタで届く） */

.wpcf7-form-control-wrap {
    display: block;
}

/* CF7が入れる隠しフィールド用の枠。線も余白も出さない */
.wpcf7-form .hidden-fields-container {
    display: none;
}

/* 同意チェック：CF7既定の左マージンを外してラベルと横並びにする */
.wpcf7-acceptance .wpcf7-list-item {
    margin: 0.5rem 0 0;
}

.wpcf7-acceptance .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.wpcf7-list-item-label {
    font-size: 0.75rem;
}

/* ラジオ（ご用件）。テーマ既定の .radio-group と同じ並びに揃える */
.wpcf7-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.wpcf7-radio .wpcf7-list-item {
    margin: 0;
}

.wpcf7-radio .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* 入力エラーの吹き出し */
.wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #ff8a8a;
}

.wpcf7-form-control.wpcf7-not-valid {
    outline: 1px solid #ff8a8a;
}

/* 送信結果のメッセージ。暗い地に合わせて色を振り直す */
.wpcf7-response-output {
    margin: 1.5rem 0 0;
    padding: 0.875rem 1rem;
    border: 1px solid #666;
    border-radius: 2px;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: #ddd;
}

.wpcf7 form.sent .wpcf7-response-output {
    border-color: #a8e6cf;
    color: #a8e6cf;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
    border-color: #ff8a8a;
    color: #ff8a8a;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
    border-color: #ff8a8a;
    color: #ff8a8a;
}

/* Turnstileウィジェット。フォームに [turnstile] を明示的に置いているので
   CF7の自動先頭挿入は働かず、送信ボタンの直前に出る */
.wpcf7-turnstile {
    margin: 1.5rem 0 0;
}

/* 送信ボタン。value に矢印を入れているので inline-flex の gap は不要 */
.wpcf7-submit.btn-outline {
    display: inline-block;
}

.wpcf7-spinner {
    margin: 0 0 0 0.75rem;
}

/* スクリーンリーダー向けの重複メッセージは視覚的に隠す（CF7既定のまま） */
.wpcf7 .screen-reader-response {
    position: absolute;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
}

/* --- Library Archive --- */
.library-tabs {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 3rem;
}

.library-tabs a {
    color: #999;
    text-decoration: none;
    font-size: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.library-tabs a.active,
.library-tabs a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

/* --- News Featured --- */
.news-featured {
    position: relative;
    max-width: 1200px;
    margin: 0 auto 4rem;
    overflow: hidden;
}

.news-featured img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.news-featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

/* --- Article --- */
.article-header {
    padding: 8rem 2rem 2rem;
    max-width: 1264px;
    margin: 0 auto;
}

.article-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

/* --- 記事の目次 --- */
.toc {
    margin: 0 0 3.5rem;
    padding: 1.75rem 2rem;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 2px;
}

.toc-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #a8e6cf;
    margin: 0 0 1.25rem;
}

.toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: toc;
}

.toc li {
    counter-increment: toc;
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    line-height: 1.6;
}

.toc li:last-child {
    margin-bottom: 0;
}

.toc li::before {
    content: counter(toc, decimal-leading-zero);
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #8a8a8a;
    padding-top: 0.15em;
}

/* 本文リンクのアクセント色ではなく、落ち着いた色で並べる */
.article-content .toc a {
    color: #ddd;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: color 0.2s;
}

.article-content .toc a:hover {
    color: #a8e6cf;
    opacity: 1;
}

/* 固定ヘッダーに見出しが潜らないように */
.article-content h2 {
    scroll-margin-top: 96px;
}

/* 記事ヘッダーのアイキャッチ。ヘッダーの内側幅と同じ幅で見せる */
.article-hero {
    margin-top: 2.5rem;
}

.article-hero img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
}

/* 本文中のリンクはアクセントカラーで。ブラウザ既定の青紫を使わない */
.article-content a {
    color: #a8e6cf;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.25em;
    transition: opacity 0.2s;
}

.article-content a:hover {
    opacity: 0.7;
}

.article-content a:visited {
    color: #a8e6cf;
}

.project-lead {
    font-size: 1.05rem;
    line-height: 2;
    color: #ccc;
    margin-bottom: 2rem;
}

.project-meta {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #333;
}

.article-content p {
    font-size: 0.9375rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
    color: #ddd;
}

.article-content h2 {
    font-size: 1.375rem;
    margin: 3rem 0 1rem;
}

.article-content h3 {
    font-size: 1.125rem;
    margin: 2rem 0 1rem;
}

/* 本文中のリスト。p と同じ級数・行間・文字色に揃える
   （.toc ol のような list-style:none は当てず、記号は残す） */
.article-content ul,
.article-content ol {
    margin: 0 0 1.5rem;
    padding-left: 1.5em;
}

.article-content li {
    font-size: 0.9375rem;
    line-height: 1.9;
    color: #ddd;
    margin-bottom: 0.5rem;
}

.article-content li:last-child {
    margin-bottom: 0;
}

.article-content hr {
    border: 0;
    border-top: 1px solid #333;
    margin: 3rem 0;
}

/* 記事内の画像。
   inline のままだと行ボックスのベースラインぶんの隙間が画像の下にでき、
   さらに親（p / li）の margin-bottom と画像の margin-bottom が二重にかかって、
   意図しない余白が積み上がる。block にして margin だけで管理する */
.article-content img {
    display: block;
    width: 100%;
    height: auto;
    margin: 2rem 0;
}

/* 画像で終わる段落・リスト項目は、自分の下マージンを持たない。
   画像側の margin-bottom と二重になるため */
.article-content p:has(> img:last-child),
.article-content li:has(> img:last-child) {
    margin-bottom: 0;
}

/* 画像だけの段落は、行ボックス由来の隙間も残さない */
.article-content p:has(> img:only-child) {
    line-height: 0;
}

/* 画像に隣り合う <br>。
   画像は display:block で自分で改行するので改行タグは不要なのに、
   本文の line-height(1.9) ぶんの空の行が作られ、
   さらに前後の画像のマージンが相殺されなくなって余白が二重・三重に積み上がる */
.article-content img + br,
.article-content figure + br,
.article-content .gallery + br,
.article-content br:has(+ img),
.article-content br:has(+ figure),
.article-content br:has(+ .gallery),
.article-content br:has(+ .wp-caption) {
    display: none;
}

/* キャプション付き画像（[caption] / ブロックエディタの figure）。
   余白は figure が持ち、中の img は 0 にして二重取りを防ぐ。
   WordPress は figure に style="width:○○px" を直書きするので、
   狭い画面ではみ出さないよう width を上書きする */
.article-content figure,
.article-content .wp-caption {
    width: auto !important;
    max-width: 100%;
    margin: 2rem 0;
}

.article-content figure img,
.article-content .wp-caption img {
    margin: 0;
}

/* キャプションは画像に寄せる。段落と同じ余白だと画像から切り離れて見える */
.article-content figcaption,
.article-content .wp-caption-text {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    line-height: 1.7;
    color: #999;
}

/* ギャラリー（ショートコード [gallery] 出力） */
.article-content .gallery {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
    margin: 2rem 0 !important;
}

/* カラム未指定時のデフォルトは3列。flex-grow: 0 で最終行の余りを引き伸ばさない */
.article-content .gallery .gallery-item {
    flex: 0 0 calc(33.333% - 0.334rem) !important;
    margin: 0 !important;
    text-align: center;
}

/* ショートコードの columns 指定（gallery-columns-N クラス）を反映 */
.article-content .gallery.gallery-columns-1 .gallery-item { flex-basis: 100% !important; }
.article-content .gallery.gallery-columns-2 .gallery-item { flex-basis: calc(50% - 0.25rem) !important; }
.article-content .gallery.gallery-columns-3 .gallery-item { flex-basis: calc(33.333% - 0.334rem) !important; }
.article-content .gallery.gallery-columns-4 .gallery-item { flex-basis: calc(25% - 0.375rem) !important; }
.article-content .gallery.gallery-columns-5 .gallery-item { flex-basis: calc(20% - 0.4rem) !important; }
.article-content .gallery.gallery-columns-6 .gallery-item { flex-basis: calc(16.666% - 0.417rem) !important; }
.article-content .gallery.gallery-columns-7 .gallery-item { flex-basis: calc(14.285% - 0.429rem) !important; }
.article-content .gallery.gallery-columns-8 .gallery-item { flex-basis: calc(12.5% - 0.438rem) !important; }
.article-content .gallery.gallery-columns-9 .gallery-item { flex-basis: calc(11.111% - 0.445rem) !important; }

/* PCでの画像・ギャラリーの余白。上は下の半分。
   上を狭くするのは、画像が「直前の説明文に属するもの」に見えるようにするため。
   下を広く取ることで、次の塊との切れ目がはっきりする。
   メディアが連続する場合はマージンが相殺され、広いほう（3.5rem）が採用される。
   狭い画面は縦が伸びすぎるため2remのまま */
@media (min-width: 769px) {
    .article-content img,
    .article-content figure,
    .article-content .wp-caption {
        margin-top: 1.75rem;
        margin-bottom: 3.5rem;
    }

    /* ギャラリー側の既存指定が !important なので、同じ強さで上書きする */
    .article-content .gallery {
        margin-top: 1.75rem !important;
        margin-bottom: 3.5rem !important;
    }

    /* キャプションは画像に属するので、ここは広げない */
    .article-content figure img,
    .article-content .wp-caption img {
        margin: 0;
    }
}

/* 狭い画面では段組みをやめて1カラムにする。
   ギャラリーに入るのは資料や図版が多く、2列に割ると中身が読めなくなるため。
   既存の columns 指定は !important なので、同じ強さで後ろから上書きする */
@media (max-width: 768px) {
    .article-content .gallery .gallery-item,
    .article-content .gallery[class*="gallery-columns-"] .gallery-item {
        flex-basis: 100% !important;
    }
}

/* display:block にしないと画像下にベースライン分の余白が入り、行間だけ広くなる */
.article-content .gallery .gallery-item img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
}

.article-content .gallery .gallery-caption {
    font-size: 0.75rem;
    color: #999;
}

/* ギャラリー（ブロックエディタ） */
.article-content .wp-block-gallery {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
}

/* カラム未指定時のデフォルトは3列。flex-grow: 0 で最終行の余りを引き伸ばさない */
.article-content .wp-block-gallery .wp-block-image {
    flex: 0 0 calc(33.333% - 0.334rem) !important;
    margin: 0 !important;
    width: auto !important;
}

/* エディタで指定したカラム数（columns-N クラス）を反映 */
.article-content .wp-block-gallery.columns-1 .wp-block-image { flex-basis: 100% !important; }
.article-content .wp-block-gallery.columns-2 .wp-block-image { flex-basis: calc(50% - 0.25rem) !important; }
.article-content .wp-block-gallery.columns-3 .wp-block-image { flex-basis: calc(33.333% - 0.334rem) !important; }
.article-content .wp-block-gallery.columns-4 .wp-block-image { flex-basis: calc(25% - 0.375rem) !important; }
.article-content .wp-block-gallery.columns-5 .wp-block-image { flex-basis: calc(20% - 0.4rem) !important; }
.article-content .wp-block-gallery.columns-6 .wp-block-image { flex-basis: calc(16.666% - 0.417rem) !important; }

.article-content .wp-block-gallery .wp-block-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    margin: 0 !important;
}

@media (max-width: 600px) {
    .article-content .gallery[class][class] .gallery-item,
    .article-content .wp-block-gallery[class][class] .wp-block-image {
        flex: 0 0 100% !important;
    }
}

.works-content .wp-block-gallery {
    margin-bottom: 1rem !important;
}

.works-content h2 {
    margin-top: 2rem !important;
}

.works-content p:empty,
.works-content p:has(> br:only-child) {
    display: none !important;
    margin: 0 !important;
    height: 0;
}

/* --- Portfolio Grid (Top page) --- */
/*
 * Takram-style bento box: 4列×5行、セルは正方形ベース、10 items
 * 大正方形×3（big1/big2/big3）＋小正方形×6＋横長×1（wide）
 * Layout（手描きスケッチ準拠・Featured②は1行オフセット）:
 *   [ B1 ][ B1 ][ s1 ][ s2 ]
 *   [ B1 ][ B1 ][ B2 ][ B2 ]
 *   [ s3 ][ s4 ][ B2 ][ B2 ]
 *   [ B3 ][ B3 ][ s5 ][ s6 ]
 *   [ B3 ][ B3 ][  Wide−4  ]
 */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    grid-auto-flow: dense;
    aspect-ratio: 4 / 5;
    gap: 4px;
}

.portfolio-item--big1 {
    grid-column: 1 / 3;
    grid-row: 1 / 3;
}

.portfolio-item--big2 {
    grid-column: 3 / 5;
    grid-row: 2 / 4;
}

.portfolio-item--big3 {
    grid-column: 1 / 3;
    grid-row: 4 / 6;
}

/* 最下段の横長。ここより上の col3-4 は正方形が流し込まれる */
.portfolio-item--big4 {
    grid-column: 3 / 5;
    grid-row: 5 / 6;
}

.portfolio-item {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    border-radius: 2px;
}

.portfolio-item-img {
    width: 100%;
    height: 100%;
}

.portfolio-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.portfolio-item:hover .portfolio-item-img img {
    transform: scale(1.05);
}

.portfolio-item-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #2d3535 100%);
}

/* Placeholder color variations */
.portfolio-item:nth-child(2) .portfolio-item-placeholder {
    background: linear-gradient(145deg, #252530 0%, #1a1a2a 50%, #2a2535 100%);
}
.portfolio-item:nth-child(4) .portfolio-item-placeholder {
    background: linear-gradient(145deg, #2a3028 0%, #1a2a1a 50%, #253530 100%);
}
.portfolio-item:nth-child(6) .portfolio-item-placeholder {
    background: linear-gradient(145deg, #302a28 0%, #2a1a1a 50%, #352d25 100%);
}
.portfolio-item:nth-child(8) .portfolio-item-placeholder {
    background: linear-gradient(145deg, #28302a 0%, #1a2a25 50%, #253035 100%);
}

.portfolio-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    transform: translateY(calc(100% - 4rem));
    transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-item-overlay {
    transform: translateY(0);
}

.portfolio-item-cat {
    display: inline-block;
    font-size: 0.65rem;
    color: #a8e6cf;
    border: 1px solid #a8e6cf;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

/* Service label（塗り）: タグ（枠線）と区別 */
.portfolio-item-service {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #a8e6cf;
    padding: 0.2rem 0.55rem;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portfolio-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.portfolio-item:hover .portfolio-item-tags {
    opacity: 1;
}

.portfolio-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.portfolio-item-desc {
    font-size: 0.8rem;
    color: #ccc;
    line-height: 1.6;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

.portfolio-item:hover .portfolio-item-desc {
    opacity: 1;
}

/* 直下の「わたしたちについて」が余白ゼロの全面画像で始まるため、
   その手前だけ通常（6rem）より広く空けて息継ぎを作る。
   .section の padding は後方の @media でも上書きされるので詳細度を2つ分にしている */
.section.works-section {
    padding-bottom: 10rem;
}

@media (max-width: 840px) {
    .section.works-section {
        padding-bottom: 7rem;
    }
}

@media (max-width: 540px) {
    .section.works-section {
        padding-bottom: 5rem;
    }
}

/* --- Works Carousel（トップ 事例紹介） ---
   中央のカードが1枚フルで見え、左右の隣が見切れる。
   横スクロール＋scroll-snapだけで動くので、矢印はJSが無くても
   スワイプ/トラックパッドで代替できる（プログレッシブエンハンスメント）。 */

.works-carousel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
}

.works-carousel-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

/* btn-outline と同じ「線→反転」の作法に揃える */
.works-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.works-nav-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.works-nav-btn:hover:not(:disabled) {
    background: #fff;
    color: #1a1a1a;
}

.works-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.works-nav-btn:focus-visible {
    outline: 2px solid #a8e6cf;
    outline-offset: 2px;
}

.works-carousel {
    /* .section の左右padding(2rem)を打ち消して画面幅いっぱいに広げる。
       見切れを作るにはトラックがビューポート端まで届いている必要がある */
    margin-inline: -2rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    /* スクロールバーは出さない（矢印とスワイプで操作する） */
    scrollbar-width: none;
    -ms-overflow-style: none;

    --works-card-w: clamp(260px, 40vw, 760px);
    --works-gap: 2.5rem;
    /* JS無効時にカードが画面端に貼りつかないための最小余白。
       JSが動くときは前後にクローンが入るので、この値は端まで送らない限り見えない */
    --works-edge: 2rem;
}

.works-carousel::-webkit-scrollbar {
    display: none;
}

.works-track {
    display: flex;
    gap: var(--works-gap);
    padding-inline: var(--works-edge);
}

.works-carousel .works-card {
    flex: 0 0 var(--works-card-w);
    scroll-snap-align: center;
    display: block;
    text-decoration: none;
    color: #fff;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.works-carousel .works-card:hover {
    transform: translateY(-4px);
}

.works-carousel .works-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #2a2a2a;
}

.works-carousel .works-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.works-carousel .works-card:hover .works-card-thumb img {
    transform: scale(1.05);
}

.works-carousel .works-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 50%, #2d3535 100%);
}

.works-carousel .works-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.works-carousel .works-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.875rem;
}

/* サービス名は写真の上に乗せる。仕事内容タグ（線）と場所も形も分ける */
.works-carousel .works-card-service {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: #1a1a1a;
    background: #a8e6cf;
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.works-carousel .works-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 0.75rem;
}

.works-carousel .works-card-excerpt {
    font-size: 0.8125rem;
    color: #aaa;
    line-height: 1.9;
    margin: 0;
    /* 高さを揃えて、カードが隣と食い違わないようにする */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    /* 縦積みにせず、他セクション（ブログ・お知らせ）と同じ
       「見出し左 ／ すべて見る右」の並びを保つ。
       狭い画面でも収まるよう、矢印とボタンだけ小さくする */
    .works-carousel-head {
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .works-carousel-nav {
        gap: 0.5rem;
        flex-shrink: 0;
    }

    .works-nav-btn {
        width: 34px;
        height: 34px;
    }

    .works-nav-btn svg {
        width: 13px;
        height: 13px;
    }

    .works-carousel-nav .btn-outline {
        padding: 0.5rem 0.875rem;
        gap: 0.375rem;
        white-space: nowrap;
    }

    .works-carousel {
        --works-card-w: 78vw;
        --works-gap: 1rem;
        --works-edge: 1.5rem;
    }

    .works-carousel .works-card-body {
        padding: 1.25rem 1.25rem 1.5rem;
    }
}

@media (max-width: 540px) {
    /* この幅で .section の左右padding が 1rem に変わるので、打ち消し量も合わせる。
       ずれるとページ全体に横スクロールが出る */
    .works-carousel {
        margin-inline: -1rem;
        --works-edge: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .works-carousel {
        scroll-behavior: auto;
    }

    .works-carousel .works-card,
    .works-carousel .works-card-thumb img {
        transition: none;
    }
}

/* --- Project Cards --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.project-card {
    display: block;
    text-decoration: none;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    background: #222;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.project-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #333;
}

.project-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-card-thumb img {
    transform: scale(1.05);
}

.project-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    color: #444;
    font-family: var(--font-logo);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.project-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.project-card-cat {
    display: inline-block;
    font-size: 0.7rem;
    color: #a8e6cf;
    border: 1px solid #a8e6cf;
    padding: 0.15rem 0.6rem;
    border-radius: 2px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.05em;
}

.project-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.project-card-excerpt {
    font-size: 0.8rem;
    color: #999;
    line-height: 1.6;
}

/* --- Works（実績） --- */
.works-filter {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    max-width: 1264px;
    margin: 0 auto;
    padding: 0 2rem 1rem;
}

.works-filter-item {
    color: #999;
    text-decoration: none;
    font-size: 0.8125rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    cursor: pointer;
    font-family: inherit;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
}

.works-filter-item.active,
.works-filter-item:hover {
    color: #fff;
    border-bottom-color: #a8e6cf;
}

.works-featured-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.works-featured-item {
    display: block;
    text-decoration: none;
    color: #fff;
}

.works-featured-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 2px;
    margin-bottom: 1.25rem;
    background: #2a2a2a;
}

.works-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.works-featured-item:hover .works-featured-img img {
    transform: scale(1.05);
}

.works-featured-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 0.5rem 0 0.75rem;
}

.works-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.works-card {
    display: block;
    text-decoration: none;
    color: #fff;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.works-card:hover {
    transform: translateY(-4px);
}

.works-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #2a2a2a;
}

.works-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.works-card:hover .works-card-thumb img {
    transform: scale(1.05);
}

.works-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.works-card-client {
    display: inline-block;
    font-size: 0.7rem;
    color: #999;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.works-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    /* カルーセル側(.works-carousel .works-card-title)と揃える。
       未指定だと <h4> の既定の上マージンが出てクライアント名との間が空く */
    margin: 0 0 0.75rem;
}

.works-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.works-tag {
    display: inline-block;
    font-size: 0.65rem;
    color: #a8e6cf;
    border: 1px solid rgba(168, 230, 207, 0.5);
    padding: 0.1rem 0.5rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
}

.works-related-label {
    display: inline-block;
    font-size: 0.65rem;
    color: #1a1a1a;
    background: #a8e6cf;
    padding: 0.1rem 0.5rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Works single */
.works-header-meta {
    margin-bottom: 0.75rem;
}

.works-client {
    font-size: 0.875rem;
    color: #a8e6cf;
    letter-spacing: 0.05em;
}

.works-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.works-meta-row {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.works-meta-item {
    font-size: 0.8125rem;
    color: #ccc;
}

.works-meta-label {
    display: block;
    font-size: 0.7rem;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.works-content h3 {
    font-size: 1.125rem;
    margin: 3rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #333;
}

.works-content ul {
    padding-left: 1.25rem;
    margin-bottom: 1.5rem;
}

.works-content ul li {
    font-size: 0.9375rem;
    line-height: 1.9;
    color: #ddd;
    margin-bottom: 0.75rem;
}

/* 狭い画面では、項目内の画像だけリストの字下げ(1.25rem)から外に出して
   本文・見出しと左端を揃える。文章は字下げしたまま＝行頭記号は残る */
@media (max-width: 768px) {
    .works-content li img,
    .works-content li figure,
    .works-content li .wp-caption {
        margin-left: -1.25rem;
        width: calc(100% + 1.25rem);
        max-width: none;
    }

    /* ギャラリー側は margin ショートコードが !important なので同じ強さで */
    .works-content li .gallery {
        margin-left: -1.25rem !important;
        width: calc(100% + 1.25rem) !important;
    }
}

.works-outcome-numbers {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: #222;
    border-left: 2px solid #a8e6cf;
}

.works-outcome-numbers p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.works-outcome-label {
    font-size: 0.7rem;
    color: #a8e6cf;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem !important;
}

/* --- Service Page（4サービス・7ブロック構成） --- */
.service-tagline {
    font-family: var(--font-serif-jp);
    font-size: 1.5rem;
    color: #a8e6cf;
    font-weight: 500;
    margin-bottom: 2.5rem;
    letter-spacing: 0.02em;
}

.service-partner {
    display: inline-block;
    font-size: 0.75rem;
    color: #999;
    margin-left: 1rem;
    letter-spacing: 0.05em;
}

.service-block {
    margin-bottom: 3rem;
}

.service-block-label {
    font-size: 0.95rem;
    color: #a8e6cf;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-block-text {
    font-size: 0.9375rem;
    color: #ddd;
    line-height: 2;
    margin-bottom: 1.75rem;
}

.service-cando-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.service-cando {
    padding: 1.5rem;
    background: #222;
    border-top: 1px solid #404040;
}

.service-cando h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
}

.service-cando p {
    font-size: 0.8125rem;
    color: #999;
    line-height: 1.8;
}

/* --- Service index（/service/ 4サービスカード） --- */
.service-index-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.service-index-card {
    display: block;
    padding: 2rem;
    background: #222;
    border-top: 1px solid #404040;
    border-radius: 2px;
    text-decoration: none;
    color: #fff;
    transition: background 0.3s ease;
}

.service-index-card:hover {
    background: #262d2a;
}

.service-index-card:hover .service-card-icon {
    opacity: 1;
    transform: translateY(-2px);
}

.service-index-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.service-index-tagline {
    font-family: var(--font-serif-jp);
    font-size: 0.875rem;
    color: #a8e6cf;
    margin-bottom: 1rem;
}

/* --- Service index: OUR METHOD・会社紹介への導線 --- */

/* 英字キッカー。section-subtitle の下余白だけ詰める */
.service-method-kicker {
    margin-bottom: 0.75rem;
}

/* キッカーと h2 のあいだの日本語サブラベル */
.service-method-label {
    font-size: 0.8125rem;
    color: #999;
    letter-spacing: 0.04em;
    margin-bottom: 0.75rem;
}

.service-method-lead {
    font-size: 1rem;
    color: #ddd;
    line-height: 2;
    margin: 1rem 0 0;
}

/* 会社紹介への橋渡し。CTAボタンと同格にならないようテキストリンクで */
/* ページ末尾の「次はこちら」導線。会社紹介・事業内容の相互リンクで使う */
.page-next-link {
    display: inline-block;
    font-size: 0.875rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #404040;
    padding-bottom: 0.25rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.page-next-link:hover {
    color: #a8e6cf;
    border-bottom-color: #a8e6cf;
}

.service-index-lead {
    font-size: 0.8125rem;
    color: #999;
    line-height: 1.9;
    margin-bottom: 1.5rem;
}

.service-index-more {
    font-size: 0.75rem;
}

/* --- Service detail: 他のサービス --- */
.service-nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.service-nav-card {
    display: block;
    padding: 1.5rem;
    background: #222;
    border-top: 1px solid #404040;
    border-radius: 2px;
    text-decoration: none;
    color: #fff;
    transition: background 0.3s ease;
}

.service-nav-card:hover {
    background: #262d2a;
}

.service-nav-card:hover .service-card-icon {
    opacity: 1;
    transform: translateY(-2px);
}

.service-nav-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
}

/* --- Service detail: 関連する読みもの（ライブラリ・テキストリスト形式） --- */
.service-library-list {
    border-top: 1px solid #333;
}

.service-library-row {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    padding: 1.1rem 0.25rem;
    border-bottom: 1px solid #333;
    text-decoration: none;
    color: #fff;
    transition: background 0.3s ease;
}

.service-library-row:hover {
    background: rgba(168, 230, 207, 0.04);
}

.service-library-date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #777;
    flex-shrink: 0;
}

.service-library-cat {
    font-size: 0.65rem;
    color: #a8e6cf;
    border: 1px solid #a8e6cf;
    padding: 0.1rem 0.5rem;
    border-radius: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.service-library-title {
    font-size: 0.875rem;
    line-height: 1.6;
    flex: 1;
    transition: color 0.3s ease;
}

.service-library-row:hover .service-library-title {
    color: #a8e6cf;
}

.service-library-arrow {
    color: #a8e6cf;
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.service-library-row:hover .service-library-arrow {
    transform: translateX(4px);
}

.service-process {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.service-process-step {
    position: relative;
    padding: 1.25rem 1rem;
    background: #222;
    border-radius: 2px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.service-process-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #a8e6cf;
    border-radius: 50%;
    color: #a8e6cf;
    font-size: 0.75rem;
    margin-right: 0.6rem;
}

.service-process-step small {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: #999;
    margin-top: 0.6rem;
    line-height: 1.5;
}

/* 事例がまだない領域の Coming Soon 表示（サービス詳細・実績一覧の両方で使う） */
.coming-soon {
    margin: 0;
    padding: 2.5rem 0;
    color: #8a8a8a;
    font-size: 0.875rem;
    letter-spacing: 0.12em;
    text-align: center;
    border: 1px dashed #333;
}

.coming-soon[hidden] {
    display: none;
}

/* Speaker Deck 埋め込み。比率は --deck-ratio で個別指定 */
.service-deck iframe {
    display: block;
    width: 100%;
    aspect-ratio: var(--deck-ratio, 16 / 9);
    border: 1px solid #333;
    background: #000;
}

.service-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.service-ringi {
    margin-top: 1rem;
    padding: 2rem;
    background: #222;
    border-left: 2px solid #a8e6cf;
}

.service-ringi-table {
    width: 100%;
    border-collapse: collapse;
}

.service-ringi-table th,
.service-ringi-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid #333;
    font-size: 0.8125rem;
    text-align: left;
    vertical-align: top;
}

.service-ringi-table th {
    width: 180px;
    color: #999;
    font-weight: 400;
    padding-right: 1.5rem;
}

.service-ringi-table td {
    color: #ddd;
}

@media (max-width: 840px) {
    .service-cando-grid,
    .service-works-grid,
    .service-index-grid,
    .service-nav-grid {
        grid-template-columns: 1fr;
    }

    .service-library-row {
        flex-wrap: wrap;
        gap: 0.5rem 0.75rem;
    }

    .service-library-title {
        flex-basis: 100%;
        order: 3;
    }

    .service-library-arrow {
        display: none;
    }

    .service-process {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-ringi-table th {
        width: 120px;
    }
}

/* Figure placeholder（図版差し替え前提のグレーブロック） */
.fig-placeholder {
    margin: 2.5rem 0;
}

.fig-placeholder-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #2e2e2e 0%, #242424 50%, #2a2f2f 100%);
    border: 1px dashed #444;
    border-radius: 2px;
}

.fig-placeholder-id {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #555;
    letter-spacing: 0.1em;
}

.fig-placeholder-caption {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.6rem;
    line-height: 1.6;
}

@media (max-width: 840px) {
    .works-featured-grid,
    .works-card-grid {
        grid-template-columns: 1fr;
    }

    .works-meta-row {
        flex-direction: column;
        gap: 1rem;
    }

    /* 横スクロールに切り替える。左右パディングは .section と揃える */
    .works-filter {
        gap: 1rem;
        padding: 0 2rem 1rem;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .works-filter-item {
        white-space: nowrap;
    }

    /* 続きがあることを、押せると誤解されない形で示す。
       ボタンではなく端のフェード。端まで来たらその側だけ消える。
       マスクなので、下線（.active）も一緒に薄くなって自然に切れる */
    .works-filter {
        --fade-start: 0px;
        --fade-end: 0px;
        -webkit-mask-image: linear-gradient(to right,
            transparent 0,
            #000 var(--fade-start),
            #000 calc(100% - var(--fade-end)),
            transparent 100%);
        mask-image: linear-gradient(to right,
            transparent 0,
            #000 var(--fade-start),
            #000 calc(100% - var(--fade-end)),
            transparent 100%);
    }

    .works-filter.has-fade-start {
        --fade-start: 3rem;
    }

    .works-filter.has-fade-end {
        --fade-end: 3rem;
    }
}

/* --- Responsive --- */
@media (max-width: 840px) {
    .service-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-preview,
    .service-content,
    .footer-cta {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: none;
        grid-auto-rows: 200px;
        aspect-ratio: auto;
    }

    /* タブレット以下は明示配置を解除して流し込み。Featured枠は横幅いっぱいに */
    .portfolio-item--big1,
    .portfolio-item--big2,
    .portfolio-item--big3,
    .portfolio-item--big4,
    .portfolio-item--big5 {
        grid-column: span 2;
        grid-row: auto;
    }

    .portfolio-item-overlay {
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 70%, transparent 100%);
        padding: 1rem;
    }

    /* スマホは高さが限られるためタグを常時表示し、説明文は非表示 */
    .portfolio-item-desc {
        display: none;
    }

    .portfolio-item-tags {
        opacity: 1;
    }

    .portfolio-item-title {
        font-size: 0.8125rem;
    }

    .hero h1 {
        font-size: 2rem;
    }
}

@media (max-width: 540px) {
    .service-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3rem 1rem;
    }

    /* 左右パディングを持つ要素は .section と同じ値に揃える。
       ここが不揃いだと、狭い画面で本文とヘッダー・フッターの左端がずれる */
    .page-header,
    .article-header,
    .article-content,
    .works-filter,
    .site-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .site-header {
        padding: 0 1rem;
    }

    .team-grid {
        grid-template-columns: 1fr 1fr;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-rows: 180px;
        aspect-ratio: auto;
    }

    .portfolio-item--big1,
    .portfolio-item--big2,
    .portfolio-item--big3,
    .portfolio-item--big4 {
        grid-column: span 1;
        grid-row: auto;
    }

    .footer-nav {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   About page — Vision / Approach / Team
   ============================================ */

.about-statement p {
    font-family: var(--font-serif-jp);
    font-size: 1rem;
    color: #ddd;
    line-height: 2.2;
    margin: 0 0 1.75rem;
}

.about-statement p:last-child {
    margin-bottom: 0;
}

/* --- Vision セクション --- */
/* 見出しは中央で構え、本文はブロックごと中央に置いて文字は左揃え */
.about-vision {
    padding-top: 5rem;
    padding-bottom: 8rem;
}

.about-vision-label {
    text-align: center;
    margin-bottom: 2.5rem;
}

.about-vision-title {
    font-family: var(--font-serif-jp);
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.04em;
    color: #fff;
    text-align: center;
    margin: 0;
}

/* 狭い画面では 13文字が1行に収まらず「む。」だけが取り残される。
   画面幅に比例させて、320px でも1行に収まるサイズにする。
   540px 以上では従来どおり 1.75rem（28px）で頭打ちになり、見た目は変わらない */
@media (max-width: 540px) {
    .about-vision-title {
        font-size: min(5.4vw, 1.75rem);
    }
}

/* 見出しと本文を分ける細いアクセント線 */
.about-vision-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: #a8e6cf;
    margin: 3rem auto 0;
}

.about-vision .about-statement {
    max-width: 640px;
    margin: 3rem auto 0;
    text-align: left;
}

/* 結びの一文だけ白く起こして締める */
.about-vision .about-statement p:last-child {
    color: #fff;
    margin-top: 2.5rem;
}

.approach-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-top: 8rem;
}

/* 1つめだけはセクション見出しからの距離なので詰める */
.approach-item:first-of-type {
    margin-top: 4rem;
}

.approach-item--reverse .approach-fig {
    order: 2;
}

.approach-item--reverse .approach-text {
    order: 1;
}

.approach-text h3 {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.approach-text p {
    font-size: 0.875rem;
    color: #ccc;
    line-height: 1.9;
    margin-bottom: 1rem;
}

.approach-text p:last-child {
    margin-bottom: 0;
}

/* アプローチ内の定義リスト（Design / Craft / Business） */
.approach-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.approach-list li {
    font-size: 0.875rem;
    color: #ccc;
    line-height: 1.9;
    margin-bottom: 0.5rem;
}

.approach-list li:last-child {
    margin-bottom: 0;
}

.approach-list-label {
    color: #fff;
}

.about-team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.about-team-member h4 {
    font-size: 1.0625rem;
    color: #fff;
    margin-bottom: 0.25rem;
}

.about-team-member h4 span {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #999;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

.about-team-role {
    font-size: 0.75rem;
    color: #a8e6cf;
    letter-spacing: 0.08em;
    margin: 0.5rem 0 0.875rem;
}

.about-team-bio {
    font-size: 0.8125rem;
    color: #bbb;
    line-height: 1.9;
}

@media (max-width: 840px) {
    .approach-item {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-top: 5rem;
    }

    .approach-item:first-of-type {
        margin-top: 3rem;
    }

    /* 縦積みでは3項目とも「テキスト → 図」の順に揃える。
       先に何の話かを読んでから図を見るほうが理解しやすく、
       PCの左右交互（--reverse）の並びを縦にそのまま持ち込むと
       項目ごとに順番が変わって落ち着かないため */
    .approach-text {
        order: 1;
    }

    .approach-fig {
        order: 2;
    }

    /* メンバー間は gap だけでなく、氏名(h4)の既定の上マージン23pxも
       上乗せされていて合計76pxあった。h4側を打ち消したうえで gap を詰め、
       間隔をおよそ半分にする */
    .about-team-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .about-team-member h4 {
        margin-top: 0;
    }

    .company-layout {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
}
