/**
 * BREWING JAPAN — トップページスタイル
 *
 * 依存: bj-design-tokens.css → bj-global.css → bj-components.css → (this)
 * 対象: front-page.php が付与する .bj-top-page ラッパー
 * デザイン参照: Brewing Japan トップ 案B プレミアム.dc.html
 */

/* ================================================================
   0. Cocoon コンテナリセット
   トップページで Cocoon のコンテナ幅制約をリセットし、フルブリードを確保
   ================================================================ */

.bj-front-page #container,
.bj-front-page #main,
.bj-front-page #contents,
.bj-front-page .contents-in,
.bj-front-page #main-contents-all,
.bj-front-page #main-contents,
.bj-front-page .main-element,
.bj-front-page .wrap {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
}

/* Cocoon 標準サイドバー・広告ゾーンをすべて非表示（.bj-top-sidebar を使用） */
.bj-front-page #sidebar,
.bj-front-page .sidebar,
.bj-front-page #sidebody,
/* Cocoon 広告ゾーン（ヘッダー上下・記事前後・サイドバー内） */
.bj-front-page .ad-area,
.bj-front-page .ad-wrap,
.bj-front-page .ad-wrapper,
.bj-front-page #header-ads,
.bj-front-page .header-ads,
.bj-front-page .site-header-ads,
.bj-front-page .before-content-ads,
.bj-front-page .after-content-ads,
.bj-front-page .in-feed-ads,
.bj-front-page .above-the-fold,
/* Cocoon の右側ウィジェット列（サイドコンテンツ） */
.bj-front-page #sub-area,
.bj-front-page .sub-contents,
.bj-front-page #sideback {
    display: none !important;
}

/* Cocoon がデフォルトで出力するページタイトル・メタ情報・読書時間を非表示 */
.bj-front-page .entry-title,
.bj-front-page .entry-header,
.bj-front-page .cat-info,
.bj-front-page .post-cats,
.bj-front-page .post-date,
.bj-front-page .post-update,
.bj-front-page .reading-time,
.bj-front-page .after-title,
.bj-front-page .eye-catch,
.bj-front-page .entry-top,
.bj-front-page .entry-meta-bottom {
    display: none !important;
}

/* ================================================================
   0b. Cocoon ヘッダー スティッキー化
   デザインモックの sticky header を CSS で再現
   ================================================================ */

.bj-front-page #header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: rgba(255, 255, 255, .92) !important;
    backdrop-filter: saturate(140%) blur(8px) !important;
    -webkit-backdrop-filter: saturate(140%) blur(8px) !important;
    border-bottom: 1px solid #efe7d7 !important;
    box-shadow: none !important;
}

/* ================================================================
   1. ページラッパー
   ================================================================ */

.bj-top-page {
    width: 100%;
    overflow-x: hidden;
    background: #fff;
    color: var(--bj-text);
    font-family: var(--bj-font-sans);
    -webkit-font-smoothing: antialiased;
}

/* ================================================================
   2. ヒーロー（フルブリード）
   ================================================================ */

.bj-top-hero {
    position: relative;
    min-height: clamp(560px, 80vh, 780px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: #0B1223; /* 画像がない場合のフォールバック */
    background-size: cover;
    background-position: center 50%;
}

/* 縦方向グラデーション（下を暗くしてテキストを読みやすくする） */
.bj-top-hero__overlay-v {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(12, 10, 7, .22) 0%,
        rgba(12, 10, 7, .08) 38%,
        rgba(12, 10, 7, .72) 78%,
        rgba(12, 10, 7, .92) 100%
    );
}

/* 横方向グラデーション（左を暗くして余白テキストエリアを確保） */
.bj-top-hero__overlay-h {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(12, 10, 7, .80) 0%,
        rgba(12, 10, 7, .32) 50%,
        rgba(12, 10, 7, 0) 100%
    );
}

/* ゴーストワード装飾 */
.bj-top-hero__ghost {
    position: absolute;
    right: clamp(-10px, 1vw, 28px);
    top: clamp(40px, 9vw, 86px);
    font-family: var(--bj-font-display);
    font-weight: 700;
    font-size: clamp(70px, 15vw, 210px);
    line-height: .8;
    letter-spacing: -.02em;
    color: rgba(255, 255, 255, .06);
    pointer-events: none;
    user-select: none;
}

/* ヒーロー内コンテンツラッパー */
.bj-top-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 56px) clamp(46px, 6vw, 74px);
}

/* アイブロー（SINCE 2019 ライン） */
.bj-top-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: clamp(18px, 2.5vw, 26px);
}

.bj-top-hero__eyebrow-line {
    display: block;
    width: 34px;
    height: 2px;
    background: var(--bj-gold);
    flex-shrink: 0;
}

