/* SEIOH official V2 — project-centric, gallery-style */

:root {
  --fg: #111;
  --fg-soft: #666;
  --fg-faint: #999;
  --bg: #fff;
  --bg-soft: #fafafa;
  --line: #e5e5e5;
  --line-soft: #f0f0f0;
  --max: 1280px;
  --max-text: 760px;
  --gutter: 20px;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Times New Roman", serif;
  --sans: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--fg); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.6; }

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

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 920px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 50;
}
.site-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.18em;
  margin: 0;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0; padding: 0;
  font-size: 13px;
  letter-spacing: 0.1em;
}
.site-nav a.active { border-bottom: 1px solid var(--fg); padding-bottom: 2px; }

@media (max-width: 700px) {
  .site-header { flex-direction: column; gap: 8px; padding: 14px var(--gutter); }
  .site-nav ul { gap: 14px; font-size: 12px; }
  .site-title { font-size: 18px; }
}

/* ---------- Hero stage (home) — v1-style: full bleed black, image contained, slide-out ---------- */
.hero-stage {
  position: relative;
  width: 100%;
  height: 88vh;
  min-height: 540px;
  background: #000;
  overflow: hidden;
  margin: 0;
}
@media (max-width: 700px) {
  .hero-stage { height: 78vh; min-height: 440px; }
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: block;
  background: #000;
  transform: translateX(0);
  /* JS adds transition + transform when sliding out */
}
.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;        /* v1 style: no crop, black bars on sides */
  object-position: center;
  margin: 0 auto;
}
.hero-slide:hover img { opacity: 0.96; }

/* On home, no caption overlay on the hero image — kept minimal like v1.
   The title/period appear under the hero (see .hero-caption below). */
.hero-meta { display: none; }

.hero-caption {
  text-align: center;
  padding: 14px 16px 0;
  font-size: 13px;
  color: var(--fg-soft);
  letter-spacing: 0.06em;
  min-height: 1.2em;
}
.hero-caption .period { color: var(--fg-faint); margin-right: 8px; letter-spacing: 0.14em; }
.hero-caption a { border-bottom: 1px solid transparent; transition: border-color 0.2s ease; }
.hero-caption a:hover { border-color: var(--fg-soft); }

/* Dot indicators for hero stage. Container ignores clicks; only dots receive them,
   so slide-area clicks still navigate to the project. */
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  padding: 6px 10px;
}
.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: 0;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.25s ease, transform 0.25s ease;
}
.hero-dot:hover { background: rgba(255, 255, 255, 0.7); }
.hero-dot.active {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.25);
}
@media (max-width: 700px) {
  .hero-dots { bottom: 10px; gap: 8px; }
  .hero-dot { width: 7px; height: 7px; }
}

/* ---------- Page intro ---------- */
.page-intro {
  text-align: center;
  margin: 80px auto 64px;
  max-width: 720px;
}
.page-intro-tag {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin: 0 0 18px;
}
.page-intro-lead {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.9;
  color: var(--fg-soft);
  margin: 0;
}

/* ---------- Category section ---------- */
.cat-section {
  margin: 88px 0 0;
}
.cat-section:last-of-type {
  margin-bottom: 96px;
}
.cat-section-head {
  text-align: center;
  margin: 0 auto 36px;
  max-width: 720px;
  padding-top: 32px;
  border-top: 1px solid var(--rule, rgba(0,0,0,0.08));
}
.cat-section-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
}
.cat-section-sub {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fg-soft);
  margin: 0;
}
.cat-section .project-grid { margin: 24px 0 0; }

