/*
Theme Name: eRCC Theme
Theme URI: https://ercc.co.jp
Author: eRCC Inc.
Author URI: https://ercc.co.jp
Description: eRCC コーポレートサイト用WordPressテーマ
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ercc-theme
*/

/* RCCシンボル ボヨンアニメーション（セクション見出し用） */
@keyframes rcc-boyon {
    0%   { opacity: 0; transform: scale(0); }
    40%  { opacity: 1; transform: scale(1.35); }
    58%  { transform: scale(0.88); }
    72%  { transform: scale(1.12); }
    84%  { transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}
.rcc-boyon {
    opacity: 0;
    animation: rcc-boyon 0.45s ease-out 0.4s forwards;
    animation-play-state: paused;
}
.is-visible .rcc-boyon {
    animation-play-state: running;
}

/* 強みセクション 見出し スライドイン（シンボルポヨン後） */
@keyframes strength-from-right {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes strength-from-left {
    from { opacity: 0; transform: translateX(-50px); }
    to   { opacity: 1; transform: translateX(0); }
}
/* 右からシュッ（Strength 01・03） */
.strength-title-r {
    opacity: 0;
    animation: strength-from-right 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards;
    animation-play-state: paused;
}
/* 左からシュッ（Strength 02） */
.strength-title-l {
    opacity: 0;
    animation: strength-from-left 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.95s forwards;
    animation-play-state: paused;
}
.is-visible .strength-title-r,
.is-visible .strength-title-l {
    animation-play-state: running;
}

/* RCCシンボル ふわっと表示アニメーション */
@keyframes rcc-symbol-appear {
    0%   { opacity: 0; transform: scale(1.08); }
    100% { opacity: 0.25; transform: scale(1); }
}
.rcc-symbol-fadein {
    opacity: 0;
    animation: rcc-symbol-appear 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

/* =============================
   ページ読み込み演出
   ============================= */

/* ローディングオーバーレイ */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease;
}
#loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* ローディングスピナー */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: #E62F8B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* RCCシンボル（ヒーロー）：大きめでフワッと登場 → 縮みながら同時に半透明に */
.hero-symbol {
    opacity: 0;
    transform: scale(1.25);
    transition: opacity 0.7s ease;
}
/* Phase1: 大きいまま不透明でフワッと表示 */
.hero-symbol.phase-in {
    opacity: 1;
    transform: scale(1.25);
}
/* Phase2: 縮みながら同時に半透明へ */
.hero-symbol.phase-dim {
    opacity: 0.25;
    transform: scale(1);
    transition: opacity 1.6s ease, transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ヒーローテキスト各要素：初期状態（非表示・下にずれた状態） */
.hero-item {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.hero-item.is-shown {
    opacity: 1;
    transform: translateY(0);
}

/* ヘッダー：初期状態（上に隠れた状態） */
#header.hero-hidden {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
#header.hero-shown {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ヘッダー：スクロール後（白背景・黒文字） */
#header.is-scrolled #header-nav a:not([class*="bg-primary"]) {
    color: #1f2937 !important;
}
#header.is-scrolled #header-inner > div > a {
    color: #1f2937 !important;
}
#header.is-scrolled #menu-open {
    color: #1f2937 !important;
}

/* サービスセクション 浮遊イラスト レスポンシブ */
/* スマホ・タブレット（〜1255px）：見出し上右 */
#services-illust {
    right: 0;
    top: -110px;
    width: 130px;
}
/* 中間サイズ（900px〜1255px）：見出し上右・少し大きめ */
@media (min-width: 900px) and (max-width: 1255px) {
    #services-illust {
        right: 0;
        top: -140px;
        width: 180px;
    }
}
/* PC（1256px以上）：見出し右側・大きめ・少し上に */
@media (min-width: 1256px) {
    #services-illust {
        right: 20px;
        top: calc(50% - 100px);
        transform: translateY(-50%);
        width: 340px;
    }
}

/* カスタムロゴのサイズ制限 */
.custom-logo {
    max-height: 36px;
    max-width: 100px;
    width: auto;
    height: auto;
    display: block;
}

