/* =====================================================
   +81 HIPHOP — Contrast & Link Safety Overrides
   SAFE TAIL for /wp-content/themes/cocoon-child/css/style.css
   ----------------------------------------------------- */

html, body {
  background: #111 !important;   /* keep dark site background */
  color: #e6e6e6;                 /* readable default body text */
}

/* Dark sections only: white links */
.site-masthead a,
.site-masthead_nav a,
.site-footer a { color:#fff; }

/* Article defaults */
.entry-content { color:#e6e6e6; }
.entry-content a { color:#8ec9ff; text-decoration: underline; }

/* White-background boxes inside article: force black text/links */
.entry-content [style*="background-color:#fff" i],
.entry-content [style*="background:#fff" i],
.entry-content [style*="rgb(255, 255, 255)"],
.entry-content [style*="#FFFFFF" i],
.entry-content [bgcolor="#ffffff" i],
.entry-content [bgcolor="#fff" i]{ color:#111 !important; }

.entry-content [style*="background-color:#fff" i] *,
.entry-content [style*="background:#fff" i] *,
.entry-content [style*="rgb(255, 255, 255)"] *,
.entry-content [style*="#FFFFFF" i] *,
.entry-content [bgcolor="#ffffff" i] *,
.entry-content [bgcolor="#fff" i] *{ color:#111 !important; }

.entry-content [style*="background-color:#fff" i] a,
.entry-content [style*="background:#fff" i] a,
.entry-content [style*="rgb(255, 255, 255)"] a,
.entry-content [style*="#FFFFFF" i] a,
.entry-content [bgcolor="#ffffff" i] a,
.entry-content [bgcolor="#fff" i] a{ color:#111 !important; }

/* Inline white text neutralizer (just in case) */
.entry-content [style*="color:#fff" i],
.entry-content [style*="color: #fff" i],
.entry-content [style*="color:#FFFFFF" i],
.entry-content [style*="color: #FFFFFF" i]{ color:#111 !important; }

/* Cocoon blogcards / affiliate boxes */
.entry-content .blogcard,
.entry-content .blogcard-wrap,
.entry-content .internal-blogcard,
.entry-content .external-blogcard,
.entry-content .yyi-rinker,
.entry-content .kaerebalink-box{
  background:#fff; color:#111;
}
.entry-content .blogcard a,
.entry-content .yyi-rinker a,
.entry-content .kaerebalink-box a{ color:#111; }

/* Gutenberg preset backgrounds */
.entry-content .has-white-background-color,
.entry-content .has-background.has-white-background-color,
.entry-content .has-light-gray-background-color{ color:#111 !important; }
.entry-content .has-white-background-color a,
.entry-content .has-background.has-white-background-color a,
.entry-content .has-light-gray-background-color a{ color:#111 !important; }

/* Code/pre */
.entry-content pre,
.entry-content pre.wp-block-code,
.entry-content .wp-block-preformatted,
.entry-content code{
  background:#1d1f21; color:#eaeaea; border:1px solid rgba(255,255,255,.15);
}

/* --- Top page: 背景を透過に戻す（白抜け対策） --- */
.page-template-page-top .site-main,
.page-template-page-top .entry-content,
.page-template-page-top .contents-section,
.page-template-page-top .contents-grid {
  background: transparent !important;
}

/* カード系が白背景になっている場合を無効化 */
.page-template-page-top .content-card,
.page-template-page-top .content-card * {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

/* Cocoonベースのカード/ラッパが白いときの保険 */
.page-template-page-top .ect-entry-card-wrap,
.page-template-page-top .rect-entry-card-wrap,
.page-template-page-top .entry-card-wrap {
  background: transparent !important;
}

/* 文字色は暗背景に合わせて */
.page-template-page-top .contents-section,
.page-template-page-top .content-card,
.page-template-page-top .content-card a {
  color: #e6e6e6;
}

/* （保険）Cocoonのカード要素名が違う場合も透過に */
.page-template-page-top .entry-card,
.page-template-page-top .entry-card * { background: transparent !important; box-shadow:none !important; border-color:transparent !important; }

/* （保険）トップのセクションラッパが白指定のテーマ/プラグインにも対応 */
.page-template-page-top [class*="section"] { background: transparent !important; }

/* --- Top: カードまわりの “薄さ” をリセットして文字を濃くする --- */

/* まず背景透過のままにする（前回の続き） */
.page-template-page-top .site-main,
.page-template-page-top .entry-content,
.page-template-page-top .contents-section,
.page-template-page-top .contents-grid {
  background: transparent !important;
}

/* 薄く見える原因になりやすい opacity / filter を無効化 */
.page-template-page-top .contents-section,
.page-template-page-top .contents-grid,
.page-template-page-top .content-card,
.page-template-page-top .content-card *,
.page-template-page-top .entry-card,
.page-template-page-top .entry-card *{
  opacity: 1 !important;
  filter: none !important;
}

/* 文字色をトップだけで明るく固定（リンク含む） */
.page-template-page-top .content-card,
.page-template-page-top .content-card *,
.page-template-page-top .entry-card,
.page-template-page-top .entry-card *{
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important; /* iOS/Safari 対策 */
}

/* 万一、カードタイトルだけ別色指定されている場合の保険 */
.page-template-page-top .content-card a,
.page-template-page-top .entry-card a{
  color: #e6e6e6 !important;
}
.page-template-page-top .content-card a:hover,
.page-template-page-top .entry-card a:hover{
  color: #ffffff !important;
}


/* ===== Top専用：#content の白っぽさを完全リセット ===== */
.page-template-page-top #content,
.page-template-page-top #content-in,
.page-template-page-top .content,
.page-template-page-top .content-in {
  background: transparent !important;
  opacity: 1 !important;
  filter: none !important;
}

/* #content 配下の文字色を濃く固定（リンク含む） */
.page-template-page-top #content,
.page-template-page-top #content * {
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important; /* iOS/Safari 用 */
}

/* メタ情報など“淡色指定”されがちな所も見やすく */
.page-template-page-top #content .entry-meta,
.page-template-page-top #content .cat-label,
.page-template-page-top #content .term-badge {
  color: #cfcfcf !important;
  opacity: 1 !important;
}

/* カード系の保険（テーマ名違いにも対応） */
.page-template-page-top #content .entry-card,
.page-template-page-top #content .entry-card *,
.page-template-page-top #content .content-card,
.page-template-page-top #content .content-card * {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  opacity: 1 !important;
  filter: none !important;
}

/* ===== Top専用：#content配下の“薄く見える”原因を完全リセット ===== */

/* #content 自体の半透明化・フィルタを無効化 */
.page-template-page-top #content,
.page-template-page-top #content.content,
.page-template-page-top #content.content.cf {
  background: transparent !important;
  opacity: 1 !important;
  filter: none !important;
}

/* もしオーバーレイが :before で乗っていた場合は消す */
.page-template-page-top #content::before,
.page-template-page-top .content::before,
.page-template-page-top .content-in::before,
.page-template-page-top .contents-section::before,
.page-template-page-top .contents-grid::before {
  content: none !important;
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}

/* ===== Top専用：main#main と親ラッパの薄さ/オーバーレイを完全リセット ===== */

/* main とその親の背景・不透明度・フィルタを全解除 */
body.page-template-page-top #container.container.cf,
body.page-template-page-top #content.content.cf,
body.page-template-page-top #content-in.content-in.wrap,
body.page-template-page-top main#main.main {
  background: transparent !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* main やラッパに乗っている半透明オーバーレイ(:before)を無効化 */
body.page-template-page-top #container.container.cf::before,
body.page-template-page-top #content.content.cf::before,
body.page-template-page-top #content-in.content-in.wrap::before,
body.page-template-page-top main#main.main::before {
  content: none !important;
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}

/* 念のため、main 配下のテキストは濃い色で固定 */
body.page-template-page-top main#main.main,
body.page-template-page-top main#main.main * {
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important; /* iOS/Safari */
  opacity: 1 !important;
  filter: none !important;
}

/* ===== Top専用：main→contents→contents-grid→content-card をフルリセット ===== */

/* main とセクション/グリッドの半透明や合成を無効化 */
body.page-template-page-top main#main.main,
body.page-template-page-top main#main.main > section#contents.contents-section,
body.page-template-page-top main#main.main #contents-grid.contents-grid {
  background: transparent !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  isolation: isolate !important;
}

/* もし :before オーバーレイが乗っていたら消す */
body.page-template-page-top main#main.main::before,
body.page-template-page-top main#main.main > section#contents.contents-section::before,
body.page-template-page-top main#main.main #contents-grid.contents-grid::before {
  content: none !important;
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}

/* グリッド内のカード類は白背景/半透明/枠を無効化して暗背景に馴染ませる */
body.page-template-page-top #contents-grid.contents-grid .content-card,
body.page-template-page-top #contents-grid.contents-grid .entry-card {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
  opacity: 1 !important;
  filter: none !important;
}

/* 文字色をトップ専用で濃く固定（リンク含む） */
body.page-template-page-top main#main.main,
body.page-template-page-top main#main.main * {
  color: #e6e6e6 !important;
  -webkit-text-fill-color: #e6e6e6 !important; /* iOS/Safari */
}

/* 見出しが薄色指定されている場合の保険 */
body.page-template-page-top #contents h2,
body.page-template-page-top #contents h2 * {
  color: #e0e0e0 !important;
  opacity: 1 !important;
}

