/*
Theme Name: MARUNOA
Theme URI:
Author: MARUNOA
Author URI:
Description: 外構工事会社MARUNOAのオリジナルテーマ。シンプルで無駄のない「引き算」のデザイン。1枚LP構成、固定ページ＋ACFで編集、施工事例はInstagram連携。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: marunoa
*/

/* -----------------------------------------
 * RESET & BASE STYLES
 * ----------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-size: 16px;
    line-height: 2.0;
    color: #1a1a1a;
    background-color: #ffffff;
    -webkit-font-smoothing: antialiased;
    letter-spacing: 0.08em;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

ul {
    list-style: none;
}

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

.sans {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
}

/* WordPressが本文で挿入する画像などのフォールバック */
main a:hover {
    opacity: 0.7;
}

/* -----------------------------------------
 * UTILITIES (余白・ライン)
 * ----------------------------------------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4%;
}

.section-padding {
    padding: 160px 0;
}

/* 繊細な直線 */
.line-divider {
    width: 100%;
    height: 1px;
    background-color: #e5e5e5;
}

/* ページ全体をヘッダー分だけ下げる（固定ヘッダー対策） */
.site-body {
    padding-top: 120px; /* header上段70 + 下段50 */
}
.site-body--hero {
    padding-top: 0; /* フロントページはHeroが全画面なので詰めない */
}

/* -----------------------------------------
 * HEADER (2段構造: Top情報 + ナビゲーション)
 * ----------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e5e5e5;
    z-index: 1000;
    display: flex;
    flex-direction: column; /* 縦並びにして2段にする */
}

/* --- ヘッダー上段（ロゴとコンタクト情報） --- */
.header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px; /* 上段の高さ */
    padding-left: 4%;
}

.header__logo {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.15em;
    flex-shrink: 0;
}

.header__logo img {
    max-height: 52px;
    width: auto;
    display: block;
}

.header__top-right {
    display: flex;
    align-items: center;
    height: 100%;
}

.header__phone {
    display: flex;
    align-items: baseline;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-right: 30px;
    color: #1a1a1a;
}

.header__phone span {
    font-size: 11px;
    color: #7d858c;
    margin-right: 10px;
    letter-spacing: 0.15em;
}

.header__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 40px;
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 13px;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.header__cta:hover {
    background-color: #c8b195;
    color: #ffffff;
}

/* --- ヘッダー下段（ナビゲーション） --- */
.header__nav {
    width: 100%;
    height: 50px; /* 下段メニューの高さ */
    border-top: 1px solid #e5e5e5; /* 上段との境界線 */
    display: flex;
}

.header__nav ul {
    display: flex;
    width: 100%;
    height: 100%;
    border-left: 1px solid #e5e5e5;
}

.header__nav li {
    flex: 1; /* メニューの幅を均等に広げる */
    border-right: 1px solid #e5e5e5;
}

.header__nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: #444;
}

.header__nav a:hover {
    background-color: #f8f9fa;
    color: #1a1a1a;
}

/* スマホ用ハンバーガーメニューアイコン */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    margin-right: 4%;
    cursor: pointer;
    z-index: 1001;
    background: none;
    border: none;
    padding: 0;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #1a1a1a;
    transition: all 0.3s;
}

/* ハンバーガー → × への変形（開いているとき） */
.mobile-menu-btn.is-open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.mobile-menu-btn.is-open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.is-open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* -----------------------------------------
 * MOBILE MENU PANEL (スライドイン)
 * ----------------------------------------- */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    padding: 100px 0 40px;
    overflow-y: auto;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu ul {
    border-top: 1px solid #e5e5e5;
}

.mobile-menu li {
    border-bottom: 1px solid #e5e5e5;
}

.mobile-menu a {
    display: block;
    padding: 20px 8%;
    font-size: 15px;
    letter-spacing: 0.1em;
    color: #1a1a1a;
}

.mobile-menu a:hover {
    background-color: #f8f9fa;
}

.mobile-menu__contact {
    display: block;
    margin: 30px 8% 0;
    padding: 16px;
    text-align: center;
    background-color: #1a1a1a;
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 0.1em;
}

.mobile-menu__phone {
    display: block;
    margin: 20px 8% 0;
    text-align: center;
    font-size: 18px;
    letter-spacing: 0.1em;
    color: #1a1a1a;
}

/* 背景オーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.menu-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* -----------------------------------------
 * RESPONSIVE BREAKPOINTS
 * ----------------------------------------- */
