/* ============================================================
   日本子ども食育学会 - Custom Styles
   カラーパレット:
     Fresh Green:  #4ade80
     Warm Orange:  #fb923c
     Cream White:  #fffbeb
   ============================================================ */

/* ---------- CSS カスタムプロパティ ---------- */
:root {
  --color-green:       #4ade80;
  --color-green-dark:  #22c55e;
  --color-orange:      #fb923c;
  --color-cream:       #fffbeb;
  --color-cream-100:   #fef3c7;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 30px rgba(0,0,0,.12), 0 4px 10px rgba(0,0,0,.08);
  --transition: all .25s cubic-bezier(.4,0,.2,1);
  --radius-xl:  1.25rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
}

/* ---------- スムーズスクロール ---------- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* ---------- ベーススタイル ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

/* ---------- フォーカス可視性（アクセシビリティ） ---------- */
:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- スクリーンリーダー専用 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}
.sr-only:focus,
.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ---------- セレクション ---------- */
::selection {
  background-color: #bbf7d0;
  color: #166534;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  transition: box-shadow .3s ease;
}

header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,.08);
}

.nav-link {
  position: relative;
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-green);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: calc(100% - 24px);
}

/* ============================================================
   HERO SECTION
   ============================================================ */

/* 葉っぱ浮遊アニメーション */
@keyframes floatLeaf {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25%       { transform: translateY(-12px) rotate(5deg); }
  75%       { transform: translateY(-6px) rotate(-3deg); }
}

@keyframes floatLeafSlow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-18px) rotate(8deg); }
}

.float-animation {
  animation: floatLeaf 4s ease-in-out infinite;
}

.float-animation-delay {
  animation: floatLeaf 5s ease-in-out infinite;
  animation-delay: 1s;
}

.float-animation-slow {
  animation: floatLeafSlow 6s ease-in-out infinite;
  animation-delay: 0.5s;
}

/* ヒーロー画像カード */
@keyframes heroImageEntrance {
  from { opacity: 0; transform: translateY(30px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-image-card {
  animation: heroImageEntrance .9s cubic-bezier(.34,1.56,.64,1) forwards;
}

/* バッジ浮遊 */
@keyframes badgeFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.badge-float {
  animation: badgeFloat 3s ease-in-out infinite;
}

.badge-float-delay {
  animation: badgeFloat 3.5s ease-in-out infinite;
  animation-delay: 0.7s;
}

/* スクロールインジケーター */
.scroll-indicator {
  opacity: 1;
  transition: opacity .3s ease;
}

.scroll-indicator.hidden {
  opacity: 0;
}

/* ============================================================
   ACTIVITY CARDS
   ============================================================ */
.activity-card {
  transition: var(--transition);
  transform: translateY(0);
}

.activity-card:hover {
  transform: translateY(-6px);
}

/* キーワードタグ */
.keyword-tag {
  transition: var(--transition);
  cursor: default;
}

.keyword-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   FORM STYLES
   ============================================================ */
input, select, textarea {
  transition: border-color .2s ease, box-shadow .2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
}

/* セレクトボックスの矢印 */
select {
  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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px !important;
}

/* フォームバリデーションエラー */
.form-field-error {
  border-color: #f87171 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .15) !important;
}

.form-error-msg {
  color: #ef4444;
  font-size: .75rem;
  margin-top: .25rem;
  display: flex;
  align-items: center;
  gap: .25rem;
}

/* ============================================================
   DOTS BACKGROUND PATTERN
   ============================================================ */
.bg-dots-pattern {
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ============================================================
   BACK TO TOP BUTTON
   ============================================================ */
#back-to-top {
  transition: opacity .3s ease, transform .3s ease, background-color .2s ease;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-3px);
}

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ディレイクラス */
.delay-100 { transition-delay: .1s; }
.delay-200 { transition-delay: .2s; }
.delay-300 { transition-delay: .3s; }
.delay-400 { transition-delay: .4s; }
.delay-500 { transition-delay: .5s; }
.delay-600 { transition-delay: .6s; }

/* ============================================================
   MOBILE MENU ANIMATION
   ============================================================ */
#mobile-menu {
  transition: max-height .35s cubic-bezier(.4,0,.2,1), opacity .3s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}

#mobile-menu.open {
  max-height: 500px;
  opacity: 1;
}

/* ============================================================
   SECTION DIVIDERS
   ============================================================ */
.section-divider {
  width: 100%;
  height: 60px;
  overflow: hidden;
}

.section-divider svg {
  width: 100%;
  height: 100%;
}

/* ============================================================
   CUSTOM SCROLLBAR (WebKit)
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================
   IMAGE LOADING PLACEHOLDER
   ============================================================ */
img {
  transition: opacity .3s ease;
}

img.loading {
  opacity: 0;
}

img.loaded {
  opacity: 1;
}

/* ============================================================
   TYPOGRAPHY ENHANCEMENTS
   ============================================================ */
.font-serif {
  letter-spacing: -.01em;
}

/* 見出しグラデーション */
.text-gradient-green {
  background: linear-gradient(135deg, #22c55e 0%, #4ade80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-orange {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  header, #back-to-top, .scroll-indicator, .badge-float, .badge-float-delay {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  a {
    text-decoration: underline;
  }

  section {
    page-break-inside: avoid;
  }
}

/* ============================================================
   REDUCED MOTION (アクセシビリティ)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .float-animation,
  .float-animation-delay,
  .float-animation-slow,
  .badge-float,
  .badge-float-delay {
    animation: none !important;
  }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 640px) {
  .hero-image-wrapper {
    width: 100%;
    max-width: 400px;
  }

  section {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 768px) {
  .activity-card:hover {
    transform: translateY(-3px);
  }
}

/* ============================================================
   HIGH CONTRAST MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
  /* ダークモードは現在未対応（将来の拡張用） */
}
