/*
Theme Name: コバヤシ商会
Theme URI: https://kobayashi-syoukai.com/
Author: ミュープロダクト
Description: 有限会社コバヤシ商会の採用・施工実績サイト専用テーマです。
Version: 1.0.1
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: kobayashi-syokai
*/

:root {
  --navy: #072b4a;
  --navy-deep: #031a2d;
  --blue: #008bd2;
  --green: #378f3e;
  --lime: #a6d92e;
  --ink: #10283d;
  --muted: #607284;
  --paper: #f4f7f8;
  --white: #fff;
  --line: #d8e1e7;
  --shadow: 0 18px 60px rgba(3, 26, 45, .12);
  --radius: 22px;
  --content: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed !important; z-index: 9999; top: 10px; left: 10px;
  width: auto; height: auto; padding: 10px 16px; margin: 0;
  clip: auto; background: var(--white); color: var(--navy); border-radius: 8px;
}
.container { width: min(calc(100% - 48px), var(--content)); margin-inline: auto; }
.section { padding: 112px 0; }
.section--soft { background: var(--paper); }
.section-kicker {
  margin: 0 0 14px; color: var(--blue); font-size: .78rem;
  font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
}
.section-title {
  margin: 0; color: var(--navy); font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 1.15; letter-spacing: -.035em;
}
.section-lead { max-width: 760px; margin: 26px 0 0; color: var(--muted); font-size: 1.05rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 12px 24px; border: 1px solid transparent;
  border-radius: 999px; background: var(--blue); color: var(--white);
  font-weight: 800; line-height: 1.2; transition: transform .2s, box-shadow .2s, background .2s;
}
.button:hover, .button:focus-visible { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 139, 210, .28); }
.button--outline { border-color: rgba(255,255,255,.6); background: transparent; color: var(--white); }
.button--outline:hover { background: rgba(255,255,255,.12); box-shadow: none; }
.button--green { background: var(--green); }

