/*
Theme Name: Sagamikyouei Static Theme
Description: A professional and reliable theme for Sagamikyouei Bousai.
Version: 1.0.0
*/

:root {
    /* Color Palette */
    --primary-navy: #003366;
    --primary-navy-light: #004d99;
    --accent-red: #D32F2F;
    --accent-red-hover: #B71C1C;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-white: #FFFFFF;
    --bg-light-gray: #F5F5F5;

    /* Typography */
    --font-heading: 'Noto Serif JP', serif;
    --font-body: 'Noto Sans JP', sans-serif;

    /* Spacing */
    --section-padding: 80px 20px;
    --container-width: 1100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    line-height: 1.8;
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
.serif {
    font-family: var(--font-heading);
    color: var(--primary-navy);
}

a {
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

/* Base Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 15px 40px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-red);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary-navy);
    color: var(--primary-navy);
}

.btn-outline:hover {
    background-color: var(--primary-navy);
    color: #fff;
}

.btn-lg {
    padding: 18px 50px;
    font-size: 1.1rem;
}

/* Common Section Layout */
section {
    padding: var(--section-padding);
}

.section-bg {
    background-color: var(--bg-light-gray);
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 50px;
    text-align: center;
}

/* Scroll Fade Animation */
.animate-up,
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-up.visible,
.animate-up.active,
.fade-in-up.visible,
.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* Page Header / Hero */
.page-header {
    background-color: var(--primary-navy);
    background-size: cover;
    background-position: center;
    color: #fff !important;
    padding: 120px 20px;
    text-align: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.page-title {
    font-size: 2.5rem;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #fff !important;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* Service Value Grid */
.intro-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: -100px;
    position: relative;
    z-index: 10;
    margin-bottom: 80px;
}

.lead {
    font-size: 1.1rem;
    color: var(--primary-navy);
    font-weight: bold;
}

.value-grid {
    gap: 30px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.value-card {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
    border-top: 4px solid var(--primary-navy);
}

.value-num {
    font-size: 3rem;
    font-weight: bold;
    color: var(--bg-light-gray);
    display: block;
    line-height: 1;
    margin-bottom: 15px;
}

/* Flow Steps */
.flow-steps {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.flow-step {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    align-items: flex-start !important;
}

.step-num {
    width: 40px;
    height: 40px;
    background: var(--primary-navy);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    z-index: 2;
}

.step-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    margin-top: 5px;
}

/* Equipment Grid */
.equipment-grid {
    gap: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.equipment-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.equipment-item h4 {
    color: var(--primary-navy);
    margin-bottom: 10px;
}

/* Profile Table */
.profile-table-wrapper {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.profile-table table {
    width: 100% !important;
    border-collapse: collapse;
}

.profile-table th {
    width: 25%;
    text-align: left;
    padding: 20px;
    border-bottom: 1px solid #eee;
    color: var(--text-light);
    font-weight: bold;
}

.profile-table td {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

/* CTA Area */
.cta-title {
    font-size: 2.2rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.cta-tel-box {
    margin: 40px auto;
    background: var(--bg-light-gray);
    padding: 40px;
    border-radius: 12px;
    max-width: 500px;
    text-align: center;
}

.tel-number {
    font-size: 2.8rem;
    font-weight: bold;
    color: var(--primary-navy);
    margin-bottom: 5px;
    line-height: 1;
}

.tel-hours {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.tel-note {
    font-size: 0.95rem;
}

.micro-copy {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 15px;
}

/* ===== Header Styles ===== */
.main-header {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-navy);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-weight: bold;
    color: var(--text-dark);
}

.main-nav a:hover {
    color: var(--accent-red);
}

.btn-sm {
    padding: 10px 20px;
}

/* ===== Footer Styles ===== */
.main-footer {
    background-color: var(--primary-navy);
    color: #fff;
    padding: 60px 0 20px;
}

.main-footer h3 {
    color: #fff;
    margin-bottom: 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-btn {
    border-color: #fff;
    color: #fff;
}

.footer-btn:hover {
    background-color: #fff;
    color: var(--primary-navy);
}

.footer-nav ul {
    list-style: none;
}

.footer-nav li {
    margin-bottom: 10px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {

    /* タイトルサイズの調整 (修正指示2) */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    .page-title {
        font-size: 1.6rem !important;
        line-height: 1.4;
    }

    .section-title {
        font-size: 1.6rem !important;
        margin-bottom: 30px;
    }

    .lead {
        font-size: 1rem;
    }

    /* 全体的な余白の調整 */
    section {
        padding: 50px 15px;
    }

    .intro-box {
        padding: 30px 15px;
        margin-top: -60px;
        margin-bottom: 40px;
    }

    /* 各種グリッド (横並び) の解除 (修正指示1) */
    .wp-block-columns {
        display: flex !important;
        flex-direction: column;
        gap: 30px !important;
    }

    .wp-block-column {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    /* problem-solutionセクションの横並び解除 */
    .problem-solution>.container>div:first-child {
        display: flex !important;
        flex-direction: column;
        gap: 30px !important;
    }

    /* 画像を上にする (DOMの順番通りならすでに画像が上ですが、念のためorder指定) */
    .problem-solution .image-wrapper {
        order: -1;
    }

    /* recruitmentのメッセージセクション */
    .recruit-message .container {
        flex-direction: column !important;
    }

    /* 画像を確実に上にする */
    .recruit-message .message-image,
    .home-recruit .recruit-image {
        order: -1;
        margin-bottom: 20px;
    }

    /* strengthページのcommitments */
    .commitment-item {
        flex-direction: column !important;
        gap: 30px !important;
        margin-bottom: 60px !important;
    }

    /* 画像を確実に上にする */
    .commitment-item .commitment-image {
        order: -1;
    }

    /* reverseクラスがついている要素も縦積み時に画像を上にする */
    .commitment-item.reverse {
        flex-direction: column !important;
    }

    .value-grid,
    .equipment-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .profile-table th {
        width: 100%;
        display: block;
        padding-bottom: 5px;
        border-bottom: none;
    }

    .profile-table td {
        width: 100%;
        display: block;
        padding-top: 0;
    }

    .footer-grid {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }

    .header-inner {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    /* ヒーローエリアのキービジュアルテキスト等のマージン調整 */
    .key-visual-text {
        flex-direction: column;
        gap: 10px !important;
        margin-bottom: 30px !important;
    }

    .cta-tel-box {
        padding: 20px;
        min-width: 100% !important;
        width: 100%;
    }

    .tel-number {
        font-size: 2rem !important;
    }
}

/* Inspection Page specific */
.flow-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.equipment-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .flow-container {
        grid-template-columns: repeat(3, 1fr);
    }
    .equipment-tiles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .flow-container,
    .equipment-tiles {
        grid-template-columns: 1fr !important;
    }
}

/* Utility Classes */
.text-center {
    text-align: center !important;
}

.tel-cta {
    margin: 0 auto;
    text-align: center;
    display: block !important;
    max-width: max-content;
}

/* Contact Form Styles */
.contact-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 50px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.form-group {
    margin-bottom: 30px;
}

.form-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-navy);
}

.label-required {
    background: var(--accent-red);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 10px;
    vertical-align: middle;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-navy);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    margin-top: 10px;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-item input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.file-input-wrapper {
    background: var(--bg-light-gray);
    padding: 20px;
    border-radius: 4px;
    border: 2px dashed #ddd;
    text-align: center;
}

.privacy-policy-box {
    background: var(--bg-light-gray);
    padding: 20px;
    height: 150px;
    overflow-y: scroll;
    font-size: 0.9rem;
    margin-bottom: 20px;
    border-radius: 4px;
}

.form-agreement {
    text-align: center;
    margin-bottom: 30px;
}

.form-actions {
    text-align: center;
}

.btn-submit {
    min-width: 250px;
    background: var(--primary-navy);
    color: #fff;
    border: none;
    font-size: 1.1rem;
    padding: 18px 20px;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-submit:hover {
    background: var(--primary-navy-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 51, 102, 0.2);
}

@media (max-width: 768px) {
    .contact-form-wrapper {
        padding: 30px 20px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ハンバーガーメニュー・モバイル調整追記
   ========================================= */
.btn {
    max-width: 100%;
}

@media (max-width: 768px) {
    .pc-only { display: none !important; }

    body.menu-open {
        overflow: hidden;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1001;
    }

    .hamburger-line {
        width: 30px;
        height: 3px;
        background-color: var(--primary-navy);
        transition: all 0.3s linear;
        border-radius: 2px;
    }

    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: rotate(-45deg) translate(7px, -6px); }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: #fff;
        padding: 100px 40px;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 1000;
        display: block !important;
    }

    .main-nav.is-active {
        right: 0;
    }

    .main-nav ul {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 20px !important;
    }

    .main-nav a {
        font-size: 1.2rem;
        display: block;
        padding: 10px 0;
        color: var(--text-dark);
        border-bottom: 1px solid #eee;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 1.6rem !important;
        line-height: 1.4;
    }
    .hero-title br {
        display: none;
    }
    .hero-title span {
        display: inline !important;
        white-space: normal !important;
    }
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
}

html, body {
    overflow-x: hidden;
    width: 100%;
}


/* =========================================
   施工案内ページ等 インライングリッドのモバイル対応
   ========================================= */
@media (max-width: 768px) {
    /* 対応工事等のメインコンテナの縦積み */
    .items-container {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    /* ギャラリー内の「span 2」要素が、万が一1カラムになった場合に壊れないためのフェイルセーフ */
    .items-gallery > div {
        grid-column: 1 / -1 !important;
    }

    /* 対応地域コンテナ (クラスがないdivに対する対応) */
    .service-area .container > div {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }
    
    /* セクションタイトルの左寄せを中央寄せに(必要であれば) */
    .service-area .section-title {
        text-align: center !important;
    }
}


/* =========================================
   当社の強みページ等 全インライングリッドのモバイル対応
   ========================================= */
@media (max-width: 768px) {
    /* お客様の声セクション */
    .testimonial-grid {
        grid-template-columns: 1fr !important;
        gap: 30px !important;
    }

    /* 汎用: インライン要素でのgrid指定を全検知してモバイルでは1カラム化 */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 30px !important; /* スマホ用に余白も圧縮 */
        display: flex !important; /* flexにして強制的に縦並びにするのも安全な回避策 */
        flex-direction: column !important;
    }
}
