/* ============================================
   民宿よしおか - Static HTML Custom Styles
   ============================================ */

/* ===== 固定 宿泊予約ボタン（PC:左縦型 / SP:下部バー） ===== */
.reserve-fixed {
  position: fixed;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e1b330;
  color: #111111;
  text-decoration: none;
  font-family: "Noto Serif JP", serif;
  transition: opacity 300ms ease;
}
.reserve-fixed:hover {
  background: #e1b330;
  color: #111111;
  opacity: 0.8;
}
.reserve-fixed__text {
  font-weight: 700;
}

/* 宿泊予約ボタンに半分重なるマスコット（わんこ・にゃんこ） */
/* ボタン(z-index:45)より背面に置き、ボタンを常に最前面にする */
.reserve-mascot {
  position: fixed;
  z-index: 44;
  right: 4px;
  top: 50%;
  /* ボタンは top:50% 中央基準。マスコットの下半分がボタン上部に重なるよう上へずらす */
  margin-top: -201px;
  width: 150px;
  max-width: none;         /* Tailwind の img{max-width:100%} を解除 */
  height: auto;
  transform-origin: bottom right;
  animation: yoyaku-peek 20s ease-in-out 2s infinite;
}

/* 2秒後に開始 → 以後20秒に1回ひょこっと動く */
@keyframes yoyaku-peek {
  0%    { transform: translate(0, 0) rotate(0deg); }
  2.2%  { transform: translate(-8px, -9px) rotate(-3deg); }
  3.5%  { transform: translate(-8px, -9px) rotate(-3deg); }
  6.5%  { transform: translate(0, 0) rotate(0deg); }
  100%  { transform: translate(0, 0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .reserve-mascot { animation: none; }
}

/* SP: マスコットは右下に配置し、上下にゆっくり動く */
@media screen and (max-width: 767px) {
  .reserve-mascot {
    display: block;
    top: auto;
    margin-top: 0;
    bottom: 32px;          /* 下部バーの上、大きく見えるよう配置 */
    right: 6px;
    width: 130px;
    z-index: 44;           /* 下部バー(reserve-fixed:45)より背面 */
    animation: yoyaku-bob 20s ease-in-out 2s infinite;
  }
}

/* SP用：2秒後に開始 → 以後20秒に1回だけ上下に動く */
@keyframes yoyaku-bob {
  0%    { transform: translateY(0); }
  1.5%  { transform: translateY(-12px); }
  3%    { transform: translateY(0); }
  4.5%  { transform: translateY(-6px); }
  6%    { transform: translateY(0); }
  100%  { transform: translateY(0); }
}

/* PC: 画面左端の縦型タブ */
@media screen and (min-width: 768px) {
  .reserve-fixed {
    right: 0;
    top: 50%;
    transform: translateY(calc(-50% + 80px));
    flex-direction: column;
    gap: 18px;
    padding: 40px 20px;
    border-radius: 14px 0 0 14px;
  }
  .reserve-fixed__text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 0.35em;
    font-size: 1.5rem;
  }
  .reserve-fixed__icon {
    font-size: 1.9rem;
  }
  .reserve-mascot {
    margin-top: -121px;
  }
}

/* 犬猫イラスト上部の吹き出し（PCのみ表示） */
.reserve-balloon {
  display: none;
}
@media screen and (min-width: 768px) {
  .reserve-balloon {
    display: block;
    position: fixed;
    z-index: 44;
    right: 29px;
    top: 50%;
    margin-top: -378px;
    width: 100px;
    max-width: none;
    height: auto;
    opacity: 0;
    animation: hero-fade-in 1s ease forwards;
    animation-delay: 2s;
  }
}

/* SP: 画面下部の全幅バー */
@media screen and (max-width: 767px) {
  .reserve-fixed {
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: row;
    gap: 8px;
    padding: 28px 16px;
    font-size: 16.4px;
    letter-spacing: 0.08em;
  }
  .reserve-fixed__icon {
    font-size: 1.2rem;
  }
  body {
    padding-bottom: 84px;
  }
}

/* ===== TOPへ戻るボタン（PC・SP共通・右下） ===== */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1f3a5c;
  border: 1px solid #1f3a5c;
  border-radius: 9999px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease, background 300ms ease, color 300ms ease;
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.to-top .ri-arrow-up-s-line {
  font-size: 1.6rem;
  line-height: 1;
}
.to-top:hover {
  background: #1f3a5c;
  color: #ffffff;
}
/* SP: 下部の宿泊予約バー・マスコットと重ならない位置に配置 */
@media screen and (max-width: 767px) {
  .to-top {
    right: 16px;
    bottom: 195px;
    width: 44px;
    height: 44px;
  }
}

/* 横スクロール抑止（フルブリード要素のはみ出し対策） */
body {
  overflow-x: hidden;
  max-width: 100%;
}

/* 背景テクスチャ（全ページ共通） */
body {
  background-image: url(../img/back.jpg);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Navbar scroll state */
#navbar {
  transition: all 300ms ease;
}

#navbar[data-scrolled="true"] {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Logo swap: 透明ヘッダー=白ロゴ / スクロール後=通常ロゴ */
#navbar .logo-dark {
  display: none;
}

