/*
Theme Name: Shisui Artist Theme
Description: アーティストポートフォリオ用テーマ（ブロックエディタ用オリジナルセクションブロック対応）
Version: 1.9.1
Author: 美術紫水
Text Domain: shisui-artist
*/

:root {
  --paper: #FAFAF7;
  --paper-deep: #F1EEE6;
  --paper-deep2: #E9E5DA;
  --ink: #17160F;
  --ink-soft: #4A4840;
  --ink-faint: #9c9890;
  --line: #DEDACF;
  --accent: #9C3B2E;
  --header-bg: #FAFAF7;
  --footer-bg: #F1EEE6;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  font-weight: 300;
  line-height: 1.9;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

.serif { font-family: 'Shippori Mincho', serif; }
a { color: inherit; text-decoration: none; }

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding-top: calc(18px + var(--safe-top));
  padding-right: calc(36px + var(--safe-right));
  padding-bottom: 18px;
  padding-left: calc(36px + var(--safe-left));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--header-bg);
  border-bottom: none;
  transition: background 0.4s ease, border-color 0.4s ease;
}
.site-header.is-transparent {
  background: rgba(0,0,0,0);
  border-bottom-color: transparent;
}
.site-logo { font-size: 15px; letter-spacing: 0.16em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-logo .custom-logo-link { display: block; flex-shrink: 0; }
.site-logo img,
.site-logo .custom-logo {
  display: block;
  width: auto;
  max-width: 140px;
  height: 32px;
  object-fit: contain;
  object-position: left center;
}
.site-logo .site-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .site-logo img,
  .site-logo .custom-logo { max-width: 88px; height: 26px; }
}
.site-nav { display: flex; gap: 34px; font-size: 12px; letter-spacing: 0.14em; line-height: 1; }
@media (min-width: 641px) {
  .site-nav { font-size: 14px; gap: 38px; }
}
.site-nav a { position: relative; padding-bottom: 3px; }
.site-nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0%; height: 1px; background: var(--accent);
  transition: width 0.35s ease;
}
.site-nav a:hover::after { width: 100%; }
@media (max-width: 640px) {
  .site-nav {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 26px;
    padding: 0 calc(40px + var(--safe-right)) 0 calc(40px + var(--safe-left));
    font-size: 20px;
    z-index: 99;
  }
  body.shisui-nav-open .site-nav { display: flex; }
}

.site-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 101;
  position: relative;
}
.site-nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
body.shisui-nav-open .site-nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.shisui-nav-open .site-nav-toggle span:nth-child(2) { opacity: 0; }
body.shisui-nav-open .site-nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 640px) {
  .site-nav-toggle { display: flex; }
}

/* ===== Hero block ===== */
.shisui-hero { position: relative; width: 100%; height: 100svh; overflow: hidden; }
.shisui-hero-track {
  display: flex; width: 100%; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.shisui-hero-track::-webkit-scrollbar { display: none; }
.shisui-hero-slide {
  min-width: 100%; height: 100%;
  scroll-snap-align: start;
  background: var(--paper-deep);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.shisui-hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.shisui-hero-slide-index {
  position: absolute; bottom: calc(28px + var(--safe-bottom)); left: calc(36px + var(--safe-left));
  font-size: 11px; letter-spacing: 0.12em; color: var(--ink-faint);
  background: rgba(250,250,247,0.7); padding: 3px 8px;
}
.shisui-hero-dots {
  position: absolute; bottom: calc(28px + var(--safe-bottom)); right: calc(36px + var(--safe-right));
  display: flex; gap: 8px; z-index: 5;
}
.shisui-hero-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint); opacity: 0.5; cursor: pointer;
  transition: opacity 0.3s ease, background 0.3s ease;
  border: none; padding: 0;
}
.shisui-hero-dot.is-active { background: var(--accent); opacity: 1; }
.shisui-hero-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--ink-faint); font-size: 13px;
}

