/* 
 * GO/LOOK! CONTEXT - Dedicated Article CSS
 * Tailwind CSSのPreflightによる影響を無効化し、WPエディタ上のインラインCSSを統合・最適化したCSS。
 * 1ペイン化に伴い、読みやすさ（可読長・文字サイズ）を最適化しています。
 *
 * @author SINGULIER,INC.
 * @copyright SINGULIER,INC.
 */

.context-single-content {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #333;
  line-height: 1.8;
  font-size: 16px;
}

@media (min-width: 768px) {
  .context-single-content {
    font-size: 17px;
  }
}

/* Post Header直下のコンテンツ内の先頭要素の余白を強制ゼロ化 */
.context-single-content > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ========================================================
   基礎タイポグラフィの復元（Tailwindリセット対策）
   ======================================================== */


.context-single-content a {
  color: #148ACC;
  transition: opacity 0.3s;
}
.context-single-content a:hover {
  opacity: 0.7;
}



.context-single-content strong,
.context-single-content b {
  font-weight: 700;
}

/* ========================================================
   特集記事専用カスタムクラス群（従来のインラインCSSの抽出分）
   ※ the_content() 内に埋め込まれているHTML構造に対応
   ======================================================== */

.golook-feature-article a {
  color: inherit;
  text-decoration: none;
}
.golook-feature-article img {
  border-radius: 8px;
  margin: 0 auto; /* 中央寄せ */
}
.golook-feature-article .feature-container {
  /* 
   * 1ペイン化の最適化: 元々最大幅800pxで左右余白があった。
   * PCの1ペインでも読みやすい行長（日本語の場合約40字、800px程度）を維持しつつ、
   * 周囲の余白を少しゆったり取る。
   */
  max-width: 800px;
  margin: 0 auto;
}

/* --- Header --- */
.feature-header {
  margin-bottom: 0.5em;
}
.feature-header h1 {
  font-size: 1.75em !important;
  font-weight: 700;
  text-align: left;
  line-height: 1.5;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding-left: 20px;
  border-left: 8px solid #333;
  border-bottom: none; /* デフォルトのリセット */
}

/* --- Introduction --- */
.feature-intro {
  margin-top: 10px !important;
  margin-bottom: 20px !important;
  font-size: 1em !important;
}
.feature-intro p {
  margin-bottom: 1.5em;
  text-align: left;
}
.marker-highlight {
  background: linear-gradient(transparent 60%, #ffecb3 60%);
  font-weight: 700;
}

/* --- Summary Box (「この記事の結論」などに使用されるグレー枠) --- */
.context-single-content div[style*="background-color: #f8f8f8"] {
  padding: 24px 28px !important; /* 元のインライン padding: 15px を上書きして余裕を持たせる */
  border-radius: 8px !important; /* 元の 4px から少しモダンに丸みを足す（任意ですが全体のデザインに合わせます） */
  margin-top: 2em;
  margin-bottom: 2em !important;
}

.context-single-content div[style*="background-color: #f8f8f8"] p:first-child {
  margin-top: 0 !important;
  font-size: 1.15em !important;
  border-bottom: 2px solid #333;
  padding-bottom: 8px;
  margin-bottom: 16px !important;
}

.context-single-content div[style*="background-color: #f8f8f8"] ul {
  padding-left: 1.2em;
}

.context-single-content div[style*="background-color: #f8f8f8"] li {
  margin-bottom: 0.8em;
  line-height: 1.6;
}
.context-single-content div[style*="background-color: #f8f8f8"] li:last-child {
  margin-bottom: 0;
}

/* --- Brand Section --- */
.brand-section {
  padding-top: 30px;
  border-top: 1px solid #eee;
  margin-bottom: 50px !important;
}
.brand-section h2 {
  font-size: 1.5em !important;
  font-weight: 700;
  text-align: left;
  margin-bottom: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: none;
}
.brand-section h2 .brand-name {
  border-bottom: 3px solid #333;
  padding-bottom: 0.2em;
}
.brand-section .brand-description {
  color: #555;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3em;
  text-align: left;
}

/* --- Product Grid --- */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 2em;
}

