@charset "UTF-8";
/*!
Theme Name: Cocoon Child
Description: Cocoon専用の子テーマ
Theme URI: https://wp-cocoon.com/
Author: わいひら
Author URI: https://nelog.jp/
Template: cocoon-master
Version: 2.0.0
*/

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
    --mst-primary: #19448e;
    --mst-primary-dark: #0d2d5e;
    --mst-primary-light: #2a5cb0;
    --mst-accent: #f6a068;
    --mst-accent-hover: #e8884a;
    --mst-text: #333;
    --mst-text-light: #666;
    --mst-text-muted: #999;
    --mst-bg: #f5f7fa;
    --mst-card-bg: #fff;
    --mst-border: #e2e8f0;
    --mst-border-light: #edf2f7;
    --mst-radius: 8px;
    --mst-radius-sm: 4px;
    --mst-shadow: 0 1px 3px rgba(0,0,0,0.08);
    --mst-shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --mst-max-width: 1200px;
}

/* ============================================================
   Base
   ============================================================ */
body {
    background: var(--mst-bg) !important;
}

/* ============================================================
   Header Search Box
   ============================================================ */
.header-in {
    position: relative;
}
.header-in .search-box {
    position: absolute;
    top: 50%;
    right: 16px;
    margin: 0;
    width: 280px;
    transform: translateY(-50%);
}
.header-in input[type="text"] {
    padding: 8px 14px 8px 40px;
    font-size: 14px;
    background: #edf6f9;
    border: 1px solid #9fcde1;
    border-radius: 16px;
}
.header-in .search-submit {
    top: 60%;
    left: 3px;
    right: auto;
    color: #378cb0;
}

/* ============================================================
   Eye catch hidden
   ============================================================ */
.eye-catch-wrap,
.eye-catch,
.article-header .eye-catch {
    display: none !important;
}

/* ============================================================
   Tags (top of article)
   ============================================================ */
.mst-tags-top {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--mst-border-light);
}
.mst-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: #eef2ff;
    color: var(--mst-primary) !important;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none !important;
    border: 1px solid #c7d2fe;
    transition: background 0.2s, border-color 0.2s;
    line-height: 1.5;
}
.mst-tag-pill:hover {
    background: var(--mst-primary);
    color: #fff !important;
    border-color: var(--mst-primary);
}

/* ============================================================
   Hide Cocoon SNS / Related
   ============================================================ */
.sns-share, .sns-share-buttons, .sns-follow-buttons,
.sns-share-message, .sns-follow,
div[class*="sns-share"], div[class*="sns-follow"],
.ss-top, .ss-bottom {
    display: none !important;
}
.tag-link, .entry-categories-tags .tag-link,
.article-footer .post-taxonomy, .post-taxonomy {
    display: none !important;
}
.related-entries, .related-entry-card-wrap, .related-list,
#related-entries, .related-entry-heading {
    display: none !important;
}

/* ============================================================
   Sidebar
   ============================================================ */
