/* =========================================================
   Jugo / fifteen theme — main.css (full revised)
   ========================================================= */

/* ========== Variables ========== */
:root{
  --container: 1120px;
  --maxw: 1080px;
  --gap: 24px;
  --text: #222;
  --muted:#777;
  --nav-h: 64px;
}

/* ========== Reset / Base ========== */
*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: "Avenir", Arial, sans-serif;
  color: var(--text);
  background:#fff;
  padding-top: calc(var(--nav-h) + 16px);
}
img{ max-width:100%; height:auto; display:block; }
a{ color:inherit; text-decoration:none; }

/* ========== Layout ========== */
.site-main{
  width: min(var(--maxw), 100% - var(--gap) * 2);
  margin-left:auto; margin-right:auto;
  padding: 40px var(--gap) 80px;
  padding-left: 0;
  padding-right: 0;
}

/* ========== Header / Nav ========== */
.site-header .nav{
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  background: transparent;
  box-shadow: none;
}
.site-header .nav .nav-inner{
  height: 100%;
  width: min(var(--maxw), 100% - var(--gap) * 2);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 48px;
  padding: 0 8px;
}

/* Brand */
.brand a{
  font-weight: 700;
  text-decoration: none;
  color:#000;
  font-size: clamp(20px, 2.4vw, 24px);
}

/* WP Menu (PC表示) */
.menu ul{
  list-style:none; margin:0; padding:0;
  display:flex; gap:28px; align-items:center;
}
.menu a{
  text-decoration:none; color:#333;
  display:block; padding:6px 0;
}

/* SNS（右側） */
.sns .social-links{ display:flex; gap:18px; align-items:center; }
.sns .social-links a{ color:#000; }
.sns .social-links i{ font-size:22px; }

/* トップ以外／スクロール後は白＋ブラー */
body.scrolled .site-header .nav,
body:not(.front-page):not(.home) .site-header .nav{
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
/* トップ最上部は透明 */
body.front-page:not(.scrolled) .site-header .nav,
body.home:not(.scrolled) .site-header .nav{
  background: transparent;
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}

/* ========== Hero (front only) ========== */
.hero{
  position: relative;
  width: 100%;
  margin: 0;
  height: 70vh;
  min-height: 300px;
  overflow: hidden;
}
.hero-bg{
  position:absolute;
  inset:0;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  z-index:0;
}
body.front-page, body.home{ padding-top:0 !important; }

/* ========== Grid (front) ========== */
.works-grid .grid{
  display:grid; gap: var(--gap);
  grid-template-columns: repeat(3, 1fr);
}
.tile{
  position:relative; display:block; color:inherit; text-decoration:none;
  overflow:hidden; border-radius:10px;
}
.tile-media{
  aspect-ratio:4/3;
  background:#f4f4f4 center/cover no-repeat;
  transition:transform .6s cubic-bezier(.22,.61,.36,1);
}
.tile:hover .tile-media{ transform: scale(1.03); }
.tile-label{
  position:absolute; left:12px; bottom:10px;
  padding:6px 10px; border-radius:999px; font-size:14px;
  backdrop-filter: blur(5px);
  background: rgba(255,255,255,.55);
}

/* ========== Single Work ========== */
.work-article{ width:min(1080px, 100% - 48px); margin: 24px auto 96px; }
/* 共通（個別ページ以外） */
body:not(.single-work) .work-hero{
  max-width: var(--container);
  margin: 0 auto var(--gap);
}
body:not(.single-work) .work-hero img{
  width:100%;
  height:auto;
  border-radius:14px;
}
.work-header{ margin-top:16px; }
.work-title{ font-size: clamp(28px, 3.2vw, 40px); margin:0 0 8px; }
.work-excerpt{ color:#666; }

/* ========== Reveal animation (static表示に変更) ========== */
[data-reveal]{
  opacity:1 !important;
  transform:none !important;
  transition:none !important;
}

/* ========== Hamburger Button (3 bars) ========== */
.nav-toggle{
  display:none;
  justify-content:center; align-items:center; flex-direction:column;
  width:44px; height:44px; border:0; background:transparent; padding:0; cursor:pointer;
  -webkit-tap-highlight-color: transparent;
  gap:6px;
}
.nav-toggle .bar{
  display:block;
  width:24px; height:2px;
  background:#000;
  border-radius:2px;
  transition:transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1){ transform:translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2){ opacity:0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3){ transform:translateY(-8px) rotate(-45deg); }

/* ========== Mobile Nav (Overlay) ========== */
#primary-menu{}

/* SNS (mobile overlay) */
.mobile-sns{ display:none; }
.mobile-sns a{ color:#000; }
.mobile-sns i{ font-size:24px; }

/* ========== Responsive ========== */
@media (max-width: 1024px){
  .works-grid .grid{ grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 820px){
  .hero{ height:36vh; }

  .nav-toggle{ display:flex; }
  .sns{ display:none; }

  #primary-menu{
    position: fixed;
    top: var(--nav-h);
    left:0; right:0;
    height: calc(100dvh - var(--nav-h));
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow:auto;
    padding: 0 var(--gap) 24px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    z-index: 999;
  }
  #primary-menu.is-open{
    transform:none;
    opacity:1;
    pointer-events:auto;
  }

  #primary-menu ul{
    margin:0; padding:0; list-style:none;
    display:flex; flex-direction:column;
  }
  #primary-menu li{
    margin:0; border-bottom:1px solid rgba(0,0,0,0.06);
  }
  #primary-menu a{
    display:block;
    padding:22px 0;
    font-size:20px;
    color:#000;
  }

  .mobile-sns{
    display:flex;
    gap:20px;
    padding: 20px 0 10px;
    justify-content:center;
  }
}
@media (min-width: 821px){
  .sns{ display:block; }
  .mobile-sns{ display:none; }
}
body.menu-open{ overflow:hidden; touch-action:none; }