/* ===== Section shell ===== */
.shisui-section-head {
  padding: 100px calc(36px + var(--safe-right)) 50px calc(36px + var(--safe-left));
  border-top: 0.5px solid var(--line);
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.shisui-section-label { font-size: 12px; letter-spacing: 0.24em; color: var(--ink-soft); }
.shisui-section-link { font-size: 12px; letter-spacing: 0.08em; position: relative; padding-bottom: 3px; }
.shisui-section-link::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 0%; height: 1px; background: var(--accent);
  transition: width 0.35s ease;
}
.shisui-section-link:hover::after { width: 100%; }

/* ===== Works pickup block / works list ===== */
.shisui-work {
  display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center;
  gap: 6vw; padding: 90px calc(36px + var(--safe-right)) 90px calc(36px + var(--safe-left));
  border-top: 0.5px solid var(--line);
}
.shisui-work:nth-child(even) { grid-template-columns: 0.85fr 1.15fr; }
.shisui-work:nth-child(even) .shisui-work-visual { order: 2; }
.shisui-work:nth-child(even) .shisui-work-text { order: 1; }
@media (max-width: 860px) {
  .shisui-work, .shisui-work:nth-child(even) {
    grid-template-columns: 1fr; gap: 30px;
    padding: 60px calc(24px + var(--safe-right)) 60px calc(24px + var(--safe-left));
  }
  .shisui-work:nth-child(even) .shisui-work-visual, .shisui-work:nth-child(even) .shisui-work-text { order: initial; }
}
.shisui-work-visual {
  aspect-ratio: 4 / 5; background: var(--paper-deep); position: relative;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.shisui-work-visual img { width: 100%; height: 100%; object-fit: cover; }
.shisui-work-visual .frame-note { position: absolute; bottom: 14px; left: 14px; font-size: 10px; letter-spacing: 0.1em; color: var(--ink-faint); }
.shisui-work-index { font-size: 12px; color: var(--ink-faint); letter-spacing: 0.1em; margin-bottom: 18px; }
.shisui-work-title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 400; margin-bottom: 6px; }
.shisui-work-meta { font-size: 12px; letter-spacing: 0.05em; margin-bottom: 22px; color: var(--ink-soft); }
.shisui-work-line { width: 0%; height: 1px; background: var(--accent); margin-bottom: 24px; transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1); }
.shisui-work.in-view .shisui-work-line { width: 64px; }
.shisui-work-desc { font-size: 14px; max-width: 420px; }

/* ===== Works archive grid ===== */
.shisui-works-filter {
  padding: 0 calc(36px + var(--safe-right)) 40px calc(36px + var(--safe-left));
  display: flex; gap: 28px; flex-wrap: wrap; font-size: 12px; letter-spacing: 0.08em;
}
.shisui-works-filter-group { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.shisui-works-filter-label { color: var(--ink-faint); }
.shisui-works-filter a { position: relative; padding-bottom: 2px; color: var(--ink-soft); }
.shisui-works-filter a.is-active { color: var(--ink); }
.shisui-works-filter a.is-active::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--accent);
}
.shisui-works-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px; background: var(--line);
  border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line);
}
.shisui-works-grid-item { background: var(--paper); padding: 28px; }
.shisui-works-grid-visual { aspect-ratio: 4/5; background: var(--paper-deep); overflow: hidden; margin-bottom: 16px; }
.shisui-works-grid-visual img { width: 100%; height: 100%; object-fit: cover; }
.shisui-works-grid-title { font-size: 15px; margin-bottom: 4px; }
.shisui-works-grid-meta { font-size: 11px; color: var(--ink-faint); }
.shisui-works-empty { padding: 60px calc(36px + var(--safe-right)) 100px calc(36px + var(--safe-left)); color: var(--ink-faint); font-size: 13px; }

/* ===== Single work ===== */
.shisui-single-work { padding: calc(120px + var(--safe-top)) calc(36px + var(--safe-right)) 100px calc(36px + var(--safe-left)); }
.shisui-single-work-visual { background: var(--paper-deep); margin-bottom: 40px; overflow: hidden; }
.shisui-single-work-visual img { width: 100%; height: auto; display: block; }
.shisui-single-work-title { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: 10px; }
.shisui-single-work-meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 30px; }
.shisui-single-work-desc { font-size: 15px; max-width: 640px; }
.shisui-single-work-back { display: inline-block; margin-top: 50px; font-size: 12px; letter-spacing: 0.08em; }

