:root {
  --indigo: #1a365d;
  --vermilion: #d53c32;
  --ivory: #fef7f0;
  --accent-gold: #ffd700;
  --accent-blue: #2563eb;
  --deep-red: #b91c1c;
  --soft-pink: #fdf2f8;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Serif JP", serif;
  background-color: var(--ivory);
  color: var(--indigo);
}

.navbar {
  background-color: var(--indigo) !important;
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.3);
}

.navbar-brand,
.nav-link {
  color: var(--ivory) !important;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Ensure navbar text is always visible */
.navbar-brand {
  font-weight: 700 !important;
  font-size: 1.5rem !important;
}

.navbar-nav .nav-link {
  font-weight: 500 !important;
  padding: 0.5rem 1rem !important;
}

/* Navbar toggler for mobile */
.navbar-toggler {
  border-color: var(--ivory) !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fef7f0' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.nav-link:hover {
  color: var(--vermilion) !important;
}

/* Dropdown menu styles */
.dropdown-menu {
  background-color: var(--ivory) !important;
  border: 1px solid var(--indigo);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
  color: var(--indigo) !important;
}

.dropdown-item:hover {
  background-color: var(--vermilion) !important;
  color: var(--ivory) !important;
}

.dropdown-item.active {
  background-color: var(--indigo) !important;
  color: var(--ivory) !important;
}

.hero-section {
  height: 100vh;
  background-color: var(--indigo);
  /* Try multiple path options */
  background-image: linear-gradient(
      rgba(26, 54, 93, 0.3),
      rgba(181, 28, 28, 0.2)
    ),
    url("../image/art/Kunimasa_Utagawa/A-10569-847_E0128774.jpg"),
    url("../../assets/image/art/Kunimasa_Utagawa/A-10569-847_E0128774.jpg"),
    url("/assets/image/art/Kunimasa_Utagawa/A-10569-847_E0128774.jpg");
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  background-attachment: scroll;
  display: flex;
  align-items: center;
}

/* Fallback for when image doesn't load */
.hero-section:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--indigo) 0%, var(--vermilion) 100%);
  opacity: 0.1;
  z-index: -1;
}

.hero-text {
  color: var(--ivory);
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8), 1px 1px 3px rgba(0, 0, 0, 0.9);
}

.hero-text h1 {
  background: rgba(26, 54, 93, 0.8);
  padding: 25px;
  border-radius: 15px;
  margin-bottom: 30px;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(213, 60, 50, 0.3);
}

.hero-text p.lead {
  background: rgba(26, 54, 93, 0.6);
  padding: 20px;
  border-radius: 12px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(213, 60, 50, 0.2);
}

/* Responsive adjustments for hero section */
@media (max-width: 991.98px) {
  .hero-section {
    background-position: center 25%;
  }

  .hero-text {
    text-align: center !important;
  }

  .hero-text h1 {
    font-size: 2.5rem;
  }
}

/* Fine-tune background position for different screen sizes */
@media (min-width: 992px) {
  .hero-section {
    background-position: 30% 20%;
  }
}

@media (max-width: 767.98px) {
  .hero-section {
    background-position: center 30%;
  }

  .hero-text h1 {
    font-size: 2rem;
  }
}

.btn-traditional {
  background-color: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--ivory);
  border-radius: 0;
  padding: 12px 30px;
  font-weight: 600;
  margin: 0 10px;
  transition: all 0.3s ease;
}

.btn-traditional:hover {
  background-color: var(--indigo);
  border-color: var(--indigo);
  color: var(--ivory);
  transform: translateY(-2px);
}

.section-title {
  color: var(--indigo);
  border-bottom: 4px solid var(--vermilion);
  display: inline-block;
  padding-bottom: 10px;
  margin-bottom: 30px;
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 50%;
  height: 2px;
  background: var(--accent-gold);
}

.card {
  border: none;
  box-shadow: 0 4px 20px rgba(213, 60, 50, 0.15);
  transition: all 0.3s ease;
  border-radius: 0;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(213, 60, 50, 0.25);
}

/* Card header styles for better text visibility */
.card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header.bg-gradient {
  color: white !important;
}

.card-header h3,
.card-header h4,
.card-header h5 {
  color: white !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 600;
}

/* Ensure text visibility on any gradient background */
.card-header[style*="background"] h3,
.card-header[style*="background"] h4,
.card-header[style*="background"] h5 {
  color: white !important;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.9);
  font-weight: 700;
}

