/* Art Space 2015 HOME v0.87
   HOME固有の見た目だけを分離。共通site.cssは変更しない。 */

.page-home {
  --home-gap: 24px;
  background: #fff;
}

.home-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 1000 / 416;
  overflow: hidden;
  background: #fff;
}

.home-hero-link {
  position: absolute;
  inset: 0;
  display: block;
}

.home-hero-image,
.home-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.home-hero-image { z-index: 1; }

.home-hero-video {
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}

.home-hero.is-video-playing .home-hero-video { opacity: 1; }

.home-site-body { padding-top: var(--home-gap); }

.home-main { padding-left: var(--home-gap); }

/* ----------------------------------------------------------------------
   PC HOME：MENUは完成済みナビをそのまま使い、TOPICS / Xだけを
   同じ軽い情報パネルとして扱う。外枠は1px、塗り見出し帯は作らない。
   高さはhome.jsが左MENUの実測値を --home-panel-height に入れる。
   ---------------------------------------------------------------------- */
.home-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: var(--home-gap);
  align-items: stretch;
}

.home-info-panel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(116, 193, 208, .48);
  border-radius: 3px;
  background: #fff;
}

/*
   タイトル行はパネル幅いっぱいの白ベタで固定。
   スクロール内容はこの行の下から始まるため、タイトル裏へ入り込まない。
*/
.home-panel-title {
  position: relative;
  z-index: 5;
  margin: 0;
  width: 100%;
  height: 39px;
  box-sizing: border-box;
  padding: 8px 17px 5px;
  background: #fff;
  color: var(--nav-text);
  font-family: "Kiwi Maru", "Zen Kaku Gothic New", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: .08em;
}

/* 小さな一点だけテーマ色を置き、箱自体は軽く見せる。 */
.home-panel-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  margin: 0 9px -2px 0;
  border-radius: 2px;
  background: var(--nav-cyan);
}

.home-info-panel {
  display: grid;
  grid-template-rows: 39px minmax(0, 1fr);
}

.home-panel-content {
  width: 100%;
  height: auto;
  min-height: 0;
  padding-top: 0;
}

/*
   TOPICS / X 共通のスクロール領域。
   スクロールバー自体は見せず、上下のフェードと矢印で続きを示す。
*/
.home-scroll-viewport {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.home-scroll-viewport::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/*
   現在のTOPICSは旧WordPressを一時表示しているため、iframe自体を縦長にして
   HOME側のスクロール領域で見せる。後で自作TOPICSへ置換する前提の暫定値。
*/
.home-topics-frame {
  display: block;
  width: calc(100% + 20px);
  height: 2200px;
  margin-right: -20px;
  border: 0;
  background: #fff;
}

/*
   Xは data-tweet-limit="20" で静的に複数投稿を展開し、
   HOME側のスクロール領域でスクロール位置を管理する。
*/
.home-x-frame {
  position: relative;
}

.home-x-frame .twitter-timeline,
.home-x-frame iframe {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
}

/* 上下のフェード。初期状態では上側のみ非表示。 */
.home-scroll-fade {
  position: absolute;
  z-index: 3;
  left: 1px;
  right: 1px;
  height: 36px;
  pointer-events: none;
  opacity: 1;
  transition: opacity .16s ease;
}

.home-scroll-fade-top {
  top: 39px;
  background: linear-gradient(
    to bottom,
    rgba(216, 238, 243, .92) 0%,
    rgba(222, 241, 245, .56) 33%,
    rgba(231, 245, 248, .18) 76%,
    rgba(231, 245, 248, 0) 100%
  );
  opacity: 0;
}

.home-scroll-fade-bottom {
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(231, 245, 248, 0) 0%,
    rgba(231, 245, 248, .18) 24%,
    rgba(222, 241, 245, .56) 67%,
    rgba(216, 238, 243, .92) 100%
  );
}

.home-scroll-cue {
  position: absolute;
  z-index: 4;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  color: var(--nav-cyan);
  font-family: sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  opacity: .92;
  transition: opacity .16s ease;
}

.home-scroll-cue-top {
  top: 46px;
  opacity: 0;
}

.home-scroll-cue-bottom {
  bottom: 7px;
}

/* 少し下へ進むと上側の案内を出す。 */
.home-info-panel.has-scroll-above .home-scroll-fade-top,
.home-info-panel.has-scroll-above .home-scroll-cue-top {
  opacity: 1;
}

/* 最下部では下側の案内を消す。 */
.home-info-panel:not(.has-scroll-below) .home-scroll-fade-bottom,
.home-info-panel:not(.has-scroll-below) .home-scroll-cue-bottom {
  opacity: 0;
}

.home-mobile-shortcuts,
.home-mobile-links { display: none; }

@media (min-width: 761px) {
  .home-site-body { align-items: start; }

  .home-columns {
    height: var(--home-panel-height, 612px);
    min-height: 520px;
  }
}

