@font-face {
    font-family: "Kanit Light";
    src: url("/assets/font/Kanit-Light.ttf") format("truetype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

.page-blog {
    min-height: 100vh;
}

.blog-hero {
    max-width: 920px;
    margin: 0 auto;
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
}

.blog-hero h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 0.95;
    letter-spacing: -0.05em;
}

.blog-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--hero-text-color);
    font-size: var(--hero-text-size);
    line-height: 1.6;
}

.search-container {
    max-width: 760px;
    margin: 0 auto 1.5rem;
    padding: 0 2rem;
}

.blog-search-container {
    max-width: 1200px;
    margin: 2rem auto 1.5rem;
    padding: 0 2rem;
    display: flex;
    justify-content: flex-end;
}

.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--d4-border);
    border-radius: 999px;
    background: var(--d4-surface);
    color: var(--d4-text);
    font: inherit;
    font-size: 1rem;
    padding: 1rem 3rem 1rem 1.25rem;
    outline: none;
}

.search-input:focus {
    border-color: rgba(255, 213, 0, 0.65);
    box-shadow: 0 0 0 4px rgba(255, 213, 0, 0.08);
}

.search-icon {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--d4-yellow);
}

.quick-nav {
    max-width: 1100px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-nav-title {
    color: var(--d4-text-muted);
    font-size: 0.95rem;
}

.quick-nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.quick-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--d4-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--d4-text-muted);
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}

.quick-nav-link:hover,
.quick-nav-link.active {
    color: #000;
    border-color: var(--d4-yellow);
    background: var(--d4-yellow);
    transform: translateY(-1px);
}

.blog-grid {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.blog-card {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--d4-border);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)), var(--d4-surface);
    color: var(--d4-text);
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 213, 0, 0.45);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.blog-card-tag {
    display: inline-block;
    border-radius: 999px;
    background: var(--d4-yellow);
    color: #000;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.7rem;
    margin-left: auto;
    flex-shrink: 0;
}

.blog-card-content {
    padding: 1.35rem;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.blog-card-meta,
.post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--d4-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.85rem;
    justify-content: space-between;
}

.blog-card-divider {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--d4-text-muted);
}

.blog-card-title {
    margin: 0 0 0.75rem;
    font-size: 1.45rem;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.blog-card-excerpt {
    color: var(--d4-text-muted);
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

.blog-card-footer {
    margin-top: auto;
    color: var(--d4-yellow);
    font-weight: 700;
}

.blog-empty {
    grid-column: 1 / -1;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--d4-text-muted);
}

.blog-pagination {
    max-width: 760px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--d4-text-muted);
}

.pagination-btn {
    border: 1px solid var(--d4-border);
    border-radius: 999px;
    background: var(--d4-surface);
    color: var(--d4-text);
    padding: 0.7rem 1rem;
    text-decoration: none;
}

.post-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 2.5rem 2rem 5rem;
}

.post-back {
    color: var(--d4-yellow);
    text-decoration: none;
    font-weight: 700;
}

.post-title {
    margin: 1rem 0;
    font-size: clamp(3rem, 8vw, 3.4rem);
    line-height: 1.1;
}

.post-description {
    color: var(--d4-text-muted);
    font-size: 1.3rem;
    line-height: 1.6;
}

.post-hero-image {
    display: block;
    width: 100%;
    border-radius: 24px;
    border: 1px solid var(--d4-border);
    margin: 2rem 0;
}

.post-content {
    color: var(--d4-text);
    font-size: 1.15rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin: 2.25rem 0 1rem;
}

.post-content h1 { font-size: 2.7rem; }
.post-content h2 { font-size: 2.1rem; }
.post-content h3 { font-size: 1.55rem; }

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote {
    font-family: "Kanit Light", sans-serif;
    line-height: 1.575;
}

.post-content ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.post-content ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

.post-content li + li {
    margin-top: 0.45rem;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content table,
.post-content pre {
    margin-bottom: 1.25rem;
}

.post-content a {
    color: var(--d4-yellow);
}

.post-content code {
    background: var(--d4-surface-alt);
    border: 1px solid var(--d4-border);
    border-radius: 0.35rem;
    padding: 0.12rem 0.35rem;
}

.post-content pre {
    overflow: auto;
    background: #11102a;
    border: 1px solid var(--d4-border);
    border-radius: 18px;
    padding: 1rem;
    color: #fff;
}

.post-content pre code {
    background: transparent;
    border: 0;
    padding: 0;
    color: #fff;
}

.post-content blockquote {
    border-left: 4px solid var(--d4-yellow);
    padding-left: 1rem;
    color: var(--d4-text-muted);
}

.post-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    border: 1px solid var(--d4-border);
}

.table-responsive {
    overflow-x: auto;
}

.post-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--d4-border);
    border-radius: 14px;
    overflow: hidden;
}

.post-table th,
.post-table td {
    border: 1px solid var(--d4-border);
    padding: 0.75rem;
    text-align: left;
}

.post-table th {
    background: var(--d4-surface-alt);
}

.post-cta {
    margin-top: 3rem;
    padding: 2rem;
    border: 1px solid rgba(255, 213, 0, 0.35);
    border-radius: 24px;
    background: var(--d4-surface);
    text-align: center;
}

.post-cta h3 {
    margin: 0 0 0.75rem;
    font-size: 2rem;
}

.post-cta p {
    color: var(--d4-text-muted);
    margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
    .blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .blog-hero,
    .search-container,
    .quick-nav,
    .post-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .quick-nav {
        align-items: stretch;
    }

    .blog-pagination {
        padding: 0 1rem;
    }
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-description {
    margin-bottom: 0;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 2.5rem 0;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--d4-border);
    background: #000;
}

.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
