/* main.css - メインCSSファイル（新構造版） */

/* ===== 01 - FOUNDATION（基盤） ===== */
/* CSS変数とリセットスタイル - 最初に読み込む */
@import url('01-foundation/variables.css');
@import url('01-foundation/reset.css');
@import url('01-foundation/typography.css');

/* ===== 02 - LAYOUT（レイアウト） ===== */
/* レイアウトシステムとユーティリティ */
@import url('02-layout/grid.css');
@import url('02-layout/container.css');
@import url('02-layout/utilities.css');

/* ===== 03 - COMPONENTS（コンポーネント） ===== */
/* 再利用可能なUIコンポーネント */
@import url('03-components/buttons.css');
@import url('03-components/forms.css');
@import url('03-components/tables.css');
@import url('03-components/cards.css');
@import url('03-components/navigation.css');

/* ===== 04 - SECTIONS（セクション） ===== */
/* サイトの主要セクション */
@import url('04-sections/header.css');
@import url('04-sections/hero.css');
@import url('04-sections/content.css');
@import url('04-sections/sidebar.css');
@import url('04-sections/footer.css');

/* ===== 05 - PAGES（ページ専用） ===== */
/* ページ固有のスタイル */
@import url('05-pages/home.css');
@import url('05-pages/wlcde.css');
@import url('05-pages/contact.css');
@import url('05-pages/events.css');
@import url('05-pages/news-archive.css');
@import url('05-pages/terms.css');
@import url('05-pages/sitemap.css');

/* ===== 06 - RESPONSIVE（レスポンシブ） ===== */
/* レスポンシブ対応 - 最後に読み込んで上書き */
@import url('06-responsive/responsive.css');

/* ===== グローバル調整 ===== */

/* フォーカス管理 */
*:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* スクロールバーのスタイリング（Webkit系） */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-lighter);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* 選択時のスタイル */
::selection {
  background-color: var(--primary-light);
  color: var(--white);
}

::-moz-selection {
  background-color: var(--primary-light);
  color: var(--white);
}

/* ===== アクセシビリティ改善 ===== */

/* スキップリンク */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* 視覚的に隠すがスクリーンリーダーには読まれるクラス */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== パフォーマンス最適化 ===== */

/* GPU加速を利用 */
.nav-item a,
.btn,
.card,
.news-item,
.activity-item,
.event-card {
  will-change: transform;
}

/* レイアウトシフトを防ぐ */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* フォント表示の最適化 */
@font-face {
  font-family: 'Noto Sans JP';
  font-display: swap;
  src: local('Noto Sans JP');
}

/* ===== CSS変数のフォールバック ===== */
.btn-primary {
  background-color: #5ba1b3; /* var(--primary-color) のフォールバック */
}

.btn-secondary {
  background-color: #48717c; /* var(--secondary-color) のフォールバック */
}

/* ===== デバッグ用（開発時のみ使用） ===== */
/*
.debug * {
  outline: 1px solid red;
}

.debug .container {
  outline: 2px solid blue;
}

.debug .content-wrap {
  outline: 2px solid green;
}
*/

/* ===== 旧ブラウザ対応 ===== */

/* Flexboxのフォールバック */
@supports not (display: flex) {
  .content-wrap {
    display: table;
    width: 100%;
  }
  
  .main-content,
  .sidebar {
    display: table-cell;
    vertical-align: top;
  }
}

/* CSS Grid のフォールバック */
@supports not (display: grid) {
  .departments-grid {
    display: flex;
    flex-wrap: wrap;
  }
  
  .department-card {
    flex: 1 1 200px;
    margin: 0.5rem;
  }
}

/* ===== 印刷最適化 ===== */
@media print {
  /* ページサイズ設定 */
  @page {
    size: A4;
    margin: 15mm;
  }
  
  /* 強制改ページ */
  .page-break {
    page-break-before: always;
  }
  
  /* 改ページを防ぐ */
  .no-break {
    page-break-inside: avoid;
  }
  
  /* フォーム要素の印刷スタイル */
  .form-input,
  .form-textarea,
  .form-select {
    border: 1px solid #000;
    background: transparent;
  }
}

