/* === Google Font のインポート === */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Noto+Serif+JP:wght@700;900&display=swap');

/* === カラーとフォントの変数定義（名刺準拠） === */
:root {
    --white: #FFFFFF;
    --black: #333333;
    --light-gray: #F7F7F7;
    --rust-red: #B7312C;
    /* 名刺の「M」とアクセント */
    --dark-brown: #5D4037;
    /* 名刺の「B」 */
    --olive-green: #556B2F;
    /* 名刺の「E」 */

    --font-serif: 'Noto Serif JP', serif;
    --font-sans: 'Noto Sans JP', sans-serif;
}

/* === 基本スタイル === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    color: var(--black);
    line-height: 1.7;
    background-color: var(--white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.pc-only {
    display: block;
}

.sp-only {
    display: none;
}

/* === ボタン スタイル === */
.cta-button {
    display: inline-block;
    padding: 12px 32px;
    background-color: var(--rust-red);
    color: var(--white);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 2px solid var(--rust-red);
}

.cta-button:hover {
    background-color: #a02a25;
    transform: translateY(-2px);
}

.cta-button.large {
    padding: 16px 48px;
    font-size: 1.1rem;
}

.secondary-button {
    display: inline-block;
    padding: 12px 32px;
    background-color: transparent;
    color: var(--white);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 2px solid var(--white);
}

.secondary-button:hover {
    background-color: var(--white);
    color: var(--black);
}

/* === セクション共通 === */
.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 3.5rem;
    color: var(--black);
}

/* === 0. ヘッダー & ナビゲーション === */
.header {
    width: 100%;
    padding: 1rem 0;
    /* ← 修正後 (上下に16px) */
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid #eee;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-img {
    height: 50px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    font-weight: 700;
    position: relative;
    padding: 0.5rem 0.5rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--rust-red);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    background-color: var(--rust-red);
    color: var(--white);

    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-cta:hover {
    background-color: #a02a25;
}

.nav-cta::after {
    display: none;
    /* CTAボタンは下線を消す */
}

.hamburger {
    display: none;
    /* スマホでのみ表示 */
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--black);
    transition: all 0.3s ease;
}

/* PCでは非表示にするスマホ専用要素 (ここで定義) */
.nav-item-close,
.nav-item-footer {
    display: none;
}

/* === 1. ヒーローセクション === */
.hero {
    min-height: 65vh;
    margin-top: 80px;
    /* ヘッダー分 */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);

    /* 仮の背景（ここに画像を適用） */
    /* background-color: #222; */
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('./images/bme_pc_hero_1.png');
    background-size: cover;
    background-position: center;

}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.hero-title span {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    margin-top: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* === 2. 課題提起（よくある失敗） === */
.issues-section {
    padding: 6rem 0;
    background-color: var(--light-gray);
}

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

.issue-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.issue-icon {
    margin-bottom: 1.5rem;
    /* アイコンを中央に配置（仮） */
    display: flex;
    justify-content: center;
}

.issue-icon img {
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.issue-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--black);
}

.bridge-copy {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    color: var(--black);
}

/* === 3. BMEの強み === */
.strengths-section {
    padding: 6rem 0;
    background-color: var(--white);
}

.strength-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
}

.strength-item.reverse {
    grid-template-columns: 1fr 1fr;
    /* スマホで順序変更するため */
}

.strength-item.reverse .strength-image {
    order: 2;
}

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

.strength-image img {
    width: 100%;
    /* height: 400px; */
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.strength-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--rust-red);
}

.strength-text p {
    font-size: 1.1rem;
}

/* === 4. 開発実績 === */
.portfolio-section {
    padding: 6rem 0;
    background-color: var(--light-gray);
}

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

.portfolio-card {
    background-color: var(--white);
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}


.portfolio-image {
    margin: 10% 10% 0;
    /* ↓↓↓ この行を追加してください ↓↓↓ */
    overflow: hidden;

}

.portfolio-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 3px;
    /* ↓↓↓ この行を追加してください ↓↓↓ */
    object-position: center 70%;
    /* 画像の中央(50%)より少し下(70%)を基準に切り取ります */
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-title {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.portfolio-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    min-height: 50px;
    /* カードの高さを揃えるため */
}

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

.tags .tag {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    background-color: var(--olive-green);
}