.mst-sidebar-cats,
.mst-sidebar-collections {
    background: var(--mst-card-bg) !important;
    border-radius: var(--mst-radius) !important;
    box-shadow: var(--mst-shadow) !important;
    padding: 20px !important;
}
.mst-sidebar-heading {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--mst-primary) !important;
    border-left: 3px solid var(--mst-accent) !important;
    padding: 0 0 0 10px !important;
    margin: 0 0 14px !important;
    background: none !important;
    border-bottom: none !important;
}
.mst-cat-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.mst-cat-list li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid var(--mst-border-light);
}
.mst-cat-list li:last-child { border-bottom: none; }
.mst-cat-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    color: var(--mst-text) !important;
    text-decoration: none !important;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
    border-radius: var(--mst-radius-sm);
}
.mst-cat-link:hover, .mst-cat-link.mst-cat-active {
    background: #eef2ff;
    color: var(--mst-primary) !important;
}
.mst-cat-badge {
    background: var(--mst-border);
    color: var(--mst-text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}
.mst-cat-link:hover .mst-cat-badge,
.mst-cat-link.mst-cat-active .mst-cat-badge {
    background: var(--mst-primary);
    color: #fff;
}

/* ============================================================
   Footer - All Icons Grid
   ============================================================ */
.mst-footer-icons {
    background: var(--mst-primary-dark);
    color: #fff;
    padding: 48px 0 32px;
}
.mst-footer-icons-inner {
    max-width: var(--mst-max-width);
    margin: 0 auto;
    padding: 0 16px;
}
.mst-footer-icons-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
    margin: 0 0 32px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255,255,255,0.2);
    text-align: center;
}
.mst-footer-cat { margin-bottom: 28px; }
.mst-footer-cat-name {
    font-size: 1em;
    font-weight: 600;
    color: var(--mst-accent);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mst-footer-cat-count {
    font-size: 11px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 400;
}
.mst-footer-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}
.mst-footer-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--mst-radius-sm);
    text-decoration: none !important;
    transition: background 0.2s, transform 0.15s;
    color: rgba(255,255,255,0.85) !important;
}
.mst-footer-icon-item:hover {
    background: rgba(255,255,255,0.14);
    transform: translateY(-2px);
}
.mst-footer-icon-item img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 4px;
    background: #fff;
    padding: 3px;
}
.mst-footer-icon-item span {
    font-size: 10px;
    text-align: center;
    line-height: 1.3;
    color: rgba(255,255,255,0.75);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mst-footer-cat-links {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mst-footer-cat-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    color: rgba(255,255,255,0.9) !important;
    text-decoration: none !important;
    font-size: 13px;
}
.mst-footer-cat-links a:hover { background: rgba(255,255,255,0.14); }
.mst-footer-cat-more {
    margin: 12px 0 0;
    font-size: 13px;
    text-align: center;
}
.mst-footer-cat-more a { color: var(--mst-accent) !important; }

/* ============================================================
   Front Page Catalog
   ============================================================ */
.mst-front-catalog {
    max-width: var(--mst-max-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* Hero */
.mst-front-hero {
    text-align: center;
    padding: 32px 16px 24px;
    margin-bottom: 24px;
}
.mst-front-hero-sub {
    font-size: 14px;
    color: var(--mst-text-light);
    margin: 0 0 8px;
}
.mst-front-hero-count {
    font-size: 22px;
    color: var(--mst-text);
    margin: 0 0 8px;
    line-height: 1.4;
}
.mst-front-hero-count strong {
    color: var(--mst-primary);
    font-size: 28px;
}
.mst-front-hero-note {
    font-size: 13px;
    color: var(--mst-text-muted);
    margin: 0;
}

.mst-front-hero-link {
    font-size: 13px;
    margin: 8px 0 0;
}

/* Collection Cards */
.mst-front-collections {
    margin-bottom: 32px;
}
.mst-front-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mst-primary);
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 3px solid var(--mst-accent);
}
.mst-front-collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}
.mst-front-collection-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--mst-card-bg);
    border: 1px solid var(--mst-border);
    border-radius: var(--mst-radius);
    text-decoration: none !important;
    color: var(--mst-text) !important;
    font-size: 13px;
    font-weight: 600;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.mst-front-collection-card:hover {
    border-color: var(--mst-primary);
    box-shadow: var(--mst-shadow-hover);
    color: var(--mst-primary) !important;
}
.mst-front-collection-count {
    font-size: 11px;
    color: var(--mst-text-muted);
    font-weight: 400;
}

/* Category Filter Chips */
.mst-front-filter {
    margin-bottom: 24px;
}
.mst-front-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.mst-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--mst-card-bg);
    border: 1px solid var(--mst-border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--mst-text);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.mst-chip:hover {
    border-color: var(--mst-primary);
    color: var(--mst-primary);
}
.mst-chip-active {
    background: var(--mst-primary) !important;
    color: #fff !important;
    border-color: var(--mst-primary) !important;
}
.mst-chip-count {
    font-size: 11px;
    opacity: 0.7;
}
.mst-chip-active .mst-chip-count {
    opacity: 0.85;
}