/* ===== PDFダウンロードセクション ===== */
.pdf-download-section {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.pdf-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.pdf-icon {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.5rem;
  box-shadow: 0 4px 8px rgba(91, 161, 179, 0.3);
}

.pdf-title-content {
  flex: 1;
}

.pdf-download-title {
  color: var(--text-dark);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.pdf-description {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

.pdf-content {
  display: grid;
  gap: 2rem;
}

.pdf-info {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
}

.pdf-features {
  display: grid;
  gap: 1rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dark);
}

.feature-item i {
  color: var(--success-color);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pdf-actions {
  display: flex;
  justify-content: center;
}

.pdf-buttons {
  justify-content: center;
  max-width: 100%;
  width: 100%;
}

.btn-pdf-download,
.btn-pdf-view {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.btn-pdf-download {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--white);
}

.btn-pdf-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(91, 161, 179, 0.3);
}

.btn-pdf-view {
  background: var(--white);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-pdf-view:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(91, 161, 179, 0.2);
}

.btn-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.btn-text strong {
  font-size: 1rem;
  font-weight: 600;
}

.btn-text small {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

.pdf-note {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--warning-light);
  border: 1px solid var(--warning-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
}

.note-icon {
  flex-shrink: 0;
  color: var(--warning-color);
  font-size: 1.25rem;
  margin-top: 0.125rem;
}

.note-content p {
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
  line-height: 1.5;
}

.note-content p:last-child {
  margin-bottom: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .pdf-download-section {
    padding: 1.5rem;
    margin: 1.5rem 0;
  }
  
  .pdf-header {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .pdf-icon {
    align-self: center;
  }
  
  .pdf-buttons {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  
  .btn-pdf-download,
  .btn-pdf-view {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .btn-text {
    align-items: center;
  }
  
  .pdf-note {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }
  
  .pdf-info {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .pdf-download-section {
    padding: 1rem;
    margin: 1rem 0;
  }
  
  .pdf-download-title {
    font-size: 1.25rem;
  }
  
  .btn-pdf-download,
  .btn-pdf-view {
    padding: 0.875rem;
  }
  
  .btn-text strong {
    font-size: 0.9rem;
  }
  
  .btn-text small {
    font-size: 0.8rem;
  }
  
  .pdf-note {
    padding: 0.875rem;
  }
  
  .note-content p {
    font-size: 0.875rem;
  }
}

/* ===== 最終調整 ===== */

/* ブラウザ固有のバグ対応 */
@supports (-webkit-appearance: none) {
  /* Safari専用の調整 */
  .form-input,
  .form-textarea {
    -webkit-appearance: none;
  }
}

/* Internet Explorer対応（必要に応じて） */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  /* IE専用の調整 */
  .nav-menu {
    display: -ms-flexbox;
  }
}

/* ===== 入会案内セクション ===== */
.join-options {
  display: grid;
  gap: 2rem;
  margin-bottom: 2rem;
}

.join-option {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.join-option:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.option-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-light);
}

.option-header i {
  font-size: 1.5rem;
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

.option-header h4 {
  margin: 0;
  color: var(--text-dark);
  font-size: 1.25rem;
  font-weight: 600;
}

.option-content p {
  margin: 0 0 1rem 0;
  color: var(--text-color);
  line-height: 1.6;
}

.option-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.option-benefits li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.option-benefits i {
  color: var(--success-color);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.option-note {
  background: var(--bg-light);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin: 1rem 0 0 0 !important;
  font-size: 0.9rem;
}

.contact-details {
  background: var(--bg-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-item:last-of-type {
  margin-bottom: 1rem;
}

.contact-item i {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.contact-text strong {
  display: block;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.contact-text p {
  margin: 0;
  color: var(--text-color);
  line-height: 1.5;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .join-options {
    gap: 1.5rem;
  }
  
  .join-option {
    padding: 1.25rem;
  }
  
  .option-header {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  
  .option-header h4 {
    font-size: 1.1rem;
  }
  
  .contact-details {
    padding: 1.25rem;
  }
  
  .contact-item {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .join-option {
    padding: 1rem;
  }
  
  .option-header h4 {
    font-size: 1rem;
  }
  
  .contact-details {
    padding: 1rem;
  }
}

/* ===== PDFサムネイル表示（ホームページ用） ===== */
.pdf-attachment {
  background-color: var(--bg-lighter);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  margin-top: var(--spacing-md);
}

.pdf-thumbnail-link {
  display: block;
  text-decoration: none;
  margin-bottom: var(--spacing-sm);
}

.pdf-thumbnail-link canvas {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  max-width: 100%;
  display: block;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.pdf-thumbnail-link:hover canvas {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.pdf-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pdf-text-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.pdf-text-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.pdf-text-link i {
  margin-right: var(--spacing-xs);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .pdf-info {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }
  
  .pdf-thumbnail-link canvas {
    max-width: 200px;
  }
}

@media (max-width: 480px) {
  .pdf-thumbnail-link canvas {
    max-width: 150px;
  }
}

/* ===== プライバシーポリシーページ専用スタイル ===== */

.section-privacy {
  margin-bottom: 3rem;
}

.privacy-content {
  max-width: 800px;
  margin: 0 auto;
}

.privacy-intro {
  background: var(--bg-lighter);
  padding: 2rem;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  border-left: 4px solid var(--primary-color);
}

.privacy-lead {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dark);
  margin: 0;
}

.privacy-section {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.privacy-section h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.privacy-section h2 i {
  font-size: 1.2rem;
}

.privacy-section p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.privacy-section p:last-child {
  margin-bottom: 0;
}

.purpose-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.purpose-list ul {
  list-style: none;
  padding: 0;
}

.purpose-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.purpose-list li:before {
  content: "•";
  color: var(--primary-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.contact-info {
  background: var(--bg-lighter);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-info p:last-child {
  margin-bottom: 0;
}

.contact-info i {
  color: var(--primary-color);
  width: 16px;
}

.privacy-footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-lighter);
  border-radius: var(--radius-md);
}

.update-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.update-date i {
  color: var(--primary-color);
}

/* お問い合わせページのプライバシーポリシーリンク */
.privacy-policy-link {
  margin-top: 1.5rem;
  text-align: center;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
}

.btn-link:hover {
  background: var(--primary-color);
  color: var(--white);
  text-decoration: none;
}

.btn-link i {
  font-size: 0.9rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .privacy-content {
    max-width: 100%;
  }
  
  .privacy-intro {
    padding: 1.5rem;
  }
  
  .privacy-section {
    padding: 1rem;
  }
  
  .contact-info {
    padding: 1rem;
  }
  
  .privacy-footer {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .privacy-lead {
    font-size: 1rem;
  }
  
  .privacy-section h2 {
    font-size: 1.1rem;
  }
  
  .contact-info p {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .btn-link {
    width: 100%;
    justify-content: center;
  }
}