/*
Theme Name: 前橋食品衛生協会
Description: 前橋食品衛生協会の公式サイト用WordPressテーマ
Version: 1.0
Author: 前橋食品衛生協会
Text Domain: maebashi-food-hygiene
*/

/* Google Font - Noto Sans JP */
.noto-sans-jp-regular {
  font-family: 'Noto Sans JP', sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
}

.noto-sans-jp-medium {
  font-family: 'Noto Sans JP', sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

.noto-sans-jp-bold {
  font-family: 'Noto Sans JP', sans-serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: normal;
}

/* Reset and base styles */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px; /* ヘッダーの高さを考慮 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* Global link color */
a {
  color: #5ec43c;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 固定トップボーダー（スマホ用） */
.fixed-top-border {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #5ec43c;
  z-index: 1002;
  display: none;
}

/* PC用ヘッダー */
.header-pc {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  border-top: 3px solid #5ec43c;
  border-bottom: 1px solid #e9ecef;
  padding: 20px 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: block;
}

/* PC用ヘッダーのスクロール時 */
.header-pc.scrolled {
  background-color: rgba(255, 255, 255, 0.85);
  padding: 8px 0;
  border-bottom: 3px solid #5ec43c;
  backdrop-filter: blur(8px);
}

/* スマホ用ヘッダー */
.header-mobile {
  display: none;
  position: relative;
  background-color: #fff;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 3px; /* 固定ボーダー分のマージン */
}

/* スマホ用タイトル部分（スクロールする部分） */
.mobile-title-section {
  padding: 15px;
  text-align: center;
  background-color: #fff;
}

/* スマホ用ナビゲーション部分（固定される部分） */
.mobile-nav-section {
  background-color: #fff;
  border-top: 1px solid #e9ecef;
  padding: 10px 15px;
  transition: all 0.3s ease;
}

/* スマホ用ナビゲーションの固定時 */
.mobile-nav-section.fixed {
  position: fixed !important;
  top: 48px !important; /* メニューボタン直下に密着 */
  left: 0 !important;
  right: 0 !important;
  background-color: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 1001 !important;
  border-bottom: 3px solid #5ec43c !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  padding: 0 5px !important;
  height: auto !important;
  min-height: unset !important;
}

/* 固定時のメニュー内余白を最小化し、下側は通常どおりに */
.mobile-nav-section.fixed .nav-menu {
  padding-top: 0 !important;
  padding-right: 10px !important;
  padding-bottom: 8px !important;
  padding-left: 10px !important;
}

/* 固定時もお問い合わせを表示（非表示化を打ち消す） */
.mobile-nav-section.fixed .contact-item {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: auto !important;
  min-width: unset !important;
  flex: unset !important;
  overflow: visible !important;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  text-align: left;
  flex: 0 0 auto; /* 左側固定幅 */
}

.site-title {
  font-weight: 700;
  color: #000;
  font-size: 24px;
  margin: 0 0 5px 0;
  line-height: 1.2;
}

.site-title a {
  color: #000;
  text-decoration: none;
}

.site-title a:hover {
  color: #000;
  text-decoration: none;
}

.site-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0;
  font-weight: 400;
  white-space: nowrap; /* 折り返し防止 */
}

/* Navigation */
.header-nav {
  flex: 0 0 auto; /* 右側固定幅 */
  text-align: right; /* 右寄せ */
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.nav-item {
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease;
  gap: 8px;
}

.nav-link:hover {
  color: #5ec43c;
}

.nav-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Slideshow */
.slideshow-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background-color: #f8f9fa;
  margin-top: 87px;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.slide.active {
  opacity: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* News Section */
.news-section {
  background-color: #f9f9f9;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 40px 0;
}

.news-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.news-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  gap: 12px;
}

.news-icon {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.news-title {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.news-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #e0e0e0;
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-size: 14px;
  color: #2e8b57;
  font-weight: 500;
  min-width: 120px;
}

.news-category {
  background-color: #5ec43c;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 4px;
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  text-align: center;
  white-space: nowrap;
  display: inline-block;
  box-sizing: border-box;
}

.news-content {
  font-size: 16px;
  color: #000;
  font-weight: 400;
  line-height: 1.6;
  flex: 1;
}

/* お知らせリンクスタイル */
.news-category-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
  display: inline-block;
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  box-sizing: border-box;
}

.news-category-link:hover {
  opacity: 0.8;
}

.news-title-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
  flex: 1;
}

.news-title-link:hover .news-content {
  color: #5ec43c;
}

.news-button-container {
  text-align: center;
  margin-top: 30px;
}

.news-list-btn {
  display: inline-block;
  background-color: #5ec43c;
  color: #fff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.news-list-btn:hover {
  background-color: #7dd85d;
  transform: translateY(-1px);
}

/* Schedule Section */
.schedule-section {
  background-color: #fff;
  width: 100%;
  padding: 40px 0;
}

.schedule-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.schedule-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}