/* ---------- Project grid (home) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 24px;
  margin: 40px 0 80px;
}
@media (max-width: 900px) { .project-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 18px; } }
@media (max-width: 560px) { .project-grid { grid-template-columns: 1fr; gap: 36px; } }

.project-card { display: block; }
.project-card-img {
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  overflow: hidden;
  margin-bottom: 14px;
}
.project-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.project-card:hover .project-card-img img { transform: scale(1.04); }
.project-card-period {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-soft);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.project-card-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  margin: 0 0 4px;
  letter-spacing: 0.04em;
}
.project-card-subtitle {
  font-size: 12px;
  color: var(--fg-soft);
  line-height: 1.5;
  margin-bottom: 6px;
}
.project-card-count {
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.1em;
}

/* ---------- Project fullwidth (production category, 1-column) ---------- */
.project-fullwidth {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 40px 0 80px;
}
.project-fullwidth-card {
  display: grid;
  grid-template-columns: 60% 1fr;
  gap: 36px;
  align-items: center;
}
.project-fullwidth-img {
  aspect-ratio: 3 / 2;
  background: var(--bg-soft);
  overflow: hidden;
}
.project-fullwidth-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.project-fullwidth-card:hover .project-fullwidth-img img { transform: scale(1.03); }
.project-fullwidth-body {
  padding: 0 8px;
}
.project-fullwidth-period {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--fg-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.project-fullwidth-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}
.project-fullwidth-subtitle {
  font-size: 13px;
  color: var(--fg-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}
.project-fullwidth-summary {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.9;
  color: var(--fg-soft);
  margin: 0 0 14px;
}
.project-fullwidth-count {
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.1em;
}
@media (max-width: 700px) {
  .project-fullwidth-card { grid-template-columns: 1fr; gap: 16px; }
  .project-fullwidth-body { padding: 0; }
  .project-fullwidth-title { font-size: 20px; }
}

/* ---------- Project video embed (YouTube etc.) ---------- */
.project-video-wrap {
  margin: 24px 0 60px;
}
.project-video-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  background: #000;
  overflow: hidden;
}
.project-video-inner iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--fg-soft);
  margin: 28px 0 18px;
}
.breadcrumb span { color: var(--fg-faint); margin: 0 6px; }
.breadcrumb a { color: var(--fg-soft); border-bottom: 1px solid transparent; }
.breadcrumb a:hover { border-color: var(--fg-soft); opacity: 1; }

/* ---------- Project detail ---------- */
.project-detail { padding-bottom: 60px; }

.project-header {
  text-align: center;
  margin: 30px auto 50px;
  max-width: 760px;
}
.project-meta { margin-bottom: 16px; }
.project-period {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--fg-soft);
  text-transform: uppercase;
}
.project-subtitle {
  font-size: 13px;
  color: var(--fg-soft);
  margin-top: 6px;
  letter-spacing: 0.04em;
}
.project-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.4;
  letter-spacing: 0.06em;
  margin: 0 0 18px;
}
@media (max-width: 640px) { .project-title { font-size: 24px; } }
.project-summary {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.95;
  color: var(--fg-soft);
  margin: 0 auto;
  max-width: 640px;
}

/* Works gallery — 2-column grid */
.works-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0 auto 60px;
  max-width: 1200px;
}
@media (max-width: 560px) { .works-gallery { grid-template-columns: 1fr; } }

/* Works gallery — fullwidth (1 column, full width) */
.works-gallery-fullwidth {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1em;
  margin: 0 auto 60px;
  max-width: 1200px;
}
.works-gallery-fullwidth .work-tile { margin: 0; }
.works-gallery-fullwidth img,
.works-gallery-fullwidth video {
  width: 100%;
  height: auto;
  display: block;
}

/* Works gallery — triptych (3-column grid) */
.works-gallery-triptych {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5em;
  margin: 0 auto 60px;
  max-width: 1200px;
}
.works-gallery-triptych .work-tile { margin: 0; }
@media (max-width: 560px) { .works-gallery-triptych { grid-template-columns: repeat(3, 1fr); } }

