/**
 * Main Stylesheet
 * 一般社団法人日本語学校経営者協会
 */

/* リセット */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-1);
  line-height: 1.8;
  color: var(--fg);
  background: var(--bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--brand-accent-2);
  text-decoration: none;
  transition: color var(--dur-1) var(--easing);
}

a:hover {
  color: var(--brand-accent);
}

a:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ユーティリティ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.section {
  padding: var(--space-7) 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* タイポグラフィ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--brand-ink);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--font-size-6);
  margin-bottom: var(--space-5);
}

h2 {
  font-size: var(--font-size-5);
  margin-bottom: var(--space-4);
}

h3 {
  font-size: var(--font-size-4);
  margin-bottom: var(--space-3);
}

h4 {
  font-size: var(--font-size-3);
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-3);
}

/* ヘッダー */
.site-header {
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-1);
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  max-width: 1400px;
  margin: 0 auto;
}

.site-logo {
  font-size: var(--font-size-3);
  font-weight: 700;
  color: var(--brand-ink);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  line-height: 1.2;
}

.site-logo__prefix {
  font-size: var(--font-size-0);
  font-weight: 500;
  color: var(--muted);
}

.site-logo__image {
  height: 40px;
  max-width: 120px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.site-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-logo__main {
  font-size: var(--font-size-3);
  font-weight: 700;
}

.site-logo:hover {
  color: var(--brand-accent);
}

.site-logo:hover .site-logo__prefix {
  color: var(--brand-accent);
}

.site-nav {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.site-nav a {
  color: var(--fg);
  font-weight: 500;
  font-size: var(--font-size-0);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-s);
  transition: background var(--dur-1) var(--easing), color var(--dur-1) var(--easing);
}

.site-nav a:hover {
  background: var(--bg);
  color: var(--brand-accent);
}

.site-nav a:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

/* モバイルメニュー */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--brand-ink);
}

@media (max-width: 768px) {
  .site-logo {
    font-size: var(--font-size-2);
    gap: var(--space-2);
  }

  .site-logo__image {
    height: 32px;
    max-width: 100px;
  }

  .site-logo__prefix {
    font-size: var(--font-size-00);
  }

  .site-logo__main {
    font-size: var(--font-size-2);
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    flex-direction: column;
    padding: var(--space-6) var(--space-4);
    box-shadow: var(--shadow-3);
    transition: right var(--dur-2) var(--easing);
  }

  .site-nav.is-open {
    right: 0;
  }

  .site-nav a {
    display: block;
    padding: var(--space-3);
  }
}

/* ヒーロー */
.hero {
  position: relative;
  min-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-ink) 0%, var(--brand-accent-2) 100%);
  color: white;
}

.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
}

/* 上半分：画像領域 */
.hero__gallery-area {
  position: relative;
  flex: 1;
  min-height: 400px;
  z-index: 1;
}

/* Three.js 3Dギャラリーキャンバス（画像領域内に配置） */
.hero__three-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;  /* 上半分（60%）に制限 */
  pointer-events: none;
  z-index: 1;
}

/* 下半分：テキスト領域 */
.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-6) var(--space-4);
  text-align: center;
  /* 背景を濃くして文字を読みやすく（ぼかしは不要） */
  background: linear-gradient(to bottom, 
    rgba(26, 35, 50, 0.7) 0%,
    rgba(26, 35, 50, 0.95) 100%);
  border-top: 1px solid rgba(201, 168, 106, 0.3);
}

.hero__title {
  font-size: clamp(28px, 6vw, 56px);
  color: white;
  margin-bottom: var(--space-4);
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp var(--dur-3) var(--easing) forwards;
  /* テキストの影でさらに可読性向上 */
  text-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 4px 16px rgba(0, 0, 0, 0.3);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero__subtitle {
  font-size: clamp(16px, 2.5vw, 24px);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp var(--dur-3) var(--easing) 0.2s forwards;
  /* テキストの影 */
  text-shadow: 
    0 2px 6px rgba(0, 0, 0, 0.4),
    0 3px 12px rgba(0, 0, 0, 0.2);
}

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

/* カード */
.card {
  background: white;
  border-radius: var(--radius-l);
  padding: var(--space-5);
  box-shadow: var(--shadow-2);
  transition: transform var(--dur-2) var(--easing), box-shadow var(--dur-2) var(--easing);
}

.card:hover {
  transform: scale(1.03) translateY(-4px);
  box-shadow: var(--shadow-3);
}

.card:active {
  transform: scale(1.03) translateY(1px);
}

/* 加盟校リストのカードはホバー効果なし */
#schoolList .card {
  cursor: default;
}

#schoolList .card:hover {
  transform: none;
  box-shadow: var(--shadow-2);
}

#schoolList .card:active {
  transform: none;
}

