/**
 * GO/LOOK! CONTEXT Custom Styles
 * Provides custom animations, scrollbar hiding, and hover transitions for the CONTEXT page.
 *
 * @author SINGULIER,INC.
 * @copyright SINGULIER,INC.
 */


/* =========================================================================
 * HERO SECTION: 大画面でのアイキャッチバナーの『完全全体表示（見切れゼロ）』と迫力維持
 * 対象: PC画角（min-width: 1050px）以上のみ
 * 方針: 
 *  1. 画像エリアを単一の計算式『min(1080px, 80vh, 60vw)』で縦横同一に固定し、いかなる画角でも「絶対の正方形(1:1)」を保証。
 *  2. 縦長や横長に潰れるバグを排除（flex: 0 0 auto）。
 *  3. コンテンツ全体を max-width: 1800px でセンタリングし「画像とテキストが離れすぎる」問題を防ぐ。
 *  4. テキスト側に最大幅(768px相当)の余裕を持たせ可読性を高めつつ、背景を巨大な疑似要素で無限に引き伸ばし迫力を維持。
 * ========================================================================= */

@media (min-width: 1050px) {
    /* ① 外枠のコントロール（親を白背景にすることで左側の無限白背景を担保） */
    .hero-banner {
        background-color: #ffffff !important;
        overflow: hidden; /* 背景のはみ出しによる横スクロールを防止 */
        z-index: 1;
    }

    /* ② flexコンテナ: 離れすぎを防ぐためのセンタリング（最大1800px） */
    .hero-banner > .flex {
        max-width: 1800px !important;
        margin: 0 auto;
        /* コンテナの高さを内容に追従させつつ上限を担保 */
        height: auto !important; 
        max-height: 80vh !important;
        align-items: center; /* 縦方向の中央に配置しバランスを保つ */
    }

    /* ③ 左側テキスト: 余白すべてを利用してテキストを展開 */
    .hero-banner > .flex > div:first-child {
        width: auto !important;
        flex: 1 1 auto !important;
        background-color: #ffffff;
    }

    /* テキストの表示幅を拡張して読みやすく（Tailwindの max-w-xl = 576px の制限解除） */
    .hero-banner > .flex > div:first-child > div.max-w-xl {
        max-width: 768px !important; /* テキストの読みやすさと余裕を最適化 */
    }

    /* ④ 右側画像: いかなる縮小拡大でも絶対に正方形を維持する完全計算式 */
    .hero-banner > .flex > div:last-child {
        /* 幅・高さ = min(絶対上限, 高さオーバーフロー限界, テキスト側確保限界) */
        width: min(1080px, 80vh, 60vw) !important;
        height: min(1080px, 80vh, 60vw) !important;
        aspect-ratio: 1 / 1 !important; /* ダメ押しの比率強制 */
        flex: 0 0 auto !important; /* flexによる潰れや伸び（縦長化・横長化）を物理的に完全遮断 */
        position: relative;
        z-index: 10;
        background-color: #f3f4f6; /* 画像ロード前の背景色 */
    }

    /* 画像ラッパー: 1:1枠に100%フィットさせる */
    .hero-banner > .flex > div:last-child > div {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    /* 実際の画像 */
    .hero-banner > .flex > div:last-child img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important; 
        /* 1:1正方形枠に対して1:1画像を置くため、いかなる場合もトリミングされない */
    }

    /* ⑤ 巨大なグレー背景疑似要素: 画像エリアから右へ無限に引き伸ばす（迫力維持） */
    .hero-banner > .flex > div:last-child::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 100%; /* 画像エリアの右端からスタート */
        width: 100vw; /* 確実に画面右端まで届かせる */
        background-color: #f3f4f6; /* Tailwindのbg-gray-100と同色 */
        z-index: -1; /* 画像要素の裏側に配置 */
        pointer-events: none;
    }
}

