@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;600;700&family=EB+Garamond:wght@400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600&family=Inter:wght@200;300;400;500&family=DM+Mono:wght@400;500&display=swap');

:root {
  --background: 0 0% 100%;
  --foreground: 207 78% 8%;
  --card: 224 22% 95%;
  --card-foreground: 207 78% 8%;
  --popover: 0 0% 100%;
  --popover-foreground: 207 78% 8%;
  --primary: 204 97% 21%;
  --primary-foreground: 0 0% 100%;
  --secondary: 224 22% 95%;
  --secondary-foreground: 204 97% 21%;
  --muted: 224 22% 95%;
  --muted-foreground: 207 30% 45%;
  --accent: 214 100% 62%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 0 0% 100%;
  --border: 224 15% 88%;
  --input: 224 15% 88%;
  --ring: 214 100% 62%;
  --radius: 0rem;
  --celest-blue: 212 80% 79%;
  --celest-blue-foreground: 207 78% 8%;
  --dark-blue: 207 78% 8%;
  --dark-blue-foreground: 0 0% 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: 0.02em;
  line-height: 1.8;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

.dashed-divider {
  border: none;
  border-top: 1px solid hsl(var(--border));
  width: 100%;
  margin: 0;
}

.nav-active {
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 6px;
}

/* ========= Navbar adaptive colors ========= */
header {
  transition: background-color 0.4s ease;
}

header.nav-dark nav > .nav-item > a,
header.nav-dark nav > a {
  color: rgba(255,255,255,0.7) !important;
}
header.nav-dark nav > .nav-item > a:hover,
header.nav-dark nav > a:hover {
  color: white !important;
}
header.nav-dark #menu-toggle svg,
header.nav-dark #menu-toggle-mobile svg {
  color: white !important;
}

/* ========= Opener / Splash Screen ========= */
#opener {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #013f6a;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#opener .opener-logo {
  opacity: 0;
  animation: openerLogoIn 0.6s ease-out 0.3s forwards;
}

/* Shorter animation for page transitions */
#opener.transition-mode .opener-logo {
  animation: openerLogoIn 0.3s ease-out 0.1s forwards;
}

#opener.transition-mode.phase-out .opener-logo {
  animation: openerLogoOut 0.25s ease-in forwards;
}

#opener.transition-mode.phase-reveal {
  animation: openerReveal 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

#opener.phase-out .opener-logo {
  animation: openerLogoOut 0.5s ease-in forwards;
}

#opener.phase-reveal {
  animation: openerReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Hero image clip animation for reveal */
.hero-image-reveal {
  clip-path: inset(40% 30% 40% 30% round 12px);
  opacity: 0;
}

.hero-image-reveal.expanding {
  animation: heroImageExpand 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes openerLogoIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes openerLogoOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.02); }
}

@keyframes openerReveal {
  from { opacity: 1; }
  to { opacity: 0; pointer-events: none; }
}

@keyframes heroImageExpand {
  0% { clip-path: inset(40% 30% 40% 30% round 12px); opacity: 0; }
  15% { clip-path: inset(35% 25% 35% 25% round 10px); opacity: 1; }
  100% { clip-path: inset(0% 0% 0% 0% round 0px); opacity: 1; }
}

/* Delay page animations until opener finishes */
body.opener-active .anim-fade-up,
body.opener-active .anim-fade-up-d1,
body.opener-active .anim-fade-up-d2,
body.opener-active .anim-fade-d3,
body.opener-active .anim-fade-d4 {
  animation: none;
  opacity: 0;
}

/* Fade in animation for scroll */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Initial page load animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.anim-fade-up { animation: fadeInUp 0.6s ease-out forwards; }
.anim-fade-up-d1 { opacity: 0; animation: fadeInUp 0.6s ease-out 0.2s forwards; }
.anim-fade-up-d2 { opacity: 0; animation: fadeInUp 0.6s ease-out 0.3s forwards; }
.anim-fade-d3 { opacity: 0; animation: fadeIn 0.6s ease-out 0.4s forwards; }
.anim-fade-d4 { opacity: 0; animation: fadeIn 0.6s ease-out 0.5s forwards; }