/* ===== Profile block ===== */
.shisui-about {
  padding: 60px calc(36px + var(--safe-right)) 120px calc(36px + var(--safe-left));
  display: grid; grid-template-columns: 1fr 1fr; gap: 8vw;
  border-top: 0.5px solid var(--line);
}
@media (max-width: 860px) {
  .shisui-about { grid-template-columns: 1fr; gap: 40px; padding: 50px calc(24px + var(--safe-right)) 80px calc(24px + var(--safe-left)); }
}
.shisui-about-statement { font-size: 16px; }
.shisui-about-facts { font-size: 13px; }
.shisui-about-facts dt { letter-spacing: 0.12em; font-size: 11px; color: var(--ink-soft); margin-top: 24px; }
.shisui-about-facts dt:first-child { margin-top: 0; }
.shisui-about-facts dd { margin-top: 6px; white-space: pre-line; }

/* ===== News block ===== */
.shisui-news-list { border-top: 0.5px solid var(--line); }
.shisui-news-item {
  display: grid; grid-template-columns: 140px 1fr auto;
  align-items: baseline; gap: 24px;
  padding: 28px 0;
  border-bottom: 0.5px solid var(--line);
  transition: background 0.3s ease;
}
.shisui-news-item:hover { background: var(--paper-deep); }
@media (max-width: 640px) {
  .shisui-news-item { grid-template-columns: 1fr; gap: 6px; padding: 22px 0; }
}
.shisui-news-date { font-size: 12px; letter-spacing: 0.06em; color: var(--ink-faint); }
.shisui-news-tag {
  font-size: 11px; letter-spacing: 0.08em; color: var(--ink-soft);
  border: 0.5px solid var(--line); border-radius: 2px;
  padding: 3px 9px; justify-self: end; white-space: nowrap;
}
@media (max-width: 640px) { .shisui-news-tag { justify-self: start; } }
.shisui-news-title { font-size: 15px; }

/* ===== Contact block ===== */
.shisui-contact {
  padding: 70px calc(36px + var(--safe-right)) calc(50px + var(--safe-bottom)) calc(36px + var(--safe-left));
  border-top: 0.5px solid var(--line);
  background: var(--footer-bg);
}
.shisui-contact-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 24px; font-size: 12px; letter-spacing: 0.06em;
}
.shisui-contact-links { display: flex; gap: 26px; }
.shisui-contact-links a { position: relative; }
.shisui-contact-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px;
  width: 0%; height: 1px; background: var(--accent);
  transition: width 0.35s ease;
}
.shisui-contact-links a:hover::after { width: 100%; }

/* ===== Simple page ===== */
.shisui-page-content {
  padding: calc(120px + var(--safe-top)) calc(36px + var(--safe-right)) 100px calc(36px + var(--safe-left));
  max-width: 760px;
  margin: 0 auto;
}
.shisui-page-content h1 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 30px; font-weight: 400; }

/* ===== Footer (site-wide bottom credit) ===== */
.site-footer-credit {
  padding: 18px calc(36px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(36px + var(--safe-left));
  background: var(--footer-bg);
  font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em;
}
.site-footer-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px;
}
.site-footer-nav { display: flex; gap: 20px; }
.site-footer-nav a { color: var(--ink-faint); }
.site-footer-nav a:hover { color: var(--ink); }

