/* ====================================================
   軽マッチ ブログ — 共通スタイル
   ==================================================== */

/* Reading progress bar (top of viewport) */
.read-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #007AFF, #FFD500);
    z-index: 100;
    transition: width 0.1s linear;
    width: 0;
}

/* ====================================================
   Article container & typography
   ==================================================== */

.article-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .article-wrapper {
        grid-template-columns: 240px 1fr;
        gap: 4rem;
    }
}

.article-main {
    min-width: 0;
}

.article-content {
    font-size: 16px;
    line-height: 1.95;
    color: #1f2937;
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .article-content {
        font-size: 17px;
    }
}

.article-content > p:first-of-type {
    font-size: 1.1em;
    color: #111827;
    font-weight: 500;
}

.article-content p {
    margin-bottom: 1.5em;
}

/* H2: section heading with accent number */
.article-content h2 {
    position: relative;
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    line-height: 1.4;
    color: #111827;
    border-left: 6px solid #007AFF;
}

.article-content h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #007AFF 0%, #FFD500 100%);
    margin-top: 0.75rem;
    border-radius: 2px;
}

@media (min-width: 768px) {
    .article-content h2 {
        font-size: 1.85rem;
    }
}

/* H3: subsection */
.article-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
    padding-left: 0.75rem;
    border-left: 4px solid #FFD500;
    line-height: 1.5;
}

@media (min-width: 768px) {
    .article-content h3 {
        font-size: 1.4rem;
    }
}

/* Lists */
.article-content ul,
.article-content ol {
    margin: 1.5em 0;
    padding-left: 1.5rem;
}

.article-content ul {
    list-style: none;
    padding-left: 0;
}

.article-content ul li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.85;
}

.article-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 8px;
    height: 8px;
    background: #007AFF;
    border-radius: 50%;
}

.article-content ol {
    counter-reset: list;
    list-style: none;
    padding-left: 0;
}

.article-content ol li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.85;
    counter-increment: list;
}

.article-content ol li::before {
    content: counter(list);
    position: absolute;
    left: 0;
    top: 0.15em;
    width: 1.7rem;
    height: 1.7rem;
    background: #007AFF;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Strong text */
.article-content strong {
    font-weight: 700;
    color: #007AFF;
    background: linear-gradient(transparent 65%, rgba(255, 213, 0, 0.25) 65%);
    padding: 0 2px;
}

/* Links */
.article-content a {
    color: #007AFF;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 2px solid rgba(0, 122, 255, 0.25);
    transition: border-color 0.2s ease;
}

.article-content a:hover {
    border-bottom-color: #007AFF;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    font-size: 0.92rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.article-content th,
.article-content td {
    padding: 0.9rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #E5E7EB;
}

.article-content th {
    background: #1F2937;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.article-content tbody tr:nth-child(even) {
    background: #F9FAFB;
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

/* Blockquotes */
.article-content blockquote {
    position: relative;
    border-left: 5px solid #007AFF;
    background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%);
    padding: 1.5rem 1.5rem 1.5rem 3.5rem;
    margin: 2rem 0;
    border-radius: 0.5rem;
    font-style: italic;
    color: #1E40AF;
}

.article-content blockquote::before {
    content: "“";
    position: absolute;
    left: 0.75rem;
    top: -0.25rem;
    font-size: 4rem;
    color: #007AFF;
    font-family: Georgia, serif;
    line-height: 1;
    opacity: 0.3;
}

/* Info box */
.info-box {
    background: linear-gradient(135deg, #EFF6FF 0%, #FEF9C3 100%);
    border-left: 6px solid #007AFF;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.info-box strong {
    background: none;
    padding: 0;
    color: #1E40AF;
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.info-box ul {
    margin: 0;
    padding-left: 0;
}

.info-box ul li {
    margin-bottom: 0.4rem;
    padding-left: 1.5rem;
}

/* Warning / Caution box */
.warning-box {
    background: #FEF3C7;
    border-left: 6px solid #F59E0B;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    border-radius: 0.5rem;
    color: #92400E;
}

/* Highlight mark */
.article-content mark {
    background: linear-gradient(transparent 60%, rgba(255, 213, 0, 0.6) 60%);
    color: inherit;
    font-weight: 700;
    padding: 0 0.25rem;
}

/* ====================================================
   Table of Contents (sticky on desktop)
   ==================================================== */

.toc {
    background: #F9FAFB;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2.5rem;
    border: 1px solid #E5E7EB;
}

.toc h2,
.toc-title {
    font-size: 0.85rem !important;
    font-weight: 800 !important;
    color: #6B7280 !important;
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.toc h2::after,
.toc-title::after {
    display: none !important;
}

.toc ol {
    padding-left: 0;
    margin: 0;
    list-style: none;
    counter-reset: toc;
}

.toc ol li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.5rem;
    counter-increment: toc;
    font-size: 0.9rem;
    line-height: 1.5;
}

.toc ol li::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.1em;
    color: #9CA3AF;
    font-weight: 700;
    font-size: 0.8rem;
    width: auto;
    height: auto;
    background: none;
    border-radius: 0;
}

.toc a {
    color: #374151;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s ease;
}

.toc a:hover {
    color: #007AFF;
    border-bottom-color: #007AFF;
}

@media (min-width: 1024px) {
    .toc-sticky {
        position: sticky;
        top: 5rem;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
        scrollbar-width: thin;
    }
    .toc-sticky::-webkit-scrollbar {
        width: 4px;
    }
    .toc-sticky::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 2px;
    }
}

/* ====================================================
   Article Hero
   ==================================================== */

.article-hero {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 50%, #FFF 100%);
    padding: 3rem 1rem 3.5rem;
    border-bottom: 1px solid #E5E7EB;
}

@media (min-width: 768px) {
    .article-hero {
        padding: 4.5rem 1rem 5rem;
    }
}

.article-hero .container {
    max-width: 900px;
    margin: 0 auto;
}

.article-hero .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    letter-spacing: 0.02em;
}

.tag-pill.primary {
    background: #007AFF;
    color: white;
}

.tag-pill.accent {
    background: #FFD500;
    color: #111827;
}

.tag-pill.gray {
    background: #F3F4F6;
    color: #374151;
}

.article-hero h1 {
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1.35;
    color: #111827;
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .article-hero h1 {
        font-size: 2.5rem;
        line-height: 1.3;
    }
}

@media (min-width: 1024px) {
    .article-hero h1 {
        font-size: 3rem;
    }
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #6B7280;
    flex-wrap: wrap;
}

.article-meta .author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007AFF, #0A2540);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ====================================================
   Breadcrumb
   ==================================================== */

.breadcrumb-nav {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    padding: 0.75rem 0;
}

.breadcrumb-nav ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #6B7280;
}

