:root {
  --primary-color: #0F2540;
  --secondary-color: #B28850;
  /* Gold-ish accent */
  --text-color: #333;
  --bg-color: #fff;
  /* Soft pinkish background reminiscent of cherry blossoms */
  --header-bg: #fff;
  --footer-bg: black;
  --footer-text: #fff;
  --font-main: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  --container-width: 960px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 120px;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-color);
  background-image: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), url('img/site-background.png');
  background-size: 100% 100%, 100% auto;
  background-position: center, top center;
  background-repeat: no-repeat, repeat-y;
  color: var(--text-color);
  line-height: 1.6;
}

/* Layout */
.wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background-color: var(--header-bg);
  padding: 1rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  width: 90%;
  max-width: var(--container-width);
  margin: 0 auto;
}

h1 {
  margin: 0 0 2rem 0;
  color: var(--primary-color);
  font-size: 40px;
  font-weight: normal;
  text-align: center;
  letter-spacing: 0.05em;
}


header img {
  width: 200px;
  height: auto;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.visual-support-btn {
  background-color: #186B80;
  color: white;
  border: 1px solid #cccccc;
  border-radius: 3px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-family: var(--font-main);
  cursor: pointer;
  transition: opacity 0.3s;
}

.visual-support-btn:hover {
  opacity: 0.9;
}

/* Main Content */
main {
  flex: 1;
  padding: 3rem 0;
}

.hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  text-align: left;
  margin-bottom: 3rem;
  padding: 3rem;
  background: linear-gradient(135deg, transparent 30px, #F2F2F2 30px);
  border-radius: 0;
  box-shadow: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  position: relative;
}

.hero-help {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: #666;
}

.hero-help:hover,
.hero-help:focus {
  text-decoration: none;
}

.hero-help:hover .tooltip-text,
.hero-help:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Tooltip Styling */
.tooltip-text {
  visibility: hidden;
  width: 300px;
  background-color: #fff;
  color: #333;
  text-align: left;
  border-radius: 4px;
  padding: 10px;
  position: absolute;
  z-index: 10;
  top: 100%;
  right: 0;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.3s;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  border: 1px solid #ddd;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
}

.tooltip-title {
  display: block;
  font-weight: bold;
  border-bottom: 1px solid #333;
  margin-bottom: 5px;
  padding-bottom: 2px;
  display: inline-block;
}

.hero-image {
  flex: 0 0 90px;
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.hero-content {
  flex: 1;
}

.hero h2 {
  color: var(--primary-color);
  font-size: 24px;
  margin-bottom: 1rem;
  margin-top: 0;
  border-bottom: 3px solid #DC8744;
  padding-bottom: 5px;
}

.hero p {
  font-size: 1.1rem;
  color: #666;
  margin: 0 0 1rem 0;
}

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

/* Photo Slider */
.photo-slider {
  width: 100%;
  overflow: hidden;
  margin: 3rem 0;
  padding: 0;
  position: relative;
}

.slider-track {
  display: flex;
  gap: 20px;
  width: calc(300px * 8 + 20px * 7);
  /* Width of 8 items + gaps */
  animation: scroll 30s linear infinite;
}

.slider-item {
  flex: 0 0 300px;
  height: 200px;
}

.slider-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.slider-item:hover img {
  transform: scale(1.05);
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(calc(-300px * 4 - 20px * 4));
    /* Move by 4 items + gaps */
  }
}

.event-list ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: flex-start;
  margin-bottom: 2rem;
}

.event-list a {
  display: inline-block;
  background-color: #DC8744;
  color: #fff;
  padding: 0.4rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: normal;
  transition: opacity 0.3s ease;
}

.event-list a i {
  margin-right: 0.5rem;
}

.event-list a:hover {
  opacity: 0.8;
}

.event-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.card {
  background: white;
  padding: 0;
  border-radius: 4px;
  overflow: hidden;
}

.card-title {
  background-color: #DC8744;
  padding: 0.5rem 1rem;
}

.card h3 {
  margin: 0;
  color: white;
}

.card h3 i {
  margin-right: 0.5rem;
}

/* Card Body Layout */
.card-body {
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.card-image {
  flex: 0 0 auto;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 10px;
  background-color: #fff;
}

.card-image img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  /* コンテナの角丸に合わせて調整 */
  display: block;
}

