/* =========================================================
   Category PAGE STYLES
   Applies to /<category>/index.html and topic pages
   ========================================================= */

/* PAGE LAYOUT */
.content-narrow {
    max-width: 1180px;
    margin: 80px auto;
    text-align: left;
    padding: 0 20px;
    line-height: 1.8;
    color: var(--text);
}

/* CARD GRID */
.card-grid {
    max-width: 1180px;
    margin: 60px auto 120px;
    padding: 0 20px;

    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
}

/* CARD */
.card {
    background: var(--bg-panel, #151a20);
    border: 1px solid var(--border-light, #232a32);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: 0.25s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: var(--accent, #00d2ff);
}

/* CARD IMAGE */
.card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 18px;
}

/* CARD TITLE */
.card h3 {
    color: var(--text);
    font-weight: 500;
    margin-bottom: 12px;
}

/* CARD TEXT */
.card p {
    color: var(--text-secondary, #9a9a9a);
    margin-bottom: 22px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* CARD BUTTON */
.card-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 4px;
    background: var(--accent, #00d2ff);
    color: #000;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.25s ease;
}

.card-btn:hover {
    background: var(--accent-hover, #02e6ff);
}

/* DISABLED CARD PLACEHOLDER */
.card-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #777);
    border-style: dashed;
}

.card-disabled:hover {
    transform: none;
    border-color: var(--border-light, #1f1f1f);
    cursor: default;
}

/* TOPIC PAGE CONTENT AREA */
.topic-content {
    max-width: 1180px;
    margin: 80px auto;
    padding: 0 20px;
    line-height: 1.9;
}

.topic-content a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

.topic-content a:visited {
    color: #5bbbd8;
}

.topic-content a:hover {
    color: #7bc8e3;
    text-decoration: underline;
}

.topic-content h2 {
    color: var(--text);
    margin: 50px 0 20px;
}

/* Link style within the h2 */
.topic-content h2 a,
.topic-content h2 a:link,
.topic-content h2 a:visited {
    color: #ffffff;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size .18s ease, opacity .12s ease;
    opacity: 0.98;
}

.topic-content h2 a:hover,
.topic-content h2 a:active {
    background-size: 100% 2px;
    opacity: 1;
}

.topic-content h2 a:focus,
.topic-content h2 a:focus-visible {
    background-size: 100% 2px;
    outline: 3px solid rgba(255, 255, 255, 0.12);
    outline-offset: 4px;
    border-radius: 4px;
    text-decoration: none;
}

.topic-content p,

.topic-content ul {
    list-style-position: outside;
    padding-left: 1.2em;
    margin-bottom: 1em;
}

.topic-content li {
    color: var(--text-secondary, #c7c7c7);
    font-size: 1.05rem;
    margin-bottom: 0.5em;
    line-height: 1.6;
    padding-left: 0.5em;
    text-indent: 0em;
}

.topic-content li:last-child {
    margin-bottom: 2em;
}

.topic-content ul ul {
    padding-left: 2.5em;
}

.topic-content ul ul li {
    padding-left: 0.5em;
    text-indent: 0em;
    font-size: 1rem;
    /* 少し小さく */
    line-height: 1.4;
    /* 行間を狭く */
}

.topic-content ul ul li:last-child {
    margin-bottom: 1.5em;
}

.screenshot-img {
    max-width: 100%;
    /* 画面幅が画像より狭いときだけ縮小する */
    width: auto;
    /* ★重要：これを指定すると、元のサイズ以上に引き伸ばされません */
    height: auto;
    /* 縦横比を維持 */

    border-radius: 6px;
    /* 角丸 */
    border: 1px solid #232a32;
    /* 枠線 */
    margin-top: 10px;
    /* 余白 */
    display: block;
    /* ブロック表示 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    /* 少し影をつけて浮き上がらせる（任意） */
}

/* BREADCRUMB */
.breadcrumb {
    max-width: 1180px;
    margin: 40px auto 10px;
    padding: 0 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--accent);
}

.breadcrumb span {
    padding: 0 6px;
}

.breadcrumb,
.hero {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: left;
}

/* TABLE OF CONTENTS */
.toc {
    margin: 40px auto;
    max-width: 1180px;
    padding: 20px;
    border-left: 3px solid var(--accent);
    background: #0b0b0b;
    border-radius: 4px;
}

.toc h3 {
    margin-bottom: 12px;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin: 6px 0;
}

.toc a {
    color: var(--accent);
    font-size: 0.95rem;
}

/* RESPONSIVE */
@media (max-width: 600px) {
    .card-img {
        height: 130px;
    }
}