.work-tile {
  display: block;
  margin: 0 0 16px;
  break-inside: avoid;
  position: relative;
  background: var(--bg-soft);
  overflow: hidden;
}
.work-tile img, .work-tile video {
  width: 100%;
  display: block;
  height: auto;
}
.work-tile:hover img { opacity: 0.92; }
.work-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  padding: 3px 7px;
  letter-spacing: 0.1em;
}
.work-multi {
  position: absolute;
  top: 10px; right: 10px;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.work-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.work-tile:hover .work-caption { opacity: 1; }

/* ---------- Related projects ---------- */
.related {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding-top: 40px;
}
.related h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-align: center;
  margin: 0 0 28px;
}
.related-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 700px) { .related-row { grid-template-columns: repeat(2, 1fr); } }
.related-tile { display: block; font-size: 12px; }
.related-tile img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  background: var(--bg-soft);
  margin-bottom: 8px;
}
.related-period { color: var(--fg-soft); font-size: 11px; letter-spacing: 0.1em; }
.related-title { font-family: var(--serif); margin-top: 2px; }

/* ---------- Post detail ---------- */
.post { margin: 0 auto 40px; }
.post-media + .post-media { margin-top: 6px; }
.post-media img, .post-media video {
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  background: #000;
}
.post-meta {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.post-date {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
}
.post-caption {
  margin: 14px 0 0;
  font-size: 15px;
  line-height: 1.95;
  white-space: pre-wrap;
  font-family: var(--sans);
}
.post-tags {
  margin-top: 18px;
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  font-size: 12px;
}
.post-tags a {
  color: var(--fg-soft);
  border-bottom: 1px solid transparent;
}
.post-tags a:hover { color: var(--fg); border-color: var(--fg); }
.post-nav {
  display: flex; justify-content: space-between;
  margin: 40px 0 24px;
  font-size: 13px;
}

/* ---------- About ---------- */
.about {
  max-width: var(--max-text);
  margin: 56px auto;
  padding: 0 var(--gutter);
}
.about-portrait { text-align: center; margin-bottom: 32px; }
.about-portrait img { display: inline-block; width: 220px; height: 220px; object-fit: cover; border-radius: 50%; }
.about-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-align: center;
  margin: 16px 0 32px;
}
.about-message p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2.05;
  margin: 0 0 1.4em;
}
.about-section { margin-top: 44px; }
.about-section h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.22em;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
  margin: 0 0 14px;
}
.about-section ul { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 1.95; }

/* ---------- Tags ---------- */
.tags-index { max-width: 920px; margin: 40px auto; padding: 0 var(--gutter); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 24px 0; }
.tag-cloud a { padding: 6px 12px; border: 1px solid var(--line); font-size: 13px; display: inline-flex; gap: 6px; }
.tag-cloud a .n { color: var(--fg-soft); font-size: 11px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  padding: 30px var(--gutter) 60px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--fg-soft);
  text-align: center;
  letter-spacing: 0.06em;
}
.site-footer .sns { margin-bottom: 12px; }
.site-footer .sns a { margin: 0 10px; }

.muted { color: var(--fg-soft); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ---------- Project hero (fullwidth top of detail page) ---------- */
.project-hero {
  width: 100%;
  margin: 0 0 2rem 0;
  background: #000;
}
.project-hero-video,
.project-hero-img {
  width: 100%;
  height: auto;
  display: block;
}
.project-hero iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}
.project-statement {
  max-width: 42em;
  margin: 1.5em auto 2.5em;
  line-height: 1.85;
  font-size: 1.02em;
}
.project-statement p {
  margin: 0 0 1.2em 0;
}
.project-behind-link {
  display: inline-block;
  margin: 2em 0 1em;
  font-size: 0.95em;
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #ccc;
}
.project-behind-link:hover { color: #000; border-color: #000; }

/* ---------- Stage 6: mobile responsive + dividers + behind video ---------- */
.project-hero {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.project-hero-video,
.project-hero-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
.project-hero iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border: 0;
}
.container.project-detail {
  max-width: 100%;
  padding-left: clamp(0.6rem, 2vw, 1.5rem);
  padding-right: clamp(0.6rem, 2vw, 1.5rem);
}
.work-tile video {
  width: 100%;
  height: auto;
  max-width: 100%;
}
.behind-video {
  width: 100%;
  height: auto;
  max-width: 100%;
}
@media (max-width: 720px) {
  .project-hero,
  .project-hero-video,
  .project-hero-img,
  .project-hero iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
  }
}