.hover-img-scale {
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.group:hover .hover-img-scale {
    transform: scale(1.05);
}

.marker-anim {
    background: linear-gradient(to right, #D4F035 50%, transparent 50%);
    background-size: 200% 100%;
    background-position: right bottom;
    transition: all 0.5s ease-out;
    display: inline;
}
.group:hover .marker-anim {
    background-position: left bottom;
}

/* Infinite Marquee Animation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.animate-marquee {
    display: flex;
    width: max-content;
    animation: marquee 80s linear infinite;
}
/* Pause on hover */
.animate-marquee:hover {
    animation-play-state: paused;
}

img {
    transition: opacity 0.3s;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
/* Hide scrollbar for IE, Edge and Firefox */
.scrollbar-hide {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Responsive Helper Classes */
@media (max-width: 767px) {
    .sp-none {
        display: none !important;
    }
}
@media (min-width: 768px) {
    .pc-none {
        display: none !important;
    }
}

/* =========================================================================
 * FEATURE ARTICLES (特集記事関連の拡張スタイル)
 * ========================================================================= */
.feature-articles-section {
    margin-top: 50px;
    margin-bottom: 50px;
    text-align: center;
}
.feature-articles-section .section-title {
    font-size: 28px !important; /* style.cssを非継承 */
    font-weight: bold;
    letter-spacing: 0.1em;
    margin: 0;
    color: #000;
}
.feature-articles-section .section-subtitle {
    font-size: 16px !important; /* style.cssを非継承 */
    margin-top: 5px;
    margin-bottom: 30px;
    color: #666;
}
.feature-articles-section .flex_container {
    text-align: left;
}
.feature-articles-section .feature-article-item {
    width: calc(25% - 15px); /* PCでは4カラム */
    margin-bottom: 20px;
}
.feature-articles-section .feature-article-item .thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1; /* 正方形を保つ */
    object-fit: cover;
    border: 1px solid #eee;
}
.feature-articles-section .feature-article-item .excerpt-message {
    height: auto; /* 高さを自動調整 */
}
.feature-articles-section .feature-article-item h3 {
    font-size: 14px;
    -webkit-line-clamp: 2; /* 2行まで表示 */
    height: 3em; /* 2行分の高さを確保 */
    line-height: 1.5em;
}
/*--スマホ--*/
@media only screen and (max-width: 680px) {
    .feature-articles-section {
        margin-top: 40px;
    }

    .feature-articles-section .section-title {
        font-size: 24px !important;
    }

    .feature-articles-section .feature-article-item {
        width: calc(50% - 10px); /* SPでは2カラム */
        margin-bottom: 0px !important;
    }

    .feature-articles-section .feature-article-item .excerpt-message {
        width: 100% !important;
        float: none !important;
    }

    .feature-articles-section .feature-article-item h3 {
        font-size: 13px !important;
    }
}
/* --- 特集記事一覧の抜粋文を長く表示するための調整（上書） --- */
article.feature-list-item .excerpt-message {
    height: auto !important;
}
article.feature-list-item .excerpt-message p {
    -webkit-line-clamp: 6 !important; /* 表示行数を増やす（約140字を想定） */
    height: auto !important;
}
@media only screen and (max-width: 680px) {
    article.feature-list-item .excerpt-message {
        height: auto !important;
    }
    article.feature-list-item .excerpt-message p {
       -webkit-line-clamp: 9 !important; /* スマホは幅が狭いのでさらに行数を増やす */
       height: auto !important;
    }
}
/* --- Feature Article Detail Base Styles --- */
.golook-feature-article {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.7;
  color: #333;
}
.golook-feature-article h1, .golook-feature-article h2, .golook-feature-article h3, .golook-feature-article p {
  margin: 0;
  padding: 0;
}
.golook-feature-article a {
  color: inherit;
  text-decoration: none;
}
.golook-feature-article img {
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
  border-radius: 8px;
}
.golook-feature-article .feature-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}
/* --- Header --- */
.feature-header {
  margin-bottom: 1em;
}
.feature-header h1 {
  font-size: 28px !important; /* style.cssを非継承 */
  font-weight: 700;
  text-align: left;
  line-height: 1.5;
  margin-top: 1.5em;
  padding-left: 20px;
  border-left: 8px solid #333;
  background-color: transparent;
  border-radius: 0;
}
/* --- Introduction --- */
.feature-intro {
  margin-top: 40px !important; /* style.cssを非継承 */
  margin-bottom: 40px !important; /* style.cssを非継承 */
  font-size: 16px !important; /* style.cssを非継承 */
}
.feature-intro p {
  margin-bottom: 1.5em;
  text-align: left;
}
.marker-highlight {
  background: linear-gradient(transparent 60%, #ffecb3 60%);
  font-weight: 700;
}
/* --- Brand Section --- */
.brand-section {
  padding-top: 10px;
  border-top: 1px solid #eee;
  margin-bottom: 30px !important; /* style.cssを非継承 */
}
.brand-section h2 {
  font-size: 24px !important; /* style.cssを非継承 */
  font-weight: 700;
  text-align: left;
  margin-bottom: 0.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.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: 2.5em;
  text-align: left;
}
/* --- Product Grid --- */
.product-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 2em;
}
/* 「特集アイテム一覧」(#feature-items) のグリッドだけ、CSS Gridを使用して強制的に2列にする */
#feature-items .product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px; /* うまくいっていたHTMLの指定に合わせます */
}
.product-card {
  flex: 1 1 calc(50% - 15px); /* PC/Tablet/Plus = 2列 */
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-card.full-width {
 flex: 1 1 100%; /* 注目商品は常に1列 */
}
.product-card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.product-card-content h3 {
  font-size: 18px !important; /* style.cssを非継承 */
  font-weight: 700;
  margin-bottom: 0.5em;
  text-align: center;
}
.product-card-content h3 a:hover {
  text-decoration: underline;
}
.product-card-content .product-subtitle {
  font-size: 16px !important; /* style.cssを非継承 */
  font-weight: 700;
  color: #333;
  margin-bottom: 1em;
  text-align: center; /* 5. PCでは中央揃え */
}
.product-card-content p {
  font-size: 15px;
  margin-bottom: 1.5em;
  flex-grow: 1;
  text-align: left;
}
.product-card-footer {
  margin-top: 15px; /* autoから変更 */
  text-align: right; /* 右寄せ */
}
.product-card-footer .other-colors {
  display: block;
  font-size: 14px;
  text-align: center;
  margin-top: 1em;
}
.product-card-footer .other-colors strong {
  display: block;
  margin-bottom: 0.5em;
}
.product-card-footer .other-colors a {
  color: #148ACC;
  text-decoration: underline;
  margin: 0 0.5em;
  font-size: 16px;
  display: inline;
}
.product-card-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* PC/Tablet/Plus = 2列 */
  gap: 10px;
  margin-top: 10px;
  padding: 0 20px; /* product-card-contentのpaddingに合わせる */
}
.product-card.full-width .product-card-gallery {
  padding: 0; /* 1列フル幅の注目商品はpadding不要 */
}
/* --- CTA Button --- */
.cta-button-wrap {
  text-align: center;
  margin-top: 1em;
  margin-bottom: 2em;
}
.cta-button-primary {
  display: inline-block;
  background-color: #000;
  color: #fff !important; /* 文字色を白に */
  font-size: 24px !important; /* style.cssを非継承 */
  font-weight: 700;
  padding: 0.8em 2.5em;
  border-radius: 8px;
  letter-spacing: 0.1em;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}
.cta-button-primary:hover {
  opacity: 0.8;
}

/* 編集後記内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 {
    opacity: 0.8;
}
/* カード内CTA（白ボタン） */
.cta-button-secondary {
  display: inline-block; 
  padding: 10px 15px; 
  background-color: #ffffff; 
  color: #000000 !important;
  border: 1px solid #000000; 
  text-decoration: none !important; 
  border-radius: 5px; 
  font-size: 14px; 
  font-weight: bold;
  transition: opacity 0.3s ease;
}
.cta-button-secondary:hover {
  opacity: 0.8;
}
/* ジャック記事CTA（黄ボタン） */
.cta-button-jack {
  display: inline-block; 
  padding: 10px 15px; 
  background-color: #f8e61d; 
  color: #000000 !important;
  border: 1px solid #000000; 
  text-decoration: none !important;
  border-radius: 5px; 
  font-size: 14px; 
  font-weight: bold;
  transition: opacity 0.3s ease;
}
.cta-button-jack:hover {
  opacity: 0.8;
}
/* --- Related Articles --- */
.related-articles {
  margin-top: 3em;
  padding: 1em 10px;
  background-color: #f9f9f9;
}
.related-articles h2 {
  text-align: center;
  font-size: 24px !important;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  padding: 0 !important;
}
.related-articles h2 img {
  height: 80px !important;
  width: auto;
  margin-right: 15px;
  border-radius: 0;
  vertical-align: middle;
}
.related-articles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.related-article-card {
  flex: 1 1 calc(50% - 10px);
  min-width: 250px;
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.related-article-card-content {
  padding: 20px;
}
.related-article-card-content h3 {
  font-size: 16px !important;
  margin-bottom: 0.75em;
  text-align: left;
}
.related-article-card-content p {
  font-size: 14px !important;
  color: #555;
  margin-bottom: 1em;
  text-align: left;
}
.related-article-card-content .read-more {
  display: none; /* .cta-button-jack を使用するため非表示 */
}
.related-article-card .product-card-footer {
  text-align: right;
  margin-top: 15px;
}
/* --- Final CTA Section --- */
.final-cta-section {
  background-color: #E7E7E7;
  padding: 2em 0;
  margin-top: 3em;
}
.final-cta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
}
.final-cta-button {
  display: block;
  flex: 1 1 200px;
  max-width: 280px;
  padding: 1em;
  font-size: 14px !important;
  font-weight: 700;
  color: #fff;
  border-radius: 8px;
  text-align: center;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}
.final-cta-button:hover {
  opacity: 0.8;
}
.final-cta-button.red { background-color: #EC6478; }
.final-cta-button.blue { background-color: #148ACC; }
.final-cta-button.black { background-color: #000; color: #fff; margin-top: 1em; flex-basis: 100%; white-space: nowrap; }

/* 最終CTA（白ボタン） */
.final-cta-button.white {
  background-color: #ffffff; 
  color: #000000 !important;
  border: 1px solid #000000;
}
/* --- Responsive Styles --- */
@media (max-width: 680px) {
  .golook-feature-article .feature-container {
    padding: 0 15px;
  }
  .feature-header h1 {
    font-size: 22px !important;
  }
  .product-card-content h3,
  .product-card-content .product-subtitle {
    text-align: left; /* スマホでは左寄せ */
  }
  .brand-section h2 {
    font-size: 20px !important;
  }
  .related-articles {
    padding: 1em 5px !important;
  }
  .related-articles h2 {
    font-size: 16px !important;
    white-space: nowrap;
  }
  .related-articles h2 img {
    height: 60px !important;
    margin-right: 8px;
  }
  /* .product-card の1列化を削除し、.related-article-card のみ 1列化する。*/
  .related-article-card {
    flex: 1 1 100%;
  }
  .final-cta-button {
    flex: 1 1 100%;
  }
  .cta-button-primary {
    font-size: 20px;
    width: 100%;
    box-sizing: border-box;
    padding: 0.8em 0.5em;
  }
}
@media (max-width: 429px) {
  .product-card {
    flex: 1 1 100% !important; /* 特集一覧(2列)と注目商品(1列)の両方に適用 */
  }
  .product-card-gallery {
    grid-template-columns: 1fr !important; /* ギャラリーも1列にする */
  }
  /* 429px以下では「特集アイテム一覧」も1列にする ▼▼▼ */
  #feature-items .product-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Table of Contents (ID + !important Version) --- */
#feature-toc {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 25px 30px;
    margin-top: 40px !important;
    margin-bottom: 50px !important;
}
#feature-toc h3 {
    font-size: 18px !important;
    font-weight: 700;
    text-align: center;
    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: #ddd;
    display: block;
}
#feature-toc h3::before {
    margin-right: 0.8em;
}
#feature-toc h3::after {
    margin-left: 0.8em;
}
#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: 16px !important;
    font-weight: 700;
    padding-left: 0 !important;
    margin-bottom: 1em;
    counter-increment: toc-counter;
    background-image: none !important;
    line-height: 1.6 !important;
}
#feature-toc li:last-child {
    margin-bottom: 0;
}
#feature-toc li a {
    display: block;
    text-decoration: none !important;
    color: #333 !important;
    background-color: #fff;
    padding: 0.8em 1em 0.8em 2.8em;
    border-radius: 5px;
    position: relative;
    transition: background-color 0.3s;
    border: 1px solid #ddd;
}
#feature-toc li a:hover {
    background-color: #f0f0f0;
}
#feature-toc li a::before {
    content: counter(toc-counter);
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background-color: #333;
    border-radius: 5px 0 0 5px;
}
@media (max-width: 680px) {
  #feature-toc {
    padding: 20px !important;
  }
}

