/* ===== category_group ver0 ===== */

/* Hero */
.cg-hero {
    background: linear-gradient(135deg, #1a2a3a 0%, #2c4157 100%);
    padding: 50px 0 40px;
    text-align: center;
}
.cg-hero-thumb {
    max-width: 480px;
    margin: 0 auto 20px;
}
.cg-hero-thumb img {
    width: 100%;
    border-radius: 8px;
}
.cg-hero-title {
    font-size: 2em;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
}
.cg-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    margin: 0;
}

/* Group Nav (sticky) */
.cg-group-nav-wrap {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: top 0.3s ease;
}
/* ヘッダーが autohide で隠れたら隙間を潰す */
body.header-is-hidden .cg-group-nav-wrap {
    top: 0 !important;
}
.cg-group-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
}
.cg-group-nav::-webkit-scrollbar {
    display: none;
}
.cg-group-nav-item {
    flex-shrink: 0;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}
.cg-group-nav-item:hover,
.cg-group-nav-item.active {
    color: #1a2a3a;
    border-bottom-color: #ff3008;
    text-decoration: none;
}

/* Main */
.cg-main {
    background: #f7f8fa;
    padding: 40px 0 20px;
}

/* Sidebar */
.cg-sidebar {
    position: sticky;
    top: 140px;
}
.cg-sidebar-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}
.cg-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cg-sidebar-link {
    display: block;
    padding: 8px 10px;
    font-size: 0.82rem;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    line-height: 1.4;
    transition: background-color 0.2s, color 0.2s;
}
.cg-sidebar-link:hover {
    background: #e9ecef;
    color: #1a2a3a;
    text-decoration: none;
}
.cg-sidebar-link.active {
    background: #1a2a3a;
    color: #fff;
}

/* Article Content */
.cg-article {
    background: #fff;
    border-radius: 10px;
    padding: 32px 36px;
    margin-bottom: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cg-article .toc {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
}
.cg-article .content-body h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a2a3a;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a2a3a;
    margin: 32px 0 16px;
}
.cg-article .content-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin: 24px 0 12px;
}
.cg-article .content-body p {
    line-height: 1.9;
    color: #444;
}
.cg-article .content-body img {
    border-radius: 6px;
}
.cg-article .content-body ul,
.cg-article .content-body ol {
    margin: 1.2em 0;
    padding: 0 !important;
    list-style: none !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cg-article .content-body ul > li,
.cg-article .content-body ol > li {
    position: relative;
    padding: 14px 16px 14px 44px;
    margin-bottom: 0;
    font-size: 14.5px;
    line-height: 1.65;
    color: #2d3748;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e8ecf1;
    border-radius: 10px;
    list-style: none !important;
    transition: border-color .2s, box-shadow .2s;
}
.cg-article .content-body ul > li:hover,
.cg-article .content-body ol > li:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.cg-article .content-body ul > li::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 21px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.cg-article .content-body ol {
    counter-reset: ol-counter;
}
.cg-article .content-body ol > li {
    counter-increment: ol-counter;
}
.cg-article .content-body ol > li::before {
    content: counter(ol-counter);
    position: absolute;
    left: 14px;
    top: 12px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 6px;
    line-height: 1;
}
.cg-article .content-body li strong {
    color: #0f172a;
    font-weight: 600;
}

/* Ranking */
.cg-ranking {
    background: #fff;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cg-ranking-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1a2a3a;
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cg-ranking-title i {
    color: #f5a623;
    font-size: 1.1rem;
}
.cg-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cg-ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}
.cg-ranking-item:last-child {
    border-bottom: none;
}
.cg-ranking-item:hover {
    background-color: #faf6ee;
    text-decoration: none;
    color: inherit;
}
.cg-ranking-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: #aab2bd;
}
.cg-ranking-badge[data-rank="1"] {
    background: linear-gradient(135deg, #f5a623, #e8930c);
}
.cg-ranking-badge[data-rank="2"] {
    background: linear-gradient(135deg, #a8b0ba, #8a929c);
}
.cg-ranking-badge[data-rank="3"] {
    background: linear-gradient(135deg, #cd7f32, #b5692a);
}
.cg-ranking-img {
    flex-shrink: 0;
    width: 56px;
    height: 42px;
    border-radius: 4px;
    overflow: hidden;
    background: #eee;
}
.cg-ranking-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cg-ranking-info {
    flex: 1;
    min-width: 0;
}
.cg-ranking-plan-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 3px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cg-ranking-company {
    font-size: 0.75rem;
    color: #888;
}

/* Category Section */
.cg-category {
    margin-bottom: 40px;
}
.cg-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #1a2a3a;
}
.cg-category-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a2a3a;
    margin: 0;
}
.cg-category-title a {
    color: inherit;
    text-decoration: none;
}
.cg-category-title a:hover {
    color: #ff3008;
}
.cg-category-count {
    font-size: 0.85rem;
    color: #888;
    font-weight: 400;
    margin-left: 10px;
}
.cg-category-more {
    font-size: 0.85rem;
    color: #ff3008;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.cg-category-more:hover {
    text-decoration: underline;
    color: #cc2606;
}
.cg-category-summary {
    font-size: 0.92rem;
    color: #555;
    line-height: 1.7;
    margin: -8px 0 20px;
}

/* Cards Grid */
.cg-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Card */
.cg-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
}
.cg-card-img {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
    background: #222;
}
.cg-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.2) 100%);
    z-index: 1;
    transition: background 0.3s;
}
.cg-card:hover .cg-card-img::after {
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.25) 100%);
}
.cg-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.cg-card:hover .cg-card-img img {
    transform: scale(1.05);
}
.cg-card-plan-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.5;
    z-index: 2;
}
.cg-card-body {
    padding: 10px 14px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.cg-card-meta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cg-card-meta-row {
    display: flex;
    align-items: center;
    font-size: 0.78rem;
    color: #666;
    gap: 6px;
}
.cg-card-meta-row i {
    color: #aaa;
    font-size: 0.72rem;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}
.cg-card-meta-row img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Form Section */
.cg-form-section {
    padding: 50px 0 40px;
    background: #f0f2f5;
    scroll-margin-top: 80px;
}
.cg-form-header {
    text-align: center;
    margin-bottom: 30px;
}
.cg-form-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a2a3a;
    margin: 0 0 10px;
}
.cg-form-sub {
    font-size: 1rem;
    color: #666;
    margin: 0;
}
.cg-form-wrap {
    max-width: 720px;
    margin: 0 auto;
}

