/* =========================================================
   Free Data Japan — stylesheet
   ========================================================= */

/* ---- design tokens ---- */
:root {
  --ink:       #1C2833;   /* 見出し・本文 */
  --muted:     #5E6B78;   /* 補足テキスト */
  --accent:    #1F7A8C;   /* アクセント（リンク・強調） */
  --accent-dk: #155F6E;   /* ホバー */
  --line:      #E2E8ED;   /* 境界線 */
  --bg:        #F7F9FB;   /* セクション背景 */
  --dark:      #1C2833;   /* ヘッダー・フッター */
  --white:     #FFFFFF;

  --radius:    6px;
  --maxw:      1080px;
  --font-ja:   'Noto Sans JP', sans-serif;
  --font-en:   'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ja);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   HEADER
   ========================================================= */
#header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo a { display: inline-flex; align-items: center; }
.logo img { height: 38px; width: auto; }

/* ---- navigation ---- */
#mainNav { display: flex; align-items: center; }

#mainNav ul {
  display: flex;
  list-style: none;
  gap: 4px;
}

#mainNav ul li a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  transition: background 0.18s, color 0.18s;
}
#mainNav ul li a strong {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
}
#mainNav ul li a span {
  font-family: var(--font-en);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
#mainNav ul li a:hover { background: var(--bg); }
#mainNav ul li a:hover strong { color: var(--accent); }
#mainNav ul li.active a strong { color: var(--accent); }

/* ---- hamburger (mobile) ---- */
.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
}
.menu-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}
.menu-toggle span:nth-child(1) { top: 14px; }
.menu-toggle span:nth-child(2) { top: 20px; }
.menu-toggle span:nth-child(3) { top: 26px; }
.menu-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* =========================================================
   HERO BANNER
   ========================================================= */
#mainBanner {
  position: relative;
  overflow: hidden;
  background: var(--dark);
}
#mainBanner > img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    rgba(28,40,51,0.62) 0%,
    rgba(28,40,51,0.30) 45%,
    rgba(28,40,51,0.05) 75%
  );
}

.slogan {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  transform: translateY(-50%);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.slogan h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
  letter-spacing: -0.01em;
  text-shadow: 0 2px 18px rgba(28,40,51,0.45);
  margin-bottom: 0.8rem;
}
.slogan p {
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  font-weight: 300;
  line-height: 1.9;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 12px rgba(28,40,51,0.4);
}

/* =========================================================
   3-COLUMN SERVICES
   ========================================================= */
.gridWrapper {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid { display: flex; }

.box {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.box:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 34px rgba(28,40,51,0.1);
  border-color: transparent;
}

.box-img {
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 260 / 113;
}
.box-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.box:hover .box-img img { transform: scale(1.05); }

.box-body {
  padding: 1.4rem 1.4rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
}
.box-body h3 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.readmore {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.readmore::after {
  content: '→';
  font-family: var(--font-en);
  transition: transform 0.2s;
}
.box:hover .readmore { color: var(--accent-dk); }
.box:hover .readmore::after { transform: translateX(4px); }

/* =========================================================
   FOOTER
   ========================================================= */
#footer {
  background: var(--dark);
  color: rgba(255,255,255,0.85);
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 24px 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img { width: 45px; height: 45px; }
.footer-brand p {
  font-family: var(--font-en);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--white);
}
.footer-brand p span {
  font-size: 0.66rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
}

.footnav {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.footnav li a {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.65);
  transition: color 0.15s;
}
.footnav li a:hover { color: var(--white); }

.footer-meta {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.5rem 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.license {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.45);
}
.footer-type {
  width: 150px;
  opacity: 0.9;
}

address {
  font-style: normal;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-family: var(--font-en);
  color: var(--muted);
  padding: 1.4rem 24px;
  background: var(--bg);
}

/* =========================================================
   SUBPAGE  (main + sidebar)
   ========================================================= */

/* --- slim banner --- */
#subpage #mainBanner > img { min-height: 200px; }
#subpage .slogan h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); }

/* --- two-column layout --- */
.layout {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 24px 4.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.layout-single { grid-template-columns: minmax(0, 760px); }

/* section / article reset inside layout */
#main-content .content { margin: 0; }

.heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  padding-bottom: 0.8rem;
  margin-bottom: 1.8rem;
  border-bottom: 2px solid var(--accent);
}

.content article {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 2;
}
.content article p { margin: 0; }

/* floated service image */
.content .alignright {
  float: right;
  width: 230px;
  margin: 0 0 1.4rem 1.8rem;
  border-radius: 8px;
}
.content .border { border: 1px solid var(--line); }

/* --- sidebar --- */
#sidebar .heading {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  margin-top: 0;
}
#sidebar .heading + article { margin-bottom: 2.2rem; }

#sidebar ul {
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
#sidebar ul li + li { border-top: 1px solid var(--line); }
#sidebar ul li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--white);
  transition: background 0.16s, color 0.16s, padding-left 0.16s;
}
#sidebar ul li a::after {
  content: '→';
  font-family: var(--font-en);
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.16s, transform 0.16s;
  transform: translateX(-4px);
}
#sidebar ul li a:hover {
  background: var(--bg);
  color: var(--accent);
  padding-left: 1.4rem;
}
#sidebar ul li a:hover::after { opacity: 1; transform: translateX(0); }

#sidebar ul li.current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg);
}
#sidebar ul li.current::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 8px;
}

#sidebar .sidebar-cta { margin-top: 0.5rem; display: block; }
#sidebar .sidebar-cta img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: box-shadow 0.2s, transform 0.2s;
}
#sidebar .sidebar-cta:hover img {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(28,40,51,0.12);
}

/* --- 会社概要テーブル --- */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th,
.table td {
  text-align: left;
  vertical-align: top;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  line-height: 1.85;
}
.table th {
  width: 28%;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg);
  white-space: nowrap;
}
.table td { color: var(--muted); }
.table tr:first-child th,
.table tr:first-child td { border-top: 1px solid var(--line); }

/* --- お問い合わせ --- */
.contact-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 2.4rem;
  background: var(--bg);
}
.contact-card .contact-lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 1.8rem;
}
.contact-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.contact-row .contact-label {
  font-family: var(--font-en);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.contact-row .contact-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}
.contact-row .contact-value:hover { color: var(--accent-dk); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .header-inner { padding: 0 16px; height: 60px; }
  .logo img { height: 32px; }

  .menu-toggle { display: block; }

  #mainNav .panel {
    position: absolute;
    top: 60px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(28,40,51,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  #mainNav .panel.open { max-height: 320px; }

  #mainNav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  #mainNav ul li a {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    border-radius: 0;
    padding: 0.9rem 20px;
    border-top: 1px solid var(--line);
  }
  #mainNav ul li:first-child a { border-top: 0; }

  .gridWrapper {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 3rem 16px;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 2.5rem 16px 3rem;
  }
  .content .alignright {
    float: none;
    width: 100%;
    margin: 0 0 1.4rem 0;
  }

  .table th,
  .table td { display: block; width: 100%; }
  .table th { border-bottom: 0; padding-bottom: 0.4rem; }
  .table td { padding-top: 0.4rem; }

  .contact-card { padding: 1.5rem; }

  .footer-inner,
  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
