/* ============================================
   石川雅之 Photography — Custom Styles
   Design System: Warm Cinematic (from reference template)
   ============================================ */

/* Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background-color: #fef9f2;
  color: #353228;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-break: strict;
  overflow-wrap: break-word;
}

/* ============================================
   Hero Animation（ローダー消去後に body.hero-ready で発火）
   ============================================ */

/* h1 1文字ずつ */
.hero-char {
  display: inline-block;
  opacity: 0;
  filter: blur(6px);
}
body.hero-ready .hero-char {
  animation: heroCharIn 2s ease forwards;
}

@keyframes heroCharIn {
  0%   { opacity: 0; filter: blur(6px); }
  60%  { opacity: 1; filter: blur(0px); }
  100% { opacity: 1; filter: blur(0px); }
}

/* ============================================
   Page Loader — カーテン演出
   ============================================ */

#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: all;
}

/* 全画面カーテンパネル */
.curtain-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1a2f45;
  transition: opacity 1.2s ease;
}

/* 中央ロゴ */
.curtain-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  transition: opacity 0.5s ease;
}

.curtain-logo img {
  height: 2.5rem;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.curtain-label {
  font-family: 'Noto Serif JP', serif;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  color: rgba(255, 246, 238, 0.95);
  text-shadow: 0 0 12px rgba(255, 246, 238, 0.6);
  animation: loaderPulse 1.8s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

/* カーテンを開く */
#page-loader.open .curtain-panel {
  opacity: 0;
}
#page-loader.open .curtain-logo {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* ============================================
   Page Fade-in（カーテンが開く前に hero-ready で発火）
   ============================================ */

#page-loader ~ * {
  opacity: 0;
  transition: opacity 0.6s ease 0.3s;
}
body.hero-ready #page-loader ~ * {
  opacity: 1;
}

/* Material Symbols */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ============================================
   Navigation
   ============================================ */

/* ========== Sidebar ========== */
#sidebar {
  background-color: rgba(0, 0, 0, 0.28);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color 0.45s ease, border-color 0.45s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1);
}

#sidebar.scrolled {
  background-color: #fef9f2;
  border-right: 1px solid #e8e2d3;
}

.sidebar-logo {
  filter: brightness(0) invert(1);
  transition: filter 0.45s ease;
  height: 2.25rem;
  width: auto;
}

#sidebar.scrolled .sidebar-logo {
  filter: none;
}

.sidebar-link {
  display: block;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 1);
  padding: 0.6rem 0;
  position: relative;
  transition: color 0.2s ease;
}

.sidebar-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.sidebar-link:hover { color: rgba(255, 255, 255, 1); }
.sidebar-link:hover::after { width: 100%; }

#sidebar.scrolled .sidebar-link { color: rgba(53, 50, 40, 0.6); }
#sidebar.scrolled .sidebar-link:hover { color: rgba(53, 50, 40, 0.9); }

.sidebar-menu-btn {
  background: rgba(255, 255, 255, 0.95);
  color: #23527c;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(35, 50, 82, 0.18), 0 0 0 1px rgba(35, 82, 124, 0.08);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

/* ============================================
   Sidebar Close Button（オシャレ版）
   ============================================ */

.sidebar-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.25rem;
  color: rgba(53, 50, 40, 0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  transition: color 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-close:hover,
.sidebar-close:focus-visible {
  color: #23527c;
  outline: none;
}

.sidebar-close-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.sidebar-close-icon::before,
.sidebar-close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.sidebar-close-icon::before { transform: translateY(-0.5px) rotate(45deg); }
.sidebar-close-icon::after  { transform: translateY(-0.5px) rotate(-45deg); }

.sidebar-close:hover .sidebar-close-icon,
.sidebar-close:focus-visible .sidebar-close-icon {
  transform: rotate(90deg);
}

.sidebar-close-label {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1;
  position: relative;
}

.sidebar-close-label::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: currentColor;
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

.sidebar-close:hover .sidebar-close-label::after,
.sidebar-close:focus-visible .sidebar-close-label::after {
  width: 100%;
}
.sidebar-menu-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 20px rgba(35, 50, 82, 0.25), 0 0 0 1px rgba(35, 82, 124, 0.12);
}
.sidebar-menu-btn .material-symbols-outlined {
  font-size: 22px;
}

/* ============================================
   ボタン
   ============================================ */

/* プライマリ */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.75rem;
  background-color: #23527c;
  color: #ffffff;
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(35,82,124,0.4);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-cta:hover {
  background-color: #1c4266;
  box-shadow: 0 6px 20px rgba(35,82,124,0.5);
  transform: translateY(-1px);
}

.btn-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(35,82,124,0.3);
}