/* Icon Grid */
.mst-front-cat-section {
    margin-bottom: 28px;
    /* 2026-12-05 表示速度: 画面外のカテゴリはスクロールで近づくまで描画しない（アイコン2,700件のレイアウト負荷を減らす） */
    content-visibility: auto;
    contain-intrinsic-size: auto 2000px;
}
.mst-front-cat-heading {
    font-size: 15px;
    font-weight: 700;
    color: var(--mst-text);
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--mst-border-light);
}
.mst-front-cat-badge {
    font-size: 11px;
    background: var(--mst-primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.mst-front-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.mst-front-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px 10px;
    background: var(--mst-card-bg);
    border: 1px solid var(--mst-border);
    border-radius: var(--mst-radius);
    text-decoration: none !important;
    color: var(--mst-text) !important;
    transition: box-shadow 0.2s, transform 0.15s;
}
.mst-front-icon-card:hover {
    box-shadow: var(--mst-shadow-hover);
    transform: translateY(-2px);
    border-color: var(--mst-primary-light);
}
.mst-front-icon-card img {
    width: 72px !important;
    height: 72px !important;
    object-fit: contain;
    background: var(--mst-bg);
    border-radius: var(--mst-radius-sm);
    padding: 4px;
    margin-bottom: 6px;
}
.mst-front-icon-name {
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
    color: var(--mst-text-light);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Front page: hide Cocoon blog list and entry cards */
.front-page-type .entry-card-wrap,
.front-page-type .list,
.page .entry-card-wrap {
    /* Only hide on front page - handled by WP static front page setting */
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 1023px) {
    .header-in .search-box { display: none; }
}
@media (max-width: 834px) {
    .mst-footer-cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    .mst-front-icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
    .mst-front-collections-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
@media (max-width: 480px) {
    .mst-footer-cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    .mst-footer-icon-item img {
        width: 36px !important;
        height: 36px !important;
    }
    .mst-front-icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    .mst-front-icon-card img {
        width: 56px !important;
        height: 56px !important;
    }
}

/* ============================================================
   Multiplex Ad
   ============================================================ */
.mst-multiplex-ad {
    margin: 2em 0;
    padding: 1em 0;
    border-top: 1px solid #eee;
}

/* ============================================================
   グロナビ「テーマ別まとめ」ドロップダウン（2026-08-02）
   20件を2カラム表示。Cocoonのsub-menu表示制御(display切替)は
   上書きしないようcolumn-countで段組みする
   ============================================================ */
#navi .mst-nav-collections > .sub-menu {
  width: 480px;
  column-count: 2;
  column-gap: 0;
  padding: 6px 0;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
#navi .mst-nav-collections > .sub-menu > li {
  break-inside: avoid;
  width: 100%;
  border-bottom: 1px dotted #e5e5e5;
}
#navi .mst-nav-collections > .sub-menu > li > a {
  display: block;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: #333;
  height: auto;
}
#navi .mst-nav-collections > .sub-menu > li > a:hover {
  background: #f2f4f8;
  color: #1E2761;
}
/* まとめ一覧ハブページのグリッド微調整 */
.mst-hub-grid { margin: 20px 0 30px; }

/* 一覧系グリッド内広告・サイドバー追従広告（2026-10-01 単価改善 #2/#3） */
.mst-extra-ad {
    margin: 32px 0;
    padding: 8px 0;
    text-align: center;
    clear: both;
    width: 100%;
    flex-basis: 100%;
    min-height: 100px;
}
.mst-extra-ad-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    letter-spacing: .05em;
}
.mst-extra-ad-archive {
    grid-column: 1 / -1;
}
.mst-sidebar-scroll-ad .mst-extra-ad {
    margin: 0 0 20px;
    min-height: 250px;
}

/* ============================================================
   サイト内アイコン検索（2026-12-06。inc/mst-search.php・js/mst-search.js）
   ============================================================ */