#navbar[data-scrolled="true"] .logo-white {
  display: none;
}

#navbar[data-scrolled="true"] .logo-dark {
  display: block;
}

#navbar .nav-text {
  color: white;
  transition: opacity 300ms ease;
}

#navbar .nav-text:hover {
  opacity: 0.5;
}

#navbar[data-scrolled="true"] .nav-text {
  color: #111111;
}

#navbar .nav-btn,
#navbar[data-scrolled="true"] .nav-btn {
  background-color: #e1b330;
  color: white;
  border-color: #e1b330;
  transition: all 300ms ease;
}

#navbar .nav-btn:hover,
#navbar[data-scrolled="true"] .nav-btn:hover {
  background-color: #e1b330;
  color: white;
  border-color: #e1b330;
  opacity: 0.8;
}

#navbar .mobile-menu-btn {
  color: white;
  transition: all 300ms ease;
}

#navbar .mobile-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#navbar[data-scrolled="true"] .mobile-menu-btn {
  color: #111111;
}

#navbar[data-scrolled="true"] .mobile-menu-btn:hover {
  background-color: #f3f4f6;
}

/* Horizontal scroll animation for pet images */
@keyframes scroll-x {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.animate-scroll {
  animation: scroll-x 30s linear infinite;
}

/* SP: マーキーの速度を上げる */
@media screen and (max-width: 767px) {
  .animate-scroll {
    animation-duration: 15s;
  }
}

/* Location image slider */
.location-slide {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.location-slide.active {
  opacity: 1;
}

/* Cuisine image slider */
.cuisine-slide {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.cuisine-slide.active {
  opacity: 1;
}

/* Bath image slider */
.bath-slide {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.bath-slide.active {
  opacity: 1;
}

/* Room image slider (複数スライダーを1ページ内で独立動作) */
.room-slide {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.room-slide.active {
  opacity: 1;
}

/* Dining image slider */
.dining-slide {
  opacity: 0;
  transition: opacity 1000ms ease;
}

.dining-slide.active {
  opacity: 1;
}

/* Hero image slider (4枚クロスフェード) */
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1200ms ease;
}

/* ===== スライダー ゆっくりズームイン（Ken Burns効果） =====
   お食事処（.dining-slide）は対象外。
   .active（opacity用）とは別に .zoom-in を用い、クロスフェードで
   非表示になった後にJS側で .zoom-in を外すことで、フェードアウト中に
   拡大率が一瞬元に戻る不自然なスナップを防ぐ。 */
@keyframes slow-zoom {
  from { transform: scale(1); }
  to { transform: scale(1.12); }
}
.hero-slide.zoom-in {
  animation: slow-zoom 12s linear forwards;
}
.location-slide.zoom-in,
.cuisine-slide.zoom-in,
.room-slide.zoom-in,
.bath-slide.zoom-in {
  animation: slow-zoom 10s linear forwards;
}
@media (prefers-reduced-motion: reduce) {
  .hero-slide.zoom-in,
  .location-slide.zoom-in,
  .cuisine-slide.zoom-in,
  .room-slide.zoom-in,
  .bath-slide.zoom-in {
    animation: none;
  }
}

/* SP: ヒーロースライドのズームをより強めに */
@keyframes slow-zoom-hero-sp {
  from { transform: scale(1); }
  to { transform: scale(1.28); }
}
@media screen and (max-width: 767px) {
  .hero-slide.zoom-in {
    animation: slow-zoom-hero-sp 12s linear forwards;
  }
}
@media screen and (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .hero-slide.zoom-in {
    animation: none;
  }
}

.hero-slide.active {
  opacity: 1;
}

/* Modal */
.modal-open {
  overflow: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* ===== スクロール連動フェードアップ（.reveal） ===== */
/* .reveal 単体は opacity のみを制御し、要素自身の transform（Tailwindの
   -translate-x-1/2 等の配置用ユーティリティ）を上書きしない。
   transform も動かしたい場合のみ .reveal-up を追加する。 */
.reveal {
  opacity: 0;
  transition: opacity 0.9s ease;
}
.reveal.is-visible {
  opacity: 1;
}
.reveal-up {
  transform: translateY(30px);
  transition: transform 0.8s ease, opacity 0.9s ease;
}
.reveal-up.is-visible {
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== ページ読み込み1秒後にフェードイン（ヒーローロゴ等） ===== */
@keyframes hero-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.hero-fade-in {
  opacity: 0;
  animation: hero-fade-in 1s ease forwards;
  animation-delay: 1s;
}
@media (prefers-reduced-motion: reduce) {
  .hero-fade-in,
  .reserve-balloon {
    opacity: 1;
    animation: none;
  }
}