/* ベーススタイル */
body {
    background-color: #FFFFFF;
    color: #333333;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* ふわふわ・ゆらゆらするシェイプアニメーション */
.shape-morph {
    animation: morph 8s ease-in-out infinite alternate;
}

@keyframes morph {
    0%   { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    34%  { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    67%  { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
    100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
}

/* スクロール時のフェードインエフェクト */
.fade-in {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 左右からのスライドインエフェクト */
.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-in-left.is-visible,
.slide-in-right.is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* サービスセクション浮遊イラストアニメーション */
@keyframes float-slow {
    0%,  100% { transform: translateY(0px) rotate(0deg); }
    50%        { transform: translateY(-12px) rotate(1.5deg); }
}
.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

/* WordPress管理バーとヘッダーの重なりを解消 */
.admin-bar #header {
    top: 32px; /* PC時の管理バーの高さ */
}
@media screen and (max-width: 782px) {
    .admin-bar #header {
        top: 46px; /* スマホ時の管理バーの高さ */
    }
}

/* 背景固定キャンバス */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

/* 英語見出し用テキストシャドウ */
.title-shadow {
    color: #000000;
    text-shadow: 0 4px 16px rgba(255, 255, 255, 0.9), 0 2px 4px rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 255, 0.8);
}

/* 波紋パルスエフェクト（サービスセクション中央円） */
@keyframes ripple-effect {
    0%   { transform: scale(1);   opacity: 0.8; border-width: 3px; }
    50%  {                        opacity: 0.5; border-width: 1.5px; }
    100% { transform: scale(1.6); opacity: 0;   border-width: 1px; }
}
.animate-ripple {
    animation: ripple-effect 3.6s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}

/* ========================================
   背景シェイプのカスタムスタイル
   ここを編集するだけでビルド不要で反映されます
   ======================================== */

/* シェイプの透明度 --- 数値を上げると濃くなります（例: 0.05 → 薄い / 0.15 → 濃い） */
.shape-opacity {
    opacity: 0.2;
}

/* シェイプのぼかし強度 --- 数値を上げるとよりぼけます */
.shape-blur {
    filter: blur(64px);
}

/* シェイプの色 --- primary / accent / light の3色 */
.shape-color-primary { background-color: #0253A5; }
.shape-color-accent  { background-color: #E62F8B; }
.shape-color-light   { background-color: #AEC4D1; }

/* シェイプの重ね方 --- normalにすると色がそのまま表示されます */
.shape-blend {
    mix-blend-mode: multiply;
}

/* =============================
   ブロックエディター コンテンツスタイル
   .entry-content  → フロントエンド（実際のページ）
   .editor-styles-wrapper → 管理画面のブロックエディター内
   両方に同じスタイルを適用して見た目を統一
   ============================= */

.entry-content h1,
.editor-styles-wrapper h1,
.entry-content h2,
.editor-styles-wrapper h2,
.entry-content h3,
.editor-styles-wrapper h3,
.entry-content h4,
.editor-styles-wrapper h4,
.entry-content h5,
.editor-styles-wrapper h5,
.entry-content h6,
.editor-styles-wrapper h6 {
    font-weight: 900;
    line-height: 1.4;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #111827;
    font-family: "Noto Sans JP", sans-serif;
}
.entry-content h1, .editor-styles-wrapper h1 { font-size: 1.875rem; }
.entry-content h2, .editor-styles-wrapper h2 { font-size: 1.5rem; color: #0253A5; }
.entry-content h3, .editor-styles-wrapper h3 { font-size: 1.25rem; }
.entry-content h4, .editor-styles-wrapper h4 { font-size: 1.125rem; }

.entry-content p,
.editor-styles-wrapper p {
    margin-bottom: 1.5em;
    line-height: 1.9;
    color: #374151;
    font-family: "Noto Sans JP", sans-serif;
}

.entry-content ul,
.editor-styles-wrapper ul,
.entry-content ol,
.editor-styles-wrapper ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    color: #374151;
    line-height: 1.9;
}
.entry-content ul,
.editor-styles-wrapper ul { list-style-type: disc; }
.entry-content ol,
.editor-styles-wrapper ol { list-style-type: decimal; }
.entry-content li,
.editor-styles-wrapper li { margin-bottom: 0.4em; }

.entry-content a,
.editor-styles-wrapper a {
    color: #0253A5;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.entry-content a:hover,
.editor-styles-wrapper a:hover { color: #E62F8B; }
/* ブロックエディタのボタンはアンダーラインを除外 */
.entry-content .wp-block-button__link,
.entry-content .wp-block-button__link:hover { text-decoration: none; }

.entry-content strong,
.editor-styles-wrapper strong { font-weight: 900; color: #111827; }
.entry-content em,
.editor-styles-wrapper em { font-style: italic; }

.entry-content blockquote,
.editor-styles-wrapper blockquote {
    border-left: 4px solid #0253A5;
    padding: 1em 1.5em;
    margin: 2em 0;
    background: #f9fafb;
    border-radius: 0 0.75rem 0.75rem 0;
    color: #4b5563;
    font-style: italic;
}

.entry-content img,
.editor-styles-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 1.5em 0;
}

.entry-content figure,
.editor-styles-wrapper figure { margin: 1.5em 0; }
.entry-content figcaption,
.editor-styles-wrapper figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-top: 0.5em;
}

.entry-content hr,
.editor-styles-wrapper hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2.5em 0;
}

.entry-content table,
.editor-styles-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5em;
    font-size: 0.9rem;
}
.entry-content th,
.editor-styles-wrapper th,
.entry-content td,
.editor-styles-wrapper td {
    border: 1px solid #e5e7eb;
    padding: 0.75em 1em;
    text-align: left;
}
.entry-content th,
.editor-styles-wrapper th {
    background: #f3f4f6;
    font-weight: 900;
    color: #0253A5;
}

/* エディターの背景・余白をフロントに近づける */
.editor-styles-wrapper {
    font-family: "Noto Sans JP", sans-serif;
    color: #374151;
    line-height: 1.9;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem !important;
}

/* インラインカラー（テキスト選択して色を変えた場合）はそのまま維持 */
.entry-content .has-inline-color,
.editor-styles-wrapper .has-inline-color { /* color属性をそのまま使用 */ }

/* WordPress デフォルトブロック色クラスの上書き防止 */
.entry-content [class*="has-"][class*="-color"] {
    /* ブロックレベルの背景色はそのまま適用 */
}

/* =============================
   画像の回り込み（alignleft / alignright）
   Tailwindのリセット（img { display:block }）を上書き
   ============================= */
.entry-content .alignleft,
.editor-styles-wrapper .alignleft {
    float: left;
    margin: 0.25em 1.75em 1em 0;
    max-width: 45%;
}
.entry-content .alignright,
.editor-styles-wrapper .alignright {
    float: right;
    margin: 0.25em 0 1em 1.75em;
    max-width: 45%;
}
/* 中央揃え：figure・img・ブロック全般に対応 */
.entry-content .aligncenter,
.editor-styles-wrapper .aligncenter,
.entry-content figure.aligncenter,
.editor-styles-wrapper figure.aligncenter,
.entry-content .wp-block-image.aligncenter,
.editor-styles-wrapper .wp-block-image.aligncenter {
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
    float: none;
}
/* 中央揃え内の img も margin:auto でセンタリング */
.entry-content .aligncenter img,
.editor-styles-wrapper .aligncenter img,
.entry-content .wp-block-image.aligncenter img,
.editor-styles-wrapper .wp-block-image.aligncenter img {
    display: block;
    margin-left: auto;
    margin-right: auto;
}
/* floatした画像はdisplay:inlineにしないとfloatが効かない */
.entry-content .alignleft img,
.entry-content .alignright img,
.editor-styles-wrapper .alignleft img,
.editor-styles-wrapper .alignright img {
    display: inline;
}
/* float解除 */
.entry-content p,
.editor-styles-wrapper p {
    overflow: hidden; /* float子要素を内包する */
}

/* =============================
   メディアとテキストブロック（wp-block-media-text）
   ============================= */
.entry-content .wp-block-media-text,
.editor-styles-wrapper .wp-block-media-text {
    display: grid;
    grid-template-columns: 50% 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2em;
}
.entry-content .wp-block-media-text.has-media-on-the-right,
.editor-styles-wrapper .wp-block-media-text.has-media-on-the-right {
    grid-template-columns: 1fr 50%;
}
.entry-content .wp-block-media-text__media img,
.editor-styles-wrapper .wp-block-media-text__media img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    margin: 0;
}
@media (max-width: 768px) {
    .entry-content .wp-block-media-text,
    .editor-styles-wrapper .wp-block-media-text {
        grid-template-columns: 1fr;
    }
    .entry-content .wp-block-media-text.has-media-on-the-right,
    .editor-styles-wrapper .wp-block-media-text.has-media-on-the-right {
        grid-template-columns: 1fr;
    }
}

/* 横スクロール防止（スライドインアニメーションのはみ出し対策） */
body { overflow-x: clip; } /* hiddenはstickyを無効化するためclipに変更 */
/* overflow-x: hidden はstickyを無効にするため削除（bodyのhiddenで代替） */


/* ヒーローイントロ演出（背景＋手の画像） */
#hero-intro {
    transition: opacity 1s ease-in-out;
}
#hero-hand {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 90vh;
    width: auto;
    max-width: 70%;
    object-fit: contain;
    object-position: bottom right;
    transform: translateY(110%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
#hero-hand.nyoki {
    transform: translateY(0);
}

/* ヒーロー画像スライドショー */
#hero-slides {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-slide.active { opacity: 1; }

/* ヒーロー 日本語テキスト（スマホのみ表示） */
.hero-jp-mobile { display: block; }
@media (min-width: 768px) {
    .hero-jp-mobile { display: none; }
}

/* Prompt Black Italic（ヒーロー YOUR ONE-STOP PARTNER 用） */
.prompt-black-italic {
    font-family: "Prompt", sans-serif;
    font-weight: 900;
    font-style: italic;
}

/* ヒーロー大見出し */
.hero-title {
    font-size: clamp(2.5rem, 13vw, 10rem);
    font-weight: 900;
    color: #fff;
    line-height: 1;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.2), 0 1px 4px rgba(0,0,0,0.15);
}

/* ヒーロー日本語サブテキスト */
#hero-t1 p {
    text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

/* 強みセクション: PC/SP レイアウト切り替え */
#strengths-pc { display: none; }
#strengths-sp { display: block; }
@media (min-width: 768px) {
    #strengths-pc { display: block; }
    #strengths-sp { display: none; }
}

/* ========== 固定ページ共通ヘッダー背景 ========== */
.page-header-bg {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding: 4rem 1.5rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    background-image: var(--page-header-bg);
    background-size: cover;
    background-position: center;
}
.page-header-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.82);
}
.page-header-bg > * {
    position: relative;
    z-index: 1;
}