/* Skyscraper Sticky Button */
.cg-sticky-cta {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    text-decoration: none;
    padding: 1rem 0.75rem;
    border-radius: 8px 0 0 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    box-shadow: -2px 2px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
}
.cg-sticky-cta.visible {
    opacity: 1;
    pointer-events: auto;
}
.cg-sticky-cta:hover {
    color: #fff;
    text-decoration: none;
    padding-right: 1rem;
    box-shadow: -4px 2px 20px rgba(231,76,60,0.4);
}
.cg-sticky-cta-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.cg-sticky-cta-sub {
    font-size: 0.7rem;
    opacity: 0.9;
}

/* ===== Responsive ===== */
@media (max-width: 991px) {
    .cg-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .cg-sidebar {
        display: none;
    }
    .cg-hero {
        padding: 35px 16px 30px;
    }
    .cg-hero-title {
        font-size: 1.5em;
    }
    .cg-group-nav-item {
        padding: 12px 14px;
        font-size: 0.82rem;
    }
    .cg-main {
        padding: 24px 0 10px;
    }
    .cg-article {
        padding: 20px 18px;
        margin-bottom: 24px;
    }
    .cg-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .cg-card-body {
        padding: 8px 10px 10px;
    }
    .cg-card-plan-name {
        font-size: 0.78rem;
        padding: 8px 10px;
    }
    .cg-category-header {
        margin-bottom: 14px;
    }
    .cg-category-title {
        font-size: 1.1rem;
    }
    .cg-category {
        margin-bottom: 30px;
    }
    .cg-ranking {
        padding: 14px 12px;
    }
    .cg-ranking-item {
        padding: 10px 8px;
        gap: 10px;
    }
    .cg-ranking-plan-name {
        font-size: 0.8rem;
    }
    .cg-ranking-img {
        width: 48px;
        height: 36px;
    }
    .cg-form-section {
        padding: 36px 0 30px;
    }
    .cg-form-title {
        font-size: 1.3rem;
    }
    .cg-sticky-cta {
        display: none;
    }
}
