/* 補助金.com 収益化部品スタイル（誠実なPR枠）
   ・広告/アフィリは必ず「PR」明示し、中立の制度情報と視覚的に分離する（信頼維持）。
   ・既定では monetize.js が dormant（window.HJ_MONETIZE.enabled が真のときだけ描画）。 */
/* 2026-05-28 RL402 オーナー指示「広告欄と思えないデザインに」: コンテンツに馴染ませる。
   - 枠線・背景塗りを撤去（透明）
   - 「PR」表示は法令遵守で残すが、右上に小さく・テキストのみで控えめに
   - カードは本文制度カードと同系のbrand-tint白＋細枠で統一感
   - 注: 景表法上「PR/広告」表示は必須なので完全非表示は不可。視覚ノイズを最小化する。 */
/* 2026-05-28 RL428 オーナー指示「余分なスペース」対応で上下マージン圧縮 */
.hj-pr{border:0;border-radius:11px;background:transparent;padding:0;margin:8px 0}
.hj-pr .hj-pr-list{margin:0}
.hj-pr-item{padding:10px 12px!important}
.hj-pr-img{margin:0 0 4px!important}
/* 2026-05-28 RL404 PRラベル位置修正: absoluteで右サイドレールと重なるため、グリッド上に小さく右寄せで配置 */
.hj-pr-lbl{display:block;text-align:right;font-size:.62rem;font-weight:600;color:#9a8a73;background:transparent;border:0;border-radius:0;padding:0 4px 4px 0;letter-spacing:.05em;margin:0}
.hj-pr-lbl::before{content:"PR · ";font-weight:600;color:#9a8a73;background:transparent;border-radius:0;padding:0;font-size:.62rem;letter-spacing:0}
.hj-pr-cap{font-size:.78rem;color:#5a5249;margin:0 0 10px;line-height:1.7}
.hj-pr-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:6px}
/* 2026-05-28 RL456 オーナー指示「広告治ってない」根本原因:
   - .hj-pr-item に overflow:hidden が無く、子の img が natural size でグリッドセルを突き抜けていた
   - min-width:0 を追加（grid 子要素のデフォルト min-width:auto を解除）し、セル幅にフィットさせる */
.hj-pr-item{display:block;border:1px solid #d3e0f1;border-radius:11px;padding:14px 14px 14px;background:#fff;text-decoration:none;color:#173d70;min-height:56px;min-width:0;overflow:hidden;transition:transform .15s,box-shadow .15s,border-color .15s;box-shadow:0 1px 2px rgba(20,30,60,.04)}
.hj-pr-item:hover{background:#f7faff;border-color:#1f4d8c;transform:translateY(-1px);box-shadow:0 2px 8px rgba(20,30,60,.12)}
.hj-pr-t{display:block;font-weight:700;font-size:.92rem;line-height:1.5;color:#173d70}
.hj-pr-t::after{content:" →";font-size:.85em;color:#1f4d8c;font-weight:600;margin-left:2px}
.hj-pr-n{display:block;font-size:.78rem;color:#5a5249;margin-top:4px;line-height:1.6}
/* 2026-05-28 RL418 AdSense未配信時(file:// or 審査中)に大きな空枠が残るため、min-heightを撤廃。
   実配信時はAdSenseが広告サイズに合わせて高さを設定するため、レイアウト崩れは発生しない。 */
.hj-pr .hj-pr-adbox{min-height:0;display:flex;align-items:center;justify-content:center;background:transparent;border-radius:7px;color:#9a8a73;font-size:.74rem}
/* ins.adsbygoogle が空（広告未配信）の場合、親 .hj-pr も非表示にして「PR・広告」ラベルだけ残らないようにする */
.hj-pr:has(.hj-pr-adbox > ins.adsbygoogle:not([data-ad-status])){display:none}
.hj-pr:has(.hj-pr-adbox > ins.adsbygoogle[data-ad-status="unfilled"]){display:none}
.hj-pr .hj-pr-adbox ins.adsbygoogle{min-height:0}
@media (max-width:560px){.hj-pr-list{grid-template-columns:1fr}.hj-pr .hj-pr-adbox{min-height:220px}}
@media print{.hj-pr{display:none!important}}
/* 2026-05-26 画像バナー対応: img があれば画像優先、エラー時はテキストにフォールバック（onerror で非表示） */
/* 2026-05-28 RL455 オーナー指示「制度の広告画面おかしくなってる」: グリッドセル内で画像がはみ出して隣セルと重なる問題対策。
   - width:100% でセル幅にフィット
   - max-width:100% に変更（300px固定だと小型セルで余白が出る・大型セルで縦横比が崩れる）
   - max-height + object-fit:cover で3カードの縦高さを揃え、はみ出しを防ぐ */
.hj-pr-img{display:block!important;width:100%!important;max-width:100%!important;height:auto!important;max-height:160px!important;object-fit:cover;object-position:center;margin:0 0 8px;border-radius:6px;border:1px solid #e0e6f0;box-sizing:border-box}
@media (max-width:560px){.hj-pr-img{max-height:200px}}

/* 2026-05-26 RL393 サイドレール広告: 本文の左右余白に sticky な縦長バナー枠を配置（≥1400px のPC幅のみ表示） */
.hj-side-rail{display:none}
@media (min-width:1400px){
  /* 2026-05-28 RL434 「上が見切れ・下がはみ出る」対応:
     - top を 80px に下げてヘッダー直下から始める
     - max-height をビューポート高さに合わせ、bottom にも余白
     - 内部広告が複数あれば overflow-y:auto で画面内に収める */
  .hj-side-rail{display:block;position:fixed;top:160px;width:160px;z-index:30;max-height:calc(100vh - 180px);overflow-y:auto;scrollbar-width:thin;padding-top:0}
  .hj-side-rail .hj-pr-img{max-height:600px;object-fit:contain}
  .hj-side-rail .hj-pr{margin:0 0 10px}
  .hj-side-right{right:max(8px, calc((100vw - 1320px)/2 - 168px))}
  .hj-side-left{left:max(8px, calc((100vw - 1320px)/2 - 168px))}
  .hj-side-rail .hj-pr{margin:0 0 12px;padding:8px}
  .hj-side-rail .hj-pr-adbox{min-height:600px}
  .hj-side-rail .hj-pr-lbl{font-size:.7rem}
}
@media (min-width:1700px){
  .hj-side-rail{width:200px}
  .hj-side-right{right:max(16px, calc((100vw - 1320px)/2 - 210px))}
  .hj-side-left{left:max(16px, calc((100vw - 1320px)/2 - 210px))}
}
@media print{.hj-side-rail{display:none!important}}

/* 2026-05-26 RL394 空配信時の枠非表示: AdSense が広告を返さなかった ins.adsbygoogle は
   data-ad-status="unfilled" になる。その親 .hj-pr を視覚的に削除して空枠が目立つのを防ぐ */
.hj-pr:has(ins.adsbygoogle[data-ad-status="unfilled"]){display:none!important}
/* :has() 未対応ブラウザ向けフォールバック: 空高さは最小化 */
.hj-pr .hj-pr-adbox:empty{min-height:0;padding:0}
.hj-pr .hj-pr-adbox ins.adsbygoogle[data-ad-status="unfilled"]{min-height:0;height:0!important;display:none}

/* 2026-05-28 RL430 「広告がページと一体化・煩わしくない」: 既存スタイルを上書きして馴染ませる */
.hj-pr{margin:10px 0!important}
.hj-pr-lbl{font-size:.58rem!important;color:#a8a094!important;opacity:.55;text-align:right;padding:0 2px 2px 0!important;font-weight:500!important;letter-spacing:.04em!important}
.hj-pr-lbl::before{content:"PR · "!important;color:#a8a094!important;font-weight:500!important;font-size:.58rem!important;opacity:1}
.hj-pr-list{gap:10px!important;margin-top:2px!important}
.hj-pr-item{
  border:1px solid rgba(31,77,140,.06)!important;
  background:rgba(255,255,255,.65)!important;
  box-shadow:none!important;
  padding:10px 12px!important;
  border-radius:9px!important;
  transition:background .2s ease, border-color .2s ease!important;
}
.hj-pr-item:hover{
  background:rgba(255,255,255,.95)!important;
  border-color:rgba(31,77,140,.18)!important;
  transform:none!important;
  box-shadow:none!important;
}
.hj-pr-t{font-weight:600!important;font-size:.88rem!important;color:#2a3850!important}
.hj-pr-t::after{content:""!important}
.hj-pr-n{color:#6b7585!important;font-size:.76rem!important;line-height:1.65!important}
.hj-pr-img{border:0!important;border-radius:8px!important;margin:0 0 6px!important;opacity:.92}
.hj-pr-item:hover .hj-pr-img{opacity:1}
