/* =========================================================
   BASE RESET (SAFE – KHÔNG PHÁ THEME)
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #242424;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   BLOG LAYOUT (SIDEBAR + CONTENT)
========================================================= */

.blog-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 64px;
}

/* =========================================================
   LEFT SIDEBAR (MEDIUM STYLE)
========================================================= */

.left-sidebar {
    position: sticky;
    top: 96px;
    height: fit-content;
    padding-right: 24px;
    border-right: 1px solid #eee;
}

.left-sidebar .widget {
    margin-bottom: 32px;
}

.left-sidebar .widget-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px;
}

.left-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.left-sidebar li {
    margin-bottom: 12px;
}

.left-sidebar a {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    transition: color .2s ease;
}

.left-sidebar a:hover {
    color: #000;
}

.left-sidebar .current-menu-item > a,
.left-sidebar .current-category-ancestor > a {
    font-weight: 600;
    color: #000;
}

/* =========================================================
   BLOG CONTENT WRAPPER
========================================================= */

.blog-content {
    max-width: 720px;
}

/* =========================================================
   MEDIUM STYLE POST
========================================================= */

.medium-post {
    width: 100%;
}

/* HEADER */

.medium-header {
    margin-bottom: 32px;
}

.medium-title {
    font-size: 42px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.medium-meta {
    font-size: 14px;
    color: #777;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* COVER IMAGE */

.medium-cover {
    margin: 40px 0;
}

.medium-cover img {
    border-radius: 6px;
}

/* CONTENT */

.medium-content {
    font-size: 20px;
    line-height: 1.75;
    color: #242424;
}

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

.medium-content h2 {
    font-size: 28px;
    line-height: 1.35;
    margin: 2.5em 0 1em;
}

.medium-content h3 {
    font-size: 24px;
    line-height: 1.4;
    margin: 2em 0 1em;
}

.medium-content ul,
.medium-content ol {
    margin: 1.5em 0 1.5em 1.2em;
}

.medium-content li {
    margin-bottom: .6em;
}

.medium-content img {
    margin: 40px 0;
    border-radius: 6px;
}

.medium-content blockquote {
    border-left: 4px solid #000;
    padding-left: 20px;
    margin: 32px 0;
    font-style: italic;
    color: #555;
}

/* CODE BLOCK */

.medium-content pre {
    background: #f6f8fa;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 15px;
    line-height: 1.6;
    margin: 32px 0;
}

.medium-content code {
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 85%;
}

/* FOOTER */

.medium-footer {
    margin-top: 48px;
    font-size: 14px;
    color: #666;
}

/* =========================================================
   POST NAVIGATION
========================================================= */

.post-navigation {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

.post-navigation a {
    display: block;
    font-size: 16px;
    color: #333;
}

.post-navigation .nav-subtitle {
    font-size: 13px;
    color: #999;
}

.post-navigation .nav-title {
    font-weight: 600;
}

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

@media (max-width: 1024px) {
    .blog-wrapper {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }

    .left-sidebar {
        display: none;
    }

    .blog-content {
        max-width: 100%;
    }

    .medium-title {
        font-size: 34px;
    }

    .medium-content {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .medium-title {
        font-size: 28px;
    }

    .medium-content {
        font-size: 17px;
    }
}
/* =========================================================
   BASE RESET (SAFE – KHÔNG PHÁ THEME)
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #242424;
    background: #fff;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   BLOG LAYOUT (SIDEBAR + CONTENT)
========================================================= */

.blog-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 24px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 64px;
}

/* =========================================================
   LEFT SIDEBAR (MEDIUM STYLE)
========================================================= */

.left-sidebar {
    position: sticky;
    top: 96px;
    height: fit-content;
    padding-right: 24px;
    border-right: 1px solid #eee;
}

.left-sidebar .widget {
    margin-bottom: 32px;
}

.left-sidebar .widget-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px;
}

.left-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.left-sidebar li {
    margin-bottom: 12px;
}

.left-sidebar a {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    transition: color .2s ease;
}

.left-sidebar a:hover {
    color: #000;
}

.left-sidebar .current-menu-item > a,
.left-sidebar .current-category-ancestor > a {
    font-weight: 600;
    color: #000;
}

/* =========================================================
   BLOG CONTENT WRAPPER
========================================================= */

.blog-content {
    max-width: 720px;
}

/* =========================================================
   MEDIUM STYLE POST
========================================================= */

.medium-post {
    width: 100%;
}

/* HEADER */

.medium-header {
    margin-bottom: 32px;
}

.medium-title {
    font-size: 42px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.medium-meta {
    font-size: 14px;
    color: #777;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* COVER IMAGE */

.medium-cover {
    margin: 40px 0;
}

.medium-cover img {
    border-radius: 6px;
}

/* CONTENT */

.medium-content {
    font-size: 20px;
    line-height: 1.75;
    color: #242424;
}

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

.medium-content h2 {
    font-size: 28px;
    line-height: 1.35;
    margin: 2.5em 0 1em;
}

.medium-content h3 {
    font-size: 24px;
    line-height: 1.4;
    margin: 2em 0 1em;
}

.medium-content ul,
.medium-content ol {
    margin: 1.5em 0 1.5em 1.2em;
}

.medium-content li {
    margin-bottom: .6em;
}

.medium-content img {
    margin: 40px 0;
    border-radius: 6px;
}

.medium-content blockquote {
    border-left: 4px solid #000;
    padding-left: 20px;
    margin: 32px 0;
    font-style: italic;
    color: #555;
}

/* CODE BLOCK */

.medium-content pre {
    background: #f6f8fa;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 15px;
    line-height: 1.6;
    margin: 32px 0;
}

.medium-content code {
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 85%;
}

/* FOOTER */

.medium-footer {
    margin-top: 48px;
    font-size: 14px;
    color: #666;
}

/* =========================================================
   POST NAVIGATION
========================================================= */

.post-navigation {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

.post-navigation a {
    display: block;
    font-size: 16px;
    color: #333;
}

.post-navigation .nav-subtitle {
    font-size: 13px;
    color: #999;
}

.post-navigation .nav-title {
    font-weight: 600;
}

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

@media (max-width: 1024px) {
    .blog-wrapper {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }

    .left-sidebar {
        display: none;
    }

    .blog-content {
        max-width: 100%;
    }

    .medium-title {
        font-size: 34px;
    }

    .medium-content {
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .medium-title {
        font-size: 28px;
    }

    .medium-content {
        font-size: 17px;
    }
}


/* =========================================================
   SIDEBAR SEARCH (PRO STYLE)
========================================================= */

.left-sidebar .search-form {
    margin-bottom: 32px;
}

.left-sidebar .search-form label {
    width: 100%;
}

.left-sidebar .search-field {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.left-sidebar .search-field::placeholder {
    color: #999;
}

.left-sidebar .search-field:focus {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

/* Hide default submit button */
.left-sidebar .search-submit {
    display: none;
}


.left-sidebar .search-form {
    position: relative;
}

.left-sidebar .search-form::after {
    content: "🔍";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #999;
    pointer-events: none;
}

/* =========================================================
   SIDEBAR SEARCH WITH SVG ICON
========================================================= */

.left-sidebar .search-form {
    position: relative;
}

.left-sidebar .search-field {
    width: 100%;
    padding: 12px 44px 12px 14px; /* chừa chỗ cho icon */
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.left-sidebar .search-field:focus {
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.05);
}

/* SVG ICON */
.left-sidebar .search-form::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;

    background-color: #999;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M4.092 11.06a6.95 6.95 0 1 1 13.9 0 6.95 6.95 0 0 1-13.9 0m6.95-8.05a8.05 8.05 0 1 0 5.13 14.26l3.75 3.75a.56.56 0 1 0 .79-.79l-3.73-3.73A8.05 8.05 0 0 0 11.042 3z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;

    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' fill-rule='evenodd' d='M4.092 11.06a6.95 6.95 0 1 1 13.9 0 6.95 6.95 0 0 1-13.9 0m6.95-8.05a8.05 8.05 0 1 0 5.13 14.26l3.75 3.75a.56.56 0 1 0 .79-.79l-3.73-3.73A8.05 8.05 0 0 0 11.042 3z' clip-rule='evenodd'/%3E%3C/svg%3E") center / contain no-repeat;
}


.search-page .search-header {
    margin-bottom: 48px;
}

.search-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 24px;
}

.search-title span {
    color: #555;
}

.search-page .search-form {
    max-width: 420px;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.search-item {
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}

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

.search-item-title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.search-item-title a {
    color: #000;
}

.search-item-title a:hover {
    text-decoration: underline;
}

.search-item-meta {
    font-size: 14px;
    color: #777;
    margin-bottom: 12px;
}

.search-item-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: #444;
}


.pagination {
    margin-top: 64px;
}

.pagination .page-numbers {
    margin-right: 12px;
    font-size: 15px;
}

.pagination .current {
    font-weight: 600;
}

.no-results {
    font-size: 18px;
    color: #777;
}

/* Animate icon when focus */
.left-sidebar .search-form::after {
    transition: transform .25s ease, background-color .25s ease, opacity .25s ease;
    opacity: .7;
}

.left-sidebar .search-field:focus {
    border-color: #000;
}

.left-sidebar .search-field:focus ~ *::after,
.left-sidebar .search-form:focus-within::after {
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
    background-color: #000;
}

.live-search-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    margin-top: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
    z-index: 20;
    display: none;
}

.live-search-item {
    display: block;
    padding: 10px 14px;
    font-size: 15px;
    color: #333;
}

.live-search-item:hover {
    background: #f6f6f6;
}

.live-search-empty {
    padding: 12px;
    font-size: 14px;
    color: #999;
}

.search-highlight {
    background: #fff3cd;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: 500;
}

body.dark-mode {
    background: #0f0f0f;
    color: #ddd;
}

body.dark-mode .search-field {
    background: #1a1a1a;
    border-color: #333;
    color: #eee;
}

body.dark-mode .search-form::after {
    background-color: #aaa;
}

body.dark-mode .search-field:focus ~ *::after,
body.dark-mode .search-form:focus-within::after {
    background-color: #fff;
}





