/**
 * iitokoro - スタイルシート
 * W3C標準準拠・アクセシビリティ対応
 */

/* ==================== 基本設定 ==================== */
body {
  font-family: "Shippori Mincho", serif;
  background-color: #f4f4f2;
  color: #333333;
  line-height: 1.6;
}

/* ==================== テキストシャドウ ==================== */
.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.text-shadow-strong {
  text-shadow: 0 3px 6px rgba(0, 0, 0, 0.7), 
               0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ==================== 背景画像セクション ==================== */
/* ヒーローセクションの背景 */
.hero-section {
  background-image: url("../img/face.webp");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

/* パララックスセクションの背景 */
.parallax-section {
  background-image: url("../img/Nikon 0400.webp");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

/* モバイル端末での最適化(パララックス効果を無効化) */
@media (max-width: 768px) {
  .hero-section,
  .parallax-section {
    background-attachment: scroll;
  }
}

/* ==================== アニメーション ==================== */
/* フェードインアニメーション */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, 
              transform 0.8s ease-out;
  will-change: opacity, transform;
}

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

/* 画像ズームアニメーション */
.image-zoom-container {
  overflow: hidden;
  border-radius: 0.5rem;
}

.image-zoom {
  transform: scale(1.15);
  transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.is-visible .image-zoom {
  transform: scale(1);
}

/* ==================== アコーディオン ==================== */
/* アコーディオンコンテンツ */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, 
              padding 0.5s ease-in-out;
  padding-top: 0;
  padding-bottom: 0;
}

.accordion-content.open {
  max-height: 2000px; /* 十分な高さを確保 */
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* アコーディオンボタンのアイコン */
.accordion-button svg {
  transition: transform 0.3s ease;
}

.accordion-button.open svg {
  transform: rotate(45deg);
}

/* アコーディオンボタンのホバー効果 */
.accordion-button {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.accordion-button:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.accordion-button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

/* ==================== ヘッダー ==================== */
/* ヘッダーのスクロール時の動作 */
#header {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s ease, 
              opacity 0.3s ease;
}

#header.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* ==================== レイアウト調整 ==================== */
/* 固定CTAボタンのためのボディパディング */
body {
  padding-bottom: 140px;
}

/* メインコンテンツの最小高さ */
main {
  min-height: calc(100vh - 140px);
}

/* ==================== アクセシビリティ ==================== */
/* スクリーンリーダー専用テキスト */
.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;
}

/* フォーカス可能な要素のアウトライン */
a:focus,
button:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

/* ==================== プリント用スタイル ==================== */
@media print {
  /* ヘッダーとフッターを固定しない */
  #header,
  footer,
  aside {
    position: static;
  }
  
  /* 背景画像を印刷 */
  .hero-section,
  .parallax-section {
    background-attachment: scroll;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  /* ページ区切りの調整 */
  section {
    page-break-inside: avoid;
  }
  
  /* 余白の調整 */
  body {
    padding-bottom: 0;
  }
}

/* ==================== レスポンシブ対応 ==================== */
/* タブレット */
@media (max-width: 1024px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* モバイル */
@media (max-width: 640px) {
  body {
    padding-bottom: 120px;
  }
  
  .text-shadow-strong {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  }
}

/* ==================== パフォーマンス最適化 ==================== */
/* GPUアクセラレーションを有効化 */
.fade-in-section,
.image-zoom,
#header {
  backface-visibility: hidden;
  perspective: 1000px;
}

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

/* プリフェッチのヒント(CSSでは使用不可だが、コメントとして記載) */
/* 
  <link rel="preload" href="css/style.css" as="style">
  <link rel="prefetch" href="img/face.webp">
*/