/*
Theme Name: oshigotonote-mikawa
Author: 株式会社プライズメント
Version: 3.1.0
*/

:root {
    --color-main: #4eb99f;    /* ロゴの緑系 */
    --color-sub: #e9546b;     /* ロゴの赤系 */
    --color-accent: #f39800;  /* 警告・ボタンのオレンジ */
    --color-text: #333;
    --color-gray: #f8fbfa;
    --shadow: 0 10px 40px rgba(0,0,0,0.06);
}

html { scroll-behavior: smooth; }
body { 
    margin: 0; font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif; 
    color: var(--color-text); line-height: 1.8; -webkit-font-smoothing: antialiased;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 25px; }

/* Header */
.site-header {
    background: rgba(255,255,255,0.98); backdrop-filter: blur(5px);
    position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 20px rgba(0,0,0,0.05);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; height: 100px; }
.logo a { display: flex; align-items: center; gap: 15px; }
.logo img { height: 60px; width: auto; }
.logo-sub { 
    background: var(--color-main); color: #fff; padding: 2px 10px; border-radius: 4px; 
    font-size: 14px; font-weight: bold; margin-top: 5px;
}

.header-nav { display: flex; align-items: center; gap: 30px; }
.header-nav a { font-weight: 700; font-size: 14px; color: var(--color-text); transition: 0.3s; }
.header-nav a:hover { color: var(--color-main); }
.btn-contact-head {
    background: var(--color-sub); color: #fff !important; padding: 12px 25px;
    border-radius: 50px; transition: 0.3s;
}
.btn-contact-head:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(233,84,107,0.3); opacity: 1; }

