/* ================================
   home.css (home only)  FINAL REPLACEMENT v4 (B: span方式 / cleaned)
   目的:
   ① 上段：左2つ/右2つ（計4カード）を必ず同じ高さにする
   ② 下段：YouTube箱とレポート箱の高さを同じにする（中身だけスクロール）
   ③ レポート「開く」= 右端の小さいグレーbutton、サムネはYouTubeと同サイズ
   ④ YouTube/レポートとも、説明文は小さく・太字なし・サムネ右側に収める
   ⑤ HERO：コピー文字を「画像の中」に戻す（中央揃え・可読性確保）
      ※影ズレ防止：transform は “文字だけ” に掛ける（span）
================================ */

/* --------------------------------
   Home tokens
-------------------------------- */
body.page-home{
  /* bottom row fixed height */
  --home-bottom-card-h: clamp(360px, 42vh, 440px);

  /* HERO tuning */
  --hero-h: 170px;
  --hero-radius: 8px;
  --hero-copy-fs: 22px;                 /* 好みで調整 */
  --hero-copy-pad-x: 28px;              /* 左右余白 */
  --hero-overlay: rgba(0, 0, 0, .12);   /* 暗幕の濃さ（薄め推奨） */
  --hero-text-shift-y: 28px;            /* 文字だけ下げる */
}

body.page-home .left-section{
  padding-bottom: 8px;
  min-width: 0;
}

/* --------------------------------
   HERO（コピーを画像内に重ねる / 影ズレなし）
   前提HTML:
     <div class="header-img-copy"><span>...</span></div>
-------------------------------- */
body.page-home .left-section .header-img{
  margin: 0 0 10px;
  border: 0;
  border-radius: var(--hero-radius);
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  position: relative;
}

body.page-home .left-section .header-img > img{
  width: 100%;
  height: var(--hero-h);
  object-fit: cover;
  display: block;

  /* 明るさ調整（必要なら 1.05〜1.15） */
  filter: brightness(1);
}

/* overlay container（ここは動かさない＝影がズレない） */
body.page-home .left-section .header-img-copy{
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  padding: 0 var(--hero-copy-pad-x);
  text-align: center;

  margin: 0;
  border: 0;

  z-index: 0;
  transform: none;
}

/* 影（暗幕）は固定 */
body.page-home .left-section .header-img-copy::before{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  z-index: -1;
}

/* 文字だけを動かす（影ズレ防止の本体） */
body.page-home .left-section .header-img-copy > span{
  position: relative;
  z-index: 1;

  display: block;
  color: #fff;
  font-size: var(--hero-copy-fs);
  font-weight: 500;
  line-height: 1.35;

  transform: translateY(var(--hero-text-shift-y));

  /* 長文事故防止 */
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 6px rgba(0,0,0,.22);
}

/* HERO: smaller screens */
@media (max-width: 980px){
  body.page-home{
    --hero-h: 160px;
    --hero-copy-fs: 18px;
    --hero-copy-pad-x: 18px;
    --hero-text-shift-y: 14px;
  }
}
@media (max-width: 520px){
  body.page-home{
    --hero-h: 150px;
    --hero-copy-fs: 16px;
    --hero-text-shift-y: 12px;
  }
}

/* =========================================
   ① 上段：4カードの高さを必ず揃える
========================================= */
body.page-home .grid-2:not(.cards-row){
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}
@media (max-width: 980px){
  body.page-home .grid-2:not(.cards-row){
    grid-template-columns: 1fr;
  }
}