/* ========== Contact Form 7 スタイル ========== */
.wpcf7-form .cf7-row {
    margin-bottom: 1.5rem;
}
.wpcf7-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
}
.wpcf7-form label .required {
    color: #E62F8B;
    margin-left: 0.25rem;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e0e4ea;
    border-radius: 0.625rem;
    font-size: 0.95rem;
    color: #111;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-sizing: border-box;
}
.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form textarea:focus {
    border-color: #0253a5;
    box-shadow: 0 0 0 3px rgba(2,83,165,0.1);
    background: #fff;
}
.wpcf7-form textarea {
    min-height: 160px;
    resize: vertical;
}
.wpcf7-form input[type="submit"],
.wpcf7-form .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 2rem;
    background: #0253a5;
    color: #fff;
    font-size: 1rem;
    font-weight: 900;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.25s, box-shadow 0.25s, transform 0.2s;
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}
.wpcf7-form input[type="submit"]:hover,
.wpcf7-form .wpcf7-submit:hover {
    background: #E62F8B;
    box-shadow: 0 6px 20px rgba(230,47,139,0.3);
    transform: translateY(-1px);
}
.wpcf7-form .wpcf7-not-valid-tip {
    color: #E62F8B;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    display: block;
}
.wpcf7-form input.wpcf7-not-valid,
.wpcf7-form textarea.wpcf7-not-valid {
    border-color: #E62F8B;
    box-shadow: 0 0 0 3px rgba(230,47,139,0.1);
}
.wpcf7-form .wpcf7-response-output {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.625rem;
    font-size: 0.9rem;
    font-weight: 700;
    border: none;
}
.wpcf7-form.sent .wpcf7-response-output {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid #22c55e;
}
.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.spam .wpcf7-response-output {
    background: #fff1f2;
    color: #9f1239;
    border-left: 4px solid #E62F8B;
}

/* CF7 Multi-Step Forms 戻るボタン */
.wpcf7-form .wpcf7-previous-container,
.wpcf7-form span:has(> input.wpcf7-previous) {
    display: block;
    text-align: center;
}
.wpcf7-form input.wpcf7-previous,
.wpcf7-form .wpcf7-previous {
    display: block;
    margin: 0 auto;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: #0253a5;
    border: 2px solid #0253a5;
    padding: 0.875rem 2.5rem;
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, box-shadow 0.25s, transform 0.2s;
    box-shadow: none;
}
.wpcf7-form input.wpcf7-previous:hover,
.wpcf7-form .wpcf7-previous:hover {
    background: #0253a5;
    color: #fff;
    box-shadow: 0 4px 16px rgba(2,83,165,0.25);
    transform: translateY(-1px);
}