.bj-top-hero__eyebrow-text {
    font-family: var(--bj-font-display);
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 600;
    letter-spacing: .28em;
    color: var(--bj-gold-light);
}

/* H1 */
.bj-top-hero__h1 {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: clamp(33px, 5.1vw, 60px);
    line-height: 1.5;
    letter-spacing: .03em;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 30px rgba(0, 0, 0, .42);
}

.bj-top-hero__h1 em {
    font-style: normal;
    color: var(--bj-gold-light);
}

/* リード文 */
.bj-top-hero__lead {
    font-size: clamp(14px, 1.3vw, 17px);
    line-height: 1.95;
    color: rgba(255, 255, 255, .82);
    margin: clamp(20px, 2.5vw, 28px) 0 clamp(28px, 3.5vw, 38px);
    max-width: 560px;
    font-weight: 300;
}

/* CTA ボタン群 */
.bj-top-hero__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
}

.bj-top-hero__btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 16px 26px;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: clamp(15px, 1.2vw, 16px);
    transition:
        background var(--bj-duration) var(--bj-ease),
        border-color var(--bj-duration) var(--bj-ease),
        transform var(--bj-duration-fast) var(--bj-ease);
}

.bj-top-hero__btn--primary {
    background: var(--bj-amber);
    color: #fff;
    box-shadow: 0 14px 34px -14px rgba(194, 129, 28, .7);
}
.bj-top-hero__btn--primary:hover {
    background: var(--bj-amber-dark);
    transform: translateY(-1px);
    color: #fff;
}

.bj-top-hero__btn--ghost {
    background: rgba(255, 255, 255, .10);
    border: 1.5px solid rgba(255, 255, 255, .30);
    color: #fff;
    backdrop-filter: blur(4px);
}
.bj-top-hero__btn--ghost:hover {
    background: rgba(255, 255, 255, .18);
    color: #fff;
}
.bj-top-hero__btn--ghost span {
    color: var(--bj-gold-light);
}

/* ================================================================
   3. 共通セクションラッパー / 見出し
   ================================================================ */

.bj-top-section {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(20px, 5vw, 56px);
    padding-right: clamp(20px, 5vw, 56px);
}

.bj-top-cats-section     { margin-top: clamp(48px, 6vw, 64px); }
.bj-top-articles-section { margin-top: clamp(56px, 7vw, 74px); }
.bj-top-monetize-section { margin-top: clamp(58px, 7vw, 78px); }
.bj-top-bottomads-section {
    margin-top: clamp(48px, 6vw, 64px);
    margin-bottom: clamp(56px, 7vw, 74px);
}

.bj-top-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 26px;
}

.bj-top-section-h2 {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 26px);
    color: var(--bj-text);
    margin: 0;
}

.bj-top-label {
    font-family: var(--bj-font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .26em;
    color: var(--bj-amber);
    margin-bottom: 7px;
}

/* ================================================================
   4. カテゴリ 4カード
   ================================================================ */

.bj-top-cats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(225px, 1fr));
    gap: 16px;
}

.bj-top-cat-card {
    display: block;
    border-radius: 6px;
    border: 1px solid;
    padding: 24px 22px;
    text-decoration: none;
    transition:
        transform var(--bj-duration) var(--bj-ease),
        box-shadow var(--bj-duration) var(--bj-ease);
}
.bj-top-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px -18px rgba(21, 34, 63, .35);
}

.bj-top-cat-card__dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.bj-top-cat-card__no {
    font-family: var(--bj-font-display);
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.bj-top-cat-card__name {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 17px;
    color: var(--bj-navy);
    margin-bottom: 8px;
}

.bj-top-cat-card__desc {
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--bj-text-muted);
}

/* ================================================================
   5. 注目記事 + サイドバー レイアウト
   ================================================================ */

.bj-top-main-cols {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(28px, 3.5vw, 44px);
    align-items: flex-start;
}

.bj-top-main {
    flex: 1 1 560px;
    min-width: 0;
}

/* カテゴリラベルバッジ（全カードで共通） */
.bj-top-cat-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: var(--bj-text-link);
    background: #F6EBD6;
    padding: 4px 11px;
    border-radius: 2px;
    margin-bottom: 10px;
}

/* 注目記事（大カード） */
.bj-top-featured {
    display: block;
    text-decoration: none;
    margin-bottom: 34px;
}

.bj-top-featured__thumb {
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 18px;
    box-shadow: 0 16px 40px -22px rgba(21, 34, 63, .4);
}
.bj-top-featured__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--bj-duration-slow) var(--bj-ease);
}
.bj-top-featured:hover .bj-top-featured__thumb img {
    transform: scale(1.03);
}
.bj-top-featured__thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bj-cream-dark);
}