/* PC画角での商品カード高さ統一 */
@media (min-width: 768px) {
    .product-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        align-items: start;
    }
    .product-card .product-card-gallery img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 8px;
    }
    .product-card.full-width {
        grid-column: 1 / -1;
    }
}
.product-card {
  flex: 1 1 calc(50% - 15px);
  min-width: 280px;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.product-card.full-width {
  flex: 1 1 100%;
}
.product-card-content {
  padding: 25px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.product-card-content h3 {
  font-size: 1.1em !important;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5em;
  text-align: center;
}
.product-card-content h3 a:hover {
  text-decoration: underline;
}
.product-card-content .product-subtitle {
  font-size: 1em !important;
  font-weight: 700;
  color: #333;
  margin-bottom: 1.5em;
  text-align: center;
}
.product-card-content p {
  font-size: 0.95em;
  margin-bottom: 1.5em;
  flex-grow: 1;
  text-align: left;
}
.product-card-footer {
  margin-top: auto;
}
.product-card-footer .other-colors {
  display: block;
  font-size: 0.85em;
  text-align: center;
  margin-top: 1em;
}
.product-card-footer .other-colors strong {
  display: block;
  margin-bottom: 0.5em;
  color: #777;
}
.product-card-footer .other-colors a {
  color: #148ACC;
  text-decoration: underline;
  margin: 0 0.5em;
  font-size: 1.1em;
  display: inline;
}

/* --- CTA Button --- */
.cta-button-wrap {
  text-align: center;
  margin-top: 3em;
  margin-bottom: 4em;
}
.cta-button-primary {
  display: inline-block;
  background-color: #000;
  color: #fff !important;
  font-size: 1.25em !important;
  font-weight: 700;
  padding: 1em 3em;
  border-radius: 50px; /* 角丸を完全に取ってモダンなピル形状に */
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  white-space: nowrap;
}
.cta-button-primary:hover {
  background-color: #EAB400; /* ブランドのアクセントカラーに変えるなど工夫 */
  color: #000 !important;
  transform: translateY(-2px);
  text-decoration: none;
}

/* 編集後記内CTA: アウトラインスタイル（黒背景ボタンとの差別化） */
.feature-closing .cta-button-wrap .cta-button-primary {
    background-color: #fff;
    color: #000 !important;
    border: 2px solid #000;
}
.feature-closing .cta-button-wrap .cta-button-primary:hover {
    background-color: #000;
    color: #fff !important;
}

/* --- Related Articles --- */
.related-articles {
  margin-top: 4em;
  padding: 2em 15px;
  background-color: #f5f5f5;
  border-radius: 12px;
}
.related-articles h2 {
  text-align: left;
  font-size: 0.95em !important;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1.5em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-articles h2 img {
  height: 44px !important;
  width: 44px !important;
  min-width: 44px;
  margin-right: 10px;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 50%;
  object-fit: cover;
}
/* ----------------------------------------------------
 * ジャック領域（.related-articles h2）高詳細度コントロール 
 * (SP/デフォルト) 中身は左寄せ(flex-start)、全体も左寄せ
 * ---------------------------------------------------- */
body#golook-context-single #feature-related-stories h2,
body#golook-context-single .context-single-content #feature-related-stories .feature-container h2,
body#golook-context-single .context-single-content .related-articles h2 {
  display: flex !important;
  align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    font-size: 1.05em !important; /* スマホ文字サイズを少し大きく */
    white-space: normal !important; /* JSで挿入される<br>タグを有効にするためnormalに変更 */
    width: fit-content !important; /* 全体を中央寄せするためのfit-content枠 */
    max-width: 100% !important;
    margin: 0 auto 1.5em auto !important; /* 余白による右寄りを防ぐ全体中央寄せ */
    border: none !important;
    border-left: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}
body#golook-context-single #feature-related-stories h2 img,
body#golook-context-single .context-single-content #feature-related-stories .feature-container h2 img,
body#golook-context-single .context-single-content .related-articles h2 img {
  height: 64px !important; /* ジャックアイコンを大きく */
  width: 64px !important;
  min-width: 64px !important;
  margin-right: 15px !important; /* 余白も調整 */
  border-radius: 50% !important;
  object-fit: cover !important;
}

@media (min-width: 768px) {
  .related-articles {
    padding: 3em 30px;
  }
  /* IDセレクタとbodyのIDを重ねて最高詳細度を確保し、テーマCSSとの競合を完全排除 */
  /* 「一度左寄せしてからセンタリング」を忠実に実装 */
  /* 中身は左寄せ(flex-start)にしつつ、ブロック全体を中央寄せ(margin 0 auto)する */
  body#golook-context-single #feature-related-stories h2,
  body#golook-context-single .context-single-content #feature-related-stories .feature-container h2,
  body#golook-context-single .context-single-content .related-articles h2 {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important; /* 中身は左寄せ */
    text-align: left !important;
    font-size: 1.8em !important;
    white-space: normal !important;
    width: fit-content !important; /* 最低限の幅を持つことで中央寄せを可能に */
    max-width: 100% !important;
    margin: 0 auto 1.5em auto !important; /* 全体を中央寄せ */
    border: none !important;
    border-left: none !important;
    padding: 0 !important;
  }
  body#golook-context-single #feature-related-stories h2 img,
  body#golook-context-single .context-single-content #feature-related-stories .feature-container h2 img,
  body#golook-context-single .context-single-content .related-articles h2 img {
    height: 80px !important;
    width: 80px !important;
    min-width: 80px !important;
    margin-right: 20px !important;
  }
}

