:root {
    --blog-bg: #dafffc;
    --blog-card-bg: #ffffff;
    --blog-card-border: #41b7b7;
    --blog-accent: #5acfc6;
    --blog-accent-strong: #06ada0;
    --blog-text: #000000;
    --blog-muted: #606c6b;
}

.blog-page {
    background: var(--blog-bg);
    color: var(--blog-text);
}

.blog-listing ::selection,
.post-body-section ::selection {
    background: #06ada0;
    color: #ffffff;
}

.blog-listing ::-moz-selection,
.post-body-section ::-moz-selection {
    background: #06ada0;
    color: #ffffff;
}

/* ── Hero ──────────────────────────────────────────────────────────── */

.blog-hero {
    /* Compact band above the fold — listing carries most of the first screen */
    min-height: 32vh;
    height: 38vh;
    max-height: 44vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px 40px;
    position: relative;
    overflow: hidden;
}

.blog-hero .container {
    width: 100%;
    max-width: none;
    display: flex;
    justify-content: center;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
}

.blog-hero__inner {
    text-align: center;
    position: relative;
    z-index: 2;
    width: 75vw;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.blog-title {
    font-family: "Pacifico", cursive;
    font-size: clamp(36px, 6vw, 76px);
    line-height: 1.08;
    margin-bottom: 14px;
    color: #000000;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.blog-subtitle {
    font-size: clamp(17px, 2.1vw, 24px);
    line-height: 1.6;
    width: 100%;
    max-width: 48em;
    margin: 0 auto;
    color: #606c6b;
    font-weight: 300;
}

/* ── Floating sticker decorations ─────────────────────────────────── */

.blog-deco {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.blog-deco--tl {
    top: 15%;
    left: 7%;
    width: 80px;
    transform: rotate(-18deg);
}

.blog-deco--tr {
    top: 10%;
    right: 8%;
    width: 64px;
}

.blog-deco--ml {
    top: 52%;
    left: 4%;
    width: 70px;
    transform: rotate(12deg);
}

.blog-deco--mr {
    top: 48%;
    right: 5%;
    width: 74px;
    transform: rotate(-14deg);
}

.blog-deco--bl {
    bottom: 22%;
    left: 11%;
    width: 54px;
}

.blog-deco--br {
    bottom: 20%;
    right: 13%;
    width: 50px;
    transform: rotate(18deg);
}

/* ── Scroll hint ───────────────────────────────────────────────────── */

.blog-scroll-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--blog-accent-strong);
    font-size: 22px;
    text-decoration: none;
    z-index: 2;
    animation: blog-bounce 1.6s ease-in-out infinite;
}

@keyframes blog-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(10px); }
}

/* ── Blog listing — layered section (matches home page pattern) ────── */

.blog-listing {
    background: #ffffff;
    border-radius: 60px 60px 0 0;
    /* Start below hero fold — minimal overlap so cards read as “next screen” */
    margin-top: -24px;
    padding: 64px 0 120px;
    position: relative;
    z-index: 2;
}

.blog-grid {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.blog-card {
    background: var(--blog-card-bg);
    border: 1px solid var(--blog-card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 24px rgba(6, 173, 160, 0.12);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px rgba(6, 173, 160, 0.22);
}

.blog-card:focus-within {
    box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--blog-accent-strong);
}

/* Full-card hit target (mouse); title + Read More stay real links for keyboard/AT */
.blog-card__card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.blog-card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.blog-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card--no-image {
    border-top: 4px solid var(--blog-accent-strong);
}

.blog-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    pointer-events: none;
}

.blog-tag {
    border-radius: 999px;
    background: #bcfffa;
    color: #06ada0;
    font-size: 14px;
    line-height: 22px;
    padding: 4px 12px;
    font-weight: 500;
}

.blog-date {
    font-size: 15px;
    line-height: 22px;
    color: var(--blog-muted);
}

