/* =================================================================
   gutenberg-front.css
   Gutenbergブロックのデフォルトスタイルをテーマに合わせて上書き
   ================================================================= */

/* --- wp-block-group がテーマのセクション構造と共存できるように --- */
.wp-block-group.sec_tmpl_block {
    padding: 80px 0;
}

.wp-block-group.tmpl_inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 80px;
}

/* Gutenbergがgroupブロックに付けるデフォルトpaddingを除去 */
.wp-block-group:where(.has-global-padding) > * {
    padding-right: 0;
    padding-left: 0;
}

/* ★ Gutenberg 6.x のデフォルトレイアウトスタイルを無効化 */
.wp-block-group > .wp-block-group__inner-container {
    max-width: none;
    padding: 0;
}

/* sec_tmpl_block 内の背景色を確実に適用 */
.wp-block-group.tmpl_overview { background-color: #f8f8f8; }
.wp-block-group.tmpl_publications { background-color: #fff; }
.wp-block-group.tmpl_history { background-color: #f8f8f8; }
.wp-block-group.tmpl_organization { background-color: #fff; }
.wp-block-group.tmpl_contact_cta { background-color: #e6ebf5; text-align: center; }
.wp-block-group.tmpl_cta_section {
    background: linear-gradient(135deg, #002060 0%, #1565c0 100%);
    color: white;
    text-align: center;
}
.wp-block-group.tmpl_cta_section h2 { color: white; }
.wp-block-group.tmpl_cta_section p { color: white; opacity: 0.9; }

/* --- 見出し --- */
.wp-block-heading.tmpl_section_title {
    font-size: 28px;
    font-weight: 500;
    color: #555;
    margin-bottom: 50px;
    position: relative;
    font-family: 'Noto Serif JP', serif;
}

.wp-block-heading.tmpl_section_title:before {
    content: "◇";
    color: #777;
    margin-right: 15px;
    font-size: 16px;
    position: relative;
    top: -5px;
}

/* 製品詳細内の見出し */
.tmpl_product_content .wp-block-heading {
    font-family: 'Noto Serif JP', serif;
}
.tmpl_product_content h2.wp-block-heading {
    font-size: 24px;
    color: #333;
    margin: 40px 0 20px 0;
    border-bottom: 2px solid #002060;
    padding-bottom: 10px;
}
.tmpl_product_content h3.wp-block-heading {
    font-size: 20px;
    color: #333;
    margin: 30px 0 15px 0;
}

/* --- 段落 --- */
/* ★ 全体：段落の間隔を確保（common.cssのリセットを上書き） */
.wp-block-group p,
.sec_tmpl_block p,
.tmpl_inner p,
.tmpl_product_content p,
.tmpl_product_container p,
p.wp-block-paragraph {
    margin-bottom: 20px !important;
    font-size: 16px;
    line-height: 1.8;
}

/* --- 画像ブロック --- */
.wp-block-image {
    margin: 20px 0;
}

.wp-block-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.tmpl_product_content > .wp-block-image {
    max-width: 70%;
    margin: 20px auto;
}

/* --- ボタンブロック --- */
/* ★ Gutenbergのデフォルトボタンスタイルを完全に上書き */
.wp-block-buttons .wp-block-button .wp-block-button__link,
.wp-block-buttons .wp-block-button .wp-element-button {
    background: #002060;
    color: white;
    padding: 15px 30px;
    border-radius: 0;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: none;
    line-height: 1.4;
}

.wp-block-buttons .wp-block-button .wp-block-button__link:hover,
.wp-block-buttons .wp-block-button .wp-element-button:hover {
    background: #001040;
    color: white;
    opacity: 1;
}

.wp-block-button.tmpl_back_button .wp-block-button__link {
    background: #002060;
    color: white;
    padding: 15px 30px;
    border-radius: 0;
}

/* --- カラムブロック --- */
.wp-block-columns.tmpl_columns {
    gap: 20px;
}

.wp-block-columns.tmpl_columns .wp-block-column {
    flex-basis: auto !important;
    margin: 0 !important;
}

/* --- リストブロック --- */
.tmpl_product_content .wp-block-list {
    margin: 20px 0;
    padding-left: 30px;
}

.tmpl_product_content .wp-block-list li {
    margin-bottom: 10px;
}

/* --- 埋め込みブロック（YouTube等） --- */
.wp-block-embed-youtube {
    max-width: 70%;
    margin: 20px auto;
}

/* --- セパレータ --- */
.wp-block-separator {
    border-top: 1px solid #e0e0e0;
    margin: 40px 0;
}

/* --- カスタムHTMLブロック内はテーマCSSがそのまま効く --- */
/* 追加の上書きは不要 */

/* =================================================================
   レスポンシブ
   ================================================================= */
@media (max-width: 1200px) {
    .wp-block-group.tmpl_inner {
        padding: 0 50px;
    }
}

@media (max-width: 992px) {
    .wp-block-group.tmpl_inner {
        padding: 0 40px;
    }
}

@media (max-width: 768px) {
    .wp-block-group.tmpl_inner {
        padding: 0 20px;
    }

    .wp-block-group.sec_tmpl_block {
        padding: 50px 0;
    }

    .wp-block-heading.tmpl_section_title {
        font-size: 24px;
        margin-bottom: 35px;
    }

    .tmpl_product_content > .wp-block-image {
        max-width: 100%;
    }

    .wp-block-embed-youtube {
        max-width: 100%;
    }

    .wp-block-columns.tmpl_columns {
        flex-direction: column;
    }
}
