/**
 * BUKIYOU — Design System (Block 1 + Hero + STORY)
 * Image URLs for .buk-hero__bg are set via inline style from bukiyou-design.php
 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@300;400;500&display=swap');

/* ============================================================
   BUKIYOU — GLOBAL DESIGN SYSTEM (Block 1)
   ============================================================ */

:root {
  --font-serif: YuMincho, "Yu Mincho", "游明朝", "Noto Serif JP", "ヒラギノ明朝 ProN", serif;
  --color-ink: #1a1a1a;
  --color-mist: #f4f3f0;
  --color-axis: #c8c4bc;
  --color-border: rgba(0,0,0,0.08);
  --color-border-dark: rgba(255,255,255,0.12);
  --spacing-breath: clamp(80px, 12vw, 150px);
  --spacing-block: clamp(40px, 6vw, 80px);
}

.bukiyou-root,
.bukiyou-root * {
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

/* FILM GRAIN — SVG noise filter */
.bukiyou-grain::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  opacity: 1;
}

@keyframes buk-fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes buk-fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   HERO — DARK CINEMATIC (Block 2)
   background-image is set inline from PHP (get_template_directory_uri)
   ============================================================ */

.buk-hero {
  position: relative;
  width: 100%;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.buk-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.04);
  z-index: 0;
}

.buk-hero__glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(
      ellipse 70% 50% at 30% 60%,
      rgba(80, 160, 200, 0.18) 0%,
      transparent 70%
    ),
    radial-gradient(
      ellipse 50% 40% at 70% 40%,
      rgba(120, 80, 200, 0.10) 0%,
      transparent 65%
    );
  mix-blend-mode: screen;
}

.buk-hero__vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(
      ellipse 100% 100% at 50% 50%,
      transparent 30%,
      rgba(0, 0, 0, 0.55) 100%
    ),
    linear-gradient(
      to bottom,
      rgba(0,0,0,0.30) 0%,
      rgba(0,0,0,0.10) 40%,
      rgba(0,0,0,0.50) 100%
    );
}

.buk-hero__content {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 0 24px;
  max-width: 700px;
}

.buk-hero__eyebrow {
  font-family: var(--font-serif);
  font-size: clamp(10px, 1.2vw, 13px);
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0 0 32px;
  animation: buk-fadeIn 1.8s ease 0.3s both;
}

.buk-hero__headline {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5.5vw, 68px);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.18em;
  color: #ffffff;
  margin: 0 0 28px;
  text-shadow:
    0 1px 40px rgba(0,0,0,0.5),
    0 0 80px rgba(0,0,0,0.3);
  animation: buk-fadeUp 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.buk-hero__sub {
  font-family: var(--font-serif);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 300;
  letter-spacing: 0.28em;
  color: rgba(255,255,255,0.40);
  margin: 0;
  animation: buk-fadeIn 2s ease 1.4s both;
}

.buk-hero__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: buk-fadeIn 2s ease 2s both;
}

.buk-hero__scroll-line {
  display: block;
  width: 0.5px;
  height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  animation: buk-fadeIn 1s ease infinite alternate;
}

