/*
Theme Name: Alphaplan AI Training
Theme URI: https://example.com/alphaplan-theme
Author: Alphaplan Inc.
Author URI: https://example.com/
Description: アルファプラン株式会社 AI・生成AI活用実務研修 LP用カスタムテーマ。Tailwind CSS（CDN）+ Contact Form 7連携対応。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: alphaplan
Tags: landing-page, business, custom-colors, custom-logo
*/

/* ============ Base ============ */
html {
  scroll-behavior: smooth;
  /* iOS Safari でのテキスト自動拡大防止 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  -webkit-font-smoothing: antialiased;
  /* スマホで横スクロールが発生しないように */
  overflow-x: hidden;
}

/* iPhone（Safari）でフォーム入力時にズームされないよう16px以上を確保 */
@media screen and (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ============ iPhone (狭幅端末) 最適化 ============ */
/* iPhone SE / mini / 標準幅 (~375px) 向けの最終調整 */
@media (max-width: 390px) {
  /* Heroの見出しを小型端末で更にコンパクトに */
  .hero-title {
    font-size: 22px !important;
    line-height: 1.25 !important;
  }
  .hero-lead {
    font-size: 12.5px !important;
    line-height: 1.7 !important;
  }
  /* Heroの統計カードを狭幅でも崩れないように */
  .hero-stats dd {
    font-size: 16px !important;
  }
  .hero-stats dt {
    font-size: 9.5px !important;
  }
  /* セクション見出しをスマホで詰めて折返し対策 */
  section h2 {
    font-size: 22px !important;
    line-height: 1.3;
  }
  section h3 {
    line-height: 1.35;
  }
  /* ボタンを画面幅に収める */
  #hero a[href="#contact"],
  #hero a[href="#curriculum"] {
    font-size: 12.5px !important;
    padding: 0.625rem 0.875rem !important;
  }
  /* カリキュラムのステップタイトル */
  #curriculum h3 {
    font-size: 17px !important;
  }
  /* 開催概要の受講料カード（金額が改行しないように） */
  #overview .whitespace-nowrap {
    font-size: 14.5px !important;
  }
}

/* iPhone 標準幅 (~414px以下) 共通の余白圧縮 */
@media (max-width: 414px) {
  .max-w-7xl,
  .max-w-5xl,
  .max-w-4xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* iOS のセーフエリア対応（iPhone X 以降のノッチ） */
@supports (padding: env(safe-area-inset-bottom)) {
  #back-to-top {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    right: calc(1rem + env(safe-area-inset-right));
  }
  @media (min-width: 640px) {
    #back-to-top {
      bottom: calc(1.5rem + env(safe-area-inset-bottom));
      right: calc(1.5rem + env(safe-area-inset-right));
    }
  }
}

/* タッチターゲットの最低サイズ確保（44x44px推奨） */
@media (max-width: 640px) {
  a, button, summary {
    -webkit-tap-highlight-color: rgba(66, 100, 255, 0.1);
  }
}

/* スマホでの長い英単語・URLの折り返し */
p, li, span, h1, h2, h3, h4 {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Section reveal */
.curriculum-item,
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}
.curriculum-item.is-visible,
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle gradient text safety for older Safari */
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
}

/* Details / Summary cleanup */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Custom scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Selection */
::selection { background: #4264ff; color: #fff; }

/* Floating chat hero animation */
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
#hero .relative.bg-white { animation: floaty 6s ease-in-out infinite; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .curriculum-item, .reveal { transition: none; opacity: 1; transform: none; }
  #hero .relative.bg-white { animation: none; }
}

/* ============ Contact Form 7 オーバーライド（LPのCTAデザインに合わせる） ============ */
.cf7-styled .wpcf7-form .wpcf7-form-control-wrap { display: block; }

.cf7-styled .wpcf7-form p {
  margin: 0 0 1rem 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.cf7-styled .wpcf7-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  color: #fff;
}

.cf7-styled .wpcf7-form input[type="text"],
.cf7-styled .wpcf7-form input[type="email"],
.cf7-styled .wpcf7-form input[type="tel"],
.cf7-styled .wpcf7-form input[type="url"],
.cf7-styled .wpcf7-form input[type="number"],
.cf7-styled .wpcf7-form textarea,
.cf7-styled .wpcf7-form select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  font-size: 0.875rem;
  border: none;
  outline: none;
  transition: box-shadow 0.2s ease;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

/* スマホ時のCF7フォームを少しコンパクトに */
@media (max-width: 640px) {
  .cf7-styled .wpcf7-form p {
    margin: 0 0 0.75rem 0;
  }
  .cf7-styled .wpcf7-form input[type="text"],
  .cf7-styled .wpcf7-form input[type="email"],
  .cf7-styled .wpcf7-form input[type="tel"],
  .cf7-styled .wpcf7-form input[type="url"],
  .cf7-styled .wpcf7-form input[type="number"],
  .cf7-styled .wpcf7-form textarea,
  .cf7-styled .wpcf7-form select {
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
  }
  .cf7-styled .wpcf7-form .wpcf7-submit {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

.cf7-styled .wpcf7-form input::placeholder,
.cf7-styled .wpcf7-form textarea::placeholder {
  color: #94a3b8;
}

.cf7-styled .wpcf7-form input:focus,
.cf7-styled .wpcf7-form textarea:focus,
.cf7-styled .wpcf7-form select:focus {
  box-shadow: 0 0 0 2px #67e8f9;
}

.cf7-styled .wpcf7-form .wpcf7-submit {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  color: #2235c8;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.cf7-styled .wpcf7-form .wpcf7-submit:hover {
  background: #f1f5f9;
}

.cf7-styled .wpcf7-form .wpcf7-submit:active {
  transform: scale(0.98);
}

.cf7-styled .wpcf7-not-valid-tip {
  color: #fde68a;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.cf7-styled .wpcf7 form .wpcf7-response-output {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 0.8rem;
  background: rgba(255,255,255,0.08);
}

.cf7-styled .wpcf7 form.sent .wpcf7-response-output {
  border-color: #86efac;
  background: rgba(34,197,94,0.15);
}

.cf7-styled .wpcf7 form.invalid .wpcf7-response-output,
.cf7-styled .wpcf7 form.failed .wpcf7-response-output {
  border-color: #fca5a5;
  background: rgba(239,68,68,0.15);
}

.cf7-styled .wpcf7-spinner { background-color: #fff; }
