/* ===========================================
   Naruvia — Blog Styles
   =========================================== */

/* ---- Blog List Page ---- */

.blog-hero {
    padding-top: 9rem;
    padding-bottom: 3.5rem;
    background: var(--bg-warm);
}

.blog-hero .section-label {
    display: block;
    margin-bottom: 1rem;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
}

.blog-hero .blog-hero-desc {
    color: var(--text-body);
    max-width: 560px;
    line-height: 1.7;
}

.blog-list {
    padding: 4rem 0 7rem;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 760px;
}

.article-card {
    display: block;
    padding: 2rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-page);
    text-decoration: none;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.article-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 6px 24px rgba(0, 194, 209, 0.1);
    transform: translateY(-3px);
}

.article-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 0.75rem;
}

.article-card-title {
    font-size: 1.3rem;
    color: var(--text-main);
    line-height: 1.45;
    margin-bottom: 0.75rem;
    font-family: 'Noto Sans TC', 'Sora', sans-serif;
}

.article-card-excerpt {
    color: var(--text-body);
    font-size: 0.93rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.article-meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.5;
}

/* ---- Article Reading Page ---- */

.article-hero {
    padding-top: 9rem;
    padding-bottom: 3rem;
    background: var(--bg-warm);
}

.article-header {
    max-width: 740px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--cyan);
}

.back-link svg {
    flex-shrink: 0;
}

.article-header .article-tag {
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: clamp(1.7rem, 3.5vw, 2.4rem);
    line-height: 1.35;
    margin-bottom: 1.5rem;
    font-family: 'Noto Sans TC', 'Sora', sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.article-header .article-meta {
    padding-bottom: 0.25rem;
}

/* Reading body */
.article-body {
    padding: 4rem 0 6rem;
}

.article-content {
    max-width: 740px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-body);
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
}

.article-content h2 {
    font-size: 1.35rem;
    margin: 3rem 0 1rem;
    color: var(--text-main);
    font-family: 'Noto Sans TC', 'Sora', sans-serif;
    font-weight: 700;
    line-height: 1.4;
}

.article-content h3 {
    font-size: 1.1rem;
    margin: 2rem 0 0.75rem;
    color: var(--text-main);
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.6rem;
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.6rem 1.75rem;
}

.article-content li {
    margin-bottom: 0.6rem;
    line-height: 1.85;
}

.article-content strong {
    color: var(--text-main);
    font-weight: 700;
}

.article-content blockquote {
    border-left: 3px solid var(--cyan);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-warm);
    border-radius: 0 12px 12px 0;
    font-style: normal;
    color: var(--text-main);
}

.article-content blockquote p {
    margin-bottom: 0;
    font-size: 1.05rem;
    line-height: 1.75;
}

.article-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 2.5rem 0;
}

/* Author box */
.author-box {
    max-width: 740px;
    margin: 3.5rem auto 0;
    padding: 1.75rem 2rem;
    background: var(--bg-warm);
    border-radius: 16px;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.author-info .author-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-family: 'Sora', sans-serif;
}

.author-info .author-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.author-info .author-bio {
    font-size: 0.875rem;
    color: var(--text-body);
    line-height: 1.65;
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
}

/* Article CTA */
.article-cta {
    max-width: 740px;
    margin: 3rem auto 0;
    padding: 2.5rem;
    background: var(--gradient);
    border-radius: 20px;
    text-align: center;
}

.article-cta h3 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.article-cta p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.75rem;
    font-size: 0.93rem;
    line-height: 1.7;
    font-family: 'Noto Sans TC', 'Inter', sans-serif;
}

.article-cta .btn-white {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    background: white;
    color: var(--navy);
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 100px;
    text-decoration: none;
    transition: all 0.25s;
}

.article-cta .btn-white:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.article-footer-nav {
    max-width: 740px;
    margin: 3rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
}

.article-footer-nav .back-link {
    margin-bottom: 0;
}

/* ---- Layer Stack (三層框架 component) ---- */

.layer-stack {
    margin: 2rem 0;
    border: 1px solid var(--border-light, #e5e7eb);
    border-radius: 10px;
    overflow: hidden;
}

.layer-item {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--border-light, #e5e7eb);
    border-left: 4px solid transparent;
    background: #fff;
}

.layer-item:last-child {
    border-bottom: none;
}

.layer-item--1 { border-left-color: #94a3b8; }
.layer-item--2 { border-left-color: #3b82f6; }
.layer-item--3 { border-left-color: #8b5cf6; }

.layer-name {
    flex: 0 0 150px;
    min-width: 150px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading, #1a1a2e);
    line-height: 1.4;
    padding-top: 0.15rem;
}

.layer-body {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--text-body, #4b5563);
    line-height: 1.55;
}

.layer-uses {
    margin: 0 0 0.45rem;
}

.layer-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.layer-tag {
    font-size: 0.775rem;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
}

.layer-tag--drucker {
    background: #f3f4f6;
    color: #374151;
}

.layer-tag--pl {
    background: #eff6ff;
    color: #1e40af;
}

@media (max-width: 560px) {
    .layer-item {
        flex-direction: column;
        gap: 0.4rem;
    }
    .layer-name {
        flex: none;
        min-width: unset;
        padding-bottom: 0.1rem;
    }
}

/* ---- Article Table ---- */

.article-table-wrap {
    overflow-x: auto;
    margin: 2rem 0;
    -webkit-overflow-scrolling: touch;
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    line-height: 1.6;
    table-layout: fixed;
}

.article-table th,
.article-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border: 1px solid var(--border-light, #e5e7eb);
    vertical-align: top;
}

.article-table thead th {
    background: var(--bg-warm, #f9f7f4);
    font-weight: 600;
    color: var(--text-heading, #1a1a2e);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.article-table tbody tr:nth-child(even) td {
    background: var(--bg-warm, #f9f7f4);
}

/* 4-column layout: layer | usage | category | P&L */
.article-table.cols-4 th:nth-child(1),
.article-table.cols-4 td:nth-child(1) { width: 22%; }
.article-table.cols-4 th:nth-child(2),
.article-table.cols-4 td:nth-child(2) { width: 35%; }
.article-table.cols-4 th:nth-child(3),
.article-table.cols-4 td:nth-child(3) { width: 20%; }
.article-table.cols-4 th:nth-child(4),
.article-table.cols-4 td:nth-child(4) { width: 23%; }

/* 3-column layout */
.article-table.cols-3 th:nth-child(1),
.article-table.cols-3 td:nth-child(1) { width: 22%; }
.article-table.cols-3 th:nth-child(2),
.article-table.cols-3 td:nth-child(2) { width: 30%; }
.article-table.cols-3 th:nth-child(3),
.article-table.cols-3 td:nth-child(3) { width: 48%; }

@media (max-width: 640px) {
    .article-table {
        font-size: 0.875rem;
        table-layout: auto;
    }
    .article-table th,
    .article-table td {
        padding: 0.6rem 0.75rem;
    }
}

/* ---- Responsive ---- */

@media (max-width: 800px) {
    .article-header,
    .article-content,
    .author-box,
    .article-cta {
        max-width: 100%;
    }

    .article-header h1 {
        font-size: 1.55rem;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.85;
    }

    .author-box {
        flex-direction: column;
        gap: 1rem;
    }

    .article-cta {
        padding: 2rem 1.5rem;
    }

    .article-card {
        padding: 1.5rem;
    }
}