/* TB画角（681px〜1049px）: PC(1.8em)より微細に小さいTB専用サイズを同一詳細度で定義 */
@media (min-width: 681px) and (max-width: 1049px) {
    body#golook-context-single #feature-related-stories h2,
    body#golook-context-single .context-single-content #feature-related-stories .feature-container h2,
    body#golook-context-single .context-single-content .related-articles h2 {
        font-size: 1.5em !important; /* PC(1.8em ≈ 29px)に迫るTB専用サイズ(≈ 24px) */
    }
    body#golook-context-single #feature-related-stories h2 img,
    body#golook-context-single .context-single-content #feature-related-stories .feature-container h2 img,
    body#golook-context-single .context-single-content .related-articles h2 img {
        height: 80px !important;
        width: 80px !important;
        min-width: 80px !important;
    }
}
.related-articles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
/* 2ペイン化の保護（既存・新規含むすべての一般的なボックス要素に対応） */
.item2col, .itembox, .product-card {
  flex: 1 1 calc(50% - 15px);
  min-width: calc(50% - 20px) !important;
  box-sizing: border-box;
}
@media (max-width: 600px) {
  .item2col, .itembox, .product-card {
    min-width: 100% !important;
    flex: 1 1 100%;
  }
}

/* ========================================================
   #all-items（記事末尾の全商品一覧）専用グリッド固定制御
   ======================================================== */
#all-items .product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
#all-items .product-card.item2col {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important; /* デフォルトflexのmin-width強制を解除 */
  margin: 0 !important;
}
#all-items .product-card-content {
  padding: 12px;
}
#all-items .product-card-content h3 {
  font-size: 0.9em !important;
  line-height: 1.4 !important;
}
@media (min-width: 768px) {
  #all-items .product-grid {
    gap: 30px;
  }
  #all-items .product-card-content {
    padding: 25px;
  }
  #all-items .product-card-content h3 {
    font-size: 1.1em !important;
  }
  #all-items .product-card-content p {
    text-align: right !important;
  }
}