.blog-card__title {
    font-family: "Kanit", sans-serif;
    font-size: 30px;
    line-height: 1.2;
    margin: 0 0 14px;
    color: #000000;
    pointer-events: none;
}

.blog-card__title-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    z-index: 3;
    pointer-events: auto;
}

.blog-card__title-link:hover {
    color: #06ada0;
}

.blog-card__excerpt {
    color: var(--blog-muted);
    font-size: 19px;
    line-height: 1.6;
    margin-bottom: 24px;
    font-weight: 300;
    flex: 1;
    pointer-events: none;
}

.blog-readmore {
    margin-top: auto;
    align-self: flex-start;
    border: 1px solid #000;
    border-radius: 999px;
    padding: 10px 20px;
    line-height: 1;
    color: #000;
    font-size: 16px;
    transition: all 0.25s ease;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    text-decoration: none;
    flex-shrink: 0;
}

.blog-readmore:hover {
    background: var(--blog-accent);
    border-color: var(--blog-accent);
    color: #003b38;
}

/* ── Footer CTA — layered on top of listing ───────────────────────── */

.blog-footer-cta {
    border-radius: 60px 60px 0 0;
    background: #bcfffa;
    padding: 80px 0;
    margin-top: -60px;
    position: relative;
    z-index: 3;
}

.blog-footer-cta h4 {
    margin-bottom: 0;
}

.blog-footer-cta .download-btn-box {
    flex-wrap: nowrap;
}

.blog-footer-cta .btn {
    line-height: 75px;
    padding: 0 30px;
    font-size: 18px;
}

/* ── Post detail page ──────────────────────────────────────────────── */

.post-hero {
    background: var(--blog-bg);
    padding: 40px 0 80px;
    position: relative;
}

.post-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blog-accent-strong);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 48px;
    transition: gap 0.2s ease;
}

.post-back-link:hover {
    gap: 14px;
    color: var(--blog-accent-strong);
}

.post-hero__inner {
    width: 100%;
    max-width: none;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.post-hero__inner .blog-card__meta {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
}

.post-hero__inner .blog-date {
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
}

.post-byline {
    margin: 20px 0 0;
    width: 75%;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    box-sizing: border-box;
}

.post-byline__prefix {
    font-family: "Kanit", sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: #606c6b;
    letter-spacing: 0.02em;
}

.post-author {
    font-family: "Kanit", sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.02em;
}

.post-title {
    font-family: "Pacifico", cursive;
    font-size: 64px;
    line-height: 1.07;
    color: #000;
    margin: 20px 0 20px;
    width: 75%;
    max-width: 75%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    box-sizing: border-box;
}

.post-excerpt {
    font-size: 22px;
    line-height: 1.65;
    color: #606c6b;
    font-weight: 300;
    width: 75%;
    max-width: 75%;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

/* Loading dots */
.post-hero__loading {
    display: flex;
    gap: 10px;
    padding: 40px 0;
}

.post-loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--blog-accent);
    animation: post-dot-pulse 1.2s ease-in-out infinite;
}

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

@keyframes post-dot-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40%           { opacity: 1;   transform: scale(1.2); }
}

/* Post body section */
.post-body-section {
    background: #ffffff;
    border-radius: 60px 60px 0 0;
    margin-top: -40px;
    padding: 80px 0 120px;
    position: relative;
    z-index: 2;
}

.post-body {
    max-width: 720px;
    margin: 0 auto;
}

/* Author card — end of article */
.post-author-card {
    max-width: 720px;
    margin: 56px auto 0;
    padding: 28px 32px;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 24px;
    background: #f4fffe;
    border: 1px solid rgba(6, 173, 160, 0.25);
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(6, 173, 160, 0.08);
}

.post-author-card__avatar {
    flex-shrink: 0;
}

.post-author-card__avatar img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.post-author-card__avatar--placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bcfffa, #06ada0);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.post-author-card__initial {
    font-family: "Kanit", sans-serif;
    font-size: 40px;
    font-weight: 600;
    color: #003b38;
    line-height: 1;
}

