:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f5f5f5;
    --border: #e5e5e5;
    --border-hover: #d4d4d4;
    --text: #171717;
    --text-muted: #737373;
    --text-light: #a3a3a3;
    --accent: #000000;
    --accent-soft: #f4f4f4;
    --shadow: rgba(0, 0, 0, 0.04);
    --shadow-lg: rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h4 {
    font-size: 1.125rem;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav {
    /*max-width: 1200px;*/
    margin: 0 auto;
    padding: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}


.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin-bottom: 0;
    padding-left: 0;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
    padding: 0;
}

.nav-link:hover {
    color: var(--text);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.2s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Main Content */
.hero {
    padding: 4rem 0;
}

.hero-intro {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-title {
    margin-bottom: 1rem;
    color: var(--text);
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 5rem;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.2s ease;
}

.panel:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px var(--shadow);
}

.panel-title {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.panel-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 400;
    transition: all 0.2s ease;
}

.pill:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Posts Section */
.section {
    margin-bottom: 5rem;
}

.section-title {
    margin-bottom: 2rem;
    color: var(--text);
}

.posts-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(3, 1fr); /* mặc định 3 cột */
    container-type: inline-size;
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.post-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow-lg);
    transform: translateY(-2px);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--surface-2);
}

.post-content {
    padding: 1.5rem;
}

.post-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent-soft);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.post-title {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.post-meta {
    color: var(--text-light);
    font-size: 0.8125rem;
}

/* Featured Post */
.featured-post {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
    transition: all 0.2s ease;
}

.featured-post:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px var(--shadow);
}

.featured-image {
    width: 120px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.featured-content h4 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

.featured-content .meta {
    color: var(--text-light);
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.featured-content .excerpt {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.refresh-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.refresh-btn:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
    transform: rotate(90deg);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 3rem;
}

.footer h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.email-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9375rem;
    transition: border-color 0.2s ease;
}

.email-input:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

.form-message {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.form-message.success {
    color: #16a34a;
}

.form-message.error {
    color: #dc2626;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.breadcrumb-section {
    padding: 2rem 0 1rem; /* Adjust padding as needed */
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-item {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: var(--text);
}

.breadcrumb-item.active {
    color: var(--text);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-light);
}

/* Category Header */
.category-header {
    text-align: center;
    margin-bottom: 3rem;
}

.category-title {
    margin-bottom: 0.75rem;
    font-size: clamp(2rem, 4vw, 2.5rem); /* Use similar sizing to h1 */
}

.category-description {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Pagination */
.pagination-section {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 5rem; /* Add some space before footer */
}

.pagination {
    display: flex;
    gap: 0.5rem;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-link:hover:not(.active):not(.disabled) {
    background: var(--surface-2);
    border-color: var(--border-hover);
    color: var(--text);
}

.pagination-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    cursor: default;
}

.pagination-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.post-content ul {
    padding-left: 20px;
}

.breadcrumb-section {
    padding: 2rem 0 1rem; /* Adjust padding as needed */
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb-item {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.breadcrumb-item:hover {
    color: var(--text);
}

.breadcrumb-item.active {
    color: var(--text);
    font-weight: 500;
    cursor: default;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-light);
}

/* Custom styles for Contact Page */
.contact-section {
    padding: 4rem 0;
    text-align: center;
}

.contact-section h1 {
    margin-bottom: 1.5rem;
}

.author-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 700px;
    margin: 0 auto 3rem;
    padding: 2rem;
    /*background: var(--surface);*/
    /*border: 1px solid var(--border);*/
    /*border-radius: 12px;*/
    /*box-shadow: 0 4px 12px var(--shadow);*/
}

.author-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 2px solid var(--border);
}

.author-name {
    font-size: 1.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.author-bio {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.social-link {
    color: var(--text-muted);
    font-size: 1.125rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: var(--accent);
}

.contact-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    text-align: left; /* Align form elements to left */
}

.contact-form-container h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-form label {
    display: block;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-form button[type="submit"] {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-form button[type="submit"]:hover {
    background: #333;
    transform: translateY(-1px);
}

.contact-form-message {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.contact-form-message.success {
    color: #16a34a;
}

.contact-form-message.error {
    color: #dc2626;
}


#pipeBody {
    position: relative;
}

#pipeBody::before,
#pipeBody::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 0; /* dưới nội dung */
}

#pipeBody::before {
    left: 0;
    background: rgb(255 255 255 / 20%); /* màu bên trái */
}

#pipeBody::after {
    right: 0;
    background: rgb(0 0 0 / 20%); /* màu bên phải */
}

/* Nội dung bên trong */
#pipeBody > * {
    position: relative;
    z-index: 1; /* nổi trên 2 background */
}

#pipeBody .container{
    max-width: none !important;
}

#pipeBody .container .row > div:nth-child(odd) * {
    color: black !important;
}

#pipeBody .container .row > div:nth-child(even) * {
    color: white !important;
}

#pipeBody .container .row h2{
    font-size: 40px;
}

#pipeBody .container .row a.pill {
    background: transparent !important;
    border: none !important;
    font-size: 20px;
}

/* Responsive adjustments for category page */
@media (max-width: 600px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 900px) and (min-width: 600px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    #pipeBody .container .row h2{
        font-size: 35px;
    }

    #pipeBody .container .row a.pill {
        background: transparent !important;
        border: none !important;
        font-size: 16px;
    }

    #pipeBody::before, #pipeBody::after {
        width: 100%;
    }

    #pipeBody::before {
        top: 0;
        background: rgb(255 255 255 / 20%); /* màu bên trái */
    }

    #pipeBody::after {
        top: 50%;
        background: rgb(0 0 0 / 20%); /* màu bên phải */
    }

    .author-profile {
        padding: 1.5rem;
    }

    .contact-form-container {
        padding: 1.5rem;
    }

    .breadcrumb-section {
        padding: 1.5rem 0 0.5rem;
    }

    .category-header {
        margin-bottom: 2rem;
    }

    .category-title {
        font-size: clamp(1.8rem, 5vw, 2.2rem);
    }

    .category-description {
        font-size: 1rem;
    }

    .pagination-link {
        min-width: 36px;
        height: 36px;
        padding: 0 0.5rem;
    }

    .nav {
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .hero {
        padding: 2rem 0;
    }

    .split-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .featured-post {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .featured-image {
        width: 100%;
        height: 160px;
        margin-bottom: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .container {
        padding: 0 1rem;
    }
}