/* ==========================================================================
   Anan Early Years – Blog (listing + article)
   Builds on style.css + inner.css
   ========================================================================== */

/* ---------- Shared: article card ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 26px;
    background: #fff;
    border: 1px solid var(--line);
    transition: translate .5s var(--ease), box-shadow .4s, border-color .4s;
}

.post-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 5px;
    background: var(--c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .6s var(--ease);
}

.post-card:hover {
    translate: 0 -8px;
    border-color: transparent;
    box-shadow: var(--shadow);
}

.post-card:hover::after {
    transform: scaleX(1);
}

.pc-img {
    display: block;
    aspect-ratio: 16 / 11;
    overflow: hidden;
}

.pc-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 1s var(--ease);
}

.post-card:hover .pc-img img {
    scale: 1.08;
}

.pc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 24px 26px;
}

.pc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}

.pc-meta i {
    margin-right: 4px;
}

.pc-cat {
    padding: 5px 12px;
    border-radius: 30px;
    font-weight: 600;
    color: color-mix(in srgb, var(--c) 70%, #2f2a3a);
    background: color-mix(in srgb, var(--c) 16%, #fff);
}

.post-card h3 {
    margin-bottom: 10px;
    font-size: 1.18rem;
    line-height: 1.4;
}

.post-card h3 a {
    color: inherit;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
    transition: background-size .5s var(--ease);
}

.post-card:hover h3 a {
    background-size: 100% 2px;
}

.post-card p {
    flex: 1;
    margin-bottom: 18px;
    font-size: 14.5px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pc-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: color-mix(in srgb, var(--c) 75%, #2f2a3a);
    transition: gap .3s var(--ease);
}

.pc-more:hover,
.post-card:hover .pc-more {
    gap: 14px;
}

@media (max-width: 991px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {
    .post-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* ---------- Listing: featured article ---------- */
.featured {
    position: relative;
    z-index: 2;
    margin-top: -70px;
}

.feat-card {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    overflow: hidden;
    border-radius: 32px;
    background: #fff;
    box-shadow: var(--shadow);
}

.feat-img {
    position: relative;
    display: block;
    min-height: 380px;
    overflow: hidden;
}

.feat-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 1.2s var(--ease);
}

.feat-card:hover .feat-img img {
    scale: 1.06;
}

.feat-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 30px;
    background: #fff;
    color: var(--purple-deep);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.feat-badge i {
    color: var(--yellow);
}

.feat-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 48px 50px;
}

.feat-body h2 {
    margin: 16px 0 14px;
    font-size: clamp(1.6rem, 2.6vw, 2.3rem);
    line-height: 1.2;
}

.feat-body h2 a {
    color: inherit;
}

.feat-body h2 a:hover {
    color: var(--purple-deep);
}

.feat-body > p {
    margin-bottom: 26px;
}

.feat-body .pc-meta {
    margin: 0;
}

.feat-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px 24px;
}

.feat-author {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.feat-author img {
    width: 36px;
    height: 36px;
    padding: 4px;
    border-radius: 50%;
    background: var(--purple-soft);
    object-fit: contain;
}

@media (max-width: 991px) {
    .feat-card {
        grid-template-columns: 1fr;
    }

    .feat-img {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .feat-body {
        padding: 32px 28px 36px;
    }
}

/* ---------- Listing: search + topic filter ---------- */
.blog-search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    border-radius: 40px;
    background: #fff;
    border: 2px solid var(--line);
    transition: border-color .3s, box-shadow .3s;
}

.blog-search:focus-within {
    border-color: var(--purple);
    box-shadow: 0 0 0 5px var(--purple-soft);
}

.blog-search > i {
    position: absolute;
    left: 20px;
    color: var(--purple);
    pointer-events: none;
}

.blog-search input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px 14px 50px;
    border: 0;
    border-radius: 40px;
    background: none;
    font-size: 15px;
    color: var(--ink);
    outline: none;
}

.blog-search input::-webkit-search-cancel-button {
    display: none;
}

