/* ==========================================================================
   RE:DX ランディングページ カスタムCSS
   ========================================================================== */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@500;700;900&display=swap');

/* ==========================================================================
   スコープ隔離 — RE:DXページのみに適用
   ========================================================================== */

/* 既存テーマのスタイルをリセット */
body.redx-page {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background-color: black;
  color: white;
}

html:has(body.redx-page) {
  scroll-behavior: smooth;
}

/* 既存テーマのヘッダー・フッター等を非表示（セレクタは親テーマに合わせて調整） */
body.redx-page #site-header,
body.redx-page #site-footer,
body.redx-page .site-header,
body.redx-page .site-footer,
body.redx-page #masthead,
body.redx-page #colophon {
  display: none !important;
}

/* WordPress管理バーの調整 */
body.redx-page.admin-bar nav.redx-nav {
  top: 32px;
}
@media screen and (max-width: 782px) {
  body.redx-page.admin-bar nav.redx-nav {
    top: 46px;
  }
}

/* ==========================================================================
   RE:DX デザイントークン
   ========================================================================== */

/* Circuit Background Pattern */
.bg-circuit {
  background-image: linear-gradient(to right, rgba(34, 211, 238, 0.05) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
  background-size: 80px 60px;
}

/* Grid Block Styles */
.grid-block {
  position: relative;
  border-radius: 1px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  background-color: rgba(255, 255, 255, 0.04);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s, border-color 0.3s;
  flex-shrink: 0;
  will-change: transform, background-color, border-color;
}

.block-inner {
  width: 100%;
  height: 100%;
  padding: 2px;
  opacity: 0.2;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.block-random-active {
  transform: scale(1.08);
  background-color: rgba(34, 211, 238, 0.5) !important;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  z-index: 10;
}

/* XRay Container */
.xray-container {
  position: relative;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(6, 182, 212, 0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  will-change: border-color, box-shadow;
}

.xray-container:hover {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

/* Clickable Box with Pulsing Border */
.clickable-box {
  animation: pulse-border 4s ease-in-out infinite;
}

.clickable-box:hover {
  transform: translateY(-4px);
  animation: none;
}

.clickable-indicator {
  transition: color 0.3s ease;
}

.clickable-box:hover .clickable-indicator {
  color: rgba(34, 211, 238, 1);
}

.chevron-icon {
  transition: transform 0.3s ease;
}

.clickable-box:hover .chevron-icon {
  transform: translateX(4px);
}

@keyframes pulse-border {
  0%, 100% {
    border-color: rgba(6, 182, 212, 0.3);
  }
  50% {
    border-color: rgba(34, 211, 238, 0.5);
  }
}

/* Corner Accent */
.corner-accent {
  position: absolute;
  width: 1.2rem;
  height: 1.2rem;
  border-color: #22d3ee;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.6);
}

/* Scan Line Animation */
.scan-line {
  position: absolute;
  height: 2px;
  width: 100%;
  background: linear-gradient(to right, transparent, #22d3ee, transparent);
  animation: scan-move 3s linear infinite;
}

@keyframes scan-move {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Text Glow Effect (Hero Title Line 2) */
.text-glow {
  display: inline-block;
  background: linear-gradient(to right, #ffffff, #22d3ee, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.6), 0 0 60px rgba(34, 211, 238, 0.4);
}

/* Text Outline Effect (Hero Title Lines 1, 3) */
.text-outline {
  color: rgba(255, 255, 255, 1.0);
  text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

/* Hero Underline */
.hero-underline {
  position: absolute;
  bottom: 0.2em;
  left: 0;
  width: 100%;
  height: 0.3em;
  background-color: rgba(34, 211, 238, 0.2);
  z-index: -1;
}

/* ==========================================================================
   SVH Unit Fallback
   ========================================================================== */
.min-h-hero-mobile {
  min-height: 75vh;
  min-height: 75svh;
}

.min-h-hero-desktop {
  min-height: 90vh;
  min-height: 90svh;
}

/* ==========================================================================
   Contact Form 7 Overrides
   ========================================================================== */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: black;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  color: white;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px #22d3ee;
}

.wpcf7 input[type="submit"] {
  width: 100%;
  background-color: #0891b2;
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 2px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 10px 30px rgba(6, 182, 212, 0.3);
}

.wpcf7 input[type="submit"]:hover {
  background-color: #22d3ee;
  color: black;
}

.wpcf7-response-output {
  padding: 1rem;
  border-radius: 2px;
  font-size: 0.875rem;
  margin-top: 1rem;
}

.wpcf7 form.sent .wpcf7-response-output {
  background-color: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.wpcf7 select option {
  background-color: black;
  color: white;
}

/* ==========================================================================
   MW WP Form Overrides
   ========================================================================== */
.mw_wp_form input[type="text"],
.mw_wp_form input[type="email"],
.mw_wp_form input[type="tel"],
.mw_wp_form select,
.mw_wp_form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: black;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  color: white;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.mw_wp_form input:focus,
.mw_wp_form select:focus,
.mw_wp_form textarea:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px #22d3ee;
}

.mw_wp_form input[type="submit"] {
  width: 100%;
  background-color: #0891b2;
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 2px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.mw_wp_form input[type="submit"]:hover {
  background-color: #22d3ee;
  color: black;
}

.mw_wp_form select option {
  background-color: black;
  color: white;
}

/* ラベル */
.mw_wp_form p {
  font-size: 0.875rem;
  font-weight: 700;
  color: #d1d5db;
  margin-bottom: 0.5rem;
  margin-top: 1.5rem;
}

.mw_wp_form p:first-child {
  margin-top: 0;
}

/* バリデーションエラー */
.mw_wp_form .error {
  color: #f87171;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* 確認画面 */
.mw_wp_form_confirm .mw_wp_form p {
  color: #9ca3af;
}

/* 完了画面 */
.mw_wp_form_complete {
  text-align: center;
  padding: 2rem 0;
  color: #4ade80;
  font-weight: 700;
}

/* 戻るボタン（確認画面） */
.mw_wp_form input[type="button"] {
  width: 100%;
  background-color: transparent;
  color: white;
  padding: 1rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 0.75rem;
}

.mw_wp_form input[type="button"]:hover {
  border-color: #22d3ee;
  color: #22d3ee;
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-content {
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.is-open .modal-content {
  transform: scale(1);
}

/* ==========================================================================
   FAQ Accordion Styles
   ========================================================================== */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer.is-open {
  max-height: 24rem;
}

.faq-chevron {
  transition: transform 0.3s ease;
}

.faq-chevron.is-open {
  transform: rotate(180deg);
}

/* ==========================================================================
   Mobile Menu Styles
   ========================================================================== */
.mobile-menu-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu-panel {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

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

/* ==========================================================================
   Mobile Responsive Fixes (スマホ専用 — 768px未満のみ適用)
   ========================================================================== */
@media (max-width: 767px) {

  /* 1. Hero: キーワードを半分に間引き + やや薄く */
  #hero-background {
    opacity: 0.85 !important;
  }
  .hero-kw-alt {
    display: none !important;
  }

  /* 2. 課題カード: パディングとフォントサイズを縮小 */
  .clickable-box {
    padding: 1.5rem !important;
  }
  .clickable-box > p {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }

  /* 3. Service Concept: 説明テキストを縮小 */
  #features p.text-xl {
    font-size: 0.95rem !important;
    line-height: 1.8 !important;
  }

  /* 4. 実績の数字: フォントサイズ縮小 + ラベル調整 */
  #results .text-3xl {
    font-size: 1.4rem !important;
    line-height: 1.3 !important;
  }
  #results .text-lg {
    font-size: 0.8rem !important;
  }

  /* モーダル: パディング・フォントサイズ縮小 */
  .modal-content {
    padding: 1.5rem !important;
  }
  .modal-content h2 {
    font-size: 1.25rem !important;
  }
  .modal-content section p {
    font-size: 0.875rem !important;
    line-height: 1.7 !important;
  }
  .modal-content section h3 {
    font-size: 0.65rem !important;
  }
  .modal-content section.p-8 {
    padding: 1rem !important;
  }
  .modal-content section.p-8 h3 {
    font-size: 0.95rem !important;
  }
  .modal-content section.p-8 p {
    font-size: 0.8rem !important;
  }
  .modal-content .grid.gap-10 {
    gap: 1.5rem !important;
  }

  /* モバイルメニュー: フォントサイズ縮小 + gap調整 + 上部余白 */
  .mobile-menu-panel > div {
    padding-top: 5rem !important;
  }
  .mobile-menu-panel nav {
    gap: 1.5rem !important;
  }
  .mobile-menu-link {
    font-size: 0.875rem !important;
  }

  /* 6. Vendor Comparison: min-h-screenを解除してスマホでの大きな空白を除去 */
  section.min-h-screen {
    min-height: auto !important;
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }

}