/* Hero */
.hero { text-align: center; background: #fff; padding-bottom: 20px; }
.hero img { width: 100%; max-width: 1200px; border-radius: 0 0 40px 40px; box-shadow: var(--shadow); }

/* Information */
.info-section { padding: 40px 0; }
.info-box { 
    background: var(--color-main); color: #fff; border-radius: 15px; 
    display: flex; box-shadow: var(--shadow); overflow: hidden;
}
.info-title { 
    background: rgba(0,0,0,0.08); padding: 40px; width: 220px; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.info-title b { font-size: 22px; letter-spacing: 0.1em; }
.info-list { flex: 1; padding: 25px 40px; margin: 0; list-style: none; }
.info-list li { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.2); font-size: 15px; }

/* Concept Section */
.sec-title { text-align: center; font-size: 30px; color: var(--color-main); margin-bottom: 60px; font-weight: 800; }
.sec-title span { display: block; font-size: 14px; color: var(--color-sub); margin-bottom: 10px; opacity: 0.8; }

.concept { background: var(--color-gray); padding: 100px 0; }
.concept-lead { font-size: 22px; font-weight: bold; color: #444; line-height: 2; margin-bottom: 60px; text-align: center; }
.concept-lead strong { color: var(--color-sub); }

.concept-flex { display: flex; align-items: center; gap: 60px; }
.concept-text { flex: 1.2; font-size: 17px; line-height: 2.2; }
.concept-img { flex: 0.8; }
.concept-img img { border-radius: 20px; box-shadow: var(--shadow); border: 10px solid #fff; }

/* Contents Detail */
.contents-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 80px 0; }
.sample-box img { width: 100%; border-radius: 10px; box-shadow: var(--shadow); }
.contents-list-wrap { background: #fff; border-radius: 15px; border: 3px solid var(--color-main); overflow: hidden; }
.contents-list-wrap h3 { background: var(--color-main); color: #fff; padding: 15px 25px; margin: 0; }
.contents-list { padding: 25px; list-style: none; margin: 0; }
.contents-list li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid #f0f0f0; font-weight: bold; }
.contents-list li::before { content: "●"; color: var(--color-sub); position: absolute; left: 0; }

/* Company Grid */
.area-label { background: var(--color-main); color: #fff; padding: 10px 30px; display: inline-block; border-radius: 50px; margin-bottom: 30px; font-weight: bold; }
.company-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 80px; }
.company-card { background: #fff; padding: 20px; border-radius: 15px; border: 1px solid #eee; display: flex; align-items: center; gap: 20px; transition: 0.3s; }
.company-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--color-main); }
.co-logo { width: 100px; height: 100px; object-fit: contain; background: #f9f9f9; padding: 10px; border-radius: 10px; }
.co-info h4 { margin: 0 0 5px; font-size: 18px; }
.co-type { font-size: 13px; color: var(--color-main); margin-bottom: 15px; font-weight: bold; }
.co-btns { display: flex; gap: 10px; }
.btn-co { padding: 7px 15px; border-radius: 4px; font-size: 11px; font-weight: bold; color: #fff !important; }
.btn-hp { background: var(--color-sub); }
.btn-pdf { background: #555; }

/* Distribution */
.school-table { width: 100%; border-collapse: separate; border-spacing: 0 10px; }
.school-table td { background: #f0f6f4; padding: 25px; border-radius: 0; }
.school-table td:first-child { border-left: 6px solid var(--color-main); border-radius: 10px 0 0 10px; font-weight: bold; width: 200px; }
.school-table td:last-child { border-radius: 0 10px 10px 0; text-align: right; }
.school-table b { color: var(--color-sub); font-size: 28px; }

/* Footer */
.footer-cta { background: var(--color-accent); padding: 80px 0; text-align: center; color: #fff; }
.btn-cta-big { background: #fff; color: var(--color-accent) !important; padding: 20px 80px; border-radius: 50px; font-size: 22px; font-weight: 900; box-shadow: 0 10px 0 rgba(0,0,0,0.1); }

.site-footer { background: #333; color: #fff; padding: 80px 0; text-align: center; }
.footer-logos { display: flex; justify-content: center; gap: 50px; margin-bottom: 30px; font-weight: bold; }

@media (max-width: 900px) {
    .header-nav { display: none; }
    .concept-flex, .contents-grid, .company-grid { grid-template-columns: 1fr; }
    .info-box { flex-direction: column; }
    .info-title { width: 100%; padding: 20px; }
}

/* --- 全体設定：はみ出し防止 --- */
*, *::before, *::after { 
    box-sizing: border-box; /* パディングを含めた幅計算にする */
}

html, body {
    overflow-x: hidden; /* 横スクロールを完全に禁止 */
    width: 100%;
}

.container { 
    max-width: 1140px; 
    margin: 0 auto; 
    padding: 0 20px; /* スマホ時の左右余白 */
}

/* --- 画像グリッドの修正 (img_list01〜04) --- */
.img-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* PCは4枚並び */
    gap: 15px;
    margin-top: 40px;
}

.img-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    box-shadow: var(--shadow);
    object-fit: cover; /* 比率を保ちつつトリミング */
    aspect-ratio: 4 / 3; /* 高さを揃えてプロ感を出す */
}

/* --- スマホ表示 (900px以下) の徹底最適化 --- */
@media (max-width: 900px) {
    .header-inner { height: 80px; }
    .logo img { height: 45px; } /* スマホではロゴを少し小さく */
    
    /* ヒーロー画像のはみ出し防止 */
    .hero img {
        border-radius: 0 0 20px 20px;
    }

    /* 情報ボックスをスマホで見やすく */
    .info-box { flex-direction: column; }
    .info-title { width: 100%; padding: 15px; }
    .info-list { padding: 15px 20px; }

    /* コンセプト（画像と文字を縦並びに） */
    .concept-flex { 
        flex-direction: column-reverse; /* スマホでは画像が上、文字が下 */
        gap: 30px; 
    }
    .concept-text { font-size: 15px; text-align: left; }
    .concept-lead { font-size: 18px; margin-bottom: 30px; }

    /* どんな内容？グリッドを縦に */
    .contents-grid { 
        grid-template-columns: 1fr; 
        gap: 30px; 
        padding: 40px 0;
    }

    /* 画像グリッドをスマホでは2x2に変更（はみ出し防止） */
    .img-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
    }

    /* 企業カードをスマホでは1カラムに */
    .company-grid { 
        grid-template-columns: 1fr; 
        gap: 20px; 
    }
    .company-card {
        padding: 15px;
        flex-direction: row; /* 横並びは維持しつつコンパクトに */
        align-items: flex-start;
    }
    .co-logo { width: 70px; height: 70px; } /* ロゴをスマホサイズに */
    .co-info h4 { font-size: 16px; }
    .btn-co { padding: 6px 10px; font-size: 10px; }

    /* 配布小学校テーブルをスマホで見やすく */
    .school-table td { 
        display: block; 
        width: 100% !important; 
        text-align: left !important;
        padding: 15px;
    }
    .school-table td:first-child { 
        border-bottom: none; 
        padding-bottom: 5px;
    }
    .school-table td:last-child {
        padding-top: 0;
    }
}


/* --- 画像グリッドの修正 (PC・スマホ共通で4枚横一列) --- */
.img-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 常に4カラム固定 */
    gap: 15px; /* PC時の余白 */
    margin-top: 40px;
    width: 100%;
}

.img-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px; /* 少し角を丸めてプロ感を出す */
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    object-fit: cover;
    aspect-ratio: 1 / 1; /* 正方形に揃えるときれいに並びます */
}

/* --- スマホ表示 (900px以下) の最適化 --- */
@media (max-width: 900px) {
    /* 画像グリッド：スマホでも4枚横一列を維持 */
    .img-grid {
        gap: 5px; /* スマホでは余白を最小限にして画像を大きく見せる */
    }
    
    .img-grid img {
        border-radius: 4px; /* スマホでは角丸を控えめに */
    }

    /* その他スマホ最適化（継続） */
    .container { padding: 0 15px; }
    .header-inner { height: 70px; }
    .logo img { height: 40px; }
    
    .concept-flex { flex-direction: column-reverse; gap: 20px; }
    .concept-text { font-size: 14px; }
    
    .company-grid { grid-template-columns: 1fr; gap: 15px; }
    .company-card { padding: 12px; gap: 12px; }
    .co-logo { width: 60px; height: 60px; }
    .co-info h4 { font-size: 15px; margin-bottom: 2px; }
    .co-type { font-size: 11px; margin-bottom: 8px; }
    .btn-co { padding: 5px 8px; font-size: 10px; }

    .school-table td { 
        display: block; width: 100% !important; padding: 12px; 
    }
    .school-table td:first-child { border-bottom: none; padding-bottom: 0; }
}


/* --- 掲載企業カードの修正 --- */
.company-card {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #eee;
    display: flex;
    align-items: center; /* 垂直方向の中央揃え */
    gap: 20px;
    transition: 0.3s;
    overflow: hidden; /* 箱からはみ出るものを隠す */
    position: relative;
    min-height: 140px; /* カードの最低限の高さを確保 */
}

.company-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: var(--color-main);
}

/* ロゴを入れる「箱」の設定 */
.co-logo {
    flex: 0 0 100px; /* 幅を100pxで固定（伸び縮みさせない） */
    height: 100px;   /* 高さも100pxで固定 */
    background: #f9f9f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* はみ出し防止の決定打 */
    padding: 5px;    /* 枠線ギリギリにならないよう余白 */
}

/* ロゴ画像自体の設定 */
.co-logo img {
    max-width: 100% !important; /* 箱の幅以上に大きくならない */
    max-height: 100% !important; /* 箱の高さ以上に大きくならない */
    width: auto !important;      /* 比率を維持 */
    height: auto !important;     /* 比率を維持 */
    object-fit: contain;         /* 箱の中に全体が収まるように自動調整 */
}

/* 右側のテキスト情報 */
.co-info {
    flex: 1;      /* 残りの幅をすべて使う */
    min-width: 0; /* 文字が長すぎても枠を突き破らないようにする魔法のコード */
}

.co-info h4 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word; /* 長い単語でも改行する */
}

/* --- スマホ時の微調整 (900px以下) --- */
@media (max-width: 900px) {
    .company-card {
        padding: 15px;
        gap: 15px;
        min-height: auto; /* スマホでは高さ固定を解除 */
    }
    .co-logo {
        flex: 0 0 80px; /* スマホでは少し小さく80pxに */
        height: 80px;
    }
    .co-info h4 {
        font-size: 16px;
    }
    .co-btns {
        flex-wrap: wrap; /* ボタンが並びきらない場合は折り返す */
        gap: 8px;
    }
}

/* --- お問い合わせフォーム専用デザイン --- */
.contact-header { padding: 60px 0 40px; text-align: center; }
.contact-page-title { 
    color: #0056b3; font-size: 28px; font-weight: bold; 
    border-top: 2px solid #0056b3; border-bottom: 2px solid #0056b3;
    display: inline-block; padding: 10px 40px; margin-bottom: 30px;
}
.contact-intro { font-size: 15px; color: #333; line-height: 1.8; }

.contact-container { max-width: 850px; padding-bottom: 100px; }
.contact-form-box { 
    border: 1px solid #0056b3; padding: 40px; background: #fff; margin-bottom: 30px;
}

/* 項目ラベル */
.form-label { display: flex; align-items: center; gap: 10px; font-weight: bold; color: #003366; margin-bottom: 10px; margin-top: 25px; }
.form-label::before { content: ""; display: inline-block; width: 12px; height: 12px; background: #0056b3; }
.label-required { color: #cc0000; font-size: 12px; margin-left: 10px; background: #fff; }

/* 入力フィールド */
.wpcf7-form-control:not(.wpcf7-submit):not(.wpcf7-radio) {
    width: 100% !important; background: #eef2f6 !important; border: 1px solid #d1d9e0 !important;
    padding: 12px !important; border-radius: 4px; font-size: 16px;
}
.wpcf7-form-control:focus { background: #fff !important; outline: none; border-color: #0056b3 !important; }

/* ラジオボタン */
.wpcf7-list-item { display: block; margin: 5px 0 5px 22px !important; font-size: 15px; }

/* 送信ボタン */
.wpcf7-submit {
    display: block; width: 300px !important; margin: 40px auto 0 !important;
    background: #004692 !important; color: #fff !important; font-weight: bold !important;
    font-size: 18px !important; padding: 15px !important; border: none !important;
    border-radius: 5px !important; cursor: pointer; transition: 0.3s;
}
.wpcf7-submit:hover { background: #003366 !important; opacity: 1; }

.contact-disclaimer { font-size: 13px; color: #666; line-height: 1.6; margin-top: 20px; }

/* スマホ調整 */
@media (max-width: 768px) {
    .contact-form-box { padding: 20px; }
    .contact-page-title { font-size: 22px; width: 100%; padding: 10px 0; }
    .wpcf7-submit { width: 100% !important; }
}