/* ===== 強制的な余白確保(モバイル、他要因での上書き対策) ===== */
@media (max-width: 640px) {
  .shisui-page-content,
  .shisui-section-head,
  .shisui-work,
  .shisui-about,
  .shisui-news-item,
  .shisui-contact,
  .shisui-single-work,
  .site-header,
  .site-footer-credit {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
}

/* ===== 固定ページ本文では「全幅」ブロックを無効化(通常ページの左右余白を保つ) ===== */
.shisui-page-content .alignfull,
.shisui-page-content .alignwide {
  width: auto !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* ===== トップページ：通常ブロック用の基本余白＋専用セクションブロックは全幅に打ち消し ===== */
.shisui-front-content {
  padding-left: calc(24px + var(--safe-left));
  padding-right: calc(24px + var(--safe-right));
  padding-top: calc(90px + var(--safe-top));
}
@media (min-width: 641px) {
  .shisui-front-content {
    padding-left: calc(36px + var(--safe-left));
    padding-right: calc(36px + var(--safe-right));
  }
}
.shisui-front-content > [class*="wp-block-shisui-"] {
  margin-left: calc(-1 * (24px + var(--safe-left))) !important;
  margin-right: calc(-1 * (24px + var(--safe-right))) !important;
  width: auto !important;
  max-width: none !important;
}
@media (min-width: 641px) {
  .shisui-front-content > [class*="wp-block-shisui-"] {
    margin-left: calc(-1 * (36px + var(--safe-left))) !important;
    margin-right: calc(-1 * (36px + var(--safe-right))) !important;
  }
}
.shisui-front-content > [class*="wp-block-shisui-"]:first-child {
  margin-top: calc(-1 * (90px + var(--safe-top))) !important;
}

/* ===== ボタン群ブロック ===== */
.shisui-buttons-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 60px calc(36px + var(--safe-right)) 90px calc(36px + var(--safe-left));
  border-top: 0.5px solid var(--line);
}
.shisui-buttons-wrap.shisui-buttons-no-heading { border-top: 0.5px solid var(--line); }
.shisui-buttons-align-center { justify-content: center; }
.shisui-buttons-align-right { justify-content: flex-end; }
.shisui-buttons-align-between { justify-content: space-between; }

.shisui-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  border: 1px solid var(--btn-color, var(--ink));
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--btn-color, var(--ink));
  overflow: hidden;
  isolation: isolate;
  transition: color 0.4s ease, border-color 0.4s ease;
}
.shisui-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--btn-color, var(--ink));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: -1;
}
.shisui-button:hover {
  color: var(--paper);
  border-color: var(--btn-color, var(--ink));
}
.shisui-button:hover::before { transform: scaleX(1); }
.shisui-button-arrow {
  display: inline-block;
  transition: transform 0.35s ease;
}
.shisui-button:hover .shisui-button-arrow { transform: translateX(5px); }

/* ===== 投稿一覧グリッド(サムネメイン) ===== */
.shisui-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 0.5px solid var(--line);
  border-bottom: 0.5px solid var(--line);
}
.shisui-posts-grid-item {
  background: var(--paper);
  display: block;
}
.shisui-posts-grid-visual {
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
  overflow: hidden;
}
.shisui-posts-grid-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.shisui-posts-grid-item:hover .shisui-posts-grid-visual img { transform: scale(1.04); }
.shisui-posts-grid-noimage { width: 100%; height: 100%; }
.shisui-posts-grid-body { padding: 20px; }
.shisui-posts-grid-title { font-size: 16px; margin-bottom: 8px; line-height: 1.5; }
.shisui-posts-grid-meta { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }

/* ===== お知らせブロック: サムネメイン(グリッド)レイアウト ===== */
.shisui-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 0.5px solid var(--line);
  border-bottom: 0.5px solid var(--line);
}
.shisui-news-grid-item { background: var(--paper); display: block; }
.shisui-news-grid-visual { aspect-ratio: 4 / 3; background: var(--paper-deep); overflow: hidden; }
.shisui-news-grid-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.shisui-news-grid-item:hover .shisui-news-grid-visual img { transform: scale(1.04); }
.shisui-news-grid-body { padding: 20px; }
.shisui-news-grid-title { font-size: 15px; margin-bottom: 8px; line-height: 1.5; }
.shisui-news-grid-meta { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.06em; }

/* ===== お知らせブロックの左右余白を再確保(念のため強め指定) ===== */
.shisui-news-list,
.shisui-news-grid {
  margin-left: calc(36px + var(--safe-left)) !important;
  margin-right: calc(36px + var(--safe-right)) !important;
  width: auto !important;
}
@media (max-width: 640px) {
  .shisui-news-list,
  .shisui-news-grid {
    margin-left: calc(24px + var(--safe-left)) !important;
    margin-right: calc(24px + var(--safe-right)) !important;
  }
}