/* さらに強い白っぽさ（rgba/変数）対策の保険 */
body.page-template-page-top #contents-grid.contents-grid,
body.page-template-page-top #contents-grid.contents-grid * {
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}

/* === Related Entries: ダークカード + 白文字 === */

/* セクション・見出し・リンクは白 */
#related-entries,
#related-entries a,
#related-entries .related-entry-heading,
#related-entries .related-entry-heading * {
  color: #fff !important;
}

/* カードを暗い背景に（白カードをやめる） */
#related-entries .related-entry-card-wrap,
#related-entries .related-entry-card {
  background: #121212 !important;         /* サイトのダーク背景に合わせる */
  border: 1px solid #2e2e2e !important;   /* うっすら境界線 */
  box-shadow: none !important;
}

/* カード内のテキストは白（リンク含む） */
#related-entries .related-entry-card-wrap *,
#related-entries .related-entry-card *,
#related-entries .related-entry-card .entry-card-title a {
  color: #fff !important;
}

/* メタ情報やラベルは少しだけ淡く */
#related-entries .entry-meta,
#related-entries .cat-label,
#related-entries .term-badge {
  color: #cfcfcf !important;
}

/* ===== Prev/Next Post Navi: 白文字化（Cocoon） ===== */
#pager-post-navi,
#pager-post-navi a,
#pager-post-navi .post-navi a,
#pager-post-navi .post-navi a:visited {
  color: #fff !important;
}

/* タイトル・矢印など */
#pager-post-navi .navi-title,
#pager-post-navi .post-navi-prev a,
#pager-post-navi .post-navi-next a {
  color: #fff !important;
}

/* サブラベル（例：PREV / NEXT 等）は少し淡く */
#pager-post-navi .navi-label,
#pager-post-navi .navi-sub {
  color: #e0e0e0 !important;
}

/* ホバー時は少しだけ強調 */
#pager-post-navi a:hover {
  text-decoration: underline;
  opacity: 1 !important;
}

/* （任意）カードが白背景だと白文字が読みにくいので暗背景に */
#pager-post-navi .a-wrap.border-element.cf,
#pager-post-navi .post-navi a .a-wrap {
  background: #121212 !important;
  border: 1px solid #2e2e2e !important;
  box-shadow: none !important;
}

/* （任意）もし半透明オーバーレイが乗っていたら消す */
#pager-post-navi .a-wrap::before {
  content: none !important;
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}



/* DO NOT add a global `a { color: ... }` here */