.post-author-card__text {
    flex: 1;
    min-width: 0;
}

.post-author-card__name {
    font-family: "Kanit", sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #000;
    margin: 0 0 12px;
    line-height: 1.25;
}

.post-author-card__bio-p {
    font-size: 17px;
    line-height: 1.65;
    color: #444;
    margin: 0 0 12px;
}

.post-author-card__bio-p:last-child {
    margin-bottom: 0;
}

.post-p, .post-body p {
    font-size: 20px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 28px;
}

.post-h2, .post-body h2 {
    font-family: "Kanit", sans-serif;
    font-size: 36px;
    font-weight: 600;
    line-height: 1.25;
    color: #000;
    margin: 56px 0 20px;
}

.post-h3, .post-body h3 {
    font-family: "Kanit", sans-serif;
    font-size: 28px;
    font-weight: 500;
    color: #000;
    margin: 44px 0 16px;
}

.post-h4, .post-body h4 {
    font-family: "Kanit", sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: #000;
    margin: 36px 0 12px;
}

.post-blockquote, .post-body blockquote {
    border-left: 4px solid var(--blog-accent-strong);
    margin: 40px 0;
    padding: 16px 28px;
    background: #f4fffe;
    border-radius: 0 12px 12px 0;
    font-size: 20px;
    line-height: 1.7;
    color: #1a4f4c;
    font-style: italic;
}

.post-list, .post-body ul, .post-body ol {
    font-size: 20px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 28px;
    padding-left: 28px;
}

.post-figure img {
    width: 100%;
    border-radius: 16px;
    margin: 32px 0;
}

.post-not-found {
    font-size: 20px;
    color: #606c6b;
    padding: 40px 0;
}

.post-not-found a {
    color: var(--blog-accent-strong);
    text-decoration: none;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
    .blog-footer-cta .download-btn-box {
        flex-wrap: wrap;
    }
}

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

    .blog-title {
        font-size: clamp(44px, 7.5vw, 70px);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        height: auto;
        min-height: 36vh;
        max-height: none;
        padding: 40px 12px 36px;
    }

    .blog-hero__inner {
        width: 92vw;
        max-width: 100%;
    }

    .blog-title {
        font-size: clamp(36px, 10vw, 50px);
    }

    .blog-subtitle {
        font-size: 18px;
        line-height: 1.55;
    }

    .blog-deco--ml,
    .blog-deco--mr {
        display: none;
    }

    .blog-deco--tl { width: 54px; left: 5%; }
    .blog-deco--tr { width: 44px; right: 5%; }
    .blog-deco--bl { width: 38px; left: 8%; }
    .blog-deco--br { width: 36px; right: 10%; }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-card__title {
        font-size: 24px;
    }

    .blog-card__excerpt {
        font-size: 17px;
        line-height: 1.55;
    }

    .blog-listing {
        border-radius: 30px 30px 0 0;
        margin-top: -30px;
        padding: 50px 0 80px;
    }

    .blog-footer-cta {
        border-radius: 30px 30px 0 0;
        padding: 50px 0;
        margin-top: -30px;
    }

    .blog-footer-cta .download-btn-box {
        flex-wrap: wrap;
    }

    .blog-footer-cta .btn {
        line-height: 60px;
        padding: 0 14px;
        font-size: 15px;
    }

    .post-hero__inner .blog-card__meta {
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap;
    }

    .post-title {
        width: 100%;
        max-width: 100%;
        font-size: clamp(32px, 9vw, 48px);
        line-height: 1.08;
    }

    .post-excerpt {
        width: 100%;
        max-width: 100%;
        font-size: 18px;
    }

    .post-byline {
        width: 100%;
        max-width: 100%;
    }

    .post-author-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: 40px;
        padding: 24px 20px;
    }

    .post-author-card__text {
        text-align: center;
    }
}
