/* =========================================================
   サンプル精密加工デモ株式会社 - 昔ながらの町工場デザイン
   上から「色設定 → 各部分 → スマホ表示」の順です。
   ========================================================= */

/* ===== ここがサイト全体の色設定 ===== */
:root {
  --paper: #f4f0e5;
  --paper-dark: #e7e1d3;
  --white: #fffdf7;
  --navy: #263b52;
  --navy-dark: #182838;
  --dusty-blue: #64798c;
  --wine: #7b3035;
  --green: #405340;
  --ink: #25282a;
  --muted: #626461;
  --line: #9d9b91;
  --light-line: #cbc6b9;
  --page-width: 1080px;
  --font-body: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-heading: "Yu Mincho", "Hiragino Mincho ProN", "MS PMincho", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 55px; }
body {
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, rgba(60, 55, 45, .016) 0, rgba(60, 55, 45, .016) 1px, transparent 1px, transparent 4px),
    var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; }
.page-width { width: min(calc(100% - 40px), var(--page-width)); margin-inline: auto; }

/* ===== 最上部の架空サイト注意書き ===== */
.demo-notice {
  padding: 6px 20px;
  border-bottom: 1px solid #c8c1b2;
  background: #ddd7ca;
  color: #4f504d;
  font-size: .75rem;
  text-align: center;
}

/* ===== ヘッダー ===== */
.site-header { background: var(--white); }
.header-main {
  display: flex;
  min-height: 102px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.company-brand { display: flex; align-items: center; gap: 16px; line-height: 1.3; }
.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px double var(--navy);
  color: var(--navy);
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
}
.company-brand > span:last-child { display: flex; flex-direction: column; }
.company-brand strong {
  color: var(--navy-dark);
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  letter-spacing: .04em;
}
.company-brand small { margin-top: 4px; color: var(--muted); font-family: Georgia, serif; font-size: .62rem; letter-spacing: .13em; }
.header-contact {
  display: flex;
  min-width: 260px;
  align-items: flex-end;
  flex-direction: column;
  padding-left: 24px;
  border-left: 1px solid var(--light-line);
  line-height: 1.35;
}
.header-contact span, .header-contact small { color: var(--muted); font-size: .72rem; }
.header-contact a { color: var(--wine); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 700; letter-spacing: .03em; }