@media (max-width: 992px) {
    .header {
        /* スマホ・タブレット時は2段構造を解除し、上段のみ表示 */
        border-bottom: 1px solid #e5e5e5;
    }
    .header__top {
        width: 100%;
    }
    .header__top-right {
        display: none; /* 電話番号とボタンを隠す */
    }
    .header__nav {
        display: none; /* 下段メニューを隠す */
    }
    .mobile-menu-btn {
        display: flex; /* ハンバーガーアイコンを表示 */
    }
    .site-body {
        padding-top: 70px; /* 上段のみの高さ */
    }
    .site-body--hero {
        padding-top: 0;
    }

    .service__grid, .works-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .strength__item {
        flex-direction: column !important;
        margin-bottom: 80px;
    }
    .strength__img-wrapper, .strength__info {
        flex: none;
        width: 100%;
    }
    .strength__img-wrapper {
        height: 300px;
        margin-bottom: 30px;
    }
    .strength__info {
        padding: 0;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 100px 0;
    }
    .hero__title {
        font-size: 20px;
        line-height: 2.0;
    }
    .concept__text {
        font-size: 15px;
        text-align: left;
    }
    .service__grid, .works-gallery {
        grid-template-columns: 1fr !important;
    }
    .service__card {
        padding: 40px 20px;
    }
    .contact__btn {
        width: 100%;
        box-sizing: border-box;
    }
}

/* -----------------------------------------
 * HERO VISUAL
 * ----------------------------------------- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7f8 0%, #e4e8eb 100%);
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 0 4%;
    text-align: center;
}

/* 背景写真が設定された場合、文字を読みやすくする */
.hero--has-image {
    background-blend-mode: normal;
}
.hero--has-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
}

.hero::before, .hero::after {
    content: "";
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.03);
}
.hero::before { left: 25%; }
.hero:not(.hero--has-image)::after { left: 75%; }

.hero__content {
    position: relative;
    z-index: 10;
}

.hero__title {
    font-size: 32px;
    font-weight: 400;
    line-height: 2.2;
    letter-spacing: 0.2em;
    color: #1a1a1a;
}

.hero__title span {
    display: block;
}

.hero__scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: #7d858c;
    text-transform: uppercase;
    z-index: 10;
}

.hero__scroll::after {
    content: "";
    display: block;
    width: 1px;
    height: 40px;
    background-color: #7d858c;
    margin: 10px auto 0;
}

/* -----------------------------------------
 * CONCEPT
 * ----------------------------------------- */
.concept {
    background-color: #ffffff;
    text-align: center;
}

.concept__logo {
    font-size: 20px;
    letter-spacing: 0.3em;
    color: #7d858c;
    margin-bottom: 40px;
}

.concept__text {
    font-size: 18px;
    max-width: 740px;
    margin: 0 auto;
    color: #222222;
}

.concept__text p { margin-bottom: 40px; }
.concept__text p:last-child { margin-bottom: 0; }

/* -----------------------------------------
 * STRENGTH
 * ----------------------------------------- */
.strength { background-color: #fafafa; }

.section-title {
    text-align: center;
    margin-bottom: 100px;
}

.section-title__en {
    font-size: 13px;
    letter-spacing: 0.2em;
    color: #c8b195;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.section-title__ja {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #1a1a1a;
}

.strength__item {
    display: flex;
    align-items: center;
    margin-bottom: 140px;
}
.strength__item:last-child { margin-bottom: 0; }
.strength__item:nth-child(even) { flex-direction: row-reverse; }

.strength__img-wrapper {
    flex: 0 0 50%;
    height: 380px;
    background-color: #eef1f2;
    position: relative;
    border: 1px solid #e5e5e5;
    overflow: hidden;
}

.strength__img-wrapper img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}

.strength__img-placeholder {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #7d858c; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase;
}

.strength__info {
    flex: 0 0 50%;
    padding: 0 8%;
}

.strength__num {
    font-size: 40px; font-weight: 300; color: #c8b195;
    line-height: 1; margin-bottom: 20px; display: block;
}

.strength__title {
    font-size: 22px; font-weight: 400; margin-bottom: 24px; color: #1a1a1a; letter-spacing: 0.05em;
}

.strength__desc {
    font-size: 15px; color: #444444; text-align: justify;
}

/* -----------------------------------------
 * SERVICE / WORKS
 * ----------------------------------------- */
.service { background-color: #ffffff; }

.service__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 80px;
}

.service__card {
    border: 1px solid #e5e5e5;
    padding: 50px 30px;
    text-align: center;
    background-color: #ffffff;
    transition: border-color 0.3s ease;
}