@media (max-width: 760px) {
  .home-hero { aspect-ratio: 1000 / 416; }
  .home-hero-video { display: none; }
  .home-main { padding: 0 16px; }

  .home-mobile-shortcuts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 18px auto 28px;
    width: min(100%, 430px);
  }

  .home-mobile-shortcuts a {
    position: relative;
    display: block;
    overflow: hidden;
  }

  .home-mobile-shortcuts a::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px solid transparent;
    transition: border-color .16s ease, background-color .16s ease;
  }

  .home-mobile-shortcuts a:hover::after,
  .home-mobile-shortcuts a:focus-visible::after {
    border-color: var(--nav-cyan);
    background: rgba(255,255,255,.22);
  }

  .home-mobile-shortcuts img { width: 100%; }

  .home-columns { display: block; }

  .home-info-panel {
    width: min(100%, 520px);
    height: 520px;
    margin: 0 auto 34px;
  }

  .home-x-panel {
    width: min(100%, 460px);
    height: 560px;
  }

  .home-panel-title {
    padding-left: 13px;
    font-size: 16px;
  }

  .home-mobile-links {
    display: block;
    margin: 0 auto 30px;
    width: min(100%, 520px);
  }

  .home-section-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    width: min(100%, 520px);
    min-height: 38px;
    margin: 0 auto 10px;
  }

  .home-section-heading > span {
    height: 1px;
    background: var(--nav-cyan);
    opacity: .72;
  }

  .home-section-heading h2 {
    margin: 0;
    color: var(--nav-text);
    font-family: "Kiwi Maru", "Zen Kaku Gothic New", sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: .08em;
    white-space: nowrap;
  }

  .home-mobile-link-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
  }

  .home-mobile-link-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 7px 10px 7px 0;
    color: var(--nav-text);
    font-family: "Kiwi Maru", "Zen Kaku Gothic New", sans-serif;
    font-size: 15px;
    letter-spacing: .06em;
    text-decoration: none;
  }

  .home-mobile-link-list a::before {
    content: "";
    width: 3px;
    height: 18px;
    margin-right: 12px;
    border-radius: 2px;
    background: var(--nav-cyan);
    transition: height .16s ease, background-color .16s ease;
  }

  .home-mobile-link-list a:hover,
  .home-mobile-link-list a:focus-visible { color: var(--nav-coral); }

  .home-mobile-link-list a:hover::before,
  .home-mobile-link-list a:focus-visible::before {
    height: 25px;
    background: var(--nav-coral);
  }
}

@media (max-width: 420px) {
  .home-main { padding: 0 12px; }
  .home-mobile-shortcuts { margin-top: 14px; }
  .home-mobile-link-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-video { display: none; }
}

/* ----------------------------------------------------------------------
   v0.58：HOMEのTOPICSは画像を主役にし、各行のおよそ半分を画像に使う。
   データは assets/data/topics.json。次工程でFirestore取得へ差し替える。
   ---------------------------------------------------------------------- */
.home-topics-content {
  background: #fff;
}

.home-topics-list {
  padding: 4px 13px 18px;
}

.home-topic-item {
  margin: 0;
  border-bottom: 1px solid rgba(116, 193, 208, .24);
}

.home-topic-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 13px;
  padding: 14px 4px;
  color: inherit;
  text-decoration: none;
}

.home-topic-thumb {
  display: flex;
  align-self: start;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 3px;
  background: #f8fbfb;
}

.home-topic-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-topic-copy {
  display: block;
  min-width: 0;
  align-self: center;
}

.home-topic-copy time {
  display: block;
  margin-bottom: 3px;
  color: #8b8990;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

.home-topic-copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--nav-text);
  font-family: "Kiwi Maru", "Zen Kaku Gothic New", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .045em;
  transition: color .16s ease;
}

.home-topic-copy > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #6b696d;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 11.5px;
  line-height: 1.65;
}

.home-topic-link:hover .home-topic-copy strong,
.home-topic-link:focus-visible .home-topic-copy strong {
  color: var(--nav-coral);
}

.home-topics-more {
  margin: 14px 3px 0;
  text-align: right;
}

.home-topics-more a {
  color: var(--nav-purple);
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
  text-decoration: none;
}

.home-topics-more a::after {
  content: "  →";
  white-space: pre;
}

.home-topics-more a:hover,
.home-topics-more a:focus-visible {
  color: var(--nav-coral);
}

.topics-loading,
.home-topics-list .topics-empty,
.home-topics-list .topics-error {
  margin: 10px 3px;
  color: #77747a;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 12px;
}

@media (max-width: 760px) {
  .home-topics-list {
    padding-right: 11px;
    padding-left: 11px;
  }

  .home-topic-link {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
  }
}

@media (max-width: 420px) {
  .home-topic-link {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .home-topic-copy strong {
    font-size: 14px;
  }

  .home-topic-copy > span {
    -webkit-line-clamp: 2;
    font-size: 11px;
  }
}