/* ===== 四角いナビゲーション ===== */
.main-nav { border-top: 3px double #79818a; border-bottom: 3px double #182838; background: var(--navy); }
.nav-inner { display: grid; grid-template-columns: repeat(6, 1fr); }
.main-nav a {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-left: 1px solid rgba(255,255,255,.25);
  color: var(--white);
  font-size: .88rem;
  font-weight: 700;
}
.main-nav a:last-child { border-right: 1px solid rgba(255,255,255,.25); }
.main-nav a:hover, .main-nav a:focus-visible { background: var(--dusty-blue); }
.main-nav .contact-nav { background: var(--wine); }
.menu-button { display: none; }

/* ===== ファーストビュー ===== */
.hero { padding: 32px 0; border-bottom: 1px solid var(--line); background: var(--paper-dark); }
.hero-layout {
  display: grid;
  min-height: 370px;
  grid-template-columns: 1.15fr .85fr;
  border: 1px solid #8f8c82;
  background: var(--white);
  box-shadow: 5px 5px 0 rgba(63, 60, 53, .16);
}
.hero-copy { display: flex; justify-content: center; flex-direction: column; padding: 46px 50px; }
.hero-kicker {
  width: fit-content;
  margin: 0 0 16px;
  padding: 3px 12px;
  border-left: 6px solid var(--wine);
  background: #ebe7dc;
  color: var(--navy);
  font-size: .82rem;
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  color: var(--navy-dark);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.35rem);
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.45;
}
.hero-summary { margin: 20px 0 0; color: var(--green); font-size: 1.05rem; font-weight: 700; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.retro-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border: 2px solid var(--navy);
  border-radius: 0;
  background: #f6f3eb;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
}
.retro-button:hover, .retro-button:focus-visible { background: #e2ded3; }
.primary-button { background: var(--navy); color: var(--white); }
.primary-button:hover, .primary-button:focus-visible { background: var(--dusty-blue); }
.hero-photo {
  min-height: 370px;
  border-left: 1px solid #8f8c82;
  object-fit: cover;
}
.photo-placeholder {
  display: grid;
  place-content: center;
  gap: 5px;
  background:
    linear-gradient(rgba(38,59,82,.82), rgba(38,59,82,.82)),
    repeating-linear-gradient(135deg, #788796 0 12px, #697989 12px 24px);
  color: #e9e5d9;
  text-align: center;
}
.photo-placeholder span { font-family: var(--font-heading); font-size: 1rem; letter-spacing: .08em; }
.photo-placeholder small { color: #c5c6c1; font-family: Georgia, serif; font-size: .65rem; letter-spacing: .18em; }

/* ===== 一目で分かる対応内容 ===== */
.quick-info { border-bottom: 3px double var(--line); background: var(--navy-dark); color: var(--white); }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.quick-grid div { display: flex; min-height: 82px; align-items: center; justify-content: center; flex-direction: column; border-left: 1px solid rgba(255,255,255,.22); }
.quick-grid div:last-child { border-right: 1px solid rgba(255,255,255,.22); }
.quick-grid strong { color: #f0e5c8; font-family: var(--font-heading); font-size: 1.15rem; }
.quick-grid span { color: #cbd1d4; font-size: .72rem; }

/* ===== 共通セクション ===== */
.content-section { padding: 66px 0; }
.alternate-bg { border-block: 1px solid var(--light-line); background: rgba(255,253,247,.68); }
.section-heading {
  margin: 0 0 26px;
  padding: 9px 16px 8px;
  border-left: 8px solid var(--wine);
  border-bottom: 2px solid var(--navy);
  background: #dfe2df;
  color: var(--navy-dark);
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.35;
}
.section-lead { margin: -12px 0 18px; color: var(--muted); font-size: .9rem; }
.fiction-note { margin: 13px 0 0; color: var(--muted); font-size: .76rem; }

/* ===== 当社について ===== */
.about-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 34px; align-items: start; }
.about-message { padding: 20px 22px; border: 1px solid var(--line); background: var(--white); }
.about-message h3 { margin: 0 0 12px; color: var(--navy); font-family: var(--font-heading); font-size: 1.35rem; line-height: 1.55; }
.about-message p { margin: 0; color: #4e514f; font-size: .9rem; }
.strength-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  list-style: none;
}
.strength-list li { display: flex; min-height: 92px; justify-content: center; flex-direction: column; padding: 14px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #ece8dd; }
.strength-list strong { color: var(--navy-dark); font-family: var(--font-heading); font-size: 1.05rem; }
.strength-list span { color: var(--muted); font-size: .78rem; }

/* ===== 加工内容 ===== */
.service-table { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service-table article { min-height: 142px; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--white); }
.service-table h3 { margin: 0 0 7px; padding-bottom: 6px; border-bottom: 1px solid var(--light-line); color: var(--navy); font-family: var(--font-heading); font-size: 1.1rem; }
.service-table p { margin: 0 0 6px; font-size: .86rem; }
.service-table span { color: var(--wine); font-size: .73rem; font-weight: 700; }

/* ===== 表共通・設備一覧 ===== */
.table-frame { border: 2px solid #777970; background: var(--white); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 14px; border: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table thead th { background: var(--navy); color: var(--white); font-size: .82rem; text-align: center; }
.data-table tbody tr:nth-child(even) { background: #eeebe2; }
.equipment-table td { font-size: .8rem; line-height: 1.55; }
.equipment-table td:first-child { width: 27%; color: var(--navy-dark); }
.equipment-table td:nth-child(2) { width: 22%; font-size: .72rem; }
.equipment-table td:nth-child(3) { width: 24%; }
.equipment-table td strong { color: var(--wine); font-family: Georgia, serif; }

/* ===== 加工実績 ===== */
.works-list { display: grid; gap: 18px; }
.work-item { display: grid; grid-template-columns: 220px 1fr; border: 1px solid var(--line); background: var(--white); }
.work-photo { min-height: 165px; border-right: 1px solid var(--line); object-fit: cover; }
.work-item > div:last-child { padding: 18px 22px; }
.work-item h3 { margin: 0 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--light-line); color: var(--navy); font-family: var(--font-heading); font-size: 1.12rem; }
.work-item dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin: 0; }
.work-item dl div { display: grid; grid-template-columns: 65px 1fr; border-bottom: 1px dotted var(--line); }
.work-item dt { color: var(--muted); font-size: .75rem; }
.work-item dd { margin: 0; font-size: .8rem; font-weight: 700; }

/* ===== 会社概要 ===== */
.company-table th { width: 180px; background: #dfe2df; color: var(--navy-dark); font-size: .82rem; }
.company-table td { background: var(--white); font-size: .86rem; }

/* ===== お問い合わせ ===== */
.contact-section { padding: 66px 0; border-top: 5px solid var(--wine); background: var(--navy-dark); color: var(--white); }
.light-heading { border-bottom-color: #9faab3; background: #e0ddd3; }
.contact-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; align-items: center; margin-bottom: 22px; padding: 20px 24px; border: 1px solid #8794a0; background: var(--navy); }
.contact-summary > div { display: flex; flex-direction: column; }
.contact-summary span, .contact-summary small { color: #c7cfd4; font-size: .75rem; }
.contact-summary a { width: fit-content; color: #fff0c4; font-family: Georgia, serif; font-size: 2rem; font-weight: 700; line-height: 1.25; }
.contact-summary p { margin: 0; color: #e2e4df; font-size: .88rem; }
.contact-form { padding: 24px; border: 1px solid #a9a497; background: var(--paper); color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid label { color: var(--navy-dark); font-size: .8rem; font-weight: 700; }
.form-grid label b { margin-left: 5px; padding: 1px 5px; background: var(--wine); color: var(--white); font-size: .65rem; }
.form-grid label em { margin-left: 5px; color: var(--muted); font-size: .68rem; font-style: normal; font-weight: 400; }
.form-grid input, .form-grid textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  border: 1px solid #777970;
  border-radius: 0;
  outline: none;
  background: var(--white);
  color: var(--ink);
}
.form-grid input:focus, .form-grid textarea:focus { outline: 2px solid #8b9dac; outline-offset: 1px; }
.message-field { grid-column: 1 / -1; }
.form-grid textarea { resize: vertical; }
.privacy-check { display: flex; align-items: flex-start; gap: 8px; margin: 18px 0 14px; color: #4f524f; font-size: .75rem; }
.privacy-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--navy); }
.submit-button { min-width: 280px; background: var(--wine); border-color: #5e2226; color: var(--white); }
.submit-button:hover, .submit-button:focus-visible { background: #65252a; }
.form-note { margin: 8px 0 0; color: var(--muted); font-size: .7rem; }
.form-success { display: flex; align-items: flex-start; flex-direction: column; margin-top: 14px; padding: 13px 16px; border: 1px solid #6d7c6d; background: #dfe6da; color: #253925; font-size: .82rem; }
.form-success[hidden] { display: none; }

/* ===== フッター ===== */
.site-footer { border-top: 3px double #b5b0a3; background: #d9d4c8; }
.footer-layout { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-block: 28px; }
.footer-layout > div { display: flex; flex-direction: column; }
.footer-layout strong { color: var(--navy-dark); font-family: var(--font-heading); font-size: 1.15rem; }
.footer-layout span { color: var(--muted); font-family: Georgia, serif; font-size: .62rem; letter-spacing: .1em; }
.footer-layout p { margin: 0; font-size: .78rem; text-align: right; }
.footer-note { padding: 11px 0; background: var(--navy-dark); color: #c9cdd0; }
.footer-note > div { display: flex; justify-content: space-between; gap: 24px; }
.footer-note p { margin: 0; font-size: .66rem; }

/* ===== タブレット表示 ===== */
@media (max-width: 900px) {
  .header-contact { display: none; }
  .hero-layout { grid-template-columns: 1fr .75fr; }
  .hero-copy { padding: 38px 34px; }
  .service-table { grid-template-columns: 1fr 1fr; }
  .equipment-table th, .equipment-table td { padding: 10px 8px; }
}

/* ===== スマートフォン表示：ここを編集するとスマホ表示が変わります ===== */
@media (max-width: 700px) {
  html { scroll-padding-top: 0; }
  .page-width { width: min(calc(100% - 24px), var(--page-width)); }
  .demo-notice { padding: 6px 12px; font-size: .68rem; line-height: 1.5; }
  .header-main { min-height: 80px; gap: 10px; }
  .brand-mark { width: 42px; height: 42px; border-width: 2px; font-size: .85rem; }
  .company-brand { gap: 9px; }
  .company-brand strong { font-size: .94rem; letter-spacing: 0; }
  .company-brand small { font-size: .49rem; letter-spacing: .07em; }
  .menu-button {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--navy);
    border-radius: 0;
    background: #e9e5da;
  }
  .menu-button span { display: block; width: 22px; height: 2px; background: var(--navy); }
  .main-nav { display: none; }
  .main-nav.is-open { display: block; }
  .nav-inner { width: 100%; grid-template-columns: 1fr 1fr; }
  .main-nav a { min-height: 52px; border-bottom: 1px solid rgba(255,255,255,.25); font-size: .85rem; }
  .hero { padding: 18px 0; }
  .hero-layout { min-height: auto; grid-template-columns: 1fr; box-shadow: 3px 3px 0 rgba(63,60,53,.14); }
  .hero-copy { padding: 29px 22px; }
  .hero-kicker { margin-bottom: 12px; }
  .hero h1 { font-size: clamp(1.8rem, 8.6vw, 2.45rem); line-height: 1.45; }
  .hero-summary { margin-top: 14px; font-size: .92rem; }
  .hero-buttons { align-items: stretch; flex-direction: column; margin-top: 20px; }
  .retro-button { width: 100%; }
  .hero-photo { min-height: 220px; border-top: 1px solid #8f8c82; border-left: 0; }
  .quick-grid { grid-template-columns: 1fr 1fr; width: 100%; }
  .quick-grid div { min-height: 76px; border-right: 1px solid rgba(255,255,255,.22); border-bottom: 1px solid rgba(255,255,255,.22); }
  .quick-grid strong { font-size: 1rem; }
  .content-section, .contact-section { padding: 45px 0; }
  .section-heading { margin-bottom: 20px; padding: 8px 11px 7px; border-left-width: 6px; }
  .about-layout { grid-template-columns: 1fr; gap: 18px; }
  .about-message { padding: 17px; }
  .about-message h3 { font-size: 1.16rem; }
  .strength-list { grid-template-columns: 1fr 1fr; }
  .strength-list li { min-height: 82px; padding: 11px 13px; }
  .strength-list strong { font-size: .92rem; }
  .service-table { grid-template-columns: 1fr; }
  .service-table article { min-height: 0; padding: 15px; }

  /* 設備表はスマホで1台ずつ縦に表示します */
  .table-frame { border-width: 1px; }
  .equipment-table, .equipment-table tbody, .equipment-table tr, .equipment-table td { display: block; width: 100%; }
  .equipment-table thead { display: none; }
  .equipment-table tr { padding: 8px 10px; border-bottom: 3px double var(--navy); }
  .equipment-table tr:last-child { border-bottom: 0; }
  .equipment-table td, .equipment-table td:first-child, .equipment-table td:nth-child(2), .equipment-table td:nth-child(3) {
    display: grid;
    width: 100%;
    grid-template-columns: 112px 1fr;
    gap: 10px;
    padding: 8px 2px;
    border: 0;
    border-bottom: 1px dotted var(--light-line);
    font-size: .78rem;
  }
  .equipment-table td::before { color: var(--muted); content: attr(data-label); font-size: .7rem; font-weight: 700; }
  .equipment-table td:last-child { border-bottom: 0; }
  .work-item { grid-template-columns: 1fr; }
  .work-photo { min-height: 190px; border-right: 0; border-bottom: 1px solid var(--line); }
  .work-item > div:last-child { padding: 15px; }
  .work-item dl { gap: 5px 14px; }
  .work-item dl div { grid-template-columns: 48px 1fr; }
  .company-table th { width: 92px; }
  .company-table th, .company-table td { padding: 10px 9px; font-size: .78rem; }
  .contact-summary { grid-template-columns: 1fr; gap: 13px; padding: 17px; }
  .contact-summary a { font-size: 1.75rem; }
  .contact-form { padding: 17px; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .message-field { grid-column: auto; }
  .submit-button { min-width: 0; }
  .footer-layout { align-items: flex-start; flex-direction: column; gap: 12px; }
  .footer-layout p { text-align: left; }
  .footer-note > div { flex-direction: column; gap: 4px; }
}

/* 動きを減らす設定の端末では、スクロールの動きも止めます */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