/* Improve text visibility for all text-white elements */
.text-white {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7) !important;
}

.bg-gradient .text-white,
[style*="background"] .text-white {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 1px 1px 2px rgba(0, 0, 0, 0.9) !important;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e0e0e0; /* デバッグ用境界線 */
  cursor: pointer; /* クリック可能であることを示す */
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block; /* 確実に表示 */
}

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

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.8) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  pointer-events: none; /* オーバーレイがクリックをブロックしないようにする */
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-text {
  color: #ffffff !important; /* 確実に白色で表示 */
  text-align: center;
  width: 100%;
}

.gallery-text h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  color: #ffffff !important; /* 確実に白色で表示 */
}

.gallery-text p {
  font-size: 0.875rem;
  margin-bottom: 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  color: #ffffff !important; /* 確実に白色で表示 */
}

footer {
  background-color: var(--indigo);
  color: var(--ivory);
}

.bg-traditional {
  background-color: var(--ivory);
}

.text-traditional {
  color: var(--indigo);
}

.text-accent {
  color: var(--vermilion);
}

/* 流派詳細ページのHero section用スタイル */
.school-hero {
  position: relative;
  overflow: hidden;
}

.school-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 54, 93, 0.6) 0%,
    rgba(181, 28, 28, 0.4) 100%
  );
  z-index: 1;
}

.school-hero .container {
  position: relative;
  z-index: 2;
}

.school-hero h1 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.6),
    1px 1px 6px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  backdrop-filter: blur(5px);
}

.school-hero p.lead {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), -1px -1px 2px rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  backdrop-filter: blur(3px);
}

.school-hero .badge {
  text-shadow: none;
}

/** bootstrap custom **/
.list-unstyled li a {
  color: #fff;
  text-decoration: none;
}
.default_color {
  color: #333 !important;
}

/** bootstrap custom **/
.lead {
  font-size: 1.15rem !important;
  font-weight: 300;
}

/* Critical fix for card header text visibility - highest priority */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
  color: #ffffff !important;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9), 2px 2px 4px rgba(0, 0, 0, 0.8),
    1px 1px 2px rgba(0, 0, 0, 0.7) !important;
  font-weight: 700 !important;
}

/* Specific override for gradient backgrounds */
div[style*="background: linear-gradient"] h1,
div[style*="background: linear-gradient"] h2,
div[style*="background: linear-gradient"] h3,
div[style*="background: linear-gradient"] h4,
div[style*="background: linear-gradient"] h5,
div[style*="background: linear-gradient"] h6 {
  color: #ffffff !important;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.95), 2px 2px 4px rgba(0, 0, 0, 0.85),
    1px 1px 2px rgba(0, 0, 0, 0.75) !important;
  font-weight: 700 !important;
}

/* 初回訪問時のポップアップスタイル */
.welcome-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(38, 67, 72, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.welcome-popup {
  background-color: var(--ivory);
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: popupFadeIn 0.3s ease-out;
  border: 3px solid var(--vermilion);
}

.welcome-popup-header {
  background: linear-gradient(135deg, var(--indigo), var(--vermilion));
  color: var(--ivory);
  padding: 20px;
  text-align: center;
  border-radius: 12px 12px 0 0;
}

.welcome-popup-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.welcome-popup-body {
  padding: 25px;
  color: var(--indigo);
  line-height: 1.6;
}

.welcome-popup-body p {
  margin-bottom: 15px;
  font-size: 1rem;
}

.welcome-popup-body p:last-child {
  margin-bottom: 0;
  font-weight: 600;
  color: var(--vermilion);
}

.welcome-popup-footer {
  padding: 20px 25px;
  text-align: center;
  border-top: 1px solid rgba(38, 67, 72, 0.1);
}

.welcome-popup-footer .btn {
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 600;
  min-width: 150px;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .welcome-popup {
    max-width: 95%;
    margin: 20px;
  }

  .welcome-popup-header h3 {
    font-size: 1.3rem;
  }

  .welcome-popup-body {
    padding: 20px;
  }

  .welcome-popup-body p {
    font-size: 0.95rem;
  }

  .welcome-popup-footer {
    padding: 15px 20px;
  }
}

@media (max-width: 480px) {
  .welcome-popup-header h3 {
    font-size: 1.2rem;
  }

  .welcome-popup-body {
    padding: 15px;
  }

  .welcome-popup-footer .btn {
    font-size: 0.95rem;
    padding: 10px 25px;
    min-width: 120px;
  }
}