.card-list {
  flex: 1;
}

.card-list ul {
  margin: 0;
  padding-left: 1.2rem;
  overflow-wrap: break-word;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 2rem 0;
  margin-top: auto;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer-links {
  margin-bottom: 2rem;
}

.footer-links p {
  font-weight: bold;
  margin-bottom: 1rem;
  opacity: 1;
}

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

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

.footer-links a {
  color: white;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.modal-trigger {
  cursor: pointer;
  transition: color 0.2s;
}

.modal-trigger:hover {
  color: #DC8744;
  text-decoration: underline;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 0;
  border-radius: 8px;
  width: 90%;
  max-width: 1000px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  height: 700px;
  /* Fixed height for PC */
  max-height: 90vh;
  /* Safety cap */
  display: flex;
  flex-direction: column;
}

.modal.active .modal-content {
  transform: translateY(0);
}

.close-modal {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}

.close-modal:hover,
.close-modal:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.modal-body {
  display: flex;
  padding: 2rem;
  gap: 2rem;
  height: 100%;
  overflow: hidden;
}

.modal-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f0f0f0;
  border-radius: 4px;
  padding: 2rem;
  /* 余白を追加 */
}

.modal-left img {
  max-width: 100%;
  max-height: 100%;
  /* コンテナ内で最大化 */
  height: auto;
  display: block;
  object-fit: contain;
  /* アスペクト比を維持しつつ収める */
}

.modal-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Prevent full container scroll */
  max-height: 100%;
}

.modal-header-fixed {
  flex: 0 0 auto;
  margin-bottom: 1rem;
}

.modal-header-fixed h3 {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--primary-color);
  font-size: 1.5rem;
  border-bottom: 2px solid #DC8744;
  padding-bottom: 0.5rem;
}

.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  /* Scroll only this part */
  padding-right: 1rem;
  /* Space for scrollbar */
}


.modal-right p {
  line-height: 1.8;
  color: #333;
  overflow-wrap: break-word;
  word-break: break-word;
}

.spec-label {
  display: inline-block;
  background-color: #DC8744;
  color: #fff;
  border-radius: 50px;
  padding: 2px 12px;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 4px;
}