.project-fullwidth-card {
  margin-bottom: 5em;
  padding-top: 1.5em;
  padding-bottom: 2em;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
@media (max-width: 720px) {
  .project-fullwidth-card {
    grid-template-columns: 1fr;
  }
}

.behind-video-hero {
  width: 100%;
  margin-bottom: 2em;
}
.behind-video-hero video {
  width: 100%;
  display: block;
}
.behind-video-title {
  margin: 0.6em 0 0;
  font-size: 0.95em;
  color: var(--fg-soft);
  text-align: center;
  letter-spacing: 0.04em;
}


/* ---------- Mobile video / hero overflow fix (Stage 7) ---------- */
.container.project-detail,
.container.project-behind {
  width: 100%;
  max-width: 100%;
  padding: 0 clamp(0.4rem, 2vw, 1.5rem);
  box-sizing: border-box;
  overflow-x: hidden;
}

.project-hero, .behind-video-hero, .project-hero-video, .project-hero-img,
video, iframe {
  max-width: 100% !important;
  width: 100% !important;
  height: auto;
  box-sizing: border-box;
  display: block;
}

.project-hero iframe { aspect-ratio: 16/9; }

/* ---------- Photos full-width 1 column for production projects (Stage 7) ---------- */
.project-detail .works-gallery:not(.works-gallery-triptych) {
  display: block;
}

.project-detail .works-gallery:not(.works-gallery-triptych) .work-tile img,
.project-detail .works-gallery:not(.works-gallery-triptych) .work-tile video {
  width: 100%;
  height: auto;
  display: block;
}

.project-detail .works-gallery:not(.works-gallery-triptych) .work-tile {
  width: 100%;
  margin-bottom: 1rem;
}

/* ===================== v4: 作品ごとレイアウト (per-work, w4- 接頭辞で衝突回避) ===================== */
.w4-list { margin: 0 auto 40px; max-width: var(--max); }
.w4-work { padding: 48px 0; border-bottom: 1px solid var(--line); }
.w4-work:last-child { border-bottom: 0; }
.w4-head { margin-bottom: 22px; }
.w4-name {
  font-family: var(--serif); font-weight: 400; font-size: 23px;
  letter-spacing: 0.04em; margin: 0; line-height: 1.4;
}
@media (max-width: 640px) { .w4-name { font-size: 19px; } }
.w4-stmt { font-family: var(--serif); font-size: 16px; line-height: 1.95; color: var(--fg); }
.w4-stmt p { margin: 0 0 1em; }
.w4-imgs figure, .w4-imgs-thin figure { margin: 0; }
.w4-imgs img, .w4-imgs-thin img { width: 100%; height: auto; display: block; background: var(--bg-soft); }

/* single image: statement | image side by side */
.w4-single .w4-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 44px; align-items: start; }
/* multiple images: statement on top, images spread below */
.w4-multi .w4-body { display: block; }
.w4-multi .w4-stmt { max-width: 42em; margin-bottom: 26px; }
/* default: 横3列（三連画を維持）。2枚は2列、4枚は2×2。 */
.w4-multi .w4-imgs { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.w4-multi .w4-imgs[data-n="2"] { grid-template-columns: repeat(2, 1fr); }
.w4-multi .w4-imgs[data-n="4"] { grid-template-columns: repeat(2, 1fr); }
/* works without a statement: lighter, image-forward */
.w4-thin .w4-name { font-size: 19px; }
.w4-imgs-thin { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

@media (max-width: 720px) {
  .w4-single .w4-body { grid-template-columns: 1fr; gap: 22px; }
  .w4-multi .w4-imgs { grid-template-columns: repeat(2, 1fr); }
}
