/* ---------- Reset ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
}

body {
  color: #333;
  line-height: 1.7;
  background: #fafafa;
}

/* ---------- Header（固定方法を変更） ---------- */
header {
  position: sticky; /* fixed から sticky に変更 */
  top: 0;
  width: 100%;
  padding: 10px 20px; /* 少し上下を詰めるとバランスが良いです */
  background: rgba(0, 60, 120, 0.9);
  color: white;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px; /* 最低限の高さを確保 */
}

header h1 {
  font-size: 1.4rem;
  letter-spacing: 1px;
}

nav a {
  color: white;
  margin-left: 25px;
  text-decoration: none;
  font-weight: bold;
}
nav a:hover {
  opacity: 0.7;
}

/* ハンバーガーボタン（SP） */
#nav-toggle {
  display: none;
  background: none;
  border: 2px solid #fff;
  padding: 6px 10px;
  border-radius: 5px;
  color: white;
  font-size: 0.9rem;
}

/* ---------- Hero（トップ画像） ---------- */
/* ---------- Hero（トップ画像） ---------- */
.hero {
  margin-top: 0;
  width: 70%;            /* 横幅を画面の70%に制限 */
  margin-left: auto;     /* 左右中央寄せ */
  margin-right: auto;
  
  /* 変更の鍵：アスペクト比を維持し、背景画像のサイズ設定を調整 */
  aspect-ratio: 16 / 9;  /* 画像自体の比率に合わせて調整（例: 16:9） */
  background: url('../images/company.jpg') center center / contain no-repeat;
  
  /* 背景を白やグレーにしておくと、隙間が目立ちません */
  background-color: #fff; 
  
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero h2 {
  font-size: 2.5rem;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  padding: 0 15px;
  text-align: center;
}

/* ---------- Main ---------- */
main {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Section */
section {
  margin-bottom: 50px;
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}

.card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card img {
  width: 100%;
  
  /* 変更点: 画像の比率（または高さ）を固定し、トリミングさせます */
  aspect-ratio: 4 / 3; /* 例：すべての画像を 横4：縦3 の比率で統一 */
  /* ※ height: 200px; のようにピクセルで高さを固定しても大丈夫です */
  
  object-fit: cover; /* 枠に合わせてはみ出た部分を自動でトリミングします */
}

.card .content {
  padding: 18px;
}

.card h3 {
  margin-bottom: 10px;
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 30px;
  background: #eee;
  margin-top: 40px;
  color: #555;
}


/* ---------- Responsive（SP） ---------- */
@media (max-width: 768px) {

  header {
    padding: 10px 15px;
  }

  header h1 {
    font-size: 1.1rem; /* 少しだけ小さくして余裕を持たせる */
    white-space: normal; /* 改行を許可する設定に変更 */
    word-break: break-all;
    line-height: 1.3;
    flex: 1; /* 名前部分を可能な限り広げる */
    margin-right: 10px; /* ボタンとの間の隙間を確保 */
  }

  /* （ミナミタクシー）を2行目に送るための指定 */
  header h1 span {
    display: block;
    font-size: 0.9rem; /* サブネームを少し小さくすると綺麗です */
  }

  #nav-toggle {
    display: block;
    flex-shrink: 0; /* ボタンが絶対に押しつぶされないように固定 */
  }

  nav {
    display: none;
    flex-direction: column;
    background: rgba(0, 60, 120, 0.95);
    position: absolute;
    top: 100%; /* ヘッダーの高さが動的に変わっても、そのすぐ下に配置 */
    right: 0;
    width: 180px;
    padding: 10px 0;
  }

  /* 以下、既存の通り */
  nav.open { display: flex; }
  nav a { margin: 12px 20px; }
  .hero h2 { font-size: 1.7rem; }
}

.hero {
    width: 100%; /* スマホでは全幅に戻す */
    aspect-ratio: 16 / 9;
  }