.blog-search button {
    width: 36px;
    height: 36px;
    margin-right: 6px;
    border: 0;
    border-radius: 50%;
    background: var(--purple-soft);
    color: var(--purple-deep);
}

.blog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 34px;
}

.blog-filter button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 18px;
    border: 0;
    border-radius: 40px;
    background: var(--purple-soft);
    color: var(--purple-deep);
    font-size: 15px;
    font-weight: 600;
    transition: background .3s, color .3s, box-shadow .3s;
}

.blog-filter button i {
    color: var(--c, var(--purple));
    transition: color .3s;
}

.blog-filter button:hover {
    background: var(--pink-soft);
}

.blog-filter button.active {
    background: var(--purple-deep);
    color: #fff;
    box-shadow: 0 10px 20px -10px rgba(107, 63, 160, .7);
}

.blog-filter button.active i {
    color: #fff;
}

.bf-count {
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 20px;
    background: #fff;
    color: var(--purple-deep);
    font-size: 12px;
    text-align: center;
}

.blog-empty {
    padding: 60px 20px;
    text-align: center;
    border-radius: 28px;
    background: var(--cream);
    border: 2px dashed var(--line);
}

.blog-empty > i {
    margin-bottom: 14px;
    font-size: 44px;
    color: var(--pink);
}

.blog-empty h3 {
    font-size: 1.4rem;
}

.blog-empty .btn-ghost {
    border: 0;
}

@media (max-width: 991px) {
    .blog-search {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .blog-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px 6px;
        scrollbar-width: none;
    }

    .blog-filter::-webkit-scrollbar {
        display: none;
    }

    .blog-filter button {
        flex: none;
    }
}

/* ---------- Listing: tip of the day ---------- */
.tips {
    position: relative;
    overflow: hidden;
    color: rgba(255, 255, 255, .82);
    background:
        radial-gradient(45% 50% at 85% 20%, rgba(240, 138, 176, .28), transparent 70%),
        radial-gradient(45% 50% at 10% 85%, rgba(123, 184, 174, .25), transparent 70%),
        linear-gradient(135deg, #34175a, #57288a);
}

.tips .section-title {
    color: #fff;
}

.tips .section-head p {
    margin-bottom: 28px;
}

.tip-stack {
    position: relative;
    max-width: 560px;
    min-height: 330px;
    margin: 0 auto;
    cursor: pointer;
    outline: none;
}

.tip-ghost,
.tip-card {
    position: absolute;
    inset: 0;
    border-radius: 32px;
}

.tip-ghost-1 {
    background: color-mix(in srgb, var(--c, var(--pink)) 55%, #fff);
    rotate: 4deg;
    translate: 14px 10px;
    transition: background .5s;
}

.tip-ghost-2 {
    background: rgba(255, 255, 255, .14);
    rotate: -5deg;
    translate: -12px 16px;
}

.tip-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 44px 48px;
    background: #fff;
    box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .45);
    transition: box-shadow .4s;
}

.tip-stack:hover .tip-card,
.tip-stack:focus-visible .tip-card {
    box-shadow: 0 36px 70px -25px rgba(0, 0, 0, .55), 0 0 0 4px var(--c, var(--pink));
}

.tip-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 24px;
    color: #fff;
    background: var(--c, var(--pink));
    transition: background .5s;
}