.service__card:hover { border-color: #c8b195; }

.service__card-title {
    font-size: 18px; font-weight: 400; margin-bottom: 20px; color: #1a1a1a;
}

.service__card-desc {
    font-size: 14px; color: #555555; text-align: justify; line-height: 1.8;
}

.works-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 60px;
}

.works-gallery__item {
    aspect-ratio: 4 / 3;
    background-color: #f0f2f3;
    border: 1px solid #e5e5e5;
    display: flex; align-items: center; justify-content: center;
    color: #888888; font-size: 12px; letter-spacing: 0.1em;
    transition: background-color 0.3s ease;
}

.works-gallery__item:hover { background-color: #e4e8eb; }

/* Instagramフィード（Smash Balloon）の余白調整 */
.works-instagram {
    margin-top: 60px;
}

/* -----------------------------------------
 * CONTACT (CTA)
 * ----------------------------------------- */
.contact {
    background-color: #1a1a1a;
    color: #ffffff;
    text-align: center;
}

.contact .section-title__ja { color: #ffffff; }

.contact__text {
    font-size: 16px; margin-bottom: 50px; color: #cccccc;
}

.contact__btn {
    display: inline-block; border: 1px solid #ffffff; color: #ffffff;
    padding: 18px 60px; font-size: 14px; letter-spacing: 0.15em;
    text-transform: uppercase; transition: all 0.3s ease;
}

.contact__btn:hover {
    background-color: #ffffff; color: #1a1a1a;
}

/* -----------------------------------------
 * FOOTER
 * ----------------------------------------- */
.footer {
    background-color: #111111; color: #666666; padding: 60px 0;
    font-size: 12px; letter-spacing: 0.05em;
}

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

.footer__logo {
    color: #ffffff; font-size: 18px; font-weight: 700; letter-spacing: 0.15em;
}

.footer__logo img {
    max-height: 76px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .footer__inner { flex-direction: column; gap: 20px; text-align: center; }
}

/* =========================================================
 * BLOCK EDITOR CONTENT（トップページをブロックで編集する用）
 * front-page.php の the_content() が出力する各セクション。
 * ブロックのクラスに対して元デザインを再現するスタイルを当てる。
 * このファイルは add_editor_style により編集画面にも適用される。
 * ========================================================= */

/* コンテンツ土台：全幅セクションが横いっぱいに広がるようにする
 * 注意: .marunoa-content に overflow-x:hidden を付けると overflow-y が auto に
 * なり、縦スクロールの入れ子コンテナが生じてアンカー(#concept等)移動が壊れる。
 * 横スクロール対策が必要な場合は body 側で行う。 */
.marunoa-content { width: 100%; }
.marunoa-content > .alignfull { margin-left: 0; margin-right: 0; }

/* ナビのアンカー移動時、固定ヘッダー分だけ上に余白を空ける */
#concept, #strength, #service, #contact { scroll-margin-top: 120px; }
@media (max-width: 992px) {
    #concept, #strength, #service, #contact { scroll-margin-top: 70px; }
}

/* セクション共通の余白 */
.marunoa-content .section-padding { padding: 160px 4%; }

/* --- 見出し（Our Strength / 日本語見出し） --- */
.marunoa-content .section-en {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    font-size: 13px;
    letter-spacing: 0.2em;
    color: #c8b195;
    text-transform: uppercase;
    margin: 0 0 10px;
}
.marunoa-content .section-ja {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #1a1a1a;
    margin: 0 0 100px;
}

/* --- HERO（カバーブロック：画像・動画を背景にできる） --- */
.marunoa-content .hero-block {
    text-align: center;
    padding: 0 4%;
}
.marunoa-content .hero-block.wp-block-cover {
    min-height: 100vh;
}
.marunoa-content .hero-heading {
    font-size: 32px;
    font-weight: 400;
    line-height: 2.2;
    letter-spacing: 0.2em;
    color: #1a1a1a;
    margin: 0;
}

/* --- CONCEPT --- */
.marunoa-content .concept-block { text-align: center; }
.marunoa-content .concept-logo {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    font-size: 20px;
    letter-spacing: 0.3em;
    color: #7d858c;
    margin: 0 0 40px;
}
.marunoa-content .concept-text {
    font-size: 18px;
    color: #222222;
    max-width: 740px;
    margin: 0 auto 40px;
    line-height: 2;
}
.marunoa-content .concept-text:last-child { margin-bottom: 0; }

/* --- STRENGTH（media-text で画像＋テキスト） --- */
.marunoa-content .strength-item {
    margin-bottom: 140px;
    align-items: center;
    grid-template-columns: 50% 1fr;
}
.marunoa-content .strength-item.has-media-on-the-right {
    grid-template-columns: 1fr 50%;
}
.marunoa-content .strength-item:last-child { margin-bottom: 0; }
.marunoa-content .strength-item .wp-block-media-text__media {
    height: 380px;
    background-color: #eef1f2;
    border: 1px solid #e5e5e5;
    overflow: hidden;
}
.marunoa-content .strength-item .wp-block-media-text__media img {
    width: 100%; height: 100%; object-fit: cover;
}
.marunoa-content .strength-item .wp-block-media-text__content { padding: 0 8%; }
.marunoa-content .strength-num {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    font-size: 40px; font-weight: 300; color: #c8b195; line-height: 1; margin: 0 0 20px;
}
.marunoa-content .strength-title {
    font-size: 22px; font-weight: 400; margin: 0 0 24px; color: #1a1a1a; letter-spacing: 0.05em;
}
.marunoa-content .strength-desc {
    font-size: 15px; color: #444444; text-align: justify; margin: 0;
}

/* --- SERVICE（3カラムカード） --- */
.marunoa-content .service-cards { gap: 40px; margin-bottom: 80px; }
.marunoa-content .service-card {
    border: 1px solid #e5e5e5;
    padding: 50px 30px;
    text-align: center;
    height: 100%;
    transition: border-color 0.3s ease;
}
.marunoa-content .service-card:hover { border-color: #c8b195; }
.marunoa-content .service-card-title {
    font-size: 18px; font-weight: 400; margin: 0 0 20px; color: #1a1a1a;
}
.marunoa-content .service-card-desc {
    font-size: 14px; color: #555555; text-align: justify; line-height: 1.8; margin: 0;
}
.marunoa-content .works-heading {
    font-size: 20px; font-weight: 400; letter-spacing: 0.1em; color: #1a1a1a; margin: 40px 0 20px;
}
.marunoa-content .works-note {
    font-size: 14px; color: #7d858c; max-width: 640px; margin: 0 auto; line-height: 1.8;
}

/* --- CONTACT 内の住所・電話 --- */
.marunoa-content .contact-address {
    color: #cccccc;
    font-size: 14px;
    letter-spacing: 0.08em;
    line-height: 1.8;
    margin: 56px 0 6px;
}
.marunoa-content .contact-tel {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    color: #ffffff;
    font-size: 22px;
    letter-spacing: 0.12em;
    margin: 0;
}
.marunoa-content .contact-tel a {
    color: inherit;
    text-decoration: none;
}

/* --- CONTACT 内の地図（アクセスをコンタクトに統合） --- */
.marunoa-content .contact-map {
    position: relative;
    width: 100%;
    max-width: 960px;
    height: 420px;
    margin: 40px auto 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}
.marunoa-content .contact-map iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
@media (max-width: 768px) {
    .marunoa-content .contact-map { height: 300px; margin-top: 50px; }
}

/* --- CONTACT --- */
.marunoa-content .contact-block { text-align: center; }
.marunoa-content .contact-block .section-ja { color: #ffffff; }
.marunoa-content .contact-text {
    font-size: 16px; color: #cccccc; margin: 0 0 50px;
}
.marunoa-content .contact-btn .wp-block-button__link {
    display: inline-block;
    border: 1px solid #ffffff;
    color: #ffffff;
    background-color: transparent;
    border-radius: 0;
    padding: 18px 60px;
    font-size: 14px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}
.marunoa-content .contact-btn .wp-block-button__link:hover {
    background-color: #ffffff;
    color: #1a1a1a;
}

/* --- レスポンシブ --- */
@media (max-width: 992px) {
    .marunoa-content .strength-item,
    .marunoa-content .strength-item.has-media-on-the-right {
        grid-template-columns: 100% !important;
    }
    .marunoa-content .strength-item .wp-block-media-text__media {
        height: 300px; margin-bottom: 30px;
    }
    .marunoa-content .strength-item .wp-block-media-text__content { padding: 0; }
}

@media (max-width: 768px) {
    .marunoa-content .section-padding { padding: 100px 4%; }
    .marunoa-content .section-ja { margin-bottom: 60px; }
    .marunoa-content .hero-heading { font-size: 20px; line-height: 2; }
    .marunoa-content .concept-text { font-size: 15px; text-align: left; }
    .marunoa-content .contact-btn .wp-block-button__link { display: block; }
}