.card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-3);
  color: var(--brand-accent);
}

.card__title {
  font-size: var(--font-size-3);
  margin-bottom: var(--space-2);
}

.card__text {
  color: var(--muted);
  margin-bottom: var(--space-4);
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-weight: 600;
  color: var(--brand-accent-2);
}

.card__link::after {
  content: '→';
  transition: transform var(--dur-1) var(--easing);
}

.card__link:hover::after {
  transform: translateX(4px);
}

/* ボタン */
.btn {
  display: inline-block;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-m);
  font-weight: 600;
  font-size: var(--font-size-1);
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all var(--dur-2) var(--easing);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--brand-accent);
  color: var(--brand-ink);
}

.btn-primary:hover {
  background: #D4B478;
  color: var(--brand-ink);
}

.btn-secondary {
  background: var(--brand-accent-2);
  color: white;
}

.btn-secondary:hover {
  background: #3A80B0;
  color: white;
}

/* KPIカウンター */
.kpi-section {
  background: white;
  padding: var(--space-7) 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  text-align: center;
}

.kpi-item__number {
  font-size: var(--font-size-5);
  font-weight: 700;
  color: var(--brand-accent);
  margin-bottom: var(--space-2);
}

.kpi-item__label {
  font-size: var(--font-size-1);
  color: var(--muted);
}

/* テーブル */
.table-responsive {
  overflow-x: auto;
  margin: var(--space-4) 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: var(--radius-m);
  overflow: hidden;
}

thead {
  background: var(--brand-ink);
  color: white;
}

th, td {
  padding: var(--space-3);
  text-align: left;
}

tbody tr:nth-child(even) {
  background: var(--bg);
}

tbody tr:hover {
  background: #EEF0F5;
}

/* パンくず */
.breadcrumb {
  padding: var(--space-3) 0;
  font-size: var(--font-size-0);
}

.breadcrumb ol {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumb li::after {
  content: '›';
  margin-left: var(--space-2);
  color: var(--muted);
}

.breadcrumb li:last-child::after {
  content: '';
}

.breadcrumb a {
  color: var(--muted);
}

/* フッター */
.site-footer {
  background: var(--brand-ink);
  color: rgba(255, 255, 255, 0.8);
  padding: var(--space-7) 0 var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.footer-section h4 {
  color: white;
  font-size: var(--font-size-2);
  margin-bottom: var(--space-3);
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  display: block;
  margin-bottom: var(--space-2);
}

.footer-section a:hover {
  color: var(--brand-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-4);
  text-align: center;
  font-size: var(--font-size-0);
  color: rgba(255, 255, 255, 0.6);
}

/* ニュース一覧 */
.news-list {
  list-style: none;
}

.news-item {
  background: white;
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-1);
  transition: box-shadow var(--dur-1) var(--easing);
}

.news-item:hover {
  box-shadow: var(--shadow-2);
}

.news-item__date {
  font-size: var(--font-size-0);
  color: var(--muted);
  margin-bottom: var(--space-1);
}

.news-item__title {
  font-size: var(--font-size-2);
  color: var(--brand-ink);
  margin-bottom: var(--space-2);
}

/* マップ */
#map {
  height: 600px;
  width: 100%;
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-2);
}

/* アクセシビリティ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 特集ニュースカード */
.featured-news-card .card {
  transition: transform var(--dur-2) var(--easing), box-shadow var(--dur-2) var(--easing);
}

.featured-news-card:hover .card {
  transform: scale(1.01) translateY(-2px);
  box-shadow: var(--shadow-3);
}

.featured-news-card:active .card {
  transform: scale(1.01) translateY(1px);
}

/* レスポンシブ */
@media (max-width: 768px) {
  h1 {
    font-size: var(--font-size-5);
  }

  h2 {
    font-size: var(--font-size-4);
  }

  .section {
    padding: var(--space-6) 0;
  }

  .hero {
    min-height: 500px;
  }
  
  .hero__gallery-area {
    min-height: 250px;
  }
  
  .hero__three-canvas {
    height: 50%;  /* モバイルでは50%に制限 */
  }
  
  .hero__content {
    /* モバイルでは背景を濃くして可読性をさらに向上 */
    background: linear-gradient(to bottom, 
      rgba(26, 35, 50, 0.85) 0%,
      rgba(26, 35, 50, 0.98) 100%);
    padding: var(--space-5) var(--space-3);
  }

  #map {
    height: 400px;
  }

  table {
    font-size: var(--font-size-0);
  }

  th, td {
    padding: var(--space-2);
  }
  
  /* 特集ニュースカードのモバイル対応 */
  .featured-news-card .card {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  
  .featured-news-card .card > div:first-child {
    min-height: 200px !important;
  }
  
  .featured-news-card .card h3 {
    font-size: var(--font-size-3) !important;
  }
}

