/* ========================================
   永和信業株式会社 - メインスタイル
   ======================================== */

:root {
  --blue-dark: #0c2d5e;
  --blue-mid: #1a4a8a;
  --green: #2a9d4a;
  --green-dark: #1e7a38;
  --orange: #e87820;
  --orange-dark: #c96510;
  --red: #e41e26;
  --gold: #f5c400;
  --gold-dark: #d4a800;
  --white: #ffffff;
  --gray-light: #f4f6f8;
  --gray-mid: #e0e4ea;
  --text-dark: #1a1a2e;
  --text-mid: #444;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --header-h: 120px;
  --font: 'Noto Sans JP', 'Hiragino Sans', 'Meiryo', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- ヘッダー ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.top-bar {
  background: var(--blue-dark);
  color: var(--white);
  text-align: center;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.header-main {
  background: var(--white);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 14px 20px;
  max-width: 1100px;
  margin: 0 auto;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.brand-logo {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.brand-text {
  text-align: left;
}

.brand-name {
  font-size: clamp(1.5rem, 4.5vw, 2.2rem);
  font-weight: 900;
  color: var(--text-dark);
  line-height: 1.2;
}

.brand-tagline {
  font-size: clamp(0.85rem, 2.2vw, 1.1rem);
  color: var(--text-mid);
  margin-top: 4px;
}

/* 右側メダル画像 */
.hero-badge-area {
  position: absolute;
  right: clamp(10px, 3vw, 30px);
  top: 8px;
  z-index: 2;
  width: clamp(150px, 20vw, 240px);
}

.badge-medal {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
}

.nav-toggle {
  display: none;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--blue-dark);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 20px 10px;
  border-top: 1px solid var(--gray-mid);
}

.main-nav a {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue-dark);
  border-radius: 20px;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover {
  background: var(--gray-light);
}

.main-nav .nav-cta {
  background: var(--green);
  color: var(--white);
}

.main-nav .nav-cta:hover {
  background: var(--green-dark);
}

/* ---- ヒーロー ---- */
.hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/images/hero-bg.jpg') center/cover no-repeat;
  filter: brightness(0.95);
}

.hero-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 30px 20px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1), rgba(0,0,0,0.15));
}

.hero-top-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1100px;
  margin-bottom: 6px;
  padding: 0 clamp(160px, 22vw, 260px) 0 10px;
}

.hero-top-row .hero-catch--red {
  margin-bottom: 0;
}

.hero-catch {
  font-weight: 900;
  line-height: 1.3;
  text-shadow: 2px 2px 0 var(--white), -1px -1px 0 var(--white), 1px -1px 0 var(--white), -1px 1px 0 var(--white);
}

.hero-catch--red {
  font-size: clamp(1.8rem, 6vw, 3rem);
  color: var(--red);
  margin-bottom: 6px;
}

.hero-catch--green {
  font-size: clamp(1.1rem, 3.5vw, 1.8rem);
  color: var(--green-dark);
  margin-bottom: 20px;
}

.hero-phone-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--blue-dark);
  color: var(--gold);
  padding: 12px 32px;
  border-radius: 50px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, background 0.2s;
}

.hero-phone-btn:hover {
  transform: scale(1.04);
  background: var(--blue-mid);
}

.hero-phone-label {
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 500;
}

.hero-phone-number {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.05em;
}

/* ---- 4つの強み + CTA ---- */
.highlights {
  position: relative;
  background: var(--gray-light);
  padding: 40px 0;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 24px;
  justify-content: center;
  max-width: 1050px;
  margin: 0 auto;
}

/* 右端をメダルと揃える（青丸より少し上） */
.highlights-cta {
  position: absolute;
  right: clamp(10px, 3vw, 30px);
  top: 50%;
  width: 280px;
  z-index: 2;
}

.feature-card {
  background: var(--blue-dark);
  color: var(--white);
  border-radius: 50%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 4rem;
  margin-bottom: 12px;
  line-height: 1;
}

.feature-card h3 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 10px;
  line-height: 1.2;
}

.feature-card p {
  font-size: 1.1rem;
  line-height: 1.5;
  opacity: 0.95;
}

.cta-box {
  background: var(--white);
  border: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.cta-box-title {
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  text-align: center;
  padding: 10px 8px;
  margin: -20px -20px 14px;
  border-radius: 5px 5px 0 0;
}

.cta-box-sub {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--green-dark);
  text-align: center;
  margin-bottom: 12px;
}

.cta-checklist li {
  font-size: 0.85rem;
  padding: 5px 0 5px 22px;
  position: relative;
  color: var(--text-mid);
}

.cta-checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 900;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, transform 0.2s, color 0.2s;
  font-family: var(--font);
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
  width: 100%;
  margin-top: 14px;
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-gold {
  background: var(--gold);
  color: var(--blue-dark);
  border-color: var(--gold);
  font-weight: 900;
}

.btn-gold:hover {
  background: var(--gold-dark);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.15);
}

.btn-full {
  width: 100%;
}

/* ---- 事業内容 ---- */
.services {
  padding: 50px 0;
}

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

.service-card {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
}

.service-header {
  padding: 14px 16px;
  color: var(--white);
}

