/*
 Theme Name: RePrompt Hero3D Child
 Theme URI: https://reprompt.jp/
 Description: Child theme scaffold with HERO 3D canvas and reusable block patterns.
 Author: RePrompt
 Template: twentytwentyfive
 Version: 1.2.3
*/

/* ===== HERO: 3D canvas (prevent CLS) ===== */
#hero3d {
  width: 100%;
  height: 70vh;
  display: block;
}
.hero3d-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f7f7f7;
}

/* ===== RePrompt Blocks ===== */
.rp-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
}
@media (max-width: 768px){
  .rp-hero { grid-template-columns: 1fr; }
}
.rp-hero .rp-media{
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #f2f2f2;
}
.rp-hero .rp-media > *{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rp-grid{
  --rp-min: 280px;
  display: grid;
  gap: clamp(12px, 2.5vw, 24px);
  grid-template-columns: repeat(auto-fit, minmax(var(--rp-min), 1fr));
}

/* base card */
.rp-card{
  border-radius: 16px;
  padding: clamp(16px, 2vw, 24px);
  background: rgba(255,255,255,0.8);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  backdrop-filter: blur(10px);
}
.rp-card h3{ margin: 0 0 8px 0; }
.rp-card .rp-sample{
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #eee;
  overflow: hidden;
  margin-top: 12px;
}

/* glass upgrade (overrides base card) */
.rp-card{
  position: relative;
  border-radius: 20px;
  padding: clamp(16px, 2vw, 24px);
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.rp-card::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
  pointer-events: none;
}
.rp-card .rp-sample{
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.rp-btn{
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* Section bg & padding */
.rp-section{
  position: relative;
  background: linear-gradient(180deg, #f7f9fc 0%, #edf1f7 100%);
  padding: clamp(48px, 6vw, 80px) clamp(20px, 4vw, 40px);
  overflow: hidden;
}
.rp-section::after{
  content: "";
  position: absolute;
  inset: -2%;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1000px 500px at 110% 120%, rgba(255,255,255,.25), transparent 60%);
}

/* Force 1 column when needed */
.rp-grid.rp-vertical{ grid-template-columns: 1fr !important; }

/* ===== Columns block sometimes sets font-size:0 inline ===== */
.wp-block-columns.row-hero { font-size: 16px !important; }
.wp-block-columns.row-hero *{ font-size: inherit !important; }

/* ===== 3D logo alignment (right) ===== */
#mv3d{
  width: clamp(600px, 40vw, 1000px);
  aspect-ratio: 1 / 1;
  display: block;
  margin-left: auto !important;
  margin-right: 0 !important;
}
#mv3d model-viewer{
  width: 100%;
  height: 100%;
  display: block;
  --poster-color: transparent;
}

/* ===== HERO text sequence ===== */
/* 43px固定。初期は消す。is-active だけ出す。 */
#rp-hero.custom-hero { position: relative; }
#rp-hero.custom-hero p{
  font-size: 43px !important;
  line-height: 1.25;
  margin: 0 0 .6em;
  opacity: 0;
  transition: opacity .22s ease;
  will-change: opacity;
}
#rp-hero.custom-hero p.is-active{ opacity: 1; }

/* 念のための色指定（サイトのプリセット採用） */
#rp-hero.custom-hero *{
  color: var(--wp--preset--color--contrast, #111);
  display: block;
}
/* ヒーローページだけヘッダー直下の余白をゼロにする */
.page-id-130 .wp-site-blocks {
  padding-top: 0 !important;
}
/* ページID 130：ヘッダー直下の余白ぜんぶ消す */
.page-id-130 .wp-site-blocks {
  padding-top: 0 !important;
}

.page-id-130 header.wp-block-template-part + * {
  margin-top: 0 !important;
}
/* ページID 130：一番上の白いグループの余白を消す */
.page-id-130 .wp-site-blocks > .wp-block-group.alignfull.is-style-default.has-base-background-color.has-background:first-of-type {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
/* ヒーローページだけタイトルを完全に消す */
.page-id-130 .wp-block-post-title {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* ヘッダーとファーストビューの間の隙間を消す（page-id-130 限定） */
.page-id-130 .wp-site-blocks > * + * {
  margin-block-start: 0 !important;
}

/* 念のため main 側の余白も消しておく */
.page-id-130 .wp-block-template-part {
  margin-top: 0 !important;
  padding-top: 0 !important;
}
