/* ========================================
   Padma and Sons - カスタムスタイル（統合版）
   ======================================== */

/* 横スクロール防止 */
body { overflow-x: hidden; }

/* ---- ヘッダー ---- */
.wp-block-navigation a {
    color: #1a2860 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}
.wp-block-navigation a:hover { opacity: 0.7; }

/* ---- 隙間解消（全パターン対応） ---- */
.home .wp-site-blocks {
    padding-top: 0 !important;
    padding-block-start: 0 !important;
}
.home .wp-block-post-content {
    padding-top: 0 !important;
    padding-block-start: 0 !important;
    margin-top: 0 !important;
}
.home .wp-block-post-content.has-global-padding {
    padding-block-start: 0 !important;
}
.home .wp-block-post-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.home .wp-block-group.has-global-padding {
    padding-block-start: 0 !important;
}
/* TT5のテンプレートグループ上部パディング */
.wp-block-template-part ~ .wp-block-post-content {
    padding-block-start: 0 !important;
}

/* ---- ヒーローバナー共通（全幅） ---- */
.padma-hero {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 520px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0 !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    box-sizing: border-box;
}
.padma-hero img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}
.padma-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 1;
}

/* ヒーロー内テキスト（サブページ共通） */
.padma-hero-title {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 58px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    margin: 0;
}

/* ヒーロー内テキスト（TOPページ） */
.padma-hero-text {
    position: relative;
    z-index: 2;
    text-align: center;
}
.padma-hero-main-title {
    color: #ffffff;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
    margin: 0 0 12px;
}
.padma-hero-sub {
    color: #ffffff;
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 6px rgba(0,0,0,0.4);
    margin: 0;
}

/* ---- 会社紹介テキスト ---- */
.padma-intro-text {
    text-align: center;
    padding: 56px 24px;
    max-width: 860px;
    margin: 0 auto;
}
.padma-intro-text p {
    font-size: 20px;
    line-height: 2.2;
    color: #333;
}

/* ---- サービス3カード ---- */
.padma-services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto !important;
    padding: 0 60px 60px;
    box-sizing: border-box;
}
.padma-service-card {
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
    text-decoration: none;
    display: block;
}
.padma-service-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.padma-service-card-label {
    background-color: #ffffff !important;
    color: #1a2860 !important;
    text-align: center;
    padding: 16px 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.7 !important;
    border-top: 1px solid #e5e5e5;
}
.padma-no-link {
    cursor: default;
    display: block;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.10);
}

/* ---- GREETINGセクション（背景画像） ---- */
.padma-top-greeting-section {
    position: relative;
    width: 100vw !important;
    max-width: 100vw !important;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('https://padma-and-sons.co.jp/wp-content/uploads/2026/06/パドマ_top5.jpeg');
    background-size: cover;
    background-position: center;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}