.service-card--metal .service-header { background: var(--green); }
.service-card--waste .service-header { background: var(--blue-mid); }
.service-card--solar .service-header { background: var(--orange); }

.service-header h2 {
  font-size: 1.05rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.service-header p {
  font-size: 0.78rem;
  opacity: 0.9;
}

.service-image img,
.service-sub-image img {
  width: 100%;
  object-fit: cover;
}

.service-sub-image img {
  height: 80px;
  object-fit: cover;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--gray-light);
}

.service-tags li {
  font-size: 0.72rem;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: 12px;
  padding: 3px 10px;
  font-weight: 500;
}

.service-footer {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  color: var(--white);
  margin-top: auto;
}

.service-card--metal .service-footer { background: var(--green-dark); }
.service-card--waste .service-footer { background: var(--blue-dark); }
.service-card--solar .service-footer { background: var(--orange-dark); }

/* ---- 情報セクション ---- */
.info-section {
  background: var(--gray-light);
  padding: 50px 0;
}

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

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.info-card h2 {
  font-size: 1rem;
  font-weight: 900;
  color: var(--blue-dark);
  border-bottom: 3px solid var(--green);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.info-map img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  margin-bottom: 10px;
}

.info-highlight {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  line-height: 1.5;
}

.strength-list li,
.recommend-list li {
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px dashed var(--gray-mid);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.strength-list .check {
  color: var(--green);
  font-weight: 900;
  flex-shrink: 0;
}

.info-card--recommend {
  position: relative;
}

.recommend-icon {
  font-size: 3rem;
  text-align: center;
  margin-top: 10px;
}

/* ---- お問い合わせ ---- */
.contact-section {
  background: var(--blue-dark);
  color: var(--white);
  padding: 50px 0;
  text-align: center;
}

.contact-lead {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.contact-phone {
  display: block;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  transition: transform 0.2s;
}

.contact-phone:hover {
  transform: scale(1.03);
}

.contact-details {
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 24px;
  opacity: 0.9;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* ---- フッター ---- */
.site-footer {
  background: var(--green);
  color: var(--white);
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  line-height: 1.7;
}

.footer-copy {
  margin-top: 8px;
  opacity: 0.8;
  font-size: 0.75rem;
}

/* ---- モーダル ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal.is-open .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-mid);
  line-height: 1;
}

.modal-content h2 {
  font-size: 1.2rem;
  color: var(--blue-dark);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.required {
  color: var(--red);
  font-size: 0.75rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-mid);
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(42, 157, 74, 0.15);
}

.form-group input.is-error,
.form-group textarea.is-error {
  border-color: var(--red);
}

.form-note {
  font-size: 0.75rem;
  color: var(--text-mid);
  margin-top: 10px;
  text-align: center;
}

.form-success {
  text-align: center;
  padding: 20px 0;
}

.form-success p {
  margin-bottom: 12px;
  font-weight: 700;
  color: var(--green-dark);
}

/* ---- 固定電話ボタン ---- */
.floating-phone {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 150;
  width: 56px;
  height: 56px;
  background: var(--gold);
  color: var(--blue-dark);
  border-radius: 50%;
  font-size: 1.6rem;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.floating-phone:hover {
  transform: scale(1.1);
}

/* ---- アニメーション ---- */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* CTAボックス：アニメーションルールより優先して縦位置を固定 */
.highlights-cta[data-animate] {
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.highlights-cta[data-animate].is-visible {
  opacity: 1;
  transform: translateY(-50%);
}

/* ---- レスポンシブ ---- */
@media (max-width: 900px) {
  .highlights-cta {
    position: static;
    transform: none;
    width: 100%;
    max-width: 360px;
    margin: 28px auto 0;
  }

  .highlights-cta.is-visible {
    transform: none;
  }

  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 560px;
    margin: 0 auto;
  }

  .feature-card {
    border-radius: var(--radius);
    aspect-ratio: auto;
    padding: 32px 24px;
  }

  .feature-icon {
    font-size: 3.2rem;
  }

  .feature-card h3 {
    font-size: 1.3rem;
  }

  .feature-card p {
    font-size: 1rem;
  }

  .services-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 12px 16px;
  }

  .brand {
    gap: 12px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .nav-toggle {
    display: flex;
    right: 16px;
  }

  .hero-overlay {
    display: flex;
    flex-direction: column;
    min-height: auto;
    padding: 20px 16px 24px;
  }

  .hero {
    min-height: auto;
  }

  .hero-badge-area {
    position: static;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 16px;
    order: -1;
  }

  .hero-top-row {
    padding-right: 10px;
    order: 0;
  }

  .hero-catch--green {
    order: 1;
  }

  .hero-phone-btn {
    order: 2;
  }

  .badge-medal {
    width: 140px;
    margin: 0 auto;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    padding: 10px 20px 16px;
    gap: 4px;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .feature-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .floating-phone {
    display: flex;
  }

  .contact-actions {
    flex-direction: column;
    align-items: center;
  }

  .contact-actions .btn {
    width: 100%;
    max-width: 280px;
  }
}

@media (min-width: 641px) {
  .floating-phone {
    display: none;
  }
}
