/* ==========================================================================
   Red Eagles Global Styles
   全ページ共通のグローバルスタイル
   ========================================================================== */

/* --- CSS変数定義 --- */
:root {
  --re-primary: #cc0000;
  --re-primary-dark: #990000;
  --re-secondary: #1a1a1a;
  --re-white: #ffffff;
  --re-gray-100: #f5f5f5;
  --re-gray-200: #eeeeee;
  --re-gray-600: #666666;
  --re-gray-900: #333333;
  --re-accent-blue: #1e40af;
}

/* --- ユーティリティ --- */

/* スクリーンリーダー専用テキスト */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- ボタンスタイル --- */
.wp-block-button__link,
.btn-primary {
  background-color: var(--re-primary) !important;
  color: var(--re-white) !important;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}
.wp-block-button__link:hover,
.btn-primary:hover {
  background-color: var(--re-primary-dark) !important;
  color: var(--re-white) !important;
}

/* --- リンクスタイル --- */
a {
  color: var(--re-primary);
}
a:hover {
  color: var(--re-primary-dark);
}

/* --- ヒーローセクション --- */
.hero-section {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--re-white);
  text-align: center;
}
.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* --- トップページ見出し統一（section-title: 1.75rem と同等にする） --- */
h2.wp-block-heading {
  font-size: 1.75rem;
  font-weight: 700;
}

/* --- セクション背景 --- */
.section-alt {
  background-color: var(--re-gray-100);
}

/* --- カード --- */
.content-card {
  background: var(--re-white);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: box-shadow 0.3s ease;
}
.content-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* --- SNSアイコン --- */
.sns-icons {
  display: flex;
  justify-content: center;
  gap: 2rem;
}
.sns-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--re-gray-200);
  color: var(--re-secondary);
  transition: all 0.3s ease;
}
.sns-icons a:hover {
  background: var(--re-primary);
  color: var(--re-white);
}
.sns-icons svg {
  width: 24px;
  height: 24px;
}

/* --- レスポンシブ（モバイル） --- */
@media (max-width: 768px) {
  .hero-section {
    min-height: 350px;
  }
  h2.wp-block-heading {
    font-size: 1.5rem;
  }

  /* セクション間余白調整 */
  .wp-block-cover + .wp-block-columns {
    margin-top: 2rem;
    padding-top: 2rem !important;
  }

  .wp-block-columns h2.wp-block-heading {
    margin-top: 0;
    margin-bottom: 1rem;
  }

  .wp-block-columns > .wp-block-column:not(:first-child) {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
  }

  .wp-block-columns {
    margin-bottom: 1.5rem;
    padding-bottom: 2rem !important;
  }

  .wp-block-group {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }

  .wp-block-group.has-background {
    margin-top: 3rem;
  }

  .wp-block-group:last-of-type {
    margin-top: 2rem;
  }

  h2.section-title {
    margin-top: 0;
    margin-bottom: 1rem;
  }
}

/* --- 新着情報のシンプル化 --- */
.wp-block-latest-posts {
  padding: 0;
  margin: 0;
}
.wp-block-latest-posts li {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
  margin-bottom: 0;
}
.wp-block-latest-posts li:last-child {
  border-bottom: none;
}
.wp-block-column .wp-block-latest-posts a {
  color: var(--re-gray-900);
  text-decoration: none;
  transition: color 0.3s ease;
}
.wp-block-column .wp-block-latest-posts a:hover {
  color: var(--re-primary);
}
.wp-block-column .wp-block-latest-posts time,
.wp-block-latest-posts__post-date {
  color: var(--re-gray-600);
  font-size: 0.9em;
}

/* --- フッター独自コピーライト --- */
footer,
footer.ct-footer {
  text-align: center;
  padding: 2rem 1rem !important;
  background: var(--re-secondary) !important;
  color: var(--re-white) !important;
}
footer .ct-container {
  color: var(--re-white);
}
.ct-footer-copyright,
.ct-footer-copyright p {
  text-align: center;
  margin: 0.5rem 0;
  color: var(--re-white) !important;
}

/* --- コンテナの上パディング削除 --- */
.ct-container-full {
  padding-top: 0 !important;
}