/* Staggered children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.06s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.08s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.12s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.18s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.24s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.3s; }
.stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Overlay menu */
.overlay-menu {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.overlay-menu.active {
  opacity: 1;
  pointer-events: auto;
}

/* Desktop dropdown */
.nav-dropdown {
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.nav-item:hover .nav-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Image hover zoom */
.img-zoom img {
  transition: transform 0.7s ease;
}
.img-zoom:hover img {
  transform: scale(1.1);
}

/* Form error messages */
.form-error {
  display: none;
  color: hsl(var(--destructive));
  font-size: 12px;
  margin-top: 4px;
}

/* Custom input style */
.form-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  border-radius: 0;
  padding: 12px 0;
  font-size: 16px;
  font-weight: 300;
  color: hsl(var(--foreground));
  width: 100%;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.form-input::placeholder {
  color: hsl(var(--muted-foreground) / 0.4);
}
.form-input:focus {
  border-bottom-color: hsl(var(--foreground) / 0.6);
}
.form-input.error {
  border-bottom-color: hsl(var(--destructive));
}

textarea.form-input {
  min-height: 120px;
  resize: none;
}

/* Floating CTA button */
#floating-cta {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transition: background-color 0.4s ease, color 0.4s ease, gap 0.3s, box-shadow 0.3s;
}
@media (hover: hover) {
  #floating-cta:hover {
    opacity: 0.92;
  }
}
#floating-cta.cta-light {
  background-color: #ffffff;
  color: hsl(var(--primary));
}
@media (hover: hover) {
  #floating-cta.cta-light:hover {
    background-color: rgba(255, 255, 255, 0.92);
  }
}

select.form-input {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

/* ========= Contact Form 7（お問い合わせフォーム） ========= */
/* CF7 が各入力欄を包む span をブロック化し、既存レイアウトに合わせる */
.rbi-contact-form .wpcf7-form-control-wrap {
  display: block;
}
.rbi-contact-form .wpcf7-form p {
  margin: 0;
}
/* バリデーションメッセージ（既存 .form-error と同じ赤字） */
.rbi-contact-form .wpcf7-not-valid-tip {
  color: hsl(var(--destructive));
  font-size: 12px;
  font-weight: 300;
  margin-top: 4px;
}
.rbi-contact-form .wpcf7-form-control.wpcf7-not-valid {
  border-bottom-color: hsl(var(--destructive));
}
/* 送信後のレスポンス表示 */
.rbi-contact-form .wpcf7-response-output {
  margin: 24px 0 0;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  border: 1px solid hsl(var(--border));
}
.rbi-contact-form .wpcf7 form.invalid .wpcf7-response-output,
.rbi-contact-form .wpcf7 form.unaccepted .wpcf7-response-output,
.rbi-contact-form .wpcf7 form.spam .wpcf7-response-output,
.rbi-contact-form .wpcf7 form.failed .wpcf7-response-output {
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive));
}
.rbi-contact-form .wpcf7 form.sent .wpcf7-response-output {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}
/* 同意チェックボックス（既存の見た目を踏襲） */
.rbi-contact-form .wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
}
.rbi-contact-form .wpcf7-acceptance label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.rbi-contact-form .wpcf7-acceptance .wpcf7-list-item-label {
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  color: hsl(var(--foreground) / 0.8);
}
.rbi-contact-form .wpcf7-acceptance input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: hsl(var(--primary));
  cursor: pointer;
  flex-shrink: 0;
}
/* 送信ボタン（既存ボタンの見た目を踏襲、矢印は背景SVGで再現） */
.rbi-contact-form .rbi-submit {
  -webkit-appearance: none;
  appearance: none;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 0;
  padding: 16px 56px 16px 32px;
  font-size: 14px;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.3s, background-position 0.3s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 28px center;
}
@media (hover: hover) {
  .rbi-contact-form .rbi-submit:hover {
    background-color: hsl(var(--primary) / 0.9);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background-position: right 22px center;
  }
}
.rbi-contact-form .wpcf7-spinner {
  margin: 14px 0 0 10px;
}

/* reCAPTCHA v3 バッジを非表示にする（Google規約に従い、規約表記はフォーム内に表示する） */
/* display:none は使わない（reCAPTCHA の動作が壊れるため）。visibility:hidden を使う。 */
.grecaptcha-badge {
  visibility: hidden;
}

/* ========= Reduced Motion ========= */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .stagger > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-image-reveal {
    clip-path: none !important;
    opacity: 1 !important;
    animation: none !important;
  }
  .anim-fade-up,
  .anim-fade-up-d1,
  .anim-fade-up-d2,
  .anim-fade-d3,
  .anim-fade-d4 {
    opacity: 1 !important;
    animation: none !important;
  }
  #opener {
    display: none !important;
  }
}

/* ========= WordPress Admin Bar offset ========= */
.admin-bar header.fixed {
  top: 32px;
}
.admin-bar #opener {
  top: 32px;
}
.admin-bar #overlay-menu {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar header.fixed {
    top: 46px;
  }
  .admin-bar #opener {
    top: 46px;
  }
  .admin-bar #overlay-menu {
    top: 46px;
  }
}