/* =============================
   修正: スマホは必ず1列に戻す
============================= */
@media (max-width: 768px){
  .works-grid .grid {
    grid-template-columns: 1fr !important;
    gap: var(--gap);
  }
}

/* PC時のメニュー配置 */
@media (min-width: 821px){
  .menu { flex: 0 1 auto; }
  .sns { margin-left: auto; }
}

/* PC配置 / SP配置 */
@media (min-width: 821px){
  .site-header .nav .nav-inner{ justify-content: flex-start; }
  .menu { flex: 0 1 auto; }
  .sns { margin-left: auto; }
}
@media (max-width: 820px){
  .site-header .nav .nav-inner{ justify-content: space-between; }
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 0;
  font-size: 14px;
  color: #555;
}

/* =============================
   Work (single-work) — full-bleed & tidy
============================= */
/* 個別ページ以外は従来どおり */
body:not(.single-work) .work-hero{
  max-width: var(--container);
  margin: 0 auto var(--gap);
}
body:not(.single-work) .work-hero img{
  width:100%; height:auto; border-radius:14px;
}

/* 個別ページ（共通）：ヒーロー全幅 */
.single-work .work-hero{
  display:block; margin:0; padding:0; border:0;
  width:100vw !important; max-width:100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  border-radius:0 !important;
}
.single-work .work-hero img{
  display:block; width:100% !important; height:auto !important; border-radius:0 !important;
}

/* 個別ページ（スマホ）：本文画像フルブリード／テキスト幅 */
@media (max-width: 820px){
  .single-work .site-main{ width:100%; padding-left:0; padding-right:0; }
  .single-work .work-article{ width:100%; margin:0; padding:0; }

  .single-work .work-header,
  .single-work .work-content{
    width: min(var(--maxw), 100% - var(--gap) * 2);
    margin-left:auto; margin-right:auto; padding:0;
  }

  .single-work .work-content figure.wp-block-image,
  .single-work .work-content .wp-block-gallery{
    margin-left:  calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    width: 100vw !important; max-width: 100vw !important;
  }
  .single-work .work-content figure.wp-block-image img,
  .single-work .work-content .wp-block-gallery img{
    display:block; width:100% !important; height:auto; border-radius:0;
  }
}

/* 常にフルブリードのための補助（親の左右パディングを殺す） */
.single-work .site-main{
  padding-left: 0 !important; padding-right: 0 !important; overflow: visible !important;
}
.single-work .work-article{
  width: 100% !important; margin: 24px 0 96px !important; padding: 0 !important;
}
.single-work .work-hero{
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  position: relative !important; left: 50% !important; transform: translateX(-50%) !important;
  width: 100vw !important; max-width: 100vw !important; border-radius: 0 !important;
}
.single-work .work-hero img{
  display: block !important; width: 100% !important; height: auto !important; border-radius: 0 !important;
}

/* =============================
   Mobile stack spacing（追加）
   - single-work のスマホ時に、ブロック縦並びへ一定の行間を付与
   - 画像のフルブリードは維持（左右の calc() はそのまま）
============================= */
@media (max-width: 820px){
  /* 縦間隔の基本値（必要なら 16 / 20 / 24 に調整） */
  .single-work .work-content{ --block-gap: 12px; }

  /* まず UA の余白を打ち消してから、連続要素の先頭以外にだけギャップを足す */
  .single-work .work-content > *{ margin-top: 0; margin-bottom: 0; }
  .single-work .work-content > * + *{ margin-top: var(--block-gap); }

  /* ギャラリー内部の画像が詰まりすぎないように */
  .single-work .work-content .wp-block-gallery{ row-gap: var(--block-gap); }
  .single-work .work-content .wp-block-gallery .wp-block-image{ margin: 0; }
  /* フルブリード figure も上下には gap を適用（左右の calc は上の指定が優先） */
  .single-work .work-content figure.wp-block-image{ margin-top: var(--block-gap); margin-bottom: var(--block-gap); }
}

/* ------------------------------
   枠なし・線なしのシンプル表
   Gutenberg のテーブルブロック対応
------------------------------ */

/* ① テーブル全体 */
.entry-content .wp-block-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0;
  margin: 1.5rem 0;
}

/* ② セル（th, td） */
.entry-content .wp-block-table table th,
.entry-content .wp-block-table table td {
  border: none !important;         /* Gutenberg の枠線を完全上書き */
  padding: 0.4rem 0.8rem 0.4rem 0; /* 横方向の余白を少し追加 */
  text-align: left;
  vertical-align: top;
  background: none !important;     /* グレー背景も強制オフ */
}

/* ③ 行と行の間にうっすら余白（2段に見せる） */
.entry-content .wp-block-table table tr + tr td {
  padding-top: 0.8rem;
}