/* =========================================================================
 * 1050px境界：カテゴリナビゲーション（セレクトボックス / 横並びリンク）の完全制御
 * ========================================================================= */
@media (max-width: 1049px) {
    /* 1050px未満: PC用の文字のみ横並びナビを非表示にし、横幅圧縮による崩壊を防止 */
    .category-nav-pc {
        display: none !important;
    }
    /* 代わりにSP用のセレクトボックスを表示 */
    .category-nav-sp {
        display: block !important;
    }
}
@media (min-width: 1024px) and (max-width: 1049px) {
    /* Tailwindの lg:flex-row が発動し、見出しとセレクトボックスが「1行で横並び」になる帯域でのみ、幅を縮小・右寄せして見出しへの被りを防ぐ */
    .category-nav-sp {
        width: auto !important;
        min-width: 220px !important;
        max-width: 280px !important;
        margin-left: auto !important; /* コンテナ内で右端へ寄せる */
    }
}
@media (min-width: 1050px) {
    /* 1050px以上: SP・TB用のセレクトボックスを非表示 */
    .category-nav-sp {
        display: none !important;
    }
    /* PC用の横並びナビを表示 */
    .category-nav-pc {
        display: flex !important;
    }
}

/* =========================================================================
 * TB画角 および SP画角（1049px以下）全般の微調整
 * ========================================================================= */