/* --- ヒーロー画像の高さ固定 --- */
.wp-block-image.alignfull {
  height: 500px;
  overflow: hidden;
  margin-block-end: 0 !important;
}
.wp-block-image.alignfull img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 768px) {
  .wp-block-image.alignfull {
    height: 300px;
  }
}

/* --- キャッチコピーセクション --- */
.wp-block-image.alignfull + .wp-block-group {
  margin-top: 0 !important;
  padding: 1rem 1.5rem !important;
}
.wp-block-image.alignfull + .wp-block-group p {
  margin: 0;
  line-height: 1.4;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: "Noto Serif JP", serif;
}
.wp-block-image.alignfull + .wp-block-group br {
  display: none;
}
@media (max-width: 768px) {
  .wp-block-image.alignfull + .wp-block-group br {
    display: inline;
  }
}

/* --- アクセシブルメニュースタイル --- */

/* PC版メニュースタイル */
@media (min-width: 1024px) {
  .ct-header nav[data-menu] .menu > li > a,
  .ct-header nav[data-menu] .menu > li > button {
    font-size: 16px !important;
    padding: 12px 16px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .ct-header nav[data-menu] a:focus-visible,
  .ct-header nav[data-menu] button:focus-visible {
    outline: 3px solid var(--re-primary);
    outline-offset: 2px;
    border-radius: 4px;
  }

  .ct-header .sub-menu {
    min-width: 200px;
    padding: 12px 0;
    background: var(--re-white) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
  }

  .ct-header .sub-menu a {
    font-size: 15px;
    padding: 12px 20px;
    min-height: 44px;
    display: flex;
    align-items: center;
    color: var(--re-gray-900) !important;
  }

  .ct-header .sub-menu a:hover {
    background-color: var(--re-gray-100);
    color: var(--re-primary) !important;
  }
}

/* モバイル版メニュースタイル */
@media (max-width: 1023px) {
  [data-panel*="menu"] .ct-menu-link,
  [data-panel*="menu"] nav a {
    font-size: 18px !important;
    padding: 16px 20px !important;
    min-height: 56px;
    display: flex;
    align-items: center;
  }

  [data-panel*="menu"] .ct-toggle-dropdown-desktop-menu {
    min-width: 48px;
    min-height: 48px;
  }

  [data-panel*="menu"] a:focus-visible,
  [data-panel*="menu"] button:focus-visible {
    outline: 3px solid var(--re-primary);
    outline-offset: -3px;
  }

  .ct-toggle-close,
  [data-behaviour="modal"] button[aria-label*="閉じる"] {
    min-width: 48px !important;
    min-height: 48px !important;
  }
}

/* prefers-reduced-motion対応 */
@media (prefers-reduced-motion: reduce) {
  .ct-header nav[data-menu] *,
  [data-panel*="menu"] *,
  .sub-menu,
  .ct-drawer-canvas {
    transition: none !important;
    animation: none !important;
  }
}

/* --- チーム紹介セクション（背景色付きグループ）の余白調整 --- */
.wp-block-group.has-background {
  padding-left: 2rem;
  padding-right: 2rem;
}
@media (min-width: 768px) {
  .wp-block-group.has-background {
    padding-left: 4rem;
    padding-right: 4rem;
  }
}

/* --- レイアウト統一: 共通コンテナスタイル --- */

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-fullwidth {
  width: 100%;
}
.section-fullwidth .content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 背景色バリエーション */
.bg-white {
  background: var(--re-white);
}
.bg-alt {
  background: var(--re-gray-100);
}
.bg-dark {
  background: var(--re-secondary);
  color: var(--re-white);
}

/* --- トップページ・チーム紹介: コンテンツ1200px化 --- */

.wp-block-group.alignfull > .wp-block-columns,
.wp-block-group.alignfull > .wp-block-heading,
.wp-block-group.alignfull > .wp-block-paragraph,
.wp-block-group.alignfull > .wp-block-buttons,
.wp-block-group.alignfull > .wp-block-group:not(.alignfull) {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.wp-block-columns.alignwide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* ヒーロー画像とキャッチコピー帯はフルワイド維持 */
.wp-block-image.alignfull,
.wp-block-image.alignfull + .wp-block-group.alignfull {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.wp-block-image.alignfull + .wp-block-group.alignfull > .wp-block-paragraph {
  max-width: none;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* --- チーム沿革・歴史セクション --- */

.history-highlight-card {
  border: 2px solid var(--re-primary);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  background: var(--re-white);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.history-highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.history-highlight-card .highlight-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.history-highlight-card h3 {
  color: var(--re-primary);
  font-size: 1.1rem;
  margin: 0.5rem 0;
}
.history-highlight-card p {
  font-size: 0.95rem;
  color: var(--re-gray-700);
  margin: 0;
}

/* ==========================================================================
   Team History Timeline — Editorial Style
   EN: Two-column editorial timeline. Per-item icon badges instead of
       per-year background colors (more scannable when wins are frequent).
   JA: 2カラム編集記事風タイムライン。優勝が頻繁なため年単位の背景色を
       やめ、特別項目は行内アイコン（★金=全国優勝 / ◆赤=国際・代表）で強調。
   ========================================================================== */

.team-history-timeline {
  --re-gold: #b8860b;
  --re-gold-soft: #d4af37;
  --re-hairline: #e5e5e5;
  position: relative;
  margin: 2.5rem 0 1rem;
  padding: 0;
}

.team-history-timeline .timeline-item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 2rem;
  padding: 1.75rem 0;
  margin: 0;
  border-bottom: 1px solid var(--re-hairline);
  position: relative;
}

.team-history-timeline .timeline-item:first-child {
  border-top: 1px solid var(--re-hairline);
}

/* Reset legacy dot marker / EN: cancel old red bullet dot */
.team-history-timeline .timeline-item::before {
  content: none;
}

/* --- Year column / 年カラム --- */
.team-history-timeline .timeline-year {
  font-family: "Noto Serif JP", serif;
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--re-primary);
  margin: 0;
  padding-top: 0.15rem;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum" 1;
  align-self: start;
}

.team-history-timeline .timeline-year::after {
  content: "";
  display: block;
  width: 2.25rem;
  height: 3px;
  background: var(--re-primary);
  margin-top: 0.75rem;
  transition: width 0.35s ease;
}

.team-history-timeline .timeline-item:hover .timeline-year::after {
  width: 4rem;
}

/* --- Content column / 内容カラム --- */
.team-history-timeline .timeline-item ul.wp-block-list,
.team-history-timeline .timeline-item ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-history-timeline .timeline-item ul li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.5rem;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--re-gray-900);
}

/* Default marker: short dash / 通常マーカー: 短い横線 */
.team-history-timeline .timeline-item ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.05rem;
  width: 0.6rem;
  height: 1px;
  background: var(--re-gray-600);
}