/* === 5. 私たちの想い === */
.message-section {
    padding: 6rem 0;
    background-color: var(--black);
    color: var(--white);
    text-align: center;
}

.message-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.message-text {
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.message-signature {
    font-weight: 700;
    /* font-style: italic; */
}

/* === 6. お問い合わせ（CTA） === */
.cta-section {
    padding: 6rem 0;
    background-color: var(--white);
    text-align: center;
}

.cta-content h2 {
    color: var(--black);
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

/* === 8. お問い合わせフォーム (ここから差し替え) === */

/* #contact セクションは .issues-section (グレー背景) のスタイルを流用します。
  padding: 6rem 0; や background-color: var(--light-gray); は
  .issues-section (style.css 267行目) で定義済みです。
*/

/* フォーム本体のスタイル (旧 .area.inner のスタイル) */
.contact-form {
    max-width: 800px;
    /* フォームの横幅を読みやすいサイズに設定 */
    margin: 0 auto;
    padding: 2.5rem 3rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* フォームタイトルは .section-title (style.css 102行目) のスタイルを流用するため、
  .contact_ttl_blc 関連のCSSはすべて不要です。
*/


/* フォームテーブルのスタイル */
.contact_tbl {
    width: 100%;
    border-collapse: collapse;
}

.contact_tbl th,
.contact_tbl td {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

.contact_tbl th {
    width: 35%;
    /* ラベルの幅 */
    font-weight: 700;
    padding-right: 1.5rem;
}

.contact_tbl td {
    width: 65%;
}

/* 最後の行のボーダーを削除 */
.contact_tbl tr:last-child th,
.contact_tbl tr:last-child td {
    border-bottom: none;
}

/* 入力フィールドのスタイル */
.contact_tbl input[type="text"],
.contact_tbl input[type="tel"],
.contact_tbl input[type="email"],
.contact_tbl textarea {
    width: 100%;
    padding: 12px;
    font-family: var(--font-sans);
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: var(--white);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    /* iOSでのデフォルトスタイル解除 */
}

/* フォーカス時のスタイル */
.contact_tbl input[type="text"]:focus,
.contact_tbl input[type="tel"]:focus,
.contact_tbl input[type="email"]:focus,
.contact_tbl textarea:focus {
    border-color: var(--rust-red);
    box-shadow: 0 0 5px rgba(183, 49, 44, 0.3);
    outline: none;
}

.contact_tbl textarea {
    min-height: 150px;
    resize: vertical;
}

/* 送信ボタンのスタイル */
.confirm {
    text-align: center;
    margin-top: 2.5rem;
}

.confirm input[type="submit"] {
    /* サイト共通の .cta-button スタイルを適用 */
    display: inline-block;
    padding: 16px 48px;
    background-color: var(--rust-red);
    color: var(--white);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: 2px solid var(--rust-red);
    cursor: pointer;
    -webkit-appearance: none;
}

.confirm input[type="submit"]:hover {
    background-color: #a02a25;
    transform: translateY(-2px);
}


/* === フォームのレスポンシブ対応 (768px以下) === */
@media (max-width: 768px) {
    /* .issues-section のレスポンシブスタイル (style.css 537行目) で
      padding: 4rem 0; が適用されています。
    */

    .contact-form {
        padding: 2rem 1.5rem;
    }

    /* タイトルは .section-title のレスポンシブスタイル (style.css 541行目) が
      適用されます。
    */

    /* テーブルレイアウトを解除して縦積みに */
    .contact_tbl th,
    .contact_tbl td {
        display: block;
        width: 100%;
    }

    .contact_tbl th {
        width: 100%;
        padding-bottom: 0.25rem;
        padding-right: 0;
        border-bottom: none;
    }

    .contact_tbl td {
        width: 100%;
        padding-top: 0;
        padding-bottom: 1.5rem;
    }
}

/* === (ここまで差し替え) === */

/* === 7. フッター === */
.footer {
    padding: 3rem 0;
    background-color: #222;
    color: #aaa;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info {
    font-size: 0.9rem;
}

.footer-company {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.footer-copyright {
    font-size: 0.85rem;
}


/* ############################################### */
/* === レスポンシブ対応 (768px以下のスマホ) === */
/* ############################################### */

@media (max-width: 768px) {
    .pc-only {
        display: none;
    }

    .sp-only {
        display: block;
    }

    /* === スマホ用ナビゲーション === */

    /* === スマホ用ナビゲーション (デザイン改善版) === */
    .nav-links {
        /* 基本設定 */
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        transition: right 0.4s ease-in-out;
        z-index: 2000;
        /* ← この行を追加 */

        /* ↓↓ デザイン変更 ↓↓ */
        display: flex;
        /* ← スマホではflexを強制 */
        background-color: rgba(76, 62, 58, 0.8);
        flex-direction: column;
        justify-content: space-between;
        /* 上(close)・中(links)・下(footer)に分離 */
        align-items: center;
        padding: 5rem 1rem 2rem 1rem;
        /* 上(ボタン分)・左右・下 のパディング */
        gap: 0;
        /* 個別のgapはliで設定 */
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links.active li {

        border-bottom: #b2afaf 1px solid;
    }



    /* (↓ここから下のスタイルが @media (max-width: 768px) 内で適用されます↓) */

    .hamburger {
        display: flex;
        z-index: 1001;
        /* メニューより手前に */
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .nav-links a {
        font-size: 1.1rem;
        /* 既存の1.25remから微調整 */
        color: var(--white);
        /* 文字色を白に */
        padding: 0.75rem 0;
        display: block;
        width: 100%;
        border-radius: 4px;
        transition: background-color 0.3s ease;
    }

    .nav-links a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .nav-links a::after {
        display: none;
        /* スマホではPC用の下線を消す */
    }

    /* スマホ用 CTAボタンのスタイル */
    .nav-links .nav-cta {
        background-color: var(--rust-red);
        /* 赤い背景 */
        color: var(--white);
        /* 白文字 */
        margin-top: 1rem;
    }

    .nav-links .nav-cta:hover {
        background-color: #a02a25;
    }

    /* スマホ専用クローズボタン */
    .nav-item-close {
        display: block;
        /* スマホで表示 */
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
        width: 44px;
        height: 44px;
        margin-bottom: 0;
        /* liの余白をリセット */
    }

    .sp-nav-close {
        background: none;
        border: none;
        cursor: pointer;
        width: 100%;
        height: 100%;
        position: relative;
    }

    /* ×マークの作成 */
    .sp-nav-close::before,
    .sp-nav-close::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 24px;
        /* 線の長さ */
        height: 3px;
        /* 線の太さ */
        background-color: var(--white);
        /* 白いバツ印 */
    }

    .sp-nav-close::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .sp-nav-close::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    /* スマホ専用フッター */
    .nav-item-footer {
        display: block;
        /* スマホで表示 */
        width: 100%;
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.8rem;
        padding-top: 2rem;
        margin-bottom: 0;
    }

    /* ハンバーガーのアニメーション (X印) */
    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* === ヒーローセクション（スマホ） === */
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-title span {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    /* === 課題提起（スマホ） === */
    .issues-section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }

    /* ↓↓↓ このブロックを丸ごと追加してください ↓↓↓ */
    section[id] {
        scroll-margin-top: 20px;
    }

    .issues-grid {
        grid-template-columns: 1fr;
        /* 1カラムに */
    }

    .bridge-copy {
        font-size: 1.5rem;
    }

    /* === 強み（スマホ） === */
    .strengths-section {
        padding: 4rem 0 1rem;
    }

    .strength-item,
    .strength-item.reverse {
        grid-template-columns: 1fr;
        /* 1カラムに */
        gap: 2rem;
    }

    .strength-item.reverse .strength-image,
    .strength-item.reverse .strength-text {
        order: 0;
        /* 順序をリセット */
    }

    .strength-image img {
        /* height: 250px; */
    }

    .strength-title {
        font-size: 1.75rem;
    }

    /* === 実績（スマホ） === */
    .portfolio-section {
        padding: 4rem 0;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        /* 1カラムに */
    }

    /* === 想い（スマホ） === */
    .message-section {
        padding: 4rem 0;
    }

    .message-title {
        font-size: 2rem;
    }

    .message-text {
        font-size: 1rem;
    }

    /* === CTA（スマホ） === */
    .cta-section {
        padding: 4rem 0;
    }

    /* === フッター（スマホ） === */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
}