.tip-count {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

.tip-text {
    margin: 0 0 20px;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 600;
    line-height: 1.45;
    color: var(--ink);
}

.tip-tag {
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    color: color-mix(in srgb, var(--c, var(--pink)) 70%, #2f2a3a);
    background: color-mix(in srgb, var(--c, var(--pink)) 16%, #fff);
}

@media (max-width: 575px) {
    .tip-stack {
        min-height: 360px;
    }

    .tip-card {
        padding: 32px 28px;
    }
}

/* ---------- Article: banner ---------- */
.article-banner {
    padding-bottom: 170px;
}

.art-head {
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
}

.art-head .breadcrumb-nav {
    justify-content: center;
    flex-wrap: wrap;
}

/* Long article titles in the breadcrumb are shortened */
.art-head .breadcrumb-nav #artCrumb {
    max-width: 280px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.art-cat {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 8px;
    margin: 6px auto 18px;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: color-mix(in srgb, var(--c, var(--purple)) 70%, #2f2a3a);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.art-cat i {
    color: var(--c, var(--purple));
}

.art-title {
    margin-bottom: 22px;
    font-size: clamp(2rem, 4.4vw, 3.5rem);
    line-height: 1.15;
    letter-spacing: -.02em;
}

.art-title .w {
    display: inline-block;
}

.art-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 26px;
    font-size: 15px;
    color: var(--muted);
}

.art-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.art-meta img {
    width: 30px;
    height: 30px;
    padding: 3px;
    border-radius: 50%;
    background: #fff;
    object-fit: contain;
}

/* ---------- Article: body ---------- */
.article {
    position: relative;
    z-index: 2;
    padding-bottom: 90px;
}

.art-figure {
    margin: -120px 0 56px;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border-radius: 32px;
    box-shadow: var(--shadow);
    background: var(--purple-soft);
}

.art-figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    font-size: 1.06rem;
    line-height: 1.85;
}

.post-content > p:first-child {
    font-size: 1.2rem;
    line-height: 1.75;
    color: var(--ink);
}

.post-content > p:first-child::first-letter {
    float: left;
    margin: .1em .14em 0 0;
    font-family: var(--script);
    font-size: 3.4em;
    line-height: .95;
    color: var(--purple-deep);
}

.post-content h2 {
    position: relative;
    margin: 2.1em 0 .6em;
    padding-top: 18px;
    font-size: clamp(1.4rem, 2.2vw, 1.75rem);
    scroll-margin-top: 110px;
}

.post-content h2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 46px;
    height: 5px;
    border-radius: 5px;
    background: var(--rainbow);
}

.post-content h3 {
    margin: 1.5em 0 .3em;
    font-size: 1.15rem;
}

.post-content h3 + p {
    margin-top: 0;
}

.post-content ul {
    margin: 0 0 1.4em;
    padding: 0;
    list-style: none;
}

.post-content li {
    position: relative;
    margin-bottom: .55em;
    padding-left: 30px;
}

.post-content li::before {
    content: "";
    position: absolute;
    top: .62em;
    left: 4px;
    width: 12px;
    height: 12px;
    border-radius: 4px;
    rotate: 45deg;
    background: var(--c, var(--purple));
    opacity: .85;
}

.post-content strong {
    color: var(--ink);
}

.post-content blockquote {
    position: relative;
    margin: 2.2em 0;
    padding: 36px 40px 36px 96px;
    border-radius: 26px;
    background: var(--purple-soft);
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--purple-ink);
}

.post-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 14px;
    left: 26px;
    font-family: var(--script);
    font-size: 4.4rem;
    line-height: 1;
    color: var(--pink);
}

.post-tip {
    position: relative;
    margin: 2em 0;
    padding: 24px 28px 24px 88px;
    border-radius: 24px;
    background: var(--yellow-soft);
    border: 1px solid color-mix(in srgb, var(--yellow) 45%, #fff);
    font-size: 1rem;
    line-height: 1.7;
}

.post-tip > i {
    position: absolute;
    top: 24px;
    left: 26px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--orange);
}

.post-tip strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--orange) 70%, #2f2a3a);
}

@media (max-width: 575px) {
    .art-head .breadcrumb-nav > i:last-of-type,
    .art-head .breadcrumb-nav #artCrumb {
        display: none;
    }
}

@media (max-width: 767px) {
    .art-figure {
        aspect-ratio: 4 / 3;
        margin-bottom: 40px;
        border-radius: 24px;
    }

    .post-content blockquote {
        padding: 70px 26px 28px;
    }

    .post-tip {
        padding: 80px 22px 22px;
    }
}

/* ---------- Article: share, author, prev/next ---------- */
.share-btns {
    display: flex;
    gap: 10px;
}

.share-btns a,
.share-btns button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 17px;
    transition: translate .4s var(--ease), box-shadow .3s;
}

.share-btns a:hover,
.share-btns button:hover {
    translate: 0 -4px;
    box-shadow: var(--shadow-sm);
    color: #fff;
}