.breadcrumb-nav a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-nav a:hover {
    color: #007AFF;
}

.breadcrumb-nav .current {
    color: #111827;
    font-weight: 600;
}

/* ====================================================
   Article footer card (author + CTA)
   ==================================================== */

.article-footer-card {
    background: #F9FAFB;
    border-radius: 1.5rem;
    padding: 2rem;
    margin: 3rem 0 1rem;
    border: 1px solid #E5E7EB;
}

.article-footer-card .author-block {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.article-footer-card .author-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007AFF, #0A2540);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.article-footer-card .author-info .name {
    font-weight: 700;
    color: #111827;
    font-size: 1rem;
}

.article-footer-card .author-info .desc {
    color: #6B7280;
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* ====================================================
   Article CTA section
   ==================================================== */

.article-cta {
    background: linear-gradient(135deg, #007AFF 0%, #005EDB 100%);
    color: white;
    padding: 3rem 1.5rem;
    border-radius: 1.5rem;
    text-align: center;
    margin: 3rem auto 2rem;
    max-width: 720px;
    box-shadow: 0 20px 40px -10px rgba(0, 122, 255, 0.3);
}

.article-cta h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    padding: 0;
    border: none;
}

.article-cta h2::after {
    display: none;
}

.article-cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.article-cta .cta-btn {
    display: inline-block;
    background: white;
    color: #007AFF;
    font-weight: 700;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 0 #FFD500;
    border: none;
}

.article-cta .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #FFD500;
}

.article-cta .cta-btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #FFD500;
}

/* ====================================================
   Blog Listing (index.html)
   ==================================================== */

.blog-hero {
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 213, 0, 0.15), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(0, 122, 255, 0.25), transparent 40%),
        linear-gradient(135deg, #0A2540 0%, #1E3A8A 100%);
    color: white;
    padding: 4rem 1rem 3.5rem;
    text-align: center;
}

@media (min-width: 768px) {
    .blog-hero {
        padding: 5.5rem 1rem 5rem;
    }
}

.blog-hero h1 {
    font-size: 2rem;
    font-weight: 900;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .blog-hero h1 {
        font-size: 3rem;
    }
}

.blog-hero p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

@media (min-width: 768px) {
    .blog-hero p {
        font-size: 1.1rem;
    }
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.blog-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border: 1px solid #F3F4F6;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
    border-color: #DBEAFE;
}

.blog-card .thumb {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #007AFF, #0A2540);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.blog-card .thumb.factoring {
    background:
        radial-gradient(circle at 80% 80%, rgba(255, 213, 0, 0.3), transparent 50%),
        linear-gradient(135deg, #007AFF 0%, #0A2540 100%);
}

.blog-card .thumb-label {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
    .blog-card .thumb-label {
        font-size: 2.5rem;
    }
}

.blog-card .body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card .body .pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.blog-card .body h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    color: #111827;
    margin: 0 0 1rem;
    flex: 1;
}

.blog-card .body .date {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.blog-card.coming-soon {
    background: #F9FAFB;
    border: 2px dashed #D1D5DB;
    box-shadow: none;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    color: #9CA3AF;
    font-size: 0.85rem;
    cursor: default;
}

.blog-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
    border-color: #D1D5DB;
}

/* ====================================================
   Article inline figures (hero / section images)
   ==================================================== */

.article-content figure {
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: #F5F5F5;
}

.article-content figure img,
.article-hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
}

.article-content figure figcaption {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #6B7280;
    text-align: center;
    background: #FAFAFA;
}

/* ====================================================
   Smooth scroll for anchor links
   ==================================================== */

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}