.mst-sbar-wrap { height: 72px; }               /* 固定表示に切り替わっても本文がずれないよう高さを確保 */
.mst-sbar {
    height: 72px;
    background: #f3f9fb;
    border-bottom: 1px solid #d7e9f0;
}
.mst-sbar-in {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
}
.mst-sbox {
    position: relative;
    flex: 0 1 640px;
    margin: 0;
}
.mst-sbox input[type="search"] {
    width: 100%;
    height: 44px;
    padding: 0 76px 0 42px;
    font-size: 16px;
    background: #fff;
    border: 2px solid #9fcde1;
    border-radius: 22px;
    -webkit-appearance: none;
    appearance: none;
}
.mst-sbox input[type="search"]:focus { border-color: #378cb0; outline: none; box-shadow: 0 0 0 3px rgba(55,140,176,.15); }
.mst-sbox-icon {
    position: absolute; left: 16px; top: 22px; transform: translateY(-50%);
    color: #378cb0; font-size: 16px; pointer-events: none;
}
.mst-sbox-btn {
    position: absolute; right: 5px; top: 5px; height: 34px; padding: 0 16px;
    border: 0; border-radius: 17px; background: #378cb0; color: #fff; font-size: 14px; cursor: pointer;
}
.mst-sbox-btn:hover { background: #2c7697; }
.mst-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.mst-chips-lbl { color: #666; }
.mst-chip {
    display: inline-block; padding: 2px 10px; border: 1px solid #9fcde1; border-radius: 14px;
    background: #fff; color: #378cb0; text-decoration: none; line-height: 1.6; font-size: 12px;
}
.mst-chip:hover { background: #378cb0; color: #fff; }

/* スクロール時の固定表示（PCのみ。JSが is-fixed を付ける） */
.mst-sbar.is-fixed {
    position: fixed; top: 0; left: 0; right: 0; z-index: 999;
    height: 56px; box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.mst-sbar.is-fixed .mst-chips { display: none; }
.mst-sbar.is-fixed .mst-sbox input[type="search"] { height: 40px; }
.mst-sbar.is-fixed .mst-sbox-icon { top: 20px; }
.mst-sbar.is-fixed .mst-sbox-btn { top: 4px; height: 32px; }
.admin-bar .mst-sbar.is-fixed { top: 32px; }

/* 入力中の候補 */
.mst-dd {
    position: absolute; left: 0; top: calc(100% + 6px); width: min(900px, calc(100vw - 32px));
    background: #fff; border: 1px solid #d7e9f0; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 12px; z-index: 1000;
}
.mst-dd[hidden] { display: none; }
.mst-dd-h { margin: 0 4px 8px; font-size: 12px; color: #666; }
.mst-dd-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.mst-dd-item {
    display: block; padding: 6px 4px; border: 2px solid transparent; border-radius: 8px;
    color: #333; text-align: center; text-decoration: none; font-size: 11px; line-height: 1.35;
}
.mst-dd-item img { display: block; width: 56px; height: 56px; margin: 0 auto 4px; object-fit: contain; }
.mst-dd-item:hover, .mst-dd-item.is-sel { background: #edf6f9; border-color: #9fcde1; }
.mst-dd-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 4px 0; font-size: 12px; }
.mst-dd-lbl { color: #666; }
.mst-dd-col { padding: 3px 10px; border: 2px solid transparent; border-radius: 6px; background: #f1f5f7; color: #333; text-decoration: none; }
.mst-dd-col:hover, .mst-dd-col.is-sel { border-color: #9fcde1; }
.mst-dd-all {
    display: block; margin-top: 10px; padding: 8px; border: 2px solid transparent; border-radius: 6px;
    background: #378cb0; color: #fff !important; text-align: center; text-decoration: none; font-size: 13px;
}
.mst-dd-all:hover, .mst-dd-all.is-sel { background: #2c7697; border-color: #1d5f7c; }
.mst-dd-none { padding: 4px; font-size: 13px; color: #555; }
.mst-dd-rel { margin-top: 8px; }
.mst-dd-rel .mst-chip, .mst-sr-rel .mst-chip { margin: 0 4px 4px 0; }

/* 検索結果ページ */
.mst-sr-title .mst-sr-count { margin-left: 8px; font-size: .7em; font-weight: normal; color: #666; }
.mst-sr-body { min-height: 480px; }               /* 結果を描く前後で下の要素がずれないように */
.mst-sr-loading { color: #888; }
.mst-sr-rel { margin: 0 0 10px; font-size: 13px; color: #666; }
.mst-sr-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.mst-fchip {
    padding: 4px 12px; border: 1px solid #d7e9f0; border-radius: 14px; background: #fff;
    color: #333; font-size: 12px; cursor: pointer;
}
.mst-fchip.is-on { background: #378cb0; border-color: #378cb0; color: #fff; }
.mst-sr-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.mst-sr-cell {
    display: block; padding: 10px 4px; border: 1px solid #d7e9f0; border-radius: 8px; background: #fff;
    color: #333; text-align: center; text-decoration: none; font-size: 12px; line-height: 1.4;
}
.mst-sr-cell:hover { border-color: #378cb0; box-shadow: 0 2px 8px rgba(55,140,176,.15); }
.mst-sr-cell img { display: block; width: 96px; height: 96px; margin: 0 auto 6px; object-fit: contain; }
.mst-sr-pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 24px 0; }
.mst-sr-pager button { padding: 6px 12px; border: 1px solid #d7e9f0; border-radius: 4px; background: #fff; cursor: pointer; }
.mst-sr-pager button.is-on { background: #378cb0; border-color: #378cb0; color: #fff; }
.mst-sr-zero { padding: 16px 20px; background: #f6fafb; border-radius: 8px; font-size: 14px; line-height: 1.9; }
.mst-sr-cols { columns: 2; }

@media (min-width: 1024px) {
    html { scroll-padding-top: 64px; }          /* 固定バーで目次のジャンプ先が隠れないように */
}
/* スマホ・タブレットには検索バーを出さない（従来のヘッダー検索と同じ。モバイルは段階4で判断） */
@media (max-width: 1023px) {
    .mst-sbar-wrap { display: none; }
    .mst-sr-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 600px) {
    .mst-sr-grid { grid-template-columns: repeat(3, 1fr); }
    .mst-sr-cell img { width: 72px; height: 72px; }
}