.share-wa {
    background: #25d366;
}

.share-fb {
    background: #1877f2;
}

.share-copy {
    background: var(--purple-deep);
}

.share-copy.copied {
    background: var(--teal);
}

.art-share-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px 20px;
    margin: 44px 0 30px;
    padding: 22px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-weight: 600;
    color: var(--ink);
}

.author-box {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    padding: 28px;
    border-radius: 26px;
    background: var(--cream);
    border: 1px solid var(--line);
}

.author-box img {
    flex: none;
    width: 74px;
    height: 74px;
    padding: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    object-fit: contain;
}

.author-box small {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--pink);
}

.author-box h3 {
    margin: 2px 0 6px;
    font-size: 1.2rem;
}

.author-box p {
    margin: 0;
    font-size: 15px;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 30px;
}

.pn-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 22px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    transition: border-color .3s, box-shadow .4s, translate .4s var(--ease);
}

.pn-link:hover {
    color: var(--ink);
    border-color: var(--c);
    box-shadow: var(--shadow-sm);
    translate: 0 -4px;
}

.pn-next {
    flex-direction: row-reverse;
    text-align: right;
}

.pn-link img {
    flex: none;
    width: 74px;
    height: 74px;
    border-radius: 16px;
    object-fit: cover;
}

.pn-link small {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--c);
}

.pn-link strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14.5px;
    line-height: 1.4;
}

@media (max-width: 575px) {
    .post-nav {
        grid-template-columns: 1fr;
    }

    .author-box {
        flex-direction: column;
    }
}

/* ---------- Article: sidebar ---------- */
.art-side {
    position: sticky;
    top: 110px;
}

.side-card {
    position: relative;
    margin-bottom: 20px;
    padding: 24px;
    border-radius: 24px;
    background: #fff;
    border: 1px solid var(--line);
}

.side-card h3 {
    margin-bottom: 14px;
    font-size: 1.05rem;
}

.side-card h3 i {
    margin-right: 8px;
    color: var(--purple);
}

.toc-progress {
    height: 6px;
    border-radius: 6px;
    background: var(--line);
    overflow: hidden;
}

.toc-progress span {
    display: block;
    height: 100%;
    background: var(--rainbow);
    transform: scaleX(0);
    transform-origin: left;
}

.toc-left {
    margin: 8px 0 12px;
    font-size: 13px;
    color: var(--muted);
}

.toc {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc;
}

.toc a {
    position: relative;
    display: block;
    padding: 7px 0 7px 34px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--muted);
    counter-increment: toc;
    transition: color .3s;
}

.toc a::before {
    content: counter(toc);
    position: absolute;
    top: 6px;
    left: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--purple-deep);
    background: var(--purple-soft);
    transition: background .3s, color .3s;
}

.toc a:hover {
    color: var(--purple-deep);
}

.toc a.active {
    color: var(--ink);
    font-weight: 600;
}

.toc a.active::before,
.toc a.done::before {
    color: #fff;
    background: var(--purple-deep);
}

.copy-msg:empty {
    display: none;
}

.copy-msg {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--teal);
}

.side-cta {
    overflow: hidden;
    border: 0;
    color: rgba(255, 255, 255, .85);
    background: linear-gradient(135deg, #4a1f78, #7b4fa6);
}

.side-cta h3 {
    color: #fff;
    font-size: 1.3rem;
}

.side-cta p {
    font-size: 14.5px;
}

.side-cta .deco-star {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 30px;
    fill: var(--yellow);
}

@media (max-width: 991px) {
    .art-side {
        position: static;
    }

    .toc-card {
        display: none;
    }
}

/* ---------- Article: related + not found ---------- */
.related {
    background: linear-gradient(180deg, var(--purple-soft), #fff);
}

.art-missing {
    padding: 40px 0 20px;
    text-align: center;
}

.art-missing > i {
    margin-bottom: 14px;
    font-size: 48px;
    color: var(--pink);
}

/* The CTA follows the dark tips section, so it needs room above */
.page-blog .page-cta {
    padding-top: 100px;
}