/* Header */
.site-header {
  position: sticky; z-index: 100; top: 0; height: 84px;
  border-bottom: 1px solid rgba(7, 43, 74, .08); background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.site-brand { display: flex; align-items: center; width: min(310px, 42vw); }
.site-brand img { width: 100%; max-height: 54px; object-fit: contain; object-position: left center; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { position: relative; color: var(--navy); font-size: .88rem; font-weight: 800; letter-spacing: .04em; }
.site-nav a:not(.nav-tel)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -7px; height: 2px;
  background: var(--blue); transition: right .2s;
}
.site-nav a:hover::after { right: 0; }
.nav-tel { padding: 10px 17px; border-radius: 999px; background: var(--navy); color: var(--white) !important; }
.menu-toggle {
  display: none; width: 46px; height: 46px; padding: 0; border: 0;
  border-radius: 50%; background: var(--navy); color: var(--white); cursor: pointer;
}
.menu-toggle span, .menu-toggle::before, .menu-toggle::after {
  content: ""; display: block; width: 20px; height: 2px; margin: 5px auto; background: currentColor; transition: transform .2s, opacity .2s;
}

/* Hero */
.hero { position: relative; min-height: calc(100svh - 84px); overflow: hidden; background: var(--navy-deep); color: var(--white); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 22px 22px; mask-image: linear-gradient(to right, #000, transparent 52%);
}
.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: .86fr 1.14fr; min-height: calc(100svh - 84px); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 70px 7vw 70px max(24px, calc((100vw - var(--content)) / 2)); }
.hero-eyebrow { margin: 0 0 25px; color: #7ed5ff; font-size: .8rem; font-weight: 800; letter-spacing: .24em; }
.hero-title { margin: 0; font-size: clamp(3rem, 6.2vw, 7.2rem); line-height: .98; letter-spacing: -.055em; }
.hero-title span { display: block; opacity: 0; transform: translateY(34px); animation: revealText .85s cubic-bezier(.2,.8,.2,1) forwards; }
.hero-title span:nth-child(2) { margin-top: .22em; color: #7ed5ff; font-size: .55em; animation-delay: .28s; }
.hero-summary { max-width: 540px; margin: 34px 0 0; color: rgba(255,255,255,.78); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-media { position: relative; min-height: 620px; margin: 28px 28px 28px 0; overflow: hidden; border-radius: 34px; background: #153b57; box-shadow: var(--shadow); }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; animation: slowZoom 9s ease-in-out infinite alternate; }
.hero-slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,26,45,.12), transparent 48%); }
.hero-counter { position: absolute; z-index: 4; right: 28px; bottom: 24px; display: flex; align-items: center; gap: 10px; }
.hero-dot { width: 30px; height: 3px; border: 0; background: rgba(255,255,255,.45); cursor: pointer; transition: background .2s, width .2s; }
.hero-dot.is-active { width: 54px; background: var(--white); }
.hero-stamp {
  position: absolute; z-index: 4; left: 24px; bottom: 22px; padding: 9px 13px;
  background: rgba(3,26,45,.78); font-size: .72rem; font-weight: 800; letter-spacing: .14em;
}
@keyframes revealText { to { opacity: 1; transform: translateY(0); } }
@keyframes slowZoom { from { transform: scale(1.01); } to { transform: scale(1.07); } }

/* Craft */
.craft-intro { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: start; }
.craft-copy { padding-top: 16px; }
.craft-copy p { margin: 0 0 1.4em; color: var(--muted); }
.craft-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 68px; }
.craft-card { position: relative; min-height: 300px; padding: 34px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 10px 35px rgba(3,26,45,.06); }
.craft-card::before { content: attr(data-number); position: absolute; right: 22px; top: 8px; color: rgba(0,139,210,.08); font-size: 7rem; font-weight: 900; line-height: 1; }
.craft-card h3 { position: relative; margin: 66px 0 14px; color: var(--navy); font-size: 1.3rem; }
.craft-card p { position: relative; margin: 0; color: var(--muted); font-size: .94rem; }

/* Works */
.works-head { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 48px; }
.works-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.work-card { position: relative; grid-column: span 4; min-height: 300px; overflow: hidden; border-radius: 18px; background: #dce4e8; cursor: zoom-in; }
.work-card:nth-child(1), .work-card:nth-child(5) { grid-column: span 8; }
.work-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.work-card:hover img { transform: scale(1.045); }
.work-card-overlay { position: absolute; inset: auto 0 0; padding: 40px 20px 18px; background: linear-gradient(transparent, rgba(3,26,45,.78)); color: var(--white); opacity: 0; transition: opacity .25s; }
.work-card:hover .work-card-overlay { opacity: 1; }
.work-card-title { margin: 0; font-size: .9rem; font-weight: 800; }
.archive-hero { padding: 90px 0 58px; background: var(--navy-deep); color: var(--white); }
.archive-hero .section-title { color: var(--white); }
.archive-hero .section-lead { color: rgba(255,255,255,.72); }
.portfolio { columns: 3 320px; column-gap: 18px; }
.portfolio .work-card {
  display: block; width: 100%; min-height: 0; margin: 0 0 18px; padding: 0;
  break-inside: avoid; border: 0; appearance: none; -webkit-appearance: none; text-align: left;
}
.portfolio .work-card img { width: 100%; height: auto; }

/* Recruit */
.recruit { position: relative; overflow: hidden; background: var(--navy-deep); color: var(--white); }
.recruit::after {
  content: "RECRUIT"; position: absolute; right: -1vw; bottom: -5vw; color: rgba(255,255,255,.035);
  font-size: 20vw; font-weight: 900; line-height: .7; letter-spacing: -.08em; pointer-events: none;
}
.recruit-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.06fr .94fr; gap: 80px; align-items: center; }
.recruit .section-kicker { color: #7ed5ff; }
.recruit-title { margin: 0; font-size: clamp(2.5rem, 5.4vw, 5.8rem); line-height: 1.08; letter-spacing: -.045em; }
.recruit-panel { padding: 42px; border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius); background: rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.recruit-call { margin: 0 0 12px; color: var(--lime); font-size: clamp(1.7rem, 3vw, 2.8rem); font-weight: 900; line-height: 1.25; }
.recruit-panel p { margin: 0 0 22px; color: rgba(255,255,255,.78); }
.recruit-note { padding-top: 20px; border-top: 1px solid rgba(255,255,255,.16); font-size: .88rem; }

/* FAQ */
.faq-list { max-width: 900px; margin: 55px auto 0; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-question { display: flex; align-items: center; gap: 18px; width: 100%; padding: 25px 6px; border: 0; background: transparent; color: var(--navy); text-align: left; font-weight: 800; cursor: pointer; }
.faq-question::before { content: "Q"; flex: 0 0 auto; color: var(--blue); font-size: 1.5rem; font-weight: 400; }
.faq-question::after { content: "+"; margin-left: auto; color: var(--blue); font-size: 1.5rem; font-weight: 400; transition: transform .2s; }
.faq-item[open] .faq-question::after { transform: rotate(45deg); }
.faq-answer { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 0 44px 28px 6px; color: var(--muted); }
.faq-answer::before { content: "A"; color: var(--lime); font-size: 1.5rem; }
.faq-answer p { margin: 0; }

/* Company */
.company-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 80px; align-items: start; }
.company-table { margin: 0; border-top: 1px solid var(--line); }
.company-row { display: grid; grid-template-columns: 130px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.company-row dt { font-weight: 800; }
.company-row dd { margin: 0; color: var(--muted); }
.company-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

/* Footer */
.site-footer { padding: 64px 0 28px; background: #021321; color: var(--white); }
.footer-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.footer-logo { width: min(420px, 70vw); filter: brightness(0) invert(1); opacity: .92; }
.footer-contact { text-align: right; }
.footer-tel { display: block; font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 800; line-height: 1.1; }
.footer-address { margin: 12px 0 0; color: rgba(255,255,255,.62); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 48px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.48); font-size: .76rem; }

/* Single / normal content */
.entry-shell { min-height: 70vh; padding: 90px 0; }
.entry-content { max-width: 860px; margin: 0 auto; }
.entry-content h1 { color: var(--navy); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.2; }
.entry-content img { border-radius: var(--radius); }

/* Lightbox */
.lightbox { position: fixed; z-index: 1000; inset: 0; display: none; align-items: center; justify-content: center; padding: 30px; background: rgba(1,13,23,.94); }
.lightbox.is-open { display: flex; }
.lightbox-image { max-width: min(92vw, 1500px); max-height: 88vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 18px; right: 18px; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; background: transparent; color: var(--white); font-size: 1.8rem; cursor: pointer; }
.lightbox-nav { position: absolute; top: 50%; width: 48px; height: 70px; border: 0; background: rgba(255,255,255,.1); color: var(--white); font-size: 2rem; cursor: pointer; transform: translateY(-50%); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

@media (max-width: 980px) {
  .site-header { height: 72px; }
  .site-brand { width: min(260px, 64vw); }
  .menu-toggle { display: block; }
  .site-nav {
    position: fixed; inset: 72px 0 0; display: flex; flex-direction: column; align-items: stretch; gap: 0;
    width: 100vw; max-width: 100%; padding: 28px 24px 50px; background: var(--navy-deep);
    visibility: hidden; pointer-events: none; transform: translateX(100%);
    transition: transform .3s ease, visibility 0s linear .3s;
  }
  .menu-open .site-nav {
    visibility: visible; pointer-events: auto; transform: translateX(0);
    transition: transform .3s ease, visibility 0s linear 0s;
  }
  .site-nav a { padding: 17px 8px; border-bottom: 1px solid rgba(255,255,255,.12); color: var(--white); font-size: 1rem; }
  .nav-tel { margin-top: 20px; border-bottom: 0 !important; background: var(--blue); text-align: center; }
  .menu-open .menu-toggle span { opacity: 0; }
  .menu-open .menu-toggle::before { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-toggle::after { transform: translateY(-7px) rotate(-45deg); }
  .hero { min-height: 0; }
  .hero-grid { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { padding: 72px 24px 48px; }
  .hero-title { font-size: clamp(3.1rem, 12vw, 6rem); }
  .hero-media { order: -1; min-height: 55vw; margin: 20px 20px 0; border-radius: 24px; }
  .craft-intro, .recruit-grid, .company-grid { grid-template-columns: 1fr; gap: 44px; }
  .craft-cards { grid-template-columns: 1fr; }
  .craft-card { min-height: 250px; }
  .work-card, .work-card:nth-child(1), .work-card:nth-child(5) { grid-column: span 6; min-height: 280px; }
  .footer-top { align-items: flex-start; flex-direction: column; }
  .footer-contact { text-align: left; }
}

@media (max-width: 640px) {
  .container { width: min(calc(100% - 32px), var(--content)); }
  .section { padding: 78px 0; }
  .section-title { font-size: 2.45rem; }
  .hero-media { min-height: 72vw; }
  .hero-copy { padding-top: 50px; }
  .hero-title { font-size: clamp(3rem, 15.5vw, 5rem); }
  .hero-title span:nth-child(2) { font-size: .5em; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .craft-cards { margin-top: 44px; }
  .works-head { align-items: flex-start; flex-direction: column; }
  .works-grid { gap: 12px; }
  .work-card, .work-card:nth-child(1), .work-card:nth-child(5) { grid-column: 1 / -1; min-height: 68vw; }
  .portfolio { columns: 1; }
  .recruit-panel { padding: 28px 22px; }
  .faq-answer { padding-right: 6px; }
  .company-row { grid-template-columns: 92px 1fr; gap: 12px; }
  .footer-bottom { flex-direction: column; }
  .lightbox { padding: 12px; }
  .lightbox-nav { top: auto; bottom: 12px; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-title span { opacity: 1; transform: none; }
}
