/* Apply light theme from Pico.css by default on html tag */

/* General Customizations */
body {
  font-family: 'Montserrat', 'Noto Sans JP', sans-serif; /* Added Noto Sans JP for better Japanese char display */
  line-height: 1.7;
  color: var(--pico-contrast); /* Use Pico variable for text on light theme */
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', 'Noto Sans JP', sans-serif;
  font-weight: 700;
  color: var(--pico-primary); /* Use Pico primary color for headings on light theme */
}

a {
  color: var(--pico-primary-focus);
  text-decoration: none;
}
a:hover {
  color: var(--pico-primary-hover);
  text-decoration: underline;
}
a[target="_blank"] {
  color: #0000FF; /* 濃い青色 */
  font-weight: bold;
  text-decoration: underline;
}

.container {
  max-width: 1100px; /* Or your preferred max width */
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header & Navigation */
header.container {
  position: sticky;
  top: 0;
  z-index: 1000; /* Ensure it stays above other elements */
  background-color: #004d00; /* Dark green color */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add a subtle shadow for better visibility */
  padding: 0.5rem 1rem; /* Reduce padding for a thinner header */
  width: 100%; /* Ensure the header spans the full width of the viewport */
  box-sizing: border-box; /* Include padding in the width calculation */
}

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

header.container nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1.5rem; /* Spacing between nav items */
}

header.container nav ul li a {
  color: #ffffff; /* White text color */
}

header.container nav .desktop-nav {
    display: none; /* Hidden on mobile */
}

.mobile-nav-toggle {
  display: block; /* Visible on mobile */
  background: none;
  border: none;
  color: var(--pico-primary); /* Adjust color for light theme */
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-nav-menu {
  position: static; /* モバイルでは追尾しないように設定 */
  background-color: black !important; /* 背景色を黒に設定 */
  color: white; /* 文字色を白に設定 */
  z-index: 100;
  border-top: 1px solid var(--pico-muted-border-color);
  padding: 1rem;
}
.mobile-nav-menu ul {
    flex-direction: column;
    align-items: center;
}
.mobile-nav-menu ul li a {
    padding: 0.5rem 0;
    display: block;
    color: white; /* メニューリンクの文字色を白に設定 */
}

/* Hide mobile toggle and show desktop nav on larger screens */
@media (min-width: 768px) { /* Pico's sm breakpoint */
  header.container nav .desktop-nav {
    display: flex;
  }
  .mobile-nav-toggle {
    display: none;
  }
  .mobile-nav-menu {
    visibility: hidden; /* Use visibility instead of display to avoid conflicts */
    pointer-events: none; /* Prevent interaction when hidden */
  }
}

/* モバイル画面ではヘッダーが追尾しないように設定 */
@media (max-width: 768px) {
  header.container {
    position: static; /* モバイル画面では追尾を無効化 */
  }
}

/* Hero Section Style (Referenced from index.njk's <style> block, can move here) */
/* .hero, .hero img.profile-pic, .hero .name, .hero .skills */

/* Portfolio, Logos, Testimonials, Videos (Referenced from index.njk's <style> block, can move here) */
/* .portfolio-grid, .logo-grid, .video-grid, .testimonials blockquote, .star-primary */

.py-3 { /* Padding top and bottom utility */
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.text-center {
  text-align: center;
}

/* Ensure [x-cloak] hides elements until Alpine.js is ready */
[x-cloak] { display: none !important; }

/* Footer */
footer.container {
  padding-top: 2rem;
  padding-bottom: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--pico-muted-color); /* Ensure muted color is suitable for light theme */
}
footer .grid > section {
  padding: 1rem;
}
footer .grid > section h3 {
  margin-top: 0;
  color: var(--pico-h3-color); /* Ensure h3 color is suitable for light theme */
}

/* Ensure logos retain their original colors */
.logo-grid img {
  filter: none !important;
  opacity: 1 !important;
  transition: none !important;
}
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 自動調整のグリッド */
  gap: 0; /* ボックス間のスペースをなくす */
}

.logo-grid img {
  width: 100%; /* ボックスの幅に合わせる */
  height: 100%; /* ボックスの高さに合わせる */
  object-fit: cover; /* ボックス全体を埋める */
  display: block;
  margin: 0; /* 余白をなくす */
  padding: 0; /* 余白をなくす */
  border: none; /* ボーダーをなくす */
}

/* Highlight active header menu item with a black background box */
header.container nav ul li a.active {
  color: #ffffff; /* White text color for contrast */
  background-color: #000000; /* Black background for highlight */
  padding: 0.2rem 0.5rem; /* Add padding for the box */
  border-radius: 4px; /* Slightly round the corners */
  text-decoration: none; /* Remove underline */
}

/* Add a black border around the contact form iframe */
#contact iframe {
  border: 2px solid black;
}

/* クライアントロゴのグリッドレイアウト */
.logo-grid {
  display: grid;
  gap: 1rem; /* ロゴ間のスペース */
}

@media (max-width: 768px) {
  .logo-grid {
    display: grid !important; /* グリッドレイアウトを強制適用 */
    grid-template-columns: repeat(2, 1fr) !important; /* 横に2つずつ表示を強制 */
    gap: 1rem !important; /* ロゴ間のスペースを強制適用 */
  }
}
/* Make logos smaller and centered */
.logo-grid img {
  max-height: 60px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}