.bj-top-featured__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: clamp(19px, 2vw, 24px);
    line-height: 1.5;
    color: var(--bj-text);
    margin: 0 0 12px;
    transition: color var(--bj-duration) var(--bj-ease);
}
.bj-top-featured:hover .bj-top-featured__title {
    color: var(--bj-amber);
}

.bj-top-featured__excerpt {
    font-size: 14px;
    line-height: 1.95;
    color: var(--bj-text-sub);
    margin: 0 0 12px;
}

.bj-top-featured__date {
    font-family: var(--bj-font-mono);
    font-size: 11px;
    color: var(--bj-text-muted);
}

/* 記事グリッド（6本） */
.bj-top-article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.bj-top-article-card {
    display: block;
    text-decoration: none;
    transition: opacity var(--bj-duration) var(--bj-ease);
}
.bj-top-article-card:hover {
    opacity: .88;
}

.bj-top-article-card__thumb {
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 13px;
}
.bj-top-article-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bj-top-article-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bj-cream-dark);
}

.bj-top-article-card__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 16px;
    line-height: 1.55;
    color: var(--bj-text);
    margin: 0 0 9px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bj-top-article-card__date {
    font-family: var(--bj-font-mono);
    font-size: 11px;
    color: var(--bj-text-muted);
}

/* ================================================================
   6. サイドバー
   ================================================================ */

.bj-top-sidebar {
    flex: 1 1 270px;
    max-width: 320px;
}

.bj-top-sidebar__sticky {
    position: sticky;
    top: 88px; /* Cocoon ヘッダー高さ分オフセット */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- バナー共通 --- */
.bj-top-side-banner {
    display: flex;
    flex-direction: column;
    border-radius: 7px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 14px 30px -20px rgba(21, 34, 63, .5);
}

.bj-top-side-banner__label {
    font-family: var(--bj-font-mono);
    font-size: 10px;
    letter-spacing: .14em;
}

/* --- バナー: 講座 --- */
.bj-top-side-banner--lecture {
    position: relative;
    background: var(--bj-navy-dark);
    min-height: 168px;
    justify-content: flex-end;
    padding: 18px 18px 17px;
}
/* 背景画像のない場合のグラデーションフォールバック */
.bj-top-side-banner--lecture::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 18, 35, .15) 0%, rgba(11, 18, 35, .86) 100%);
}
.bj-top-side-banner--lecture .bj-top-side-banner__label {
    color: var(--bj-gold);
    position: relative;
    z-index: 1;
}
.bj-top-side-banner--lecture .bj-top-side-banner__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    line-height: 1.4;
    margin-top: 6px;
    position: relative;
    z-index: 1;
}
.bj-top-side-banner--lecture .bj-top-side-banner__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 11px;
    font-size: 12px;
    font-weight: 700;
    color: var(--bj-navy);
    background: var(--bj-gold);
    padding: 8px 13px;
    border-radius: 3px;
    align-self: flex-start;
    position: relative;
    z-index: 1;
}

/* --- バナー: 開業相談 --- */
.bj-top-side-banner--consul {
    background: var(--bj-navy);
    padding: 22px 20px;
    box-shadow: none;
}
.bj-top-side-banner--consul .bj-top-side-banner__label { color: var(--bj-gold); }
.bj-top-side-banner--consul .bj-top-side-banner__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    line-height: 1.45;
    margin: 10px 0 9px;
}
.bj-top-side-banner--consul .bj-top-side-banner__desc {
    font-size: 12px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .7);
    margin: 0 0 16px;
}
.bj-top-side-banner__btn--outline {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    border: 1.5px solid rgba(255, 255, 255, .45);
    padding: 9px 15px;
    border-radius: 3px;
}

/* --- バナー: 掲載依頼 --- */
.bj-top-side-banner--press {
    background: var(--bj-cream);
    border: 1.5px solid var(--bj-border-strong);
    padding: 20px;
    box-shadow: none;
}
.bj-top-side-banner--press .bj-top-side-banner__label {
    color: var(--bj-amber);
    margin-bottom: 9px;
}
.bj-top-side-banner--press .bj-top-side-banner__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 16px;
    color: var(--bj-navy);
    line-height: 1.45;
    margin-bottom: 12px;
}
.bj-top-side-banner__link {
    font-size: 12px;
    font-weight: 700;
    color: var(--bj-text-link);
}

/* --- 広告枠 --- */
.bj-top-side-ad {
    border: 1.5px dashed #d8cbac;
    border-radius: 7px;
    background: #fbf8f1;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.bj-top-side-ad--sm { height: 120px; }

.bj-top-side-ad__label {
    font-family: var(--bj-font-mono);
    font-size: 12px;
    letter-spacing: .16em;
    color: #bba97f;
}
.bj-top-side-ad__size {
    font-family: var(--bj-font-mono);
    font-size: 11px;
    color: #cbbb95;
}

/* --- 人気記事ランキング --- */
.bj-top-ranking {
    border: 1px solid var(--bj-border);
    border-radius: 7px;
    background: #fff;
    padding: 20px 18px;
}

.bj-top-ranking__head {
    display: flex;
    align-items: baseline;
    gap: 9px;
    margin-bottom: 16px;
    border-bottom: 1px solid #f0e8d8;
    padding-bottom: 13px;
}

.bj-top-ranking__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 16px;
    color: var(--bj-text);
}

