html, body {
  margin: 0;
  padding: 0;
}

/* === Global: mobile safety baseline === */
*, *::before, *::after { box-sizing: border-box; }
img, video { max-width: 100%; height: auto; }
html, body { width: 100%; overflow-x: hidden; }

.hero {
  width: 100%;
  height: 100vh;
  background-image: url('https://marugaichu.com/img/top_screen/top.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-x: hidden;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  text-align: center;
  margin: 0;
  padding: 0;
}

.title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 20px;
}

.cta {
  padding: 14px 32px;
  font-size: 20px;
  font-weight: bold;
  color: #fff;
  background-color: #FF5722; /* 目立つオレンジ */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta:hover {
  background-color: #E64A19;
  transform: translateY(-2px);
}

.hero-button {
  margin-top: 30px;
  text-align: center;
}
.hero-text {
  font-size: 60px;
  font-weight: bold;
  color: white;
  text-align: center;
  line-height: 1.6;
}

.hero-subtext {
  font-size: 28px;
  font-weight: normal;
  color: white;
  text-align: center;
  margin-top: 20px;
  line-height: 1.6;
}

.hero-pc { display: flex; }   /* PC版をデフォルト表示 */
.hero-sp { display: none; }   /* スマホ版は非表示 */

@media (max-width: 640px) {
  .hero-pc { display: none; } /* スマホではPC版を隠す */
  .hero-sp { display: flex; } /* スマホ版を表示（.heroのflex継承） */
  .hero-sp .hero-text {
    line-height: 1.6;
    text-align: center;
  }

  .hero-sp .hero-text .line1 {
    font-size: 18px;
    white-space: nowrap;
  }

  .hero-sp .hero-text .line2 {
    font-size: 65px;
    font-weight: bold;
    margin: 0 0;
  }

  .hero-sp .hero-text .line3 {
    display: block;
    font-size: 20px;
    margin-top: 0;
  }
}



/* 即日対応セクション */
.immediate-support {
  padding: 80px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.immediate-support h2 {
  font-size: 56px;
  font-weight: bold;
  color: #222;
  margin-bottom: 30px;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.immediate-support p {
  font-size: 40px; /* 少し大きめ */
  color: #333;
  text-align: left; /* 左揃え */
  line-height: 1.8;
}

.immediate-support-pc { display: block; }
.immediate-support-sp { display: none; }

@media (max-width: 640px) {
  /* スマホではSP版のみ表示 */
  .immediate-support-pc { display: none; }
  .immediate-support-sp { display: block; }

  /* スマホ向けレイアウト微調整 */
  .immediate-support { max-width: 100%; padding: 60px 16px; }
  .immediate-support-sp h2 { font-size: 44px; }
  .immediate-support-sp p  { font-size: 28px; line-height: 1.8; }
}

/* 即日対応 左揃え */
.immediate-support-pc p,
.immediate-support-sp p {
  text-align: left;
}



/* 蜂の巣例 */
.nest-examples {
  padding: 80px 20px;
  background-color: #ffffff;
  max-width: 1200px;
  margin: 0 auto;
}

.nest-examples h2 {
  font-size: 56px;
  font-weight: bold;
  color: #222;
  margin-bottom: 40px;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.12);
}

.nest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.nest-item {
  margin: 0;
}

.nest-item img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  display: block;
}

.nest-item figcaption {
  text-align: center;
  font-size: 32px;
  color: #333;
  margin-top: 16px;
}

@media (max-width: 1024px) {
  .nest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .nest-item img {
    height: 280px;
  }
  .nest-examples h2 {
    font-size: 48px;
  }
  .nest-item figcaption {
    font-size: 28px;
  }
}

@media (max-width: 640px) {
  .nest-grid {
    grid-template-columns: 1fr;
  }
  .nest-item img {
    height: 240px;
  }
  .nest-examples h2 {
    font-size: 40px;
  }
  .nest-item figcaption {
    font-size: 24px;
  }
}


