/* ========================================
   共通コンポーネント用CSS
   ヘッダー、フッター等の共通部品のスタイリング
   ======================================== */

/* Header */
.header,
.header.scrolled,
.header.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  flex-wrap: nowrap;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* Custom Logo Support */
.custom-logo-wrapper {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

.custom-logo-img {
  height: 50px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.logo-icon {
  background-color: #4a7c9e;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 1rem;
}

/* Navigation */
.desktop-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.8rem;
}

/* PC size - restore original gap */
@media (min-width: 1024px) {
  .desktop-nav ul {
    gap: 2rem;
  }
}

.desktop-nav a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: #4a7c9e;
}

.desktop-nav > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #4a7c9e;
  transition: width 0.3s ease;
}

.desktop-nav > ul > li > a:hover::after,
.desktop-nav > ul > li > a.active::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: #333;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav li {
  padding: 0.5rem 0;
}

.mobile-nav a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  display: block;
  padding: 0.5rem 2rem;
  transition: background 0.3s ease;
}

.mobile-nav a:hover {
  background: rgba(74, 124, 158, 0.1);
  color: #4a7c9e;
}

/* Mobile-only links - hidden by default, shown only on small screens */
.mobile-nav .mobile-only-link {
  display: none;
}

@media (max-width: 450px) {
  .mobile-nav .mobile-only-link {
    display: block;
  }

  .mobile-nav .mobile-only-link:first-of-type {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 0.5rem;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-btn {
    display: inline-block;
    padding: 0.5rem 0.8rem;
    font-size: 0.75rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .mobile-nav.active {
    display: block;
  }
}

/* Button Styles (共通ボタン) */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background-color: #4a7c9e;
  color: white;
}

.btn-primary:hover {
  background-color: #3a6b8a;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 124, 158, 0.3);
}

.btn-secondary {
  background-color: transparent;
  color: #4a7c9e;
  border: 2px solid #4a7c9e;
}

.btn-secondary:hover {
  background-color: #4a7c9e;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(74, 124, 158, 0.3);
}

/* Footer */
.footer {
  background: linear-gradient(135deg, #1a2b4a 0%, #2c3e50 100%);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.footer-links .footer-links-column:nth-child(3) {
  grid-column: auto;
  max-width: none;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: #4a7c9e;
}

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

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

.footer-section a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #4a7c9e;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  color: #ccc;
}

/* Footer Custom Logo Support */
.footer-custom-logo-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.footer-custom-logo-img {
  height: 40px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.footer-logo .logo-icon {
  background-color: #4a7c9e;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  margin-right: 0.8rem;
}

.footer-logo .logo-text .logo-title {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  color: white;
}

.footer-logo .logo-text .logo-subtitle {
  font-size: 0.8rem;
  margin: 0;
  color: #a0c4ff;
}

/* Footer Responsive Design */
@media (max-width: 1023px) {
  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .footer-links .footer-links-column:nth-child(3) {
    grid-column: 1 / -1;
    max-width: 300px;
  }
}

@media (max-width: 767px) {
  .footer-logo {
    justify-content: center;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-links .footer-links-column:nth-child(3) {
    grid-column: 1;
    max-width: 100%;
  }

  /* アコーディオンスタイル */
  .footer-links-column {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .footer-links-column h3 {
    cursor: pointer;
    padding: 1rem 0;
    margin-bottom: 0;
    user-select: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .footer-links-column h3::after {
    content: '+';
    position: static;
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
    width: auto;
    height: auto;
    background: none;
    bottom: auto;
    left: auto;
  }

  .footer-links-column.active h3::after {
    content: '−';
  }

  .footer-links-column ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
  }

  .footer-links-column.active ul {
    max-height: 500px;
    padding-bottom: 1rem;
  }
}