/* ========================================
   ジロー薬局 - カスタムCSS
   自分薬局風リデザイン：上質・ゆったり・写真重視
   ======================================== */

/* ========================================
   ベーススタイル
   ======================================== */
html {
  scroll-behavior: smooth;
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-size: 1.5rem;
  line-height: 2;
  letter-spacing: 0.06em;
  color: #333;
  font-family: "游ゴシック体", "YuGothic", "游ゴシック", "Yu Gothic Medium", "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

section[id] {
  scroll-margin-top: 80px;
}

/* 英語見出し用 */
.font-display {
  font-family: 'Cinzel', 'Inter', serif;
  letter-spacing: 0.15em;
}

/* ========================================
   カラー変数
   ======================================== */
:root {
  --gold: #d0ac71;
  --gold-light: #e8d5b5;
  --gold-dark: #9f7a48;
  --beige: #cdbfab;
  --charcoal: #333;
  --gray: #575757;
  --gray-light: #6f6f6f;
  --bg-light: #f8f6f3;
  --bg-white: #fff;
  --bg-dark: #2a2a2a;
  --line-green: #06C755;
  --teal: #0d9488;
  --teal-light: #14b8a6;
}

/* ========================================
   ナビゲーション
   ======================================== */
.navbar-scrolled {
  background-color: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

/* ========================================
   ヒーロー
   ======================================== */
#hero {
  position: relative;
}

#hero img {
  animation: heroZoom 40s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-scroll-indicator::after {
  content: '';
  width: 1px;
  height: 50px;
  background: rgba(255,255,255,0.5);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ========================================
   フェードインアニメーション
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeInUp 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fade-in-delay-1 { animation-delay: 0.3s; }
.fade-in-delay-2 { animation-delay: 0.6s; }
.fade-in-delay-3 { animation-delay: 0.9s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* スクロール連動フェードイン */
.scroll-fade {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ========================================
   セクション見出し
   ======================================== */
.section-label {
  font-family: 'Cinzel', 'Inter', serif;
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  font-weight: 400;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: var(--charcoal);
}

@media (min-width: 768px) {
  .section-title {
    font-size: 3.2rem;
  }
}

/* セクション区切り線 */
.section-divider {
  width: 40px;
  height: 1px;
  background: var(--gold);
  margin: 2rem auto;
}

/* ========================================
   ボタン・リンク
   ======================================== */
a, button {
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* テキストリンク（自分薬局風） */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--gray);
  border-bottom: 1px solid var(--beige);
  padding-bottom: 4px;
  transition: all 0.3s ease;
}

.text-link:hover {
  color: var(--gold-dark);
  border-color: var(--gold);
}

.text-link::after {
  content: '→';
  transition: transform 0.3s ease;
}

.text-link:hover::after {
  transform: translateX(4px);
}

/* ========================================
   写真スタイル
   ======================================== */
.photo-full {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.photo-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-frame {
  overflow: hidden;
}

.photo-frame img {
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-frame:hover img {
  transform: scale(1.05);
}

/* ========================================
   LINE CTA
   ======================================== */
#line-cta::before {
  content: '';
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--line-green));
  pointer-events: none;
}

/* ========================================
   サブページ共通
   ======================================== */
.page-header {
  padding-top: 140px;
  padding-bottom: 80px;
  background: var(--charcoal);
  color: white;
  text-align: center;
}

.page-header .section-label {
  color: var(--gold-light);
}

.page-header h1 {
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

@media (min-width: 768px) {
  .page-header {
    padding-top: 160px;
    padding-bottom: 100px;
  }
  .page-header h1 {
    font-size: 3.2rem;
  }
}

/* ========================================
   アコーディオン
   ======================================== */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.accordion-content.open {
  max-height: 500px;
}

.accordion-toggle svg {
  transition: transform 0.4s ease;
}

.accordion-toggle.active svg {
  transform: rotate(180deg);
}

.faq-item {
  border-bottom: 1px solid #e5e7eb;
}

.faq-item:last-child {
  border-bottom: none;
}

/* ========================================
   お薬手帳 横スクロール
   ======================================== */
.techo-scroll-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.techo-scroll-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: techoScroll 40s linear infinite;
}

.techo-scroll-track:hover {
  animation-play-state: paused;
}

.techo-scroll-track.techo-scroll-reverse {
  animation: techoScrollReverse 40s linear infinite;
}

.techo-scroll-item {
  flex-shrink: 0;
  width: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.techo-scroll-item:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.techo-scroll-item img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes techoScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes techoScrollReverse {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

@media (min-width: 768px) {
  .techo-scroll-item {
    width: 180px;
  }
  .techo-scroll-track {
    gap: 20px;
  }
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 640px) {
  body {
    font-size: 1.4rem;
    line-height: 1.9;
  }

  .section-title {
    font-size: 2.2rem;
  }
}

/* ========================================
   モバイルメニュー文字
   ======================================== */
#mobile-menu a.mobile-nav-link {
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

/* ========================================
   LINE固定ボタン
   ======================================== */
#line-float {
  transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

@media (max-width: 640px) {
  #line-float {
    bottom: 16px;
    right: 16px;
    width: 64px;
    height: 64px;
  }
}

/* ========================================
   高級感のある動きの追加
   ======================================== */

/* 見出し文字の一文字ずつフェードイン */
.char-reveal {
  display: inline-block;
  overflow: hidden;
}
.whitespace-nowrap .char-reveal {
  white-space: nowrap;
}
h2.text-center .char-reveal,
h1.text-center .char-reveal {
  text-align: center;
}
.char-reveal .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.char-reveal.is-visible .char,
.char-reveal.gl-in .char,
.scroll-fade.is-visible .char-reveal .char,
.scroll-fade.gl-in .char-reveal .char {
  opacity: 1;
  transform: translateY(0);
}

/* ゴールドラインの伸縮アニメーション */
.scroll-fade .section-divider {
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1s cubic-bezier(0.77, 0, 0.175, 1) 0.2s;
}
.scroll-fade.is-visible .section-divider,
.scroll-fade.gl-in .section-divider {
  transform: scaleX(1);
}

/* セクションラベル（Cinzelの英語）がふわっと上から */
.scroll-fade .section-label,
.scroll-fade p.font-display {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 1s ease 0.1s, transform 1s ease 0.1s;
}
.scroll-fade.is-visible .section-label,
.scroll-fade.is-visible p.font-display,
.scroll-fade.gl-in .section-label,
.scroll-fade.gl-in p.font-display {
  opacity: 1;
  transform: translateY(0);
}

/* ゴールドアクセントのやわらかな点滅 */
@keyframes goldGlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.gold-pulse {
  animation: goldGlow 3s ease-in-out infinite;
}

/* 写真ホバー時のオーバーレイ光沢 */
.photo-frame {
  position: relative;
}
.photo-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.9s ease;
  z-index: 1;
  pointer-events: none;
}
.photo-frame:hover::before {
  left: 100%;
}

/* ボタンのホバー拡張エフェクト */
a[class*="bg-[#06C755]"], a[class*="bg-charcoal"]:not(.block) {
  position: relative;
  overflow: hidden;
}

/* スクロール連動のゆっくりフェード */
.fade-slide-up {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.fade-slide-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   ユーティリティ
   ======================================== */
.text-balance {
  text-wrap: balance;
}

/* 印刷時 */
@media print {
  header, #line-cta, footer {
    display: none;
  }
  section {
    break-inside: avoid;
  }
}