.padma-top-greeting-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 0;
}
.padma-top-greeting-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 60px 24px;
    max-width: 700px;
}
.padma-top-greeting-heading {
    color: #ffffff;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.padma-top-greeting-body {
    color: #ffffff;
    font-size: 16px;
    line-height: 2.0;
    margin-bottom: 36px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ---- CONTACTセクション ---- */
.padma-top-contact-section {
    text-align: center;
    padding: 80px 24px;
    background-color: #ffffff;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}
.padma-top-contact-heading {
    color: #1a2860;
    font-size: 48px;
    font-weight: 800;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}
.padma-top-contact-body {
    color: #333;
    font-size: 16px;
    line-height: 2.0;
    margin-bottom: 36px;
}

/* ---- 共通ボタン ---- */
.padma-btn {
    display: inline-block;
    background-color: #1a2860;
    color: #ffffff !important;
    text-decoration: none !important;
    padding: 16px 60px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.08em;
    transition: opacity 0.2s;
}
.padma-btn:hover { opacity: 0.75; }

/* ---- コンテンツエリア（サブページ共通） ---- */
.padma-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 70px 24px 80px;
}
.padma-section-title {
    color: #1a2860;
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
}
.padma-greeting-subtitle {
    color: #1a2860;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
}
.padma-body-text {
    line-height: 2.3;
    font-size: 16px;
    color: #333333;
}

/* ---- カテゴリーボックス ---- */
.padma-category-box { margin-bottom: 16px; border: 1px solid #d8d8d8; }
.padma-category-header {
    background-color: #e8e8e8;
    color: #1a2860;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 18px;
}
.padma-category-body {
    background-color: #ffffff;
    padding: 14px 26px;
    line-height: 2.0;
    color: #333;
}

/* ---- 会社概要 ---- */
.padma-company-list { list-style: none; padding: 0; margin: 0; }
.padma-company-list li {
    padding: 14px 0;
    border-bottom: 1px solid #e5e5e5;
    font-size: 16px;
    color: #333;
    line-height: 1.8;
}
.padma-company-list li:last-child { border-bottom: none; }

/* ---- フォーム ---- */
.padma-contact-lead {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #1a2860;
    margin-bottom: 48px;
    line-height: 1.9;
}
.padma-form-wrap input[type="text"],
.padma-form-wrap input[type="email"],
.padma-form-wrap input[type="tel"],
.padma-form-wrap textarea,
.padma-form-wrap select {
    width: 100%;
    border: 1px solid #cccccc;
    border-radius: 3px;
    padding: 10px 14px;
    font-size: 15px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
}
.padma-form-wrap .wpcf7-submit {
    display: block;
    margin: 36px auto 0;
    background-color: #1a2860;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 16px 80px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.padma-form-wrap .wpcf7-submit:hover { opacity: 0.8; }
.padma-cf7-table { width: 100%; border-collapse: collapse; }
.padma-cf7-table th,
.padma-cf7-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #ebebeb;
    vertical-align: middle;
    font-size: 15px;
}
.padma-cf7-table th {
    color: #1a2860;
    font-weight: 600;
    width: 200px;
    white-space: nowrap;
}
.required-badge {
    background: #c0392b;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
}

/* ---- フッター ---- */
footer .wp-block-navigation a,
footer a { color: #ffffff !important; }
footer p, footer span { color: #aab8d4 !important; }

/* ---- フロントページのタイトル非表示 ---- */
.home .wp-block-post-title,
.home .entry-title { display: none !important; }

/* ---- レスポンシブ ---- */
@media (max-width: 768px) {
    .padma-hero { height: 260px; }
    .padma-hero-main-title { font-size: 28px; }
    .padma-hero-sub { font-size: 14px; }
    .padma-services-grid {
        grid-template-columns: 1fr;
        padding: 0 20px 40px;
    }
    .padma-top-greeting-heading,
    .padma-top-contact-heading { font-size: 32px; }
    .padma-content { padding: 50px 20px; }
}

/* ============================================
   追加修正（2026-06-12）
   ============================================ */

/* ① ヘッダーとヒーローの残り隙間を解消 */
.wp-site-blocks {
    row-gap: 0 !important;
    gap: 0 !important;
}
.wp-site-blocks > * + * {
    margin-block-start: 0 !important;
}
.home .wp-block-post-content,
.home .wp-block-post-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-block-start: 0 !important;
}

/* ② ヘッダーの左右パディングを広げる＆高さを増やす */
.wp-site-blocks > .wp-block-template-part:first-of-type .wp-block-group,
.wp-site-blocks > .wp-block-template-part:first-of-type > * {
    padding-inline: 48px !important;
    padding-block: 20px !important;
}

/* ③ ナビゲーション文字を大きく */
.wp-block-navigation a,
.wp-block-navigation .wp-block-navigation-item__label {
    font-size: 17px !important;
    font-weight: 500 !important;
    letter-spacing: 0.02em !important;
}

/* ④ フッター背景を紺色に戻す */
.wp-site-blocks > .wp-block-template-part:last-of-type,
.wp-site-blocks > .wp-block-template-part:last-of-type > *,
.wp-site-blocks > .wp-block-template-part:last-of-type .wp-block-group {
    background-color: #0d1b4b !important;
}
.wp-site-blocks > .wp-block-template-part:last-of-type a,
.wp-site-blocks > .wp-block-template-part:last-of-type p,
.wp-site-blocks > .wp-block-template-part:last-of-type span,
.wp-site-blocks > .wp-block-template-part:last-of-type div {
    color: #ffffff !important;
}
.wp-site-blocks > .wp-block-template-part:last-of-type .wp-block-navigation a {
    color: #ffffff !important;
    font-size: 14px !important;
}

/* ============================================
   サブページ共通：タイトル非表示 ＋ 隙間解消
   ============================================ */

/* 全ページのWordPressページタイトルを非表示 */
.wp-block-post-title {
    display: none !important;
}

/* 全ページのヘッダー〜コンテンツ間の隙間を解消 */
.wp-block-post-content {
    padding-top: 0 !important;
    padding-block-start: 0 !important;
    margin-top: 0 !important;
}
.wp-block-post-content > *:first-child {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.wp-block-post-content.has-global-padding {
    padding-block-start: 0 !important;
}

/* ============================================
   ヘッダー縦幅を縮小
   ============================================ */
.wp-site-blocks > .wp-block-template-part:first-of-type .wp-block-group,
.wp-site-blocks > .wp-block-template-part:first-of-type > *,
.wp-site-blocks > .wp-block-template-part:first-of-type {
    padding-block: 10px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    min-height: unset !important;
}

/* ============================================
   サブページの隙間を解消（ブロック間スペース）
   ============================================ */

/* ブロックエディターが自動挿入するブロック間マージンを削除 */
.wp-block-post-content.is-layout-flow > * + * {
    margin-block-start: 0 !important;
}
.wp-block-post-content.is-layout-flow > *:first-child {
    margin-block-start: 0 !important;
    margin-top: 0 !important;
}

/* カスタムHTMLブロック自体の上余白を削除 */
.wp-block-post-content > .wp-block-html:first-child,
.wp-block-post-content > .alignfull:first-child,
.wp-block-post-content > *:first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}

/* TT5のブロックレイアウトgap変数を上書き */
.wp-block-post-content {
    --wp--style--block-gap: 0px !important;
}

/* ============================================
   隙間の最終対処：ネガティブマージンで引き上げ
   ============================================ */
.padma-hero {
    margin-top: -70px !important;
    position: relative;
    z-index: 10;
}

/* ============================================
   横スクロール完全防止
   ============================================ */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* ============================================
   モバイル：ヘッダー修正（文字折り返し・幅）
   ============================================ */
@media (max-width: 782px) {
    /* ヘッダーのpadding-inlineを縮小 */
    .wp-site-blocks > .wp-block-template-part:first-of-type .wp-block-group,
    .wp-site-blocks > .wp-block-template-part:first-of-type > * {
        padding-inline: 16px !important;
        padding-block: 8px !important;
    }

    /* ロゴテキストを1行に収める */
    .wp-block-site-title,
    .wp-block-site-title a {
        font-size: 15px !important;
        white-space: nowrap !important;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60vw !important;
    }

    /* ハンバーガーボタンを正しい位置に */
    .wp-block-navigation__responsive-container-open {
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 9999 !important;
        position: relative !important;
        pointer-events: auto !important;
    }

    /* モバイルナビゲーションを最前面に */
    .wp-block-navigation__responsive-container.is-menu-open {
        z-index: 99999 !important;
    }

    /* ヒーローのネガティブマージンをモバイル用に調整 */
    .padma-hero {
        margin-top: -40px !important;
        height: 260px;
    }

    /* モバイルでヒーローテキストを調整 */
    .padma-hero-main-title { font-size: 26px !important; }
    .padma-hero-title { font-size: 30px !important; }
}

/* ============================================
   フッター：モバイルでのテキスト折り返し修正
   ============================================ */
@media (max-width: 782px) {
    .wp-site-blocks > .wp-block-template-part:last-of-type .wp-block-site-title,
    .wp-site-blocks > .wp-block-template-part:last-of-type p {
        font-size: 14px !important;
        line-height: 1.6 !important;
        text-align: center !important;
    }

    .wp-site-blocks > .wp-block-template-part:last-of-type {
        padding: 32px 20px !important;
    }
}


/* ============================================
   モバイル：ヘッダーの縦幅を縮小
   ============================================ */
@media (max-width: 782px) {
    .wp-site-blocks > .wp-block-template-part:first-of-type,
    .wp-site-blocks > .wp-block-template-part:first-of-type > *,
    .wp-site-blocks > .wp-block-template-part:first-of-type .wp-block-group {
        padding-top: 6px !important;
        padding-bottom: 6px !important;
        padding-block: 6px !important;
        padding-inline: 20px !important;
        min-height: unset !important;
    }
}


/* フッター：ロゴを中央揃えに */
@media (max-width: 782px) {
    .wp-site-blocks > .wp-block-template-part:last-of-type .wp-block-image {
        display: flex !important;
        justify-content: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }
    .wp-site-blocks > .wp-block-template-part:last-of-type .wp-block-image img {
        margin: 0 auto !important;
        display: block !important;
    }
}