/* PANEL外枠 */
body.page-home .panel{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

/* パネル見出し */
body.page-home .panel-head{
  /* レイアウト */
  display: flex;
  align-items: center;
  justify-content: center;   /* 範囲内で中央寄せ */
  text-align: center;

  /* 文字 */
  font-weight: 800;
  font-size: 16px;
  color: var(--accent-brown);

  /* 見た目 */
  padding: 12px 16px;
  background: var(--accent-brown-bg);

  border-top: 2px solid var(--accent-brown-soft);
  border-bottom: 2px solid var(--accent-brown-soft);
}



/* 2段等分 */
body.page-home .panel__stack{
  padding: 8px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;

  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-content: stretch;
}

/* FEATURE CARD（濃紺ヘッダー） */
body.page-home a.feature-card{
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;

  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 10px 26px rgba(2, 8, 23, .06);
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
body.page-home a.feature-card:hover{
  transform: translateY(-1px);
  border-color: rgba(29, 78, 216, .22);
  box-shadow: 0 14px 34px rgba(2, 8, 23, .09);
}

body.page-home .feature-card__head{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(15,74,114,1), rgba(11,53,82,1));
  border-bottom: 1px solid rgba(255,255,255,.10);
  flex: 0 0 auto;
}
body.page-home .feature-card__icon{
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
body.page-home .feature-card__icon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body.page-home .feature-card__title{
  margin: 0;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  font-size: 18px;
  letter-spacing: .01em;
  min-width: 0;
}

body.page-home .feature-card__desc{
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px 16px;
  background: rgba(248, 250, 252, .85);
  color: var(--text);
  line-height: 1.75;
}

/* =========================================
   ② 下段：YouTube と レポート箱の高さを必ず同じにする
========================================= */
body.page-home .grid-2.cards-row{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
  align-items: stretch;
}
@media (max-width: 980px){
  body.page-home .grid-2.cards-row{
    grid-template-columns: 1fr;
  }
}

/* 下段カード：同じ高さに固定 + 親スクロール禁止 */
body.page-home .grid-2.cards-row .card{
  height: var(--home-bottom-card-h);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ヘッダ固定 */
body.page-home .grid-2.cards-row .card-head{
  flex: 0 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.page-home .grid-2.cards-row .card-head h3{
  font-size: 16px;
  margin: 0;
  line-height: 1.2;
}

/* 検索欄 */
body.page-home .grid-2.cards-row .search{
  height: 34px;
  font-size: 14px;
  padding: 0 10px;
  width: 280px;       /* ←これ */
  max-width: 80%;     /* ←保険 */
}

/* 中身だけスクロール */
body.page-home .grid-2.cards-row :is(.glassable,.list){
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

/* =========================================
   ④ 下段リスト行レイアウト
   - 動画行とレポート行を分離
   - レポートは 3列固定（thumb / text / button）
========================================= */

/* 共通の行区切り */
body.page-home #videoList > li,
body.page-home #reportList > li{
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}
body.page-home #videoList > li:last-child,
body.page-home #reportList > li:last-child{
  border-bottom: 0;
}

/* ---------- 動画一覧 ---------- */
body.page-home #videoList > li{
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

body.page-home #videoList img.thumb{
  width: 84px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

body.page-home #videoList > li > div{
  min-width: 0;
}

body.page-home #videoList .title{
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-home #videoList small{
  display: block;
  margin-top: 3px;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- レポート一覧 ---------- */
body.page-home #reportList > li{
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}

body.page-home #reportList img.thumb{
  width: 84px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

/* 中央の説明欄だけを縮める */
body.page-home #reportList > li > div:nth-child(2){
  min-width: 0;
}

body.page-home #reportList .title{
  display: block;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-home #reportList small{
  display: block;
  margin-top: 3px;
  min-width: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   ③ レポート「開く」ボタン
   - 右列は固定幅
   - ボタンは常に横書き・中央配置
========================================= */
body.page-home #reportList .report-actions{
  width: 64px;
  min-width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.page-home #home-reports .btn-open{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 56px;
  height: 32px;
  padding: 0;

  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  word-break: keep-all;

  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, .14);
  background: rgba(148, 163, 184, .18);
  color: rgba(15, 23, 42, .75);
  text-decoration: none;
  cursor: pointer;

  writing-mode: horizontal-tb;
  text-orientation: mixed;
  box-sizing: border-box;
}

body.page-home #home-reports .btn-open:hover{
  background: rgba(148, 163, 184, .28);
  border-color: rgba(15, 23, 42, .22);
}
/* =================================================
   Guest (logged-out) safety:
   - disabled report buttons should NOT react on hover
   - avoid "clickable" illusion
================================================= */
body.page-home #home-reports .btn-open[disabled],
body.page-home #home-reports .btn-open[aria-disabled="true"],
body.page-home #home-reports .btn-open.is-disabled{
  pointer-events: none;
  cursor: default;
  filter: grayscale(.15);
  opacity: .75;
}

/* kill hover/active visuals explicitly (more specific than .btn-open:hover) */
body.page-home #home-reports .btn-open[disabled]:hover,
body.page-home #home-reports .btn-open[disabled]:active,
body.page-home #home-reports .btn-open[aria-disabled="true"]:hover,
body.page-home #home-reports .btn-open[aria-disabled="true"]:active,
body.page-home #home-reports .btn-open.is-disabled:hover,
body.page-home #home-reports .btn-open.is-disabled:active{
  transform: none;
  box-shadow: none;
  /* background/border are intentionally not changed here:
     whatever the base style is, keep it unchanged on hover */
}


/* レポート行：ボタン列を確保（保険） */
body.page-home #home-reports .report-row{
  grid-template-columns: 84px 1fr auto;
}
body.page-home #home-reports .report-row :is(a, button){
  justify-self: end;
}

/* more */
body.page-home .yt-more{
  padding: 10px 12px;
  font-size: 14px;
}

.header-text{
  margin-bottom: 10px;
}