/* Modal Responsive */
@media (max-width: 768px) {
  .modal-body {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    overflow-y: auto;
  }

  .modal-left img {
    max-height: 250px;
  }

  .modal-right {
    overflow-y: visible;
    /* Let body scroll on mobile */
    max-height: none;
    display: block;
    /* Reset flex layout */
  }

  .modal-header-fixed {
    margin-bottom: 1rem;
  }

  .modal-body-scroll {
    overflow-y: visible;
    padding-right: 0;
  }

  .modal-content {
    height: auto;
    max-height: 90vh;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h2 {
    font-size: 2rem;
  }

  main {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 24px;
    margin-bottom: 1.5rem;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 2rem 1rem;
    display: block;
    /* Stack hero content */
  }

  .hero-image {
    display: none;
  }

  .event-list a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .card-body {
    gap: 0;
    flex-direction: column;
    padding: 1rem;
    /* Adjust padding for mobile */
  }

  .card-image {
    flex: 0 0 auto;
    width: 120px;
    /* 80pxから120pxに変更 */
    height: 120px;
    margin: 0 auto 1rem;
    /* 中央配置 */
    border: none;
    padding: 0;
  }

  .card-image img {
    width: 120px;
    /* 80pxから120pxに変更 */
    height: 120px;
  }

  .card-list ul {
    padding-left: 1rem;
  }
}

.visual-support-container {
  position: relative;
}

.visual-support-popover {
  display: none;
  position: absolute;
  top: calc(100% + 15px);
  right: 0;
  width: max-content;
  /* コンテンツに合わせて幅を調整 */
  min-width: 320px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  padding: 1.2rem;
  z-index: 200;
  flex-direction: row;
  /* 横並び */
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.visual-support-popover.active {
  display: flex;
  /* flexに変更 */
}

/* Triangle bubble tail */
.visual-support-popover::before {
  content: '';
  position: absolute;
  top: -10px;
  right: 20px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #ccc;
}

.visual-support-popover::after {
  content: '';
  position: absolute;
  top: -9px;
  right: 20px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #fff;
}

.popover-section {
  flex: 0 0 auto;
}

.popover-section:first-child {
  padding-right: 20px;
  border-right: 1px solid #eee;
}

.popover-label {
  font-size: 0.85rem;
  text-align: center;
  margin: 0 0 0.8rem 0;
  font-weight: bold;
}

.btn-group {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.bg-btn,
.font-btn {
  border: 1px solid #666;
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: all 0.2s;
  width: 40px;
  height: 44px;
}

.font-btn {
  width: 45px;
  height: 44px;
  line-height: 1.2;
}

.bg-btn.active,
.font-btn.active {
  outline: 2px solid #007bff;
  outline-offset: -2px;
}

/* Choice button colors */
.bg-blue-choice {
  background-color: blue;
  color: white;
}

.bg-yellow-choice {
  background-color: yellow;
  color: black;
}

.bg-black-choice {
  background-color: black;
  color: white;
}

.font-large-choice {
  font-weight: bold;
  color: #007bff;
  background-color: #f0f7ff;
}

/* Global Accessibility Styles applied to body */
/* Blue Mode */
body.bg-blue,
body.bg-blue *,
body.bg-blue .modal-content,
body.bg-blue .modal-left,
body.bg-blue .modal-body-scroll {
  background-color: blue !important;
  color: yellow !important;
  background-image: none !important;
  border-color: yellow !important;
}

body.bg-blue .modal-content,
body.bg-blue .modal-left {
  border: 1px solid yellow !important;
}

body.bg-blue .modal-trigger::before {
  color: yellow !important;
}

/* Yellow Mode */
body.bg-yellow,
body.bg-yellow *,
body.bg-yellow .modal-content,
body.bg-yellow .modal-left,
body.bg-yellow .modal-body-scroll {
  background-color: yellow !important;
  color: black !important;
  background-image: none !important;
  border-color: black !important;
}

body.bg-yellow .modal-content,
body.bg-yellow .modal-left {
  border: 1px solid black !important;
}

/* Black Mode */
body.bg-black,
body.bg-black *,
body.bg-black .modal-content,
body.bg-black .modal-left,
body.bg-black .modal-body-scroll {
  background-color: black !important;
  color: white !important;
  background-image: none !important;
  border-color: white !important;
}

body.bg-black .modal-content,
body.bg-black .modal-left {
  border: 1px solid white !important;
}

/* Black Mode */
body.bg-black,
body.bg-black *,
body.bg-black .modal-content,
body.bg-black .modal-left,
body.bg-black .modal-body-scroll {
  background-color: black !important;
  color: white !important;
  background-image: none !important;
  border-color: white !important;
}

body.bg-black .modal-content,
body.bg-black .modal-left {
  border: 1px solid white !important;
}

/* Exception for popover elements in black mode: ensure text stays white */
body.bg-black .popover-label {
  color: white !important;
}

/* Font Size Large */
body.font-large,
body.font-large * {
  font-size: 1.05em;
  /* コンテナ全体を微増 */
}

body.font-large h1 {
  font-size: 1.8em !important;
}

body.font-large h2 {
  font-size: 1.6em !important;
}

body.font-large h3 {
  font-size: 1.4em !important;
}

body.font-large p,
body.font-large li,
body.font-large a,
body.font-large .modal-body-scroll p {
  font-size: 1.25em !important;
}

/* 視覚サポートボタンと吹き出し内は文字サイズ変更の対象外にする */
body.font-large .visual-support-container,
body.font-large .visual-support-container * {
  font-size: initial !important;
  /* 基本サイズに戻す */
}

/* 個別のラベルやボタンのサイズをCSS定義時の値で固定 */
body.font-large .visual-support-btn {
  font-size: 0.9rem !important;
}

body.font-large .popover-label {
  font-size: 0.85rem !important;
}

body.font-large .bg-btn,
body.font-large .font-btn {
  font-size: 0.8rem !important;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 70px;
  height: 70px;
  background-color: #808080;
  color: white;
  border: none;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.2s;
  line-height: 1.2;
}

.back-to-top i {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.back-to-top span {
  text-align: center;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #666;
}