/* DIY警告セクション */
.diy-warning {
  padding: 80px 20px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.diy-warning h2 {
  font-size: 40px;
  font-weight: bold;
  color: #c62828; /* 赤色で強調 */
  margin-bottom: 16px;
  line-height: 1.5;
}

.diy-warning p {
  font-size: 26px;
  color: #222;
  line-height: 1.8;
}

.diy-warning-pc { display: block; }
.diy-warning-sp { display: none; }

@media (max-width: 640px) {
  /* スマホではSP版のみ表示 */
  .diy-warning-pc { display: none; }
  .diy-warning-sp { display: block; }

  /* スマホ向けの余白と文字サイズ調整 */
  .diy-warning { max-width: 100%; padding: 60px 16px; }
  .diy-warning-sp h2 { font-size: 20px; }
  .diy-warning-sp p  { font-size: 18px; line-height: 1.9; }
}


/* MARUが選ばれる理由セクション */
.reasons {
  padding: 80px 20px;
  background-color: #e0f2f1; /* 薄い背景色で区切り */
  width: 100%;
  text-align: center;
}

.reasons h2 {
  font-size: 48px;
  font-weight: bold;
  color: #FF5722; /* オレンジで強調 */
  margin-bottom: 40px;
  text-decoration: underline; /* 下線を追加 */
}

.reasons p {
  font-size: 28px;
  color: #222;
  line-height: 1.8;
}

.reasons.reasons-pc { display: block; }
.reasons.reasons-sp { display: none; }

@media (max-width: 640px) {
  .reasons.reasons-pc { display: none; }
  .reasons.reasons-sp { display: block; }
}

@media (max-width: 640px) {
  .reasons.reasons-sp h2 {
    font-size: 35px;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
  }
  .reasons.reasons-sp p  { font-size: clamp(22px, 5.5vw, 26px); line-height: 1.9; }
  .reasons.reasons-sp .reasons-list { font-size: 22px; line-height: 1.9; }
}

.reasons-flex {
  display: flex;
  align-items: center;
  gap: 0px;
  max-width: 1200px;
  margin: 40px auto 0;
}

.reasons-list {
  flex: 1;
  list-style: disc;
  padding-left: 1.2em;
  text-align: left;
  font-size: 28px;
  line-height: 1.8;
  color: #222;
}

.reasons-illustration { flex: 1; }
.reasons-illustration img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

@media (max-width: 640px) {
  .reasons { padding: 60px 16px; box-sizing: border-box; }
  .reasons.reasons-sp { overflow-x: hidden; }

  .reasons.reasons-sp h2 {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    font-size: clamp(28px, 6vw, 34px);
  }

  .reasons.reasons-sp .reasons-flex { gap: 8px; }
  .reasons.reasons-sp .reasons-illustration,
  .reasons.reasons-sp .reasons-list {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .reasons.reasons-sp .reasons-list {
    font-size: 20px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .reasons.reasons-sp .reasons-illustration img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}



/* 価格表目安セクション */
.price-guide {
  padding: 80px 20px;
  width: 100%;
  text-align: center;
  background-color: #f5f5f5;
}

.price-guide h2 {
  font-size: 48px;
  font-weight: bold;
  color: #222;
  margin-bottom: 40px;
}

.price-guide p {
  font-size: 26px;
  color: #333;
  line-height: 1.8;
}

.price-guide.price-guide-pc { display: block; }
.price-guide.price-guide-sp { display: none; }

@media (max-width: 640px) {
  .price-guide.price-guide-sp {
    padding: 60px 12px;      /* 横余白を少し詰める */
    box-sizing: border-box;  /* paddingを幅計算に含める */
    overflow-x: hidden;      /* 万一の横スクロール抑止 */
  }
  .price-guide.price-guide-sp h2 {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    font-size: clamp(26px, 5.8vw, 34px);
    letter-spacing: 0.02em;
  }
  .price-guide.price-guide-sp p  { font-size: 20px; }

  .price-guide.price-guide-sp .price-table {
    width: 100%;
    display: table;
    table-layout: fixed;
    overflow-x: visible;
  }
  .price-guide.price-guide-sp .price-table thead th,
  .price-guide.price-guide-sp .price-table tbody td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .price-guide.price-guide-sp .price-table thead th:first-child,
  .price-guide.price-guide-sp .price-table tbody td:first-child { width: 70%; }
  .price-guide.price-guide-sp .price-table thead th:last-child { width: 30%; }
  .price-guide.price-guide-sp .price-table tbody td:last-child  { width: 30%; text-align: right; }
}


/* 価格表テーブル */
.price-table {
  width: min(1100px, 96%);
  margin: 24px auto 0;
  border-collapse: collapse;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.price-table thead th {
  font-size: 22px;
  padding: 16px 20px;
  border: 1px solid #d9d9d9;
  text-align: center;
  background: #fafafa;
}

.price-table tbody td {
  font-size: 20px;
  padding: 16px 20px;
  border: 1px solid #e0e0e0;
  text-align: left;
}

.price-table tbody tr:nth-child(odd) {
  background: #fcfcfc;
}

@media (max-width: 640px) {
  .price-guide h2 { font-size: 36px; }
  .price-guide p { font-size: 20px; }
  .price-table thead th,
  .price-table tbody td {
    font-size: 16px;
    padding: 12px 14px;
  }
}

.price-note {
  width: min(1100px, 96%);
  margin: 32px auto 0;
  text-align: center;
}

.price-note h3 {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin: 0 0 12px;
}

.price-note p {
  font-size: 22px;
  color: #333;
  line-height: 1.9;
  margin: 0;
}

@media (max-width: 640px) {
  .price-guide.price-guide-sp .price-note h3 {
    font-size: 20px;
    white-space: nowrap;
  }
  .price-guide.price-guide-sp .price-note p  {
    font-size: 16px;
    line-height: 1.5;
    white-space: nowrap;
  }
}


/* 施工例セクション */
.examples {
  padding: 80px 20px;
  background-color: #cfd8d3; /* 薄いグレーグリーン系背景 */
  width: 100%;
  text-align: center;
}

.examples h2 {
  font-size: 56px;
  font-weight: bold;
  color: #222;
  margin-bottom: 50px;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.examples-grid {
  display: flex;
  justify-content: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.example-item {
  flex: 1 1 45%;
  max-width: 500px;
}

.example-item h3 {
  font-size: 28px;
  color: #333;
  margin-bottom: 20px;
}

.example-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
  display: block;
}

.examples .contact-cta {
  margin-top: 60px;
  text-align: center;
}

.examples .contact-cta p {
  font-size: 32px;
  font-weight: bold;
  color: #222;
  margin: 0;
  line-height: 1.6;
}

.examples.examples-pc { display: block; }
.examples.examples-sp { display: none; }

@media (max-width: 640px) {
  .examples.examples-pc { display: none; }
  .examples.examples-sp { display: block; }
  .examples.examples-sp h3 { font-size: 22px; line-height: 1.4; }
}



/* お客様の声セクション */
.testimonials {
  padding: 80px 20px;
  width: 100%;
  background-color: #fafafa;
}

.testimonials h2 {
  font-size: 56px;
  font-weight: bold;
  color: #222;
  margin: 0 auto 40px;
  text-align: left;
  max-width: 1200px;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.testimonial {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.testimonial .quote {
  font-size: 24px;
  line-height: 1.9;
  color: #222;
  margin: 0 0 20px;
}

.testimonial .name {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-align: left;
}

.testimonials-cta {
  max-width: 1200px;
  margin: 60px auto 0;
  text-align: center;
}

.testimonials-cta p {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.6;
  color: #222;
  margin: 0;
}

@media (max-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
  .testimonials h2 { font-size: 48px; }
  .testimonials-cta p { font-size: 34px; }
}

@media (max-width: 640px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .testimonial .quote { font-size: 20px; }
  .testimonials h2 { font-size: 40px; text-align: center; }
  .testimonials-cta p { font-size: 28px; }
}



/* お問い合わせ・会社情報セクション */
.contact-info {
  padding: 80px 20px;
  width: 100%;
  background: #ffffff;
}

.contact-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
}

.contact-logo img {
  width: 100%;
  max-width: 420px; /* ロゴの最大幅 */
  height: auto;
  display: block;
}

.contact-details {
  flex: 1;
  text-align: left;
  color: #222;
}

.contact-button {
  display: inline-block;
  padding: 14px 28px;
  font-size: 36px;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  background: #ff5252;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  transition: transform .15s ease, background-color .15s ease;
  margin-bottom: 24px;
}

.contact-button:hover {
  background: #e64a4a;
  transform: translateY(-2px);
}

.contact-details p {
  font-size: 24px;
  line-height: 1.9;
  margin: 0 0 16px;
}

.contact-info.contact-info-pc { display: block; }
.contact-info.contact-info-sp { display: none; }

@media (max-width: 640px) {
  .contact-info.contact-info-pc { display: none; }
  .contact-info.contact-info-sp { display: block; }

  .contact-info.contact-info-sp .contact-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }

  .contact-info.contact-info-sp .contact-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 16px;
  }
  .contact-info.contact-info-sp .contact-row .contact-logo { justify-self: start; }
  .contact-info.contact-info-sp .contact-row .contact-details { text-align: left; }

  .contact-info.contact-info-sp .contact-button {
    margin-top: 16px;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
    align-self: center;
  }

  .contact-info.contact-info-sp .contact-logo img {
    max-width: 360px;
    height: auto;
  }
  .contact-info.contact-info-sp .contact-details p {
    font-size: 18px;
    line-height: 1.9;
  }
}

/* === Consolidated smartphone tuning (≤640px) === */
@media (max-width: 640px) {
  /* Section paddings: tighten consistently */
  .immediate-support,
  .nest-examples,
  .diy-warning,
  .reasons,
  .price-guide,
  .examples,
  .testimonials,
  .contact-info { padding: 60px 16px; }

  /* Headings scale safely */
  .immediate-support h2 { font-size: clamp(32px, 7vw, 44px); }
  .nest-examples h2     { font-size: clamp(32px, 6.5vw, 40px); }
  .diy-warning h2       { font-size: clamp(20px, 5.5vw, 28px); }
  .reasons h2           { font-size: clamp(28px, 6vw, 34px); }
  .examples h2          { font-size: clamp(32px, 6.5vw, 40px); }
  .testimonials h2      { font-size: clamp(32px, 6.5vw, 40px); }

  /* Hero fine-tune */
  .hero .title      { font-size: clamp(28px, 7vw, 40px); }
  .hero-subtext     { font-size: clamp(16px, 4.5vw, 22px); }

  /* Examples: force single column on very small screens */
  .examples-grid { gap: 20px; }
  .example-item { flex: 1 1 100%; max-width: 100%; }

  /* Testimonials: ensure comfortable spacing */
  .testimonials-grid { gap: 20px; }

  /* Price table: ensure fit (keeps existing table-layout: fixed etc.) */
  .price-table { width: 100%; margin-left: auto; margin-right: auto; }

  /* Contact button: scale text but keep full-bleed width from earlier rules */
  .contact-button { font-size: clamp(22px, 6.2vw, 28px); }
}
