/*
Theme Name: Doanhuy Monochrome
Theme URI: https://doanhuy.net
Author: Doan Huy
Description: Theme cá nhân cho doanhuy.net — tư vấn AIOS và xúc tiến thương mại.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: doanhuy-theme
Tags: personal, blog, monochrome, three-columns
*/

/* =============================================
   BASE RESET & TYPOGRAPHY
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    background-color: #f9fafb;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #111827; }
img { max-width: 100%; height: auto; display: block; }

/* =============================================
   AIRMAIL BORDER
   ============================================= */
.airmail-border {
    height: 6px;
    background: repeating-linear-gradient(
        -45deg,
        #111827 0px, #111827 6px,
        #ffffff 6px, #ffffff 12px
    );
}

/* =============================================
   SOCIAL ICON BUTTONS
   ============================================= */
.social-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}
.social-icon-btn:hover {
    background: #111827;
    color: white;
    border-color: #111827;
}

/* =============================================
   ENTRY CONTENT
   ============================================= */
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
    color: #111827;
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}
.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content p { margin-bottom: 1.5rem; line-height: 1.8; }
.entry-content ul, .entry-content ol { margin: 0 0 1.5rem 1.5rem; }
.entry-content li { margin-bottom: 0.4rem; }
.entry-content blockquote {
    border-left: 3px solid #111827;
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
    background: #f3f4f6;
}
.entry-content pre {
    background: #1f2937;
    color: #f3f4f6;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-size: 13px;
}
.entry-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}
.entry-content pre code { background: transparent; padding: 0; }
.entry-content img { border-radius: 8px; margin: 1.5rem 0; }
.entry-content a { color: #111827; text-decoration: underline; text-underline-offset: 3px; }
.entry-content hr { border: 0; border-top: 1px solid #e5e7eb; margin: 2rem 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
.entry-content th, .entry-content td {
    padding: 0.6rem 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
    font-size: 14px;
}
.entry-content th { background: #f3f4f6; font-weight: 600; }

/* =============================================
   WIDGET OVERRIDES
   ============================================= */
.widget { font-size: 14px; }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: 0.35rem 0; border-bottom: 1px solid #f3f4f6; }
.widget ul li:last-child { border-bottom: none; }
.widget ul li a:hover { color: #111827; text-decoration: underline; }
.widget_search .search-form { display: flex; gap: 6px; }
.widget_search input[type="search"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.widget_search input[type="search"]:focus { border-color: #111827; }
.widget_search button {
    padding: 8px 14px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

/* =============================================
   CONTACT FORM 7
   ============================================= */
.wpcf7-form input, .wpcf7-form textarea, .wpcf7-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s;
}
.wpcf7-form input:focus, .wpcf7-form textarea:focus { border-color: #111827; }
.wpcf7-form input[type="submit"] {
    background: #111827;
    color: white;
    cursor: pointer;
    font-weight: 600;
    width: auto;
}
.wpcf7-form input[type="submit"]:hover { background: #374151; }

/* =============================================
   HERO SECTION
   ============================================= */
.hero-section {
    text-align: center;
    padding: 2rem 0 2.5rem;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 2rem;
}
.hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}
.hero-name { font-size: 1.5rem; font-weight: 700; color: #111827; margin-bottom: 0.4rem; }
.hero-bio { font-size: 14px; color: #6b7280; line-height: 1.7; margin-bottom: 1.25rem; max-width: 480px; margin-left: auto; margin-right: auto; }
.hero-social { display: flex; justify-content: center; gap: 8px; margin-bottom: 1.25rem; }
.hero-cta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.btn-primary {
    padding: 9px 20px;
    background: #111827;
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    display: inline-block;
}
.btn-primary:hover { background: #374151; color: white; }
.btn-outline {
    padding: 9px 20px;
    border: 1.5px solid #111827;
    color: #111827;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
}
.btn-outline:hover { background: #111827; color: white; }

/* =============================================
   POST CARD / LOOP
   ============================================= */
.post-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.post-card-thumb { width: 100%; height: 200px; object-fit: cover; }
.post-card-thumb-placeholder {
    width: 100%;
    height: 200px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #d1d5db;
}
.post-card-body { padding: 1.25rem; }
.post-card-meta { font-size: 12px; color: #9ca3af; margin-bottom: 0.4rem; display: flex; gap: 10px; align-items: center; }
.post-card-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}
.post-card-title { font-size: 1.05rem; font-weight: 700; color: #111827; line-height: 1.4; margin-bottom: 0.5rem; }
.post-card-title a:hover { color: #4b5563; }
.post-card-excerpt { font-size: 14px; color: #6b7280; line-height: 1.6; margin-bottom: 0.75rem; }
.post-card-readmore { font-size: 13px; color: #111827; font-weight: 600; }
.post-card-readmore:hover { text-decoration: underline; }

.section-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =============================================
   SINGLE POST
   ============================================= */
.single-post-header { margin-bottom: 2rem; }
.single-post-meta { font-size: 13px; color: #9ca3af; margin-bottom: 0.75rem; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.single-post-title { font-size: 1.75rem; font-weight: 800; color: #111827; line-height: 1.25; margin-bottom: 0.75rem; }
.single-post-thumbnail { width: 100%; border-radius: 12px; margin-bottom: 2rem; max-height: 400px; object-fit: cover; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e5e7eb; }
.post-nav a { font-size: 13px; color: #6b7280; max-width: 45%; }
.post-nav a:hover { color: #111827; }
.post-nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af; margin-bottom: 4px; }

.related-posts { margin-top: 2.5rem; }
.related-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.related-post-item { background: white; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.related-post-thumb { width: 100%; height: 120px; object-fit: cover; }
.related-post-body { padding: 0.75rem; }
.related-post-title { font-size: 13px; font-weight: 600; color: #111827; line-height: 1.4; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid #f3f4f6; }
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    transition: all 0.2s;
}
.pagination a:hover, .pagination .current {
    background: #111827;
    color: white;
    border-color: #111827;
}

/* =============================================
   SEARCH FORM
   ============================================= */
.search-form { display: flex; gap: 8px; margin-bottom: 1.5rem; }
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.search-form input[type="search"]:focus { border-color: #111827; }
.search-form button {
    padding: 10px 18px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.search-results-heading { font-size: 1.1rem; font-weight: 700; color: #111827; margin-bottom: 1.5rem; }
.search-results-heading em { font-style: normal; border-bottom: 2px solid #111827; }
.no-results { text-align: center; padding: 3rem 1rem; color: #6b7280; }

/* =============================================
   404 PAGE
   ============================================= */
.not-found-wrap { text-align: center; padding: 4rem 1rem; }
.not-found-code { font-size: 6rem; font-weight: 900; color: #e5e7eb; line-height: 1; margin-bottom: 1rem; }
.not-found-title { font-size: 1.5rem; font-weight: 700; color: #111827; margin-bottom: 0.75rem; }
.not-found-desc { color: #6b7280; margin-bottom: 1.5rem; }

/* =============================================
   LOGIN / REGISTER PAGES
   ============================================= */
.page-login-wrap, .page-register-wrap {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.auth-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo-name { font-size: 1.25rem; font-weight: 800; color: #111827; }
.auth-logo-tagline { font-size: 12px; color: #9ca3af; margin-top: 2px; }
.auth-title { font-size: 1.1rem; font-weight: 700; color: #111827; margin-bottom: 1.25rem; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 1.25rem 0;
    color: #9ca3af;
    font-size: 13px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 13px; color: #6b7280; }
.auth-footer a { color: #111827; font-weight: 600; }
.auth-card .login-form label { font-size: 13px; font-weight: 600; color: #374151; display: block; margin-bottom: 4px; }
.auth-card .login-form input[type="text"],
.auth-card .login-form input[type="password"],
.auth-card .login-form input[type="email"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.auth-card .login-form input:focus { border-color: #111827; }
.auth-card .login-form input[type="submit"],
.auth-card .login-form .button-primary {
    width: 100%;
    padding: 11px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.auth-card .login-form input[type="submit"]:hover { background: #374151; }
.auth-card .login-form .forgetmenot { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 1rem; }
.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    text-align: center;
}
.google-login-btn:hover { border-color: #111827; background: #f9fafb; color: #111827; }
.google-login-btn img { width: 18px; height: 18px; }
.register-form label { font-size: 13px; font-weight: 600; color: #374151; display: block; margin-bottom: 4px; }
.register-form input[type="text"],
.register-form input[type="email"],
.register-form input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.2s;
}
.register-form input:focus { border-color: #111827; }
.register-form .submit-btn {
    width: 100%;
    padding: 11px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.register-form .submit-btn:hover { background: #374151; }
.register-error { background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }
.register-success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 1rem; }

/* =============================================
   COMMENTS
   ============================================= */
.comments-section { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid #e5e7eb; }
.comment-list { list-style: none; padding: 0; }
.comment { padding: 1rem 0; border-bottom: 1px solid #f3f4f6; }
.comment-author-avatar { width: 36px; height: 36px; border-radius: 50%; }
.comment-content { font-size: 14px; line-height: 1.7; }
.comment-reply-link { font-size: 12px; color: #6b7280; }
.comment-reply-link:hover { color: #111827; }

/* =============================================
   ARCHIVE HEADER
   ============================================= */
.archive-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #e5e7eb; }
.archive-title { font-size: 1.5rem; font-weight: 800; color: #111827; }
.archive-description { font-size: 14px; color: #6b7280; margin-top: 0.5rem; }

/* =============================================
   MOBILE STICKY HEADER
   ============================================= */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
}
.mobile-header-logo { font-weight: 800; font-size: 1rem; color: #111827; }
.mobile-menu-btn { background: none; border: none; cursor: pointer; font-size: 1.25rem; color: #374151; }
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0,0,0,0.5);
}
.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: white;
    z-index: 50;
    overflow-y: auto;
    padding: 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}
.mobile-menu-drawer.open { transform: translateX(0); }

/* =============================================
   LAYOUT — SITE GRID
   ============================================= */
.site-grid {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
}

.left-sidebar {
    display: none;
}

#main-content {
    padding: 2rem 0;
    min-width: 0;
}

.right-sidebar {
    display: block;
    padding: 1.5rem 0;
    border-top: 1px solid #f3f4f6;
    margin-top: 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.nav-item {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}
.nav-item:hover { background: #f9fafb; color: #111827; }
.nav-item.active { background: #f3f4f6; color: #111827; font-weight: 600; }

.widget-box {
    background: white;
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.widget-title {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #111827;
    margin-bottom: 0.5rem;
}

/* =============================================
   CATEGORY / POST GRID
   ============================================= */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.post-grid-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.post-grid-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}
.post-grid-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}
.post-grid-thumb-placeholder {
    width: 100%;
    height: 160px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #d1d5db;
}
.post-grid-body { padding: 1rem; }
.post-grid-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 0.4rem;
}
.post-grid-title a:hover { color: #4b5563; }
.post-grid-excerpt { font-size: 12px; color: #6b7280; line-height: 1.5; margin-bottom: 0.5rem; }

/* =============================================
   PROJECT GRID
   ============================================= */
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.project-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.project-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.09);
    transform: translateY(-2px);
}
.project-card-thumb img,
.project-card-thumb-img,
.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    max-height: 180px;
}
.project-card-thumb-placeholder {
    width: 100%;
    height: 180px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #d1d5db;
}
.project-card-body { padding: 1.25rem; }
.project-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}
.project-card-title a:hover { color: #4b5563; }
.project-card-excerpt { font-size: 13px; color: #6b7280; line-height: 1.6; margin-bottom: 0.75rem; }
.project-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.project-status {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.project-status--active { background: #f0fdf4; color: #15803d; }
.project-status--completed { background: #f3f4f6; color: #374151; }
.project-status--collab { background: #eff6ff; color: #1d4ed8; }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tag {
    font-size: 11px;
    background: #f3f4f6;
    color: #6b7280;
    padding: 2px 8px;
    border-radius: 4px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (min-width: 1024px) {
    .site-grid {
        display: grid;
        grid-template-columns: 200px 1fr 280px;
        gap: 2rem;
        padding: 0 1.5rem;
        align-items: start;
    }
    .left-sidebar {
        display: flex;
        flex-direction: column;
        padding: 2.5rem 1rem 2.5rem 0;
        border-right: 1px solid #f3f4f6;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
    }
    .right-sidebar {
        padding: 2rem 0 2rem 1rem;
        border-top: none;
        border-left: 1px solid #f3f4f6;
        margin-top: 0;
    }
    .mobile-header {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .mobile-header { display: flex; }
    .left-sidebar { display: none !important; }
    .project-grid { grid-template-columns: repeat(2, 1fr); }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
    .single-post-title { font-size: 1.35rem; }
    .related-posts-grid { grid-template-columns: 1fr; }
    .hero-cta { flex-direction: column; align-items: center; }
    .project-grid { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: 1fr; }
    .project-card-thumb img,
    .project-card-thumb-img,
    .project-card img { height: 160px; }

    /* Fix padding mobile — tránh text sát viền */
    #main-content { padding: 1.5rem 1rem; }
    .right-sidebar { padding: 1.5rem 1rem; }
    .hero-section { padding: 1.5rem 1rem 2rem; }
    .post-card-body { padding: 1rem; }
}