/* アウトライン */
.btn-cta-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.75rem;
  background: transparent;
  color: #23527c;
  border: 1px solid #23527c;
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(35,82,124,0.15);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-cta-outline:hover {
  background-color: rgba(35,82,124,0.06);
  box-shadow: 0 6px 20px rgba(35,82,124,0.22);
  transform: translateY(-1px);
}

.btn-cta-outline:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(35,82,124,0.1);
}

/* 反転（ダーク背景上） */
.btn-cta-inverse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.75rem;
  background-color: #ffffff;
  color: #23527c;
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-cta-inverse:hover {
  background-color: #d4e8f8;
  box-shadow: 0 6px 22px rgba(0,0,0,0.32);
  transform: translateY(-1px);
}

.btn-cta-inverse:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ============================================
   Hero
   ============================================ */

.hero-gradient {
  background: linear-gradient(
    to bottom,
    rgba(254, 249, 242, 0) 0%,
    rgba(254, 249, 242, 0) 60%,
    rgba(254, 249, 242, 0.08) 100%
  );
}

/* Scroll indicator animation */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(0.7); }
}

/* ============================================
   Portfolio Grid — Hover Effects
   ============================================ */

/* ============================================
   Form Fields
   ============================================ */

/* Remove default browser outline, use custom transition */
input, textarea, select {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input:focus,
textarea:focus,
select:focus {
  border-bottom-color: #23527c;
  box-shadow: none;
  outline: none;
  background-color: rgba(243, 224, 197, 0.08);
}

/* Textarea resize handle color */
textarea {
  resize: vertical;
}

/* Select arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237e7b6e' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

/* ============================================
   Panel / Card — 共通スタイル
   ============================================ */

/* ギャラリー bento カード */
[class*="md:col-span"] {
  box-shadow: 0 2px 12px rgba(53, 50, 40, 0.06);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

[class*="md:col-span"]:hover {
  box-shadow: 0 8px 32px rgba(53, 50, 40, 0.12);
}

/* 料金カード */
[class*="rounded-2xl"][class*="bg-surface-container"],
[class*="rounded-2xl"][class*="bg-primary"] {
  box-shadow: 0 4px 20px rgba(53, 50, 40, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

[class*="rounded-2xl"][class*="bg-surface-container"]:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(53, 50, 40, 0.13);
}

/* グッズカード */
[class*="rounded-xl"][class*="bg-surface-container-low"]:not(#navbar):not(#mobile-menu) {
  box-shadow: 0 2px 10px rgba(53, 50, 40, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

[class*="rounded-xl"][class*="bg-surface-container-low"]:not(#navbar):not(#mobile-menu):hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(53, 50, 40, 0.11);
}

/* ============================================
   Buttons
   ============================================ */

/* Scale on active */
button:active,
a[class*="bg-primary"]:active {
  transform: scale(0.97);
}

/* ============================================
   Mobile Bottom Navigation (optional)
   ============================================ */

@media (max-width: 767px) {
  /* Add bottom padding to prevent content hidden under mobile nav */
  body {
    padding-bottom: 0;
  }
}

/* ============================================
   Footer Logo — 白反転
   ============================================ */

footer img[src*="logo"] {
  filter: brightness(0) invert(1);
}

/* ============================================
   News Item Hover
   ============================================ */

.news-item {
  transition: background-color 0.3s ease, color 0.3s ease;
  text-decoration: none;
  display: flex;
}

.news-item:hover {
  background-color: #23527c !important;
  border-radius: 0.5rem;
}

.news-item:hover .news-title,
.news-item:hover .news-meta,
.news-item:hover .news-arrow {
  color: #ffffff !important;
  opacity: 1 !important;
}

.news-item:hover .news-tag {
  background-color: rgba(255, 246, 238, 0.2) !important;
  color: #ffffff !important;
}

/* ============================================
   Animations
   ============================================ */

/* Fade-in on scroll (applied via JS) */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }
.fade-in-delay-4 { transition-delay: 0.4s; }

/* ============================================
   Responsive Typography Adjustments
   ============================================ */

@media (max-width: 640px) {
  h1 {
    line-height: 1.1;
  }
}

/* ============================================
   Textured Backgrounds（写真館らしい紙・粒子質感）
   ============================================ */

.bg-texture-stone,
.bg-texture-stone-divider {
  background-color: #dbdad6;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 360'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.018' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.98 0 0 0 0 0.96 0 0 0 0 0.91 0 0 0 0.18 0'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.45 0.04' numOctaves='2' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.24 0 0 0 0 0.22 0 0 0 0 0.17 0 0 0 0.14 0'/%3E%3C/filter%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='1' seed='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.2 0 0 0 0 0.18 0 0 0 0 0.14 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='360' height='360' filter='url(%23a)'/%3E%3Crect width='360' height='360' filter='url(%23b)'/%3E%3Crect width='360' height='360' filter='url(%23c)'/%3E%3C/svg%3E");
  background-size: 360px 360px;
  background-repeat: repeat;
}