.schedule-icon {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3EB489;
}

.schedule-title {
  font-size: 24px;
  font-weight: 700;
  color: #3EB489;
  margin: 0;
}

.schedule-time {
  font-size: 16px;
  font-weight: 400;
  color: #333;
  margin-left: 15px;
}

.schedule-note {
  margin: 0 0 10px 36px;
  color: #b22222; /* やや暗めの赤 */
  font-size: 14px; /* 少し小さめ */
  line-height: 1.7;
}

.schedule-note-underline {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.note-icon {
  font-size: 18px;
  vertical-align: middle;
  margin-right: 6px;
  color: #b22222;
}

.schedule-note-link {
  margin: 0 0 15px 36px;
}

.note-link-icon {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 4px;
  color: #5ec43c;
}

.note-anchor-link {
  font-size: 14px;
}

.schedule-table {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.schedule-table-header {
  display: flex;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.schedule-table-header > div {
  padding: 15px;
  font-weight: 600;
  font-size: 16px;
  color: #333;
  border-right: 1px solid #e0e0e0;
}

.schedule-table-header > div:last-child {
  border-right: none;
}

.header-status {
  width: 130px;
}

.header-date {
  width: 180px;
}

.header-venue {
  width: 240px;
}

.header-address {
  width: 270px;
  border-left: 1px solid #d0d0d0 !important;
}

.header-capacity {
  width: 140px;
}

.schedule-table-body {
  display: flex;
  flex-direction: column;
}

.schedule-row {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.schedule-row:last-child {
  border-bottom: none;
}

.schedule-row.past,
.recurrent-row.past {
  background-color: #e8e8e8;
  opacity: 0.7;
  position: relative;
}

/* .schedule-row.past::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(255, 0, 0, 0.6);
    z-index: 1;
}
.recurrent-row.past::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: rgba(255, 0, 0, 0.6);
    z-index: 1;
} */

.schedule-row > div {
  padding: 15px;
  border-right: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}

.schedule-row > div:last-child {
  border-right: none;
}

.schedule-status {
  width: 130px;
  justify-content: center;
}

.schedule-date {
  font-size: 14px;
  color: #2e8b57;
  font-weight: 500;
  width: 180px;
  white-space: nowrap;
}

.schedule-venue {
  font-size: 14px;
  color: #333;
  font-weight: 400;
  width: 240px;
}

.schedule-address {
  font-size: 14px;
  color: #333;
  font-weight: 400;
  width: 270px;
  border-left: 1px solid #d0d0d0 !important;
}

.schedule-capacity {
  font-size: 16px;
  color: #000;
  font-weight: 400;
  width: 140px;
}

.schedule-capacity.full {
  color: #ff0000;
  font-weight: 500;
}

.reception-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.reception-status.open {
  background-color: #6ec5ff;
  color: #fff;
}

.reception-status.before {
  color: #8CC63F;
  border: 1px solid #8CC63F;
}

/* Recurrent Training Section */
.recurrent-section {
  background-color: #f9f9f9;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 40px 0;
}

.recurrent-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.recurrent-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  gap: 12px;
}

.recurrent-icon {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8CC63F;
}

.recurrent-title {
  font-size: 24px;
  font-weight: 700;
  color: #8CC63F;
  margin: 0;
}

.recurrent-table {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.recurrent-table-header {
  display: flex;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e0e0e0;
}

.recurrent-table-header > div {
  padding: 15px;
  font-weight: 600;
  font-size: 16px;
  color: #333;
  border-right: 1px solid #e0e0e0;
}

.recurrent-table-header > div:last-child {
  border-right: none;
}

.recurrent-table-body {
  display: flex;
  flex-direction: column;
}

.recurrent-row {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.recurrent-row:last-child {
  border-bottom: none;
}

.recurrent-row > div {
  padding: 15px;
  border-right: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
}

.recurrent-row > div:last-child {
  border-right: none;
}

.recurrent-status {
  width: 130px;
  justify-content: center;
}

.recurrent-date {
  font-size: 14px;
  color: #2e8b57;
  font-weight: 500;
  width: 180px;
  white-space: nowrap;
}

.recurrent-venue {
  font-size: 14px;
  color: #333;
  font-weight: 400;
  width: 240px;
}

.recurrent-address {
  font-size: 14px;
  color: #333;
  font-weight: 400;
  width: 270px;
  border-left: 1px solid #d0d0d0 !important;
}

.recurrent-capacity {
  font-size: 16px;
  color: #000;
  font-weight: 400;
  width: 140px;
}

.recurrent-capacity.full {
  color: #ff0000;
  font-weight: 500;
}

/* News category color variants */
.news-category.cat-yosei {
  background-color: #3EB489;
}
.news-category.cat-jitsumu {
  background-color: #8CC63F;
}
.news-category.cat-koushukai {
  background-color: #74c69d;
}
.news-category.cat-oshirase {
  background-color: #F08080; /* やさしい薄い赤系（ライトコーラル） */
}

/* E-learning Section */
.elearning-section {
  background-color: #fff;
  width: 100%;
  padding: 40px 0;
}

.elearning-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.elearning-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  gap: 12px;
}

.elearning-icon {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.elearning-title {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.elearning-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  border: 2px solid #5ec43c;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.elearning-content p {
  font-size: 16px;
  color: #333;
  line-height: 1.8;
  margin: 0;
}

.elearning-link {
  color: #5ec43c;
  text-decoration: none;
  font-weight: 500;
}

.elearning-link:hover {
  text-decoration: underline;
}

.external-link-icon {
  font-size: 16px;
  vertical-align: middle;
  margin-right: 2px;
}

/* Main content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero-container {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.hero-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.content-section {
  max-width: 1200px;
  margin: 0 auto 2rem auto;
  padding: 0 20px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-subtitle {
  position: relative;
  font-size: 22px;
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: #000;
  padding-left: 28px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e6e6e6; /* うるさくない下線装飾 */
}

.section-subtitle .subtitle-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #888;
}

/* Inline icons for content lines */
.inline-icon {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 6px;
  color: #888;
}

.list-numbered {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
  counter-reset: num;
}

.list-numbered > li {
  position: relative;
  display: block; /* 子要素を縦積みにし、改行を正しく反映 */
  margin: 0 0 0.6rem 0;
  padding-left: 34px; /* 左余白を確保してはみ出し防止 */
}

.list-numbered > li::before {
  content: counter(num);
  counter-increment: num;
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #5ec43c;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.inline-icon {
  font-size: 18px;
  vertical-align: middle;
  margin-right: 6px;
  color: #5c6b7a;
}

.list-bulleted {
  list-style: none;
  margin: 0 0 1rem 0;
  padding: 0;
}
.list-bulleted > li {
  position: relative;
  margin: 0 0 0.6rem 0;
  padding-left: 28px; /* 左のアイコン分 */
}
.list-bulleted > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #5ec43c; /* 統一カラー */
}

.list-subhead {
  font-weight: 600;
  margin: 0.5rem 0;
}

.list-alpha {
  list-style: none;
  margin-left: 1rem;
  counter-reset: item; /* A, B, C... */
}
.list-alpha > li::before {
  content: counter(item, upper-alpha) '. ';
  counter-increment: item;
}
.list-alpha > li {
  counter-reset: subitem;
  margin-bottom: 0.25rem;
}

/* Section Title (h2 subsections) */
.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 1rem 0;
  color: #000;
  padding-bottom: 8px;
  border-bottom: 2px solid #5ec43c;
}

/* Seminar Navigation Boxes */
.seminar-nav-boxes {
  display: flex;
  gap: 20px;
  margin: 1.5rem 0;
}

.seminar-nav-box {
  flex: 1;
  display: block;
  padding: 20px;
  border: 2px solid #5ec43c;
  border-radius: 8px;
  text-decoration: none;
  color: #333;
  background-color: #fff;
  transition: all 0.3s ease;
}

.seminar-nav-box:hover {
  background-color: rgba(94, 196, 60, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-decoration: none;
}

.seminar-nav-box-title {
  font-size: 20px;
  font-weight: 700;
  color: #5ec43c;
  margin-bottom: 8px;
}

.seminar-nav-box-desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

/* Custom colors for nav boxes */
.seminar-nav-box.box-yosei {
  border-color: #3EB489;
}
.seminar-nav-box.box-yosei .seminar-nav-box-title {
  color: #3EB489;
}
.seminar-nav-box.box-yosei:hover {
  background-color: rgba(62, 180, 137, 0.1);
  box-shadow: 0 4px 12px rgba(62, 180, 137, 0.3);
}

.seminar-nav-box.box-jitsumu {
  border-color: #8CC63F;
}
.seminar-nav-box.box-jitsumu .seminar-nav-box-title {
  color: #8CC63F;
}
.seminar-nav-box.box-jitsumu:hover {
  background-color: rgba(140, 198, 63, 0.1);
  box-shadow: 0 4px 12px rgba(140, 198, 63, 0.3);
}


/* Yosei Navigation Buttons (集合型・eラーニング) */
.yosei-nav-buttons {
  display: flex;
  gap: 15px;
  margin: 1rem 0 1.5rem 0;
}

.yosei-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: #3EB489;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.yosei-nav-btn:hover {
  background-color: #329A73;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(62, 180, 137, 0.3);
  text-decoration: none;
  color: #fff;
}

.yosei-nav-icon {
  font-size: 20px;
}

.kyosai-flyer-block {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.kyosai-flyer-thumbnail {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.kyosai-flyer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background-color: #3EB489;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.kyosai-flyer-button:hover {
  background-color: #329A73;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(62, 180, 137, 0.3);
  text-decoration: none;
  color: #fff;
}

section {
  margin-bottom: 2rem;
}

h2 {
  font-weight: 600;
  color: #34495e;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Footer */
footer {
  margin-top: 2rem;
}

.footer-main {
  background-color: #666;
  color: #fff;
  padding: 40px 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-left {
  flex: 1;
}

.footer-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 5px 0;
  line-height: 1.2;
}

.footer-subtitle {
  font-size: 14px;
  color: #fff;
  margin: 0 0 20px 0;
  font-weight: 400;
}

.footer-contact {
  margin-top: 20px;
}

.footer-address {
  font-size: 14px;
  color: #fff;
  margin: 0 0 4px 0;
  line-height: 1.6;
}

.footer-phone {
  font-size: 14px;
  color: #fff;
  margin: 0;
  line-height: 1.6;
}

.phone-link {
  color: #fff;
  text-decoration: none;
}

.phone-link:hover {
  text-decoration: underline;
}

.footer-nav {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
}

.footer-menu {
  display: inline-grid;
  grid-template-columns: repeat(3, auto); /* 1行目3項目 */
  grid-template-rows: auto auto auto; /* 3行 */
  column-gap: 30px;
  row-gap: 15px;
  justify-content: start; /* PC: 左揃え */
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-nav-item {
  margin: 0;
}

.footer-nav-item:nth-child(5) {
  flex-basis: 100%;
  text-align: left;
}

.footer-nav-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  transition: color 0.3s ease;
  gap: 8px;
}

.footer-nav-link:hover {
  color: #5ec43c;
}

.footer-nav-icon {
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.footer-copyright {
  background-color: #5ec43c;
  color: #fff;
  text-align: center;
  padding: 15px 0;
}

.footer-copyright p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
}

/* New Fixed Quick Buttons (PC & Mobile) */
.fixed-quick-btns {
  position: fixed;
  right: 0;
  top: 55%;
  transform: translateY(-50%);
  z-index: 1000;
}
.quick-btn {
  display: none;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  padding: 16px 12px;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  margin-bottom: 10px;
  flex-direction: column;
}
.quick-btn:hover {
  transform: translateY(-1px);
}
.quick-btn-icon {
  font-size: 24px;
  color: #fff;
}
.vertical-text {
  writing-mode: vertical-rl;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  line-height: 1.2;
  margin-top: 6px;
}
.quick-btn-yosei {
  background-color: #3EB489;
}
.quick-btn-yosei:hover {
  background-color: #329A73;
}
.quick-btn-jitsumu {
  background-color: #8CC63F;
}
.quick-btn-jitsumu:hover {
  background-color: #7BB236;
}
.quick-btn-apply {
  background-color: #6ec5ff;
}
.pc-only {
  display: flex;
}
/* Hide mobile quick buttons on PC by default */
.mobile-quick-btns {
  display: none;
}
@media (max-width: 768px) {
  .pc-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  /* 各ページのヒーローをコンパクトに */
  .hero-container {
    height: 140px; /* おおよそ50% */
    margin-bottom: 10px;
  }
  .content-section {
    padding-top: 0;
  }
  /* Reset parent so fixed children are viewport-relative on mobile */
  .fixed-quick-btns {
    position: static;
    transform: none;
    right: auto;
    top: auto;
  }

  .mobile-quick-btns {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    z-index: 1001;
    transform: translateY(0);
    transition: transform 0.3s ease;
  }
  /* .mobile-quick-btns.show remains for compatibility, but default is visible */
  .mobile-quick-btns.show {
    transform: translateY(0);
  }
  .mobile-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
  }
  .mobile-quick-yosei {
    background-color: #3EB489;
  }
  .mobile-quick-jitsumu {
    background-color: #8CC63F;
  }
  .mobile-quick-apply {
    background-color: #6ec5ff;
  }
  .mobile-quick-icon {
    font-size: 20px;
    margin-right: 0;
    margin-bottom: 4px;
  }

  .mobile-quick-text {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
  }
}

/* Page Top Button */
.page-top-btn {
  position: fixed;
  right: 10px;
  bottom: 20px;
  width: 40px;
  height: 40px;
  background-color: #f5f5f5;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
}

.page-top-btn.show {
  opacity: 1;
  visibility: visible;
}

.page-top-btn:hover {
  background-color: #e0e0e0;
  border-color: #bbb;
  transform: translateY(-2px);
}

.page-top-arrow {
  font-size: 14px;
  color: #999;
  font-weight: bold;
  line-height: 1;
}

/* Hide mobile contact button on PC */
.mobile-contact-btn {
  display: none;
}

/* Hide mobile line breaks on PC */
.mobile-br {
  display: none;
}

/* Mobile styles */
.header-nav .nav-menu {
  display: inline-grid;
  grid-template-columns: repeat(3, auto); /* 1行目3項目 */
  grid-template-rows: auto auto; /* 2行 */
  column-gap: 30px;
  row-gap: 15px;
  justify-content: end; /* 全体を右寄せ */
}

.header-nav .nav-item.nav-break {
  display: none; /* グリッドでは不要 */
}

.header-nav .nav-link {
  flex-direction: row;
  line-height: 1;
  padding: 0;
}

.nav-item.nav-break {
  flex-basis: 100%;
  height: 0;
  margin: 0;
  padding: 0;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  width: 100%;
  text-align: center;
  padding: 10px 15px;
  border-top: 1px solid #e9ecef;
  border-bottom: 1px solid #e9ecef;
  background-color: #fff;
  cursor: pointer;
  user-select: none;
}

.mobile-menu-toggle-text {
  font-size: 15px;
  font-weight: 600;
}

.mobile-menu-caret {
  font-size: 20px;
  vertical-align: middle;
  margin-right: 6px;
  color: #5ec43c;
}

/* Fixed state for mobile menu toggle */
.mobile-menu-toggle.fixed {
  position: fixed;
  top: 3px; /* 固定ボーダー直下 */
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1001;
  border-bottom: 3px solid #5ec43c; /* 緑のボーダー */
}

.mobile-home-link {
  display: none;
}

@media (max-width: 768px) {
  /* PC用ヘッダーを非表示 */
  .header-pc {
    display: none !important;
  }

  /* スマホ用ヘッダーを表示 */
  .header-mobile {
    display: block !important;
  }

  /* 固定トップボーダーをスマホで表示 */
  .fixed-top-border {
    display: block !important;
  }

  /* スマホ用タイトルセクション */
  .mobile-title-section .header-left {
    text-align: center;
  }

  .mobile-title-section .site-title {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .mobile-title-section .site-subtitle {
    font-size: 12px;
  }

  /* スマホ用ナビゲーション - 初期状態は4つのメニューを2x2で表示 */
  .mobile-menu-toggle {
    display: block;
  }

  .mobile-nav-section {
    display: none;
  }

  .mobile-nav-section.open {
    display: block;
  }

  .mobile-home-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 10px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background-color: rgba(62, 180, 137, 0.1);
    color: #3EB489;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s ease;
  }

  .mobile-home-link:hover {
    background-color: rgba(62, 180, 137, 0.18);
    color: #329A73;
    text-decoration: none;
  }

  .mobile-nav-section.fixed .mobile-home-link {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 14px;
  }

  /* モバイルでは nav-break は非表示（空行を作らない） */
  .mobile-nav-section .nav-item.nav-break {
    display: none !important;
  }

  .mobile-nav-section .nav-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    list-style: none;
    margin: 0;
    padding: 8px 10px;
    gap: 8px;
    row-gap: 8px;
    transition: all 0.3s ease;
  }

  .mobile-nav-section .nav-item {
    margin: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  /* スクロール時（固定時）は3つのメニューを横並びで表示、flexboxで確実に1行に */
  .mobile-nav-section.fixed .nav-menu {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px 8px;
    width: 100%;
    height: auto;
    min-height: unset;
  }

  /* スクロール時の全アイテムでグリッドを完全に無効化 */
  .mobile-nav-section.fixed .nav-item {
    height: auto !important;
    min-height: unset !important;
    grid-row: unset !important;
    grid-column: unset !important;
    grid-area: unset !important;
    align-self: stretch !important;
  }

  /* スクロール時の各アイテムの幅を文字数に応じて調整（全体幅100%を占有） */
  .mobile-nav-section.fixed .nav-item:nth-child(1) {
    flex: 7; /* 講習会について */
  }

  .mobile-nav-section.fixed .nav-item:nth-child(2) {
    flex: 5; /* 検便について */
  }

  .mobile-nav-section.fixed .nav-item:nth-child(3) {
    flex: 5; /* 業務内容 */
  }

  /* お問い合わせアイテムのアニメーション付き削除 */
  .mobile-nav-section.fixed .contact-item {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    width: 0;
    min-width: 0;
    flex: 0 !important;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  .mobile-nav-section .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    font-weight: 500;
    padding: 0 4px;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    flex-direction: row;
    gap: 6px;
  }

  /* スクロール時のナビゲーションリンクの高さを最小限に */
  .mobile-nav-section.fixed .nav-link {
    padding: 10px 6px;
    min-height: unset;
    height: auto;
    max-height: none;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
  }

  .mobile-nav-section.fixed .nav-icon {
    font-size: 18px;
  }

  .mobile-nav-section .nav-link:hover {
    background-color: rgba(94, 196, 60, 0.1);
    color: #5ec43c;
  }

  .mobile-nav-section .nav-icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* スライドショーのマージン調整 */
  .slideshow-container {
    height: 180px;
    margin-top: 0;
  }

  /* スマホでナビゲーションが固定された時のbody調整 */
  body.mobile-nav-fixed {
    padding-top: 73px; /* 固定ボーダー3px + メニュー高さ */
  }

  /* News Section Mobile */
  .news-section {
    padding: 30px 0;
    margin-bottom: 0.5rem;
  }

  .news-container {
    padding: 0 15px;
  }

  .news-header {
    margin-bottom: 0;
  }

  .news-title {
    font-size: 22px;
  }

  .news-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 15px 0;
  }

  .news-item:first-child {
    padding-top: 15px;
  }

  .news-item:not(:first-child) {
    padding-top: 0;
  }

  .news-date {
    font-size: 15px;
    min-width: auto;
  }

  .news-category {
    font-size: 13px;
    padding: 3px 6px;
    width: auto;
  }

  .news-content {
    font-size: 15px;
    line-height: 1.7;
  }

  .news-list-btn {
    font-size: 15px;
    padding: 10px 20px;
  }

  .news-button-container {
    margin-top: 15px;
  }

  /* Schedule Section Mobile */
  .schedule-section,
  .recurrent-section {
    padding: 30px 0;
    margin-bottom: 0.5rem;
  }

  .schedule-container,
  .recurrent-container {
    padding: 0 15px;
  }

  .schedule-title,
  .recurrent-title {
    font-size: 20px;
    line-height: 1.4;
  }
  .schedule-header {
    margin-bottom: 20px;
  }

  .schedule-note {
    margin: 0 0 15px 0;
    font-size: 13px;
  }

  .schedule-note-link {
    margin: 5px 0 15px 0;
  }

  .note-anchor-link {
    font-size: 13px;
  }

  .schedule-time {
    font-size: 14px;
    margin-left: 0;
    display: block;
    margin-top: 5px;
  }

  /* Table Mobile - Stack vertically */
  .schedule-table,
  .recurrent-table {
    border: none;
  }

  .schedule-table-header,
  .recurrent-table-header {
    display: none;
  }

  .schedule-table-body,
  .recurrent-table-body {
    gap: 15px;
  }

  .schedule-row:last-child,
  .recurrent-row:last-child {
    border-bottom: 1px solid #e0e0e0;
  }

  .schedule-row,
  .recurrent-row {
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 0;
    background-color: #fff;
  }

  .schedule-row.past,
  .recurrent-row.past {
    background-color: #e8e8e8;
    opacity: 0.7;
    position: relative;
    overflow: hidden;
  }

  /* .schedule-row.past::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 200%;
        height: 2px;
        background-color: rgba(255, 0, 0, 0.6);
        transform: rotate(22.5deg);
        transform-origin: 0 0;
        pointer-events: none;
        z-index: 1;
    }
    .recurrent-row.past::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 200%;
        height: 2px;
        background-color: rgba(255, 0, 0, 0.6);
        transform: rotate(22.5deg);
        transform-origin: 0 0;
        pointer-events: none;
        z-index: 1;
    } */

  .schedule-row > div,
  .recurrent-row > div {
    width: 100% !important;
    border: none !important;
    padding: 0;
    text-align: left;
  }

  .schedule-date,
  .recurrent-date {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
  }

  .schedule-status,
  .recurrent-status {
    justify-content: flex-start;
    margin-bottom: 10px;
  }

  .schedule-venue,
  .recurrent-venue {
    font-size: 15px;
    margin-bottom: 0;
  }

  .schedule-address,
  .recurrent-address {
    font-size: 14px;
    color: #666;
    margin-top: 0;
    margin-bottom: 8px;
  }

  .schedule-capacity,
  .recurrent-capacity {
    font-size: 15px;
    font-weight: 500;
  }

  /* E-learning Section Mobile */
  .elearning-section {
    padding: 30px 0;
    margin-bottom: 0.5rem;
  }

  .elearning-container {
    padding: 0 15px;
  }

  .elearning-title {
    font-size: 20px;
    line-height: 1.4;
  }

  .elearning-content {
    padding: 20px;
  }

  .elearning-content p {
    font-size: 15px;
    line-height: 1.8;
  }

  /* Footer Mobile */
  .footer-container {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    align-items: center; /* 中央寄せ */
    padding: 0 15px; /* 既定と同等の左右余白に戻す */
  }

  .footer-nav {
    width: 100%;
    display: flex;
    justify-content: center; /* ナビ全体を中央に */
    margin-bottom: 60px;
    margin-top: 20px; /* 協会情報との間に余白 */
  }

  .footer-menu {
    display: grid; /* 明示 */
    grid-template-columns: repeat(2, 1fr); /* 2列を均等幅に */
    grid-template-rows: repeat(3, auto);
    gap: 8px;
    row-gap: 8px;
    justify-content: center; /* グリッドを中央に */
    align-content: center;
    justify-items: center; /* 各セル内中央 */
    align-items: center;
    width: 100%; /* グリッドを全幅に */
  }

  .footer-nav-item,
  .footer-nav-link {
    text-align: center;
    justify-content: center;
    white-space: nowrap; /* 改行防止（お問い合わせなど） */
  }

  .footer-nav-item {
    margin: 0;
  }

  .footer-nav-link {
    font-size: 14px;
    justify-content: center;
  }

  .footer-nav-icon {
    font-size: 18px;
  }

  /* Add space below footer menu for mobile contact button */
  .footer-nav {
    margin-bottom: 60px;
    justify-content: center; /* モバイル: フッターナビ全体を中央寄せ */
  }

  /* お知らせ一覧（7番目）だけは行全体を使って中央揃え */
  .footer-nav-item:nth-child(7) {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 10px; /* 上のメニューとの間隔 */
  }

  /* Fixed Contact Button Mobile - Show only when scrolled */
  .fixed-contact-btn {
    display: none;
  }

  .mobile-contact-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #e74c3c;
    color: #fff;
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    z-index: 1001;
    border: none;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .mobile-contact-icon {
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
  }

  /* Show mobile line breaks on mobile */
  .mobile-br {
    display: inline;
  }

  .mobile-contact-btn.show {
    transform: translateY(0);
  }

  .mobile-contact-btn:hover {
    background-color: #ff6b5b;
    color: #fff;
  }

  /* Page Top Button Mobile */
  .page-top-btn {
    right: 15px;
    bottom: 70px;
    width: 35px;
    height: 35px;
    transition: bottom 0.3s ease;
  }

  .page-top-btn.with-contact {
    bottom: 70px;
  }

  .page-top-arrow {
    font-size: 12px;
  }

  /* Add padding to body to account for fixed elements */
  body {
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Seminar Navigation Boxes Mobile */
  .seminar-nav-boxes {
    flex-direction: column;
    gap: 12px;
  }

  .seminar-nav-box {
    padding: 15px;
  }

  .seminar-nav-box-title {
    font-size: 18px;
  }

  .seminar-nav-box-desc {
    font-size: 13px;
  }

  .section-title {
    font-size: 20px;
  }

  /* Yosei Navigation Buttons Mobile */
  .yosei-nav-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .yosei-nav-btn {
    justify-content: center;
    padding: 10px 20px;
    font-size: 15px;
  }

  .kyosai-flyer-thumbnail {
    max-width: 280px;
  }

  .kyosai-flyer-button {
    width: 100%;
    max-width: 320px;
    padding: 10px 18px;
    font-size: 15px;
  }
}
