/* 光南台乗馬クラブ - 共通スタイルシート */

/* ========================================
   カラーパレット
   ======================================== */
:root {
  --cream: #FAF8F5;
  --cream-warm: #F5F0E8;
  --sage-pale: #EEF7EE;
  --sage-light: #D2E8D2;
  --sage: #9CCB9C;
  --sage-deep: #6FA46F;
  --forest: #4F7F4F;
  --forest-dark: #386438;
  --gold: #C4A962;
  --gold-light: #E8D9A8;
  --brown-warm: #8B7355;
  --brown-deep: #5C4A3A;
  --charcoal: #2A2A2A;
  --text: #3A3A3A;
  --text-light: #6A6A6A;
  --white: #FFFFFF;
}

/* ========================================
   リセット・基本設定
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* モバイルでのスクロールパフォーマンス向上 */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.9;
  overflow-x: hidden;
  /* モバイルでのテキストサイズ調整を防止 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

::selection {
  background: var(--sage);
  color: var(--white);
}

/* ========================================
   アクセシビリティ補助
   ======================================== */
.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1200;
  background: var(--forest-dark);
  color: var(--white);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ========================================
   ナビゲーション
   ======================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 4rem;
  z-index: 1000;
  transition: all 0.5s ease;
}

nav.scrolled {
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(20px);
  padding: 1rem 4rem;
  box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

/* サブページ用：最初から背景あり */
nav.subpage {
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(20px);
  padding: 1rem 4rem;
  box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

body.subpage nav:not(.scrolled) {
  background: rgba(250, 248, 245, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0,0,0,0.05);
}

body.subpage nav:not(.scrolled) .logo,
body.subpage nav:not(.scrolled) .nav-links a {
  color: var(--text);
}

body.subpage nav:not(.scrolled) .logo {
  color: var(--forest-dark);
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: all 0.5s ease;
}

nav.scrolled .logo,
nav.subpage .logo {
  color: var(--forest-dark);
}

nav.subpage .logo:hover {
  color: var(--sage);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.mobile-menu-panel {
  display: contents;
}

.mobile-menu-card {
  display: contents;
}

.mobile-menu-actions,
.mobile-menu-action-phone {
  display: none;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 0.1em;
  position: relative;
  transition: all 0.5s ease;
}

nav.scrolled .nav-links a,
nav.subpage .nav-links a {
  color: var(--text);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.4s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

@media (max-width: 1180px) {
  nav,
  nav.scrolled,
  nav.subpage {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .nav-links {
    gap: 1rem;
  }
}

.mobile-menu {
  display: none;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0.25rem;
}

.mobile-menu-text {
  display: none;
}

/* ========================================
   フッター
   ======================================== */
footer {
  background: var(--charcoal);
  color: var(--white);
  padding: 6rem 2rem 3rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand h3 {
  font-family: 'Shippori Mincho', serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.footer-brand p {
  opacity: 0.6;
  line-height: 2;
  font-size: 0.95rem;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
  color: var(--sage);
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-contact p {
  opacity: 0.6;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.footer-contact a {
  color: var(--sage);
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 3rem;
  text-align: center;
  opacity: 0.4;
  font-size: 0.85rem;
}

/* ========================================
   共通セクションスタイル
   ======================================== */
.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  color: var(--sage-deep);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 500;
  color: var(--forest-dark);
  letter-spacing: 0.1em;
}

.site-illustration {
  pointer-events: none;
  user-select: none;
}

.site-illustration img {
  display: block;
  width: 100%;
  height: auto;
}

/* ========================================
   アニメーション
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ========================================
   Image lightbox
   ======================================== */
body.lightbox-open {
  overflow: hidden;
}

.js-lightbox-image {
  cursor: zoom-in;
}

.js-lightbox-image:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(20, 28, 20, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, background 0.22s ease, backdrop-filter 0.22s ease;
}

.image-lightbox.is-open {
  background: rgba(20, 28, 20, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
  pointer-events: auto;
}

.image-lightbox__frame {
  display: grid;
  gap: 1rem;
  max-width: min(1120px, 100%);
  max-height: 100%;
  transform: scale(0.96) translateY(16px);
  transition: transform 0.22s ease;
}

.image-lightbox.is-open .image-lightbox__frame {
  transform: scale(1) translateY(0);
}

.image-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: min(78vh, 820px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.image-lightbox__close {
  position: fixed;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.image-lightbox__close::before,
.image-lightbox__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 999px;
}

.image-lightbox__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.image-lightbox__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.image-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.04);
}

.image-lightbox__close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 1024px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  /* ナビゲーション - モバイル最適化 */
  body.mobile-menu-open {
    overflow: hidden;
  }

  nav,
  nav.scrolled,
  nav.subpage {
    padding: max(0.75rem, env(safe-area-inset-top)) 1rem 0.75rem;
  }

  .logo {
    font-size: 1rem;
    /* タップ領域を確保 */
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  body.mobile-menu-open nav {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  body.mobile-menu-open nav .logo {
    color: var(--white);
    text-shadow: 0 2px 16px rgba(20, 28, 20, 0.32);
  }

  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: block;
    min-height: 100svh;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: contain;
    background: rgba(58, 74, 53, 0.2);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .mobile-menu-panel.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: mobileMenuOverlayIn 0.28s ease forwards;
  }

  .mobile-menu-panel.open.closing {
    pointer-events: none;
    animation: mobileMenuOverlayOut 0.34s ease forwards;
  }

  .mobile-menu-card {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(80vw, 320px);
    max-width: 100%;
    padding: calc(env(safe-area-inset-top) + 5rem) 1.05rem calc(env(safe-area-inset-bottom) + 1rem);
    overflow: hidden;
    border-left: 1px solid rgba(111, 164, 111, 0.12);
    background: #fffdf8;
    box-shadow: -26px 0 64px rgba(58, 74, 53, 0.18);
    transform: translateX(calc(100% + 88px));
    will-change: transform;
  }

  .mobile-menu-panel.open .mobile-menu-card {
    transform: translateX(0);
    animation: mobileMenuDrawerIn 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .mobile-menu-panel.open.closing .mobile-menu-card {
    animation: mobileMenuDrawerOut 0.34s cubic-bezier(0.7, 0, 0.84, 0) forwards;
  }

  @keyframes mobileMenuOverlayIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes mobileMenuOverlayOut {
    from {
      opacity: 1;
      visibility: visible;
    }
    to {
      opacity: 0;
      visibility: visible;
    }
  }

  @keyframes mobileMenuDrawerIn {
    from {
      transform: translateX(calc(100% + 88px));
    }
    to {
      transform: translateX(0);
    }
  }

  @keyframes mobileMenuDrawerOut {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(calc(100% + 88px));
    }
  }

  .nav-links {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(79, 127, 79, 0.08);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  nav.scrolled .mobile-menu-panel .nav-links a,
  nav.subpage .mobile-menu-panel .nav-links a,
  body.subpage nav:not(.scrolled) .mobile-menu-panel .nav-links a,
  .mobile-menu-panel .nav-links a {
    color: #556250;
  }

  .nav-links a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    /* タップターゲットを最低44pxに */
    min-height: 55px;
    padding: 0.9rem 0.55rem 0.9rem 0.1rem;
    border-radius: 8px;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    /* タップ時の視覚フィードバック改善 */
    -webkit-tap-highlight-color: transparent;
  }

  .nav-links a:hover,
  .nav-links a:active {
    background: rgba(238, 247, 238, 0.56);
    color: #3f5f42;
    transform: translateX(3px);
  }

  .nav-links a::after {
    content: '';
    position: static;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    flex: 0 0 auto;
    width: 0.42rem;
    height: 0.42rem;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    background: transparent;
    opacity: 0.28;
    transform: rotate(45deg);
  }

  .nav-links a:hover::after,
  .nav-links a:active::after {
    opacity: 0.7;
  }

  .mobile-menu-actions {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    margin-top: auto;
    padding-top: 0.9rem;
  }

  .mobile-menu-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    width: 100%;
    min-height: 60px;
    padding: 0.78rem 1rem;
    border: 1px solid rgba(111, 164, 111, 0.26);
    border-radius: 8px;
    background: #eef7ee;
    color: #3f6141;
    text-decoration: none;
    font-weight: 650;
    box-shadow: 0 8px 20px rgba(79, 127, 79, 0.12);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-action-label {
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    line-height: 1.3;
  }

  .mobile-menu-action-phone {
    display: block;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.3;
  }

  .mobile-menu-action:hover,
  .mobile-menu-action:active {
    border-color: rgba(111, 164, 111, 0.4);
    background: #e6f2e6;
    color: #36593a;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(79, 127, 79, 0.16);
  }

  .mobile-menu-action-sub {
    flex-direction: row;
    min-height: 48px;
    margin-top: 0.65rem;
    border-color: rgba(111, 164, 111, 0.18);
    background: transparent;
    color: #5f6b5b;
    box-shadow: none;
    font-size: 0.9rem;
  }

  .mobile-menu-action-sub:hover,
  .mobile-menu-action-sub:active {
    background: rgba(238, 247, 238, 0.48);
    box-shadow: none;
  }

  .mobile-menu {
    display: flex;
    z-index: 1001;
    /* タップターゲット最適化 */
    min-width: 76px;
    min-height: 42px;
    width: auto;
    height: 42px;
    padding: 0 0.9rem;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    /* タップ時の視覚フィードバック改善 */
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .mobile-menu-text {
    display: block;
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
  }

  nav.scrolled .mobile-menu,
  nav.subpage .mobile-menu,
  body.subpage nav:not(.scrolled) .mobile-menu {
    border-color: rgba(111, 164, 111, 0.22);
    background: rgba(255, 255, 255, 0.72);
  }

  nav.scrolled .mobile-menu-text,
  nav.subpage .mobile-menu-text,
  body.subpage nav:not(.scrolled) .mobile-menu-text {
    color: #556250;
  }

  .mobile-menu[aria-expanded="true"] {
    border-color: rgba(111, 164, 111, 0.32);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 22px rgba(20, 28, 20, 0.14);
  }

  .mobile-menu[aria-expanded="true"] .mobile-menu-text {
    color: #556250;
  }

  .mobile-menu:active {
    transform: scale(0.95);
  }

  /* フッター - モバイル最適化 */
  footer {
    padding: 4rem 1.5rem 2.5rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 3rem;
    text-align: center;
  }

  .footer-brand h3 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
  }

  .footer-brand p {
    font-size: 0.925rem;
    line-height: 2;
  }

  .footer-links h4,
  .footer-contact h4 {
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
  }

  .footer-links ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.75rem;
  }

  .footer-links li {
    margin-bottom: 0;
  }

  .footer-links a {
    /* タップターゲット最適化 */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
  }

  .footer-contact p {
    font-size: 0.925rem;
    line-height: 1.9;
  }

  .footer-contact a {
    /* タップターゲット最適化 */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
  }

  .footer-bottom {
    padding-top: 2.5rem;
    margin-top: 1rem;
    font-size: 0.825rem;
  }

  .image-lightbox {
    padding: 1rem;
  }

  .image-lightbox__image {
    max-height: 76vh;
    border-radius: 6px;
  }

  .image-lightbox__close {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .mobile-menu-panel,
  .mobile-menu-card,
  .mobile-menu-panel .nav-links a,
  .mobile-menu-action,
  .mobile-menu {
    animation: none;
    transition: none;
  }
}

/* 小型スマホ向け追加調整 (375px以下) */
@media (max-width: 375px) {
  nav,
  nav.scrolled,
  nav.subpage {
    padding: 0.875rem 1rem;
  }

  .logo {
    font-size: 0.9rem;
  }

  .mobile-menu-panel {
    padding: 0;
  }

  .mobile-menu-card {
    width: min(82vw, 300px);
    padding: calc(env(safe-area-inset-top) + 4.85rem) 0.75rem calc(env(safe-area-inset-bottom) + 0.85rem);
  }

  .nav-links a {
    min-height: 54px;
    padding: 0.84rem 0.45rem 0.84rem 0;
    font-size: 0.94rem;
  }

  .mobile-menu-action {
    min-height: 54px;
  }

  .mobile-menu-action-label {
    font-size: 0.84rem;
  }

  .mobile-menu-action-phone {
    font-size: 1.12rem;
  }

  .mobile-menu {
    min-width: 70px;
    min-height: 40px;
    height: 40px;
    padding: 0 0.78rem;
  }

  .mobile-menu-text {
    font-size: 0.68rem;
  }

  footer {
    padding: 3.5rem 1.25rem 2rem;
  }

  .footer-brand h3 {
    font-size: 1.25rem;
  }
}
