/* 全体のリセットと基本スタイル */
:root {
  --orange: #f4793e;
  --black: black;
  --white-gray: #e4e3df;
}

body {
    margin: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: #fff;
    color: #000;
    line-height: 1.6;
  }

  a {
    color: inherit;
    text-decoration: underline; /* リンクらしさを残す */
  }
  
  a:hover {
    opacity: 0.8;               /* 色はそのまま、少し薄くしてアクション感 */
  }
  
  /* ヘッダー */
  header {
    position: sticky;
    top: 0;
    z-index: 1000; /* 他の要素より前面に出す */  
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    background-color: var(--black);
    color: var(--white-gray);
    padding: 1rem;
  }

  .header-icon {
    height: 50px;
    width: auto;
    object-fit: contain;
    display: block;
  }

  .left-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem; /* ← ロゴとアイコンの間に余白 */
    width: 85%;
    margin-left: 1rem;
  }

  header .logo, 
  .header-icon {
    margin: 0;
    font-size: 2rem;
    flex-shrink: 1;          /* 縮んでもいいよって許可 */
    min-width: 70px;         /* 最小サイズは設定する！ */
  }

  /* ロゴ設定 */
  .logo strong {
    font-size: 1.5rem;
    white-space: nowrap;
    display: inline-block;
  }

  .logo a {
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap !important;
    display: block;
  }

  /* ラッパーのレイアウト設定 */
  .wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  /* ヘッダー構成（基本） */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--black);
    color: var(--white-gray);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    padding: 0.1rem 1rem;
  }

  
  .site-header .wrapper {
    display: flex;
    flex-wrap: nowrap;      /* 強制的に横並び維持 */
    align-items: center;
    justify-content: space-between;
    min-width: 0;           /* 子要素が縮むのを妨げない */
    position: relative; /* ← nav-toggle位置固定用！ */
  }

  /* ロゴ部分 */
  .logo a {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
  }

  /* ナビゲーションリストの右寄せ */
  .nav-list {
    display: flex;
    white-space: nowrap;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-shrink: 1;
  }

  .nav-list li a {
    color: var(--white-gray);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
  }

  .nav-list li a:hover {
    text-decoration: underline;
  }

  .nav-toggle {
    display: none; /* ← PCサイズで非表示にする */
  }
  
  .map {
    width: 80%;
    aspect-ratio: 1 / 1; /* ← 幅と高さを同じにする */
    object-fit: cover;   /* はみ出た部分をトリミング（必要なら） */
  }

  .about-content{
    padding-left: 10rem;
    margin-left: 5rem;
  }

  .history, 
  .costomers, 
  .access {
    padding: 0 2rem;
  }

  .company-overview, .employees {
    padding: 0 1rem;
  }

  .company-data {
    margin-top: 1rem !important;
    padding-left: 2rem !important;
  }

  @media screen and (max-width: 880px) {
    .site-header {
      height: fit-content;
      padding: 0 1rem;
      position: relative; /* ← これが重要！ */
      position: sticky;
      top: 0;
      z-index: 1000;
    }

    .logo {
      display: inline-block;
      transform: scale(0.7);
      transform-origin: left center;
    }

    .header-icon {
      height: 40px;
      min-width: 40px;            
    }

    .nav-list {
      font-size: 0.6rem !important;
      flex-direction: column;
      gap: 0.5rem;
      padding: 1rem;
      position: absolute;
      top: 100%; /* ヘッダーの真下に表示 */
      right: 0;
      background-color: var(--black); /* 必要なら背景追加 */
      width: auto;
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      transition: max-height 0.3s ease, opacity 0.3s ease;
    }  
  
    .nav-toggle {
      display: flex;
      font-size: 1.5rem;
      background: none;
      border: none;
      color: var(--orange);
      margin-left: auto;
    }
  
    .main-nav {
      position: relative;
    }
    .main-nav.open .nav-list {
      max-height: 500px; /* 十分な高さに設定（必要なら大きめで） */
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
      transition-delay: 0s; /* visibilityを即表示 */
    }
  
    .map {
      width: 100%;
    }
    
    .project-card {
      width: 100% !important;
    }

    footer {
      margin-top: 1rem;
    }
    .footer-list, .contact-brock {
      margin: 0;
    }
    
    .footer-contents {
      gap: 0 !important;
    }
    
    .contact-brock {
      padding-top: 2.5rem;
    }
    
  }

  @media screen and (max-width: 750px) {
    .contact-brock {
      padding-top: 0;
    }
  }
  
  @media screen and (max-width: 420px) {
    .left-group {
      margin-left: 0;
    }

    .footer-list {
      line-height: 1 !important;
    }
    
    .contact-brock {
      padding-top: 0;
      margin: 0 !important;      
    }

    .about-content {
      font-size: 80%;
    }
  
    .company-data {
      column-gap: 0 !important;
    }
    .project {
      flex: 1 1 100%;
      padding: 0;
      margin: 0;
    }

    .area-title h2 {
      font-size: 130%;
      margin-bottom: 0;
    }

    .project-card {
      width: 100%;
    }

    .project-area {
      font-size: 90%;
    }

    .contact ul li{
      font-size: 100%;
    }

    .modal-img {
      width: 70vw !important;
      height: auto !important;
      object-fit: contain !important;
    }

  }

  .services {
    /* background-color: #f9f9f9; */
    padding: 2rem 0;
  }
  
  /* services直下のテキスト要素に幅制限+中央寄せ */
  .services, .project, .service, .about-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
  }
  
  /* Heroセクション */
  .hero {
    background-color: var(--orange);
    color: #fff;
    padding: 1rem 1rem;
    text-align: center;
    max-width: 100%;
    height: auto;
    font-size: clamp(0.5rem, 3vw, 1.2rem);
  }
  
  .hero h2 {
    margin-bottom: 0;
  }

  .top-image {
    text-align: center;
    overflow: hidden;
    position: relative;
    width: 80%;
    max-width: 900px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    padding: 0;
    display: flex;
  }
  
  .slideshow {
    position: relative;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .slide {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 0;
  }

  .slide.active {
    opacity: 1;
    z-index: 1;
  }

  .logo-slide {
    width: 100%;
    height: 100%;
    background-color: var(--black);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
  }

  .company-data {
    display: grid;
    grid-template-columns: 8rem 1fr;  /* 項目名と内容を2列で */
    row-gap: 1rem;
    column-gap: 1rem;
    margin: 2rem 0;
    padding-left: 2rem;
  }
  
  .company-data dt {
    font-weight: bold;
  }
  
  .company-data dd {
    margin: 0;  /* デフォルトの左インデントを消す */
  }
  
  /* 事業紹介など */
  section {
    padding: 2rem 1rem;
  }

  .services {
    padding: 0 2rem;
    /* display: flex; */
    flex-wrap: wrap;
    gap: 1rem 0rem;
  }

  .service-list {
    display: flex;
    flex-wrap: wrap;
    margin: 1rem;
    gap: 2rem;
    justify-content: space-between;
    padding-left: 0;
  }

  .project-card {
    width: calc(50% - 1rem);
    box-sizing: border-box;
    list-style: none;
  }

  .project-card img{
    width: 100%;
    height: auto;
    object-fit: cover;
    margin-top: 0.5rem;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.2);
  }
  
  .services a {
    display: inline-block;
    background-color: var(--orange);
    margin: 0 0 0 1rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 4px;
  }
  
  .services a:hover {
    opacity: 0.8;
  }

  /* 事業内容（services.html）用 */
  .service {
    padding: 0 3rem 1rem 3rem;
  }
  
  /* 施工事例（works.html）用 */
  .area-title {
    margin:2rem 0 0 0;
    font-size: 1.2rem;
  }

  .project-card {
    flex-direction: column;
    gap: 0.5rem;
  }

  .img-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start; /* ← 高さ揃えの基本 */
  }

  .img-row img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.2);
  }

  .img-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .img-label {
    margin-top: 0.3rem;
    font-size: 1rem;
    color: var(--black);
    letter-spacing: 0.05em;
  }

  .project-area {
    padding: 0 2rem;
    margin: 0 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 0rem;
  }

  .project {
    flex: 1 1 calc(50% - 1rem);
    box-sizing: border-box;
    margin-bottom: 2rem;
    max-width: 600px;
  }
  
  .project img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 2px 4px 10px rgba(0,0,0,0.2);
  }

  /* お問い合わせ(contact.html)用 */
  .contact {
    padding: 0 3rem 1rem 4rem;
  }

  .contact-contents {
    margin-left: 1rem;
  }

  .contact ul {
    list-style: none;
    padding: 0;
  }
  
  .contact li {
    font-size: 1.1rem;
  }
  
  .contact a {
    color: var(--orange);
    text-decoration: none;
  }
  
  .contact a:hover {
    text-decoration: underline;
  }

  /* モーダル */
  .modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
  }

  .modal-img {
    width: auto;
    max-width: 80vw;
    height: 80vh;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255,255,255,0.3);
    image-rendering: auto; /* ← 拡大時の滑らかさを保つ */
  }

  .prev,
  .next {
    color: #e4e3df;
    filter: brightness(0.8);
    transition: text-shadow 0.3s ease;
    font-size: 1rem;
    margin: 0 1rem;
    cursor: pointer;
    user-select: none; /* ← 文字の選択も禁止できる！ */
  }

  .prev:hover,
  .next:hover {
    filter: brightness(1.5);
    text-shadow: 0 0 20px cornsilk;
    transform: scale(1.1);
  }

  .prev:active,
  .next:active {
    transform: scale(0.9);
  }

  .prev,
  .next {
    transition: all 0.3s ease;
  }

  .close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    color: var(--white-gray);
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s ease;
  }

  .close:hover {
    transform: scale(1.2rem);
    text-shadow: 0 0 10px var(--white-gray);
  }
  
  /* フッター */
  footer {
    background-color: #111;
    color: var(--white-gray);
    /* text-align: center; */
    padding: 0rem;
    margin-top: 2rem;
    display: flex;
  }

  .footer-contents {
    display: flex;
    justify-content: space-between; /* 両端配置（好みに応じて変えられる） */
    align-items: flex-start;        /* 上揃え */
    gap: 6rem;                      /* 間隔調整（必要なら） */
    flex-wrap: wrap;                /* スマホでは折り返せるように */
  }
  
  .footer-list {
    line-height: 1.2;
    margin: 0;
    padding-bottom: 0;
  }
  .footer-list strong {
    font-size: 1rem;
  }

  .contact-brock {
    margin-top: 1rem; /* 他要素との間に余白 */
    line-height: 0.6;
    margin: 0.7rem 0 0 0;
    padding-bottom: 0;
    font-size: 1.05rem;
  }
  .credit {
    text-align: center;
    padding: 0.5rem;
    margin: 0;
  }

  