.bj-top-ranking__label {
    font-family: var(--bj-font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .16em;
    color: var(--bj-amber);
}

.bj-top-ranking__list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bj-top-ranking__item {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
}
.bj-top-ranking__item:hover .bj-top-ranking__item-title {
    color: var(--bj-amber);
}

.bj-top-ranking__rank {
    font-family: var(--bj-font-display);
    font-weight: 700;
    font-size: 18px;
    flex: 0 0 18px;
}

.bj-top-ranking__thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    overflow: hidden;
}
.bj-top-ranking__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bj-top-ranking__thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bj-cream-dark);
}

.bj-top-ranking__item-title {
    font-family: var(--bj-font-sans);
    font-weight: 500;
    font-size: 12.5px;
    line-height: 1.55;
    color: #2a2722;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--bj-duration) var(--bj-ease);
}

/* ================================================================
   7. 収益化 3カード
   ================================================================ */

.bj-top-monetize {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}

.bj-top-monetize-card {
    background: var(--bj-cream);
    border: 1px solid var(--bj-border);
    border-top: 3px solid; /* border-top-color はインラインで指定 */
    border-radius: 7px;
    padding: 30px 26px;
}

.bj-top-monetize-card__label {
    font-family: var(--bj-font-mono);
    font-size: 11px;
    letter-spacing: .12em;
    margin-bottom: 12px;
}

.bj-top-monetize-card__title {
    font-family: var(--bj-font-serif);
    font-weight: 700;
    font-size: 18px;
    color: var(--bj-navy);
    margin-bottom: 9px;
}

.bj-top-monetize-card__desc {
    font-size: 13px;
    line-height: 1.85;
    color: var(--bj-text-muted);
    margin: 0 0 18px;
}

.bj-top-monetize-card__link {
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.bj-top-monetize-card__link:hover {
    text-decoration: underline;
}

/* ================================================================
   8. 下部広告枠
   ================================================================ */

.bj-top-bottomads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.bj-top-bottomad {
    border: 1.5px dashed #d8cbac;
    border-radius: 7px;
    background: #fbf8f1;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bj-top-bottomad__label {
    font-family: var(--bj-font-mono);
    font-size: 12px;
    letter-spacing: .16em;
    color: #bba97f;
}

.bj-top-bottomad__size {
    font-family: var(--bj-font-mono);
    font-size: 11px;
    color: #cbbb95;
}

/* ================================================================
   9. レスポンシブ
   ================================================================ */

/* タブレット（900px 以下）: サイドバーを本文下部へ移動 */
@media (max-width: 900px) {
    .bj-top-sidebar {
        max-width: none;
        width: 100%;
        flex: none;
    }
    .bj-top-sidebar__sticky {
        position: static;
    }
    .bj-top-main-cols {
        flex-direction: column;
    }
}

/* スマートフォン（560px 以下） */
@media (max-width: 560px) {
    .bj-top-cats {
        grid-template-columns: 1fr;
    }
    .bj-top-article-grid {
        grid-template-columns: 1fr;
    }
    .bj-top-hero__btns {
        flex-direction: column;
    }
    .bj-top-hero__btn {
        width: 100%;
        justify-content: center;
    }
    .bj-top-monetize {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   10. 自社バナー（直書き）
   ================================================================ */

.bj-top-company-banners {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bj-top-company-banners__label {
    font-family: var(--bj-font-mono);
    font-size: 10px;
    letter-spacing: .14em;
    color: var(--bj-text-muted);
    margin: 0 0 2px;
}

.bj-top-company-banner {
    display: block;
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--bj-border);
    transition:
        opacity var(--bj-duration) var(--bj-ease),
        transform var(--bj-duration-fast) var(--bj-ease),
        box-shadow var(--bj-duration) var(--bj-ease);
}

.bj-top-company-banner:hover {
    opacity: .88;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -8px rgba(21, 34, 63, .25);
}

.bj-top-company-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* モーションリデュース */
@media (prefers-reduced-motion: reduce) {
    .bj-top-cat-card,
    .bj-top-featured__thumb img,
    .bj-top-article-card,
    .bj-top-hero__btn,
    .bj-top-ranking__item-title {
        transition: none;
    }
    .bj-top-featured:hover .bj-top-featured__thumb img {
        transform: none;
    }
}