.team-history-timeline .timeline-item ul li strong {
  color: var(--re-primary);
  font-weight: 700;
}

/* --- Champion item / 全国優勝マーカー (★ gold) --- */
.team-history-timeline .timeline-item ul li.champion {
  padding-left: 2rem;
}
.team-history-timeline .timeline-item ul li.champion::before {
  content: "★";
  top: 0.45rem;
  width: auto;
  height: auto;
  background: none;
  color: var(--re-gold-soft);
  font-size: 1.05rem;
  line-height: 1.75;
}
.team-history-timeline .timeline-item ul li.champion strong {
  color: var(--re-gold);
}

/* --- Highlight item / 国際・代表選出 (◆ red) --- */
.team-history-timeline .timeline-item ul li.highlight {
  padding-left: 2rem;
}
.team-history-timeline .timeline-item ul li.highlight::before {
  content: "◆";
  top: 0.55rem;
  width: auto;
  height: auto;
  background: none;
  color: var(--re-primary);
  font-size: 0.85rem;
  line-height: 1.75;
}

/* --- Mobile / モバイル --- */
@media (max-width: 782px) {
  .history-highlight-card {
    padding: 1rem;
  }
  .history-highlight-card .highlight-icon {
    font-size: 2rem;
  }
  .team-history-timeline .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 1.5rem 0;
  }
  .team-history-timeline .timeline-year {
    font-size: 1.7rem;
  }
  .team-history-timeline .timeline-year::after {
    margin-top: 0.5rem;
  }
}