.buk-hero__scroll-label {
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

@media (max-width: 767px) {
  .buk-hero__bg {
    background-position: center center;
    transform: none;
  }
  .buk-hero__glow {
    background:
      radial-gradient(
        ellipse 120% 60% at 50% 70%,
        rgba(60, 120, 180, 0.15) 0%,
        transparent 70%
      );
    mix-blend-mode: screen;
  }
  .buk-hero__headline {
    letter-spacing: 0.12em;
    line-height: 1.9;
  }
  .buk-hero__scroll {
    bottom: 24px;
  }
}

/* ============================================================
   STORY — EDITORIAL TIMELINE (Block 3)
   ============================================================ */

.buk-story {
  position: relative;
  background-color: var(--color-mist, #f4f3f0);
  padding: clamp(80px, 10vw, 140px) clamp(20px, 5vw, 60px);
  overflow: hidden;
}

.buk-story__header {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: center;
  margin-bottom: clamp(80px, 10vw, 140px);
}

.buk-story__header-rule {
  flex: 1;
  max-width: 120px;
  height: 0.5px;
  background: var(--color-axis, #c8c4bc);
  margin: 0;
}

.buk-story__title {
  font-family: var(--font-serif);
  font-size: clamp(11px, 1.3vw, 14px);
  font-weight: 400;
  letter-spacing: 0.40em;
  color: #7a7570;
  margin: 0;
  text-transform: uppercase;
}

.buk-story__axis {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5px;
  height: 100%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--color-axis, #c8c4bc) 8%,
    var(--color-axis, #c8c4bc) 92%,
    transparent 100%
  );
  z-index: 0;
  pointer-events: none;
}

.buk-story__item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(40px, 6vw, 80px);
  align-items: center;
  max-width: 1200px;
  margin: 0 auto var(--spacing-breath, 150px);
}

.buk-story__item:last-of-type {
  margin-bottom: 0;
}

.buk-story__media-wrap {
  grid-column: 1;
  grid-row: 1;
  padding-right: clamp(20px, 4vw, 48px);
}

.buk-story__text-wrap {
  grid-column: 2;
  grid-row: 1;
  padding-left: clamp(20px, 4vw, 48px);
}

.buk-story__item--flip .buk-story__media-wrap {
  grid-column: 2;
  grid-row: 1;
  padding-right: 0;
  padding-left: clamp(20px, 4vw, 48px);
}

.buk-story__item--flip .buk-story__text-wrap {
  grid-column: 1;
  grid-row: 1;
  padding-left: 0;
  padding-right: clamp(20px, 4vw, 48px);
  text-align: right;
}

.buk-story__item--flip .buk-story__index-block {
  flex-direction: row-reverse;
}

.buk-story__item--flip .buk-story__body {
  text-align: right;
}

.buk-story__figure {
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.buk-story__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-repeat: repeat;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 2;
}

.buk-story__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 0.5px solid rgba(0,0,0,0.12);
  filter: contrast(1.04) brightness(0.97);
  transition: filter 0.6s ease;
}

.buk-story__img:hover {
  filter: contrast(1.0) brightness(1.0);
}

.buk-story__index-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 28px;
}

.buk-story__index-label {
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: 0.38em;
  color: #9a9590;
  margin-top: 4px;
}

.buk-story__index-num {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 300;
  line-height: 1;
  color: var(--color-ink, #1a1a1a);
  letter-spacing: 0.04em;
}

.buk-story__index-line {
  flex: 1;
  height: 0.5px;
  background: var(--color-axis, #c8c4bc);
  align-self: center;
  max-width: 60px;
}

.buk-story__heading {
  font-family: var(--font-serif);
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 400;
  letter-spacing: 0.22em;
  line-height: 1.9;
  color: var(--color-ink, #1a1a1a);
  margin: 0 0 32px;
  text-transform: uppercase;
}

.buk-story__heading-ja {
  display: block;
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 300;
  letter-spacing: 0.20em;
  color: #7a7570;
  margin-top: 6px;
  text-transform: none;
}

.buk-story__body {
  font-family: var(--font-serif);
}

.buk-story__body p {
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: 300;
  line-height: 2.2;
  letter-spacing: 0.06em;
  color: #4a4744;
  margin: 0 0 1.8em;
}

.buk-story__body p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .buk-story__item,
  .buk-story__item--flip {
    grid-template-columns: 1fr;
    gap: 32px 0;
    margin-bottom: clamp(64px, 16vw, 100px);
  }
  .buk-story__media-wrap,
  .buk-story__item--flip .buk-story__media-wrap {
    grid-column: 1;
    grid-row: 1;
    padding: 0;
  }
  .buk-story__text-wrap,
  .buk-story__item--flip .buk-story__text-wrap {
    grid-column: 1;
    grid-row: 2;
    padding: 0;
    text-align: left;
  }
  .buk-story__item--flip .buk-story__index-block {
    flex-direction: row;
  }
  .buk-story__item--flip .buk-story__body {
    text-align: left;
  }
  .buk-story__axis {
    display: none;
  }
  .buk-story__img {
    aspect-ratio: 4 / 3;
  }
  .buk-story__figure::after {
    background-size: 100px 100px;
    opacity: 0.7;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .buk-story__item {
    gap: 0 clamp(24px, 4vw, 48px);
  }
  .buk-story__img {
    aspect-ratio: 1 / 1;
  }
}