@media (max-width: 1049px) {
    /* HEROバナー：テキストエリアの最大幅制限(576px)を解除し、親のパディング内一杯に広げる（左寄りの解消） */
    .hero-banner > .flex > div:first-child > div.max-w-xl {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}
@media (min-width: 768px) and (max-width: 1049px) {
    /* HEROバナー：1050px未満（TB）ではTailwindによる予期せぬ横並びを完全に封印し、SPと同じ「画像上・テキスト下」に強制上書き */
    .hero-banner > .flex {
        flex-direction: column !important;
        height: auto !important;
        max-height: none !important;
    }
    
    /* First Child = Text Side */
    .hero-banner > .flex > div:first-child {
        width: 100% !important;
        max-width: 100% !important;
        order: 2 !important; /* テキストは下 */
        flex: none !important;
    }

    /* Last Child = Image Side */
    .hero-banner > .flex > div:last-child {
        width: 100% !important;
        max-width: 100% !important;
        order: 1 !important; /* 画像は上 */
        aspect-ratio: 1 / 1 !important; /* 縦長・横長にならず正方形表示を維持 */
        height: auto !important;
        flex: none !important;
    }
}

@media (min-width: 681px) and (max-width: 1049px) {
    /* ジャック店長の関連ストーリーh2タイトル: JSにより動的付与された .jack-story-heading を標的にTB専用サイズを適用 */
    .jack-story-heading {
        font-size: 24px !important;
        white-space: normal !important;
    }
    .jack-story-heading img {
        height: 80px !important;
        width: auto !important;
    }
}