/* --- Highlight card (top of section) - keep gold tint / 上部カードは維持 --- */
.history-highlight-card--champion {
  background: linear-gradient(135deg, #fff9e6 0%, #fff 100%);
  border-color: #d4af37;
}

/* ==========================================================================
   最新投稿スタイル
   ========================================================================== */

.latest-posts .posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.latest-posts .post-item {
  padding: 1rem 0;
  border-bottom: 1px solid #eee;
}
.latest-posts .post-item:last-child {
  border-bottom: none;
}
.latest-posts .post-date {
  display: inline-block;
  color: #666;
  font-size: 0.9em;
  margin-right: 1rem;
  min-width: 90px;
}
.latest-posts .post-title {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}
.latest-posts .post-title:hover {
  color: #cc0000;
}
.latest-posts .posts-more {
  margin-top: 1rem;
  text-align: right;
}
.latest-posts .posts-more a {
  color: #cc0000;
  text-decoration: none;
}

/* ==========================================================================
   講演会カードスタイル
   ========================================================================== */

.lecture-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.lecture-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: 8px;
  background: var(--re-white, #fff);
  border: 1px solid var(--re-gray-200, #eee);
  text-decoration: none;
  color: inherit;
  position: relative;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.lecture-card:hover,
.lecture-card:focus {
  border-color: var(--re-primary);
  box-shadow: 0 2px 8px rgba(204, 0, 0, 0.1);
  color: inherit;
  text-decoration: none;
}
.lecture-card:focus-visible {
  outline: 3px solid var(--re-primary);
  outline-offset: 2px;
}
.lecture-card-date {
  font-size: 0.85rem;
  color: var(--re-gray-600, #666);
}
.lecture-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--re-gray-900, #1a1a1a);
  padding-right: 2rem;
}
.lecture-card-excerpt {
  font-size: 0.9rem;
  color: var(--re-gray-600, #666);
  margin: 0;
  line-height: 1.6;
}
.lecture-card-arrow {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--re-primary);
  font-size: 1.2rem;
  transition: transform 0.2s;
}
.lecture-card:hover .lecture-card-arrow {
  transform: translateY(-50%) translateX(4px);
}
@media (max-width: 768px) {
  .lecture-cards {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lecture-card,
  .lecture-card-arrow {
    transition: none;
  }
}

/* ==========================================================================
   リンクページスタイル
   ========================================================================== */

/* チーム地域別グリッド */
.link-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.link-team-region h3 {
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--re-secondary, #1a1a2e);
  color: var(--re-white, #fff);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  margin: 0 0 0.75rem 0;
  text-align: center;
}
.link-team-region ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.link-team-region li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--re-gray-200, #eee);
  font-size: 0.9rem;
}
.link-team-region li:last-child {
  border-bottom: none;
}
.link-team-region a {
  text-decoration: none;
}
.link-team-region a:hover,
.link-team-region a:focus {
  text-decoration: underline;
}
.link-team-region a:focus-visible {
  outline: 3px solid var(--re-primary);
  outline-offset: 2px;
}

/* リンクリスト */
.link-list {
  list-style: none;
  padding: 0;
}
.link-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--re-gray-200, #eee);
}
.link-list li:last-child {
  border-bottom: none;
}
.link-list a {
  text-decoration: none;
  font-size: 1rem;
}
.link-list a:hover,
.link-list a:focus {
  text-decoration: underline;
}
.link-list a:focus-visible {
  outline: 3px solid var(--re-primary);
  outline-offset: 2px;
}
.link-list a[target="_blank"]::after {
  content: " \2197";
  font-size: 0.8em;
  color: var(--re-gray-600, #666);
}

/* レスポンシブ */
@media (max-width: 768px) {
  .link-team-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  .link-team-region h3 {
    font-size: 0.85rem;
  }
  .link-team-region li {
    font-size: 0.85rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .link-team-region a,
  .link-list a {
    transition: none;
  }
}
