:root {
    --text-cream: #f4ecd8;
    --green-1: #3fce3f;
    --green-2: #1f9a2f;
    --blue-1: #1f6fd6;
    --blue-2: #1450a3;
    --panel-bg: rgba(10, 16, 30, 0.72);
    --panel-border: rgba(244, 236, 216, 0.18);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", sans-serif;
    color: var(--text-cream);
    overflow-x: hidden;
    position: relative;
    background-color: #050b16;
}

/* Soft vignette + gentle breathing, same as the rest of the site, so
   text stays readable over the background artwork. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.5) 100%);
    animation: bg-breathe 8s ease-in-out infinite;
}

@keyframes bg-breathe {
    0%, 100% {
        opacity: 0.85;
    }

    50% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    body::before {
        animation: none;
    }
}

/* ---------- Page shell ---------- */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 40px 20px 24px;
    max-width: 980px;
    margin: 0 auto;
}

.blog-title-bar {
    text-align: center;
    margin-bottom: 26px;
}

    .blog-title-bar h1 {
        margin: 0;
        font-size: 30px;
        font-weight: 800;
        text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    }

.site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(244, 236, 216, 0.75);
    padding: 32px 20px 28px;
}

/* ---------- Search ---------- */
.search-wrap {
    max-width: 520px;
    margin: 0 auto 30px;
}

.search-input {
    width: 100%;
    padding: 12px 18px;
    border-radius: 999px;
    border: 2px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--text-cream);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s ease;
}

    .search-input::placeholder {
        color: rgba(244, 236, 216, 0.55);
    }

    .search-input:focus {
        border-color: rgba(63, 206, 63, 0.6);
    }

/* ---------- Sections ---------- */
.post-section {
    margin-bottom: 38px;
}

    .post-section h2,
    .search-results h2 {
        font-size: 19px;
        font-weight: 800;
        margin: 0 0 16px;
        text-shadow: 0 2px 6px rgba(0,0,0,0.5);
    }

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.empty-msg {
    color: rgba(244, 236, 216, 0.65);
    font-size: 14px;
}

.show-all-btn {
    display: block;
    margin: 18px auto 0;
    padding: 10px 22px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,0.25);
    background: linear-gradient(180deg, var(--blue-1), var(--blue-2));
    color: #eaf3ff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease;
}

    .show-all-btn:hover,
    .show-all-btn:focus-visible {
        transform: translateY(-2px);
    }

/* ---------- Post card ---------- */
.post-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

    .post-card:hover,
    .post-card:focus-visible {
        transform: translateY(-5px) scale(1.015);
        box-shadow: 0 14px 28px rgba(0,0,0,0.45);
    }

.post-card-photo {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}

    .post-card-photo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.post-card-body {
    padding: 12px 14px 14px;
}

.post-card-title {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(244, 236, 216, 0.65);
}

/* "Đang tải..." loading indicator shown in place of the view count
   while CountAPI hasn't responded yet. */
.views-loading {
    font-style: italic;
    opacity: 0.75;
}

    .views-loading .dot {
        opacity: 0;
        animation: dot-blink 1.2s infinite;
    }

        .views-loading .dot:nth-child(1) {
            animation-delay: 0s;
        }

        .views-loading .dot:nth-child(2) {
            animation-delay: 0.2s;
        }

        .views-loading .dot:nth-child(3) {
            animation-delay: 0.4s;
        }

@keyframes dot-blink {
    0%, 80%, 100% {
        opacity: 0;
    }

    40% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .views-loading .dot {
        animation: none;
        opacity: 1;
    }
}

/* ---------- Post reading view ---------- */
.post-view {
    max-width: 720px;
    margin: 0 auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    padding: 9px 18px;
    border-radius: 999px;
    border: 2px solid var(--panel-border);
    background: var(--panel-bg);
    color: var(--text-cream);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

    .back-btn:hover,
    .back-btn:focus-visible {
        background: rgba(255,255,255,0.12);
        transform: translateX(-2px);
    }

.post-article {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    padding: 26px 24px 30px;
}

.post-cover {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
}

.post-title {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.35;
}

.post-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: rgba(244, 236, 216, 0.65);
    margin-bottom: 22px;
}

.post-body {
    font-size: 16px;
    line-height: 1.8;
}

    .post-body p {
        margin: 0 0 16px;
    }

    .post-body .post-image {
        margin: 0 0 16px;
    }

        .post-body .post-image img {
            width: 100%;
            border-radius: 12px;
            display: block;
        }

    .post-body a {
        color: #9fd7ff;
    }

        .post-body a.btn {
            display: inline-block;
            margin: 6px 0;
            padding: 10px 20px;
            border-radius: 999px;
            background: linear-gradient(180deg, var(--green-1), var(--green-2));
            color: #f4fff0 !important;
            font-weight: 700;
            text-decoration: none;
        }

/* Minecraft obfuscated (§k) placeholder styling — no runtime scramble,
   just a subtle visual cue that the text is "magic"/hidden. */
.mc-obfuscated {
    letter-spacing: 1px;
    text-shadow: 0 0 4px currentColor;
}

.related-posts {
    max-width: 720px;
    margin: 34px auto 0;
}

/* Shown instead of the post body when a post is marked "private" in
   posts.json — reuses .post-title/.post-body typography, just centered. */
.private-notice {
    text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .blog-title-bar h1 {
        font-size: 24px;
    }

    .post-title {
        font-size: 21px;
    }

    .post-article {
        padding: 20px 16px 24px;
    }
}





/* ============================================================== */
/* Timed button: <a class="button-5s" data-seconds="5">             */
/* (.btn = opens at once; .button-5s = counts down, then opens)     */
/* ============================================================== */
.post-body a.button-5s {
    position: relative;
    display: inline-block;
    margin: 6px 0;
    padding: 10px 22px;
    border-radius: 999px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, #ffb020, #cc7a00);
    color: #2a1a00 !important;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease;
}

.post-body a.button-5s:hover,
.post-body a.button-5s:focus-visible {
    transform: translateY(-2px);
}

/* progress fill that sweeps across while the countdown runs */
.post-body a.button-5s::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 0;
    background: rgba(255, 255, 255, 0.4);
}

.post-body a.button-5s.is-counting {
    cursor: progress;
    pointer-events: none;
}

.post-body a.button-5s.is-counting::before {
    animation: button5s-fill var(--b5-dur, 5s) linear forwards;
}

.post-body a.button-5s.is-ready {
    background: linear-gradient(180deg, #3fce3f, #1f9a2f);
    color: #f4fff0 !important;
}

@keyframes button5s-fill {
    from { width: 0; }
    to   { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .post-body a.button-5s.is-counting::before { animation-duration: 0.01s; }
}

.post-edited{font-style:normal;opacity:.7;font-size:.92em}
.post-comments{margin-top:32px}
.post-comments h2{margin:0 0 12px}
.post-share{display:flex;justify-content:flex-start;margin-top:22px}