.related-article-card {
  flex: 1 1 calc(50% - 10px);
  min-width: 250px;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.related-article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.related-article-card img {
  border-radius: 0;
  margin: 0;
}
.related-article-card-content {
  padding: 20px;
}
.related-article-card-content h3 {
  font-size: 1em;
  margin-top: 0;
  margin-bottom: 0.75em;
  text-align: left;
}
.related-article-card-content p {
  font-size: 0.85em;
  color: #666;
  margin-bottom: 1.5em;
  text-align: left;
}
.related-article-card-content .read-more {
  font-size: 0.85em;
  font-weight: 700;
  color: #111;
  background-color: #facc15; /* Tailwind yellow-400 equivalent */
  border: 1px solid #111;
  padding: 8px 16px;
  border-radius: 4px;
  text-align: center;
  float: right;
  transition: all 0.3s;
}
.related-article-card-content .read-more:hover {
  background-color: #eab308;
  color: #000;
  text-decoration: none;
}
.related-article-card-content::after {
  content: "";
  display: table;
  clear: both;
}

/* --- Final CTA Section --- */
.final-cta-section {
  background-color: #eaeaea;
  padding: 3em 20px;
  margin-top: 4em;
  border-radius: 12px;
}
.final-cta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin: 0 auto;
  max-width: 600px;
}
.final-cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2em 1em;
  font-size: 0.85em;
  font-weight: 700;
  color: #111;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  text-align: center;
  transition: all 0.3s;
  white-space: nowrap;
}
.final-cta-button:hover {
  background-color: #f9f9f9;
  transform: translateY(-2px);
  text-decoration: none;
}
.final-cta-button.red { background-color: #EC6478; color: #fff; border: none; }
.final-cta-button.blue { background-color: #148ACC; color: #fff; border: none; }
.final-cta-button.black { background-color: #000; color: #fff; border: none; grid-column: 1 / -1; justify-self: center; max-width: 320px; width: 100%; }
.final-cta-button.black:hover { background-color: #222; color: #fff; }

/* --- Table of Contents --- */
#feature-toc {
  background-color: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 30px;
  margin-top: 3em !important;
  margin-bottom: 3em !important;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
#feature-toc h3 {
  font-size: 1.25em !important;
  font-weight: 700;
  text-align: center;
  margin-top: 0;
  margin-bottom: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}
#feature-toc h3::before,
#feature-toc h3::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: #cbd5e1;
  display: block;
}
#feature-toc h3::before { margin-right: 1em; }
#feature-toc h3::after { margin-left: 1em; }
#feature-toc ol {
  margin: 0 auto !important;
  padding-left: 0 !important;
  list-style: none !important;
  counter-reset: toc-counter;
  max-width: 500px;
}
#feature-toc li {
  font-size: 1em !important;
  font-weight: 700;
  padding-left: 0 !important;
  margin-bottom: 1em;
  counter-increment: toc-counter;
}
#feature-toc li a {
  display: block;
  text-decoration: none !important;
  color: #333 !important;
  background-color: #f8fafc;
  padding: 1em 1em 1em 3.5em;
  border-radius: 8px;
  position: relative;
  transition: all 0.3s;
  border: 1px solid #e2e8f0;
}
#feature-toc li a:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateX(5px);
}
#feature-toc li a::before {
  content: counter(toc-counter);
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background-color: #000;
  border-radius: 8px 0 0 8px;
}

/* --- Responsive Styles --- */
@media (max-width: 680px) {
  .feature-header h1 {
    font-size: 1.4em !important;
    padding-left: 15px;
    border-left-width: 5px;
  }
  .product-card-content h3,
  .product-card-content .product-subtitle {
    text-align: left;
  }
  .brand-section h2 {
    font-size: 1.25em !important;
  }
  .related-articles {
    padding: 2em 15px !important;
  }
  .related-articles h2 {
    font-size: 1.1em !important;
  }
  .product-card, .related-article-card {
    flex: 1 1 100%;
  }
  .final-cta-grid {
    grid-template-columns: 1fr;
  }
  .cta-button-primary {
    font-size: 1.1em !important;
    width: 100%;
    padding: 1em;
    text-align: center;
  }
  #feature-toc {
    padding: 20px !important;
  }
  #feature-toc li a {
    padding-top: 0.8em;
    padding-bottom: 0.8em;
  }
}