/*
 * Blog reading experience (post page + blog list cards).
 * Loaded only on blog pages, so nothing here can affect the rest of the site.
 * Palette and fonts follow theme.css: Poppins headings, Open Sans text,
 * navy #190844, text #282828, accent #cc3500, soft blue #f3f7ff, soft orange #fff0eb.
 */

/* ---------- Reading progress bar ---------- */
.post-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: #cc3500;
    z-index: 1000; /* above the fixed navbar (999) */
    transition: width .1s linear;
}

/* ---------- Layout: article column + "On this page" sidebar ---------- */
.post-section {
    padding: 80px 0 100px;
}

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
    gap: 64px;
}

.post-layout.has-toc {
    grid-template-columns: minmax(0, 720px) 230px;
}

.post-toc {
    display: none;
}

@media (min-width: 1200px) {
    .post-toc {
        display: block;
        position: sticky;
        top: 120px;
        align-self: start;
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        border-left: 1px solid #e3e7ea;
        padding-left: 20px;
    }
}

@media (max-width: 1199.98px) {
    .post-layout.has-toc {
        grid-template-columns: minmax(0, 720px);
    }
}

.post-toc__title {
    font-family: Poppins, sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #190844;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 14px;
}

.post-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-toc li {
    margin: 0 0 10px;
    line-height: 1.35;
}

.post-toc li.is-sub {
    padding-left: 14px;
}

.post-toc a {
    font-size: 14px;
    color: #5b5b6b;
    text-decoration: none;
    transition: color .2s;
}

.post-toc a:hover,
.post-toc a.is-active {
    color: #cc3500;
}

/* Collapsible version of the TOC for tablets/phones */
.post-toc-mobile {
    margin: 0 0 32px;
    background: #f3f7ff;
    border-radius: 10px;
    padding: 14px 18px;
}

.post-toc-mobile summary {
    cursor: pointer;
    font-family: Poppins, sans-serif;
    font-weight: 600;
    color: #190844;
}

.post-toc-mobile ol {
    margin: 12px 0 0;
    padding-left: 18px;
}

.post-toc-mobile li {
    margin-bottom: 8px;
}

.post-toc-mobile li.is-sub {
    margin-left: 14px;
}

.post-toc-mobile a {
    color: #282828;
}

@media (min-width: 1200px) {
    .post-toc-mobile {
        display: none;
    }
}

/* ---------- Post header ---------- */
.post-header {
    margin-bottom: 36px;
}

.post-category {
    display: inline-block;
    background: #fff0eb;
    color: #cc3500;
    font-family: Poppins, sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 30px;
    margin-bottom: 18px;
}

.post-title {
    font-family: Poppins, sans-serif;
    font-size: 40px;
    line-height: 1.2;
    font-weight: 700;
    color: #190844;
    margin: 0 0 18px;
    overflow-wrap: anywhere;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 15px;
    color: #6b6b7b;
}

.post-meta i {
    color: #cc3500;
    margin-right: 6px;
}

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

.post-cover img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

/* ---------- Article typography ---------- */
.post-content {
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    line-height: 1.8;
    color: #282828;
    overflow-wrap: break-word;
}

.post-content > *:first-child {
    margin-top: 0;
}

.post-content p {
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0 0 1.4em;
}

.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5 {
    font-family: Poppins, sans-serif;
    font-weight: 700;
    color: #190844;
    line-height: 1.3;
    margin: 2em 0 .7em;
    scroll-margin-top: 110px; /* clears the fixed navbar when jumping from the TOC */
}

.post-content h2 { font-size: 28px; }
.post-content h3 { font-size: 24px; }
.post-content h4 { font-size: 21px; }
.post-content h5 { font-size: 18px; }

.post-content a {
    color: #cc3500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content a:hover {
    color: #190844;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.4em;
    padding-left: 1.4em;
}

.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }

.post-content li {
    margin-bottom: .5em;
}

.post-content blockquote {
    margin: 1.8em 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid #cc3500;
    color: #4a4a5a;
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .88em;
    background: #f3f7ff;
    border: 1px solid #e3e7ea;
    border-radius: 5px;
    padding: 2px 6px;
}

.post-content pre {
    background: #190844;
    color: #f3f7ff;
    border-radius: 10px;
    padding: 20px 22px;
    margin: 0 0 1.6em;
    overflow-x: auto;
    font-size: 15px;
    line-height: 1.6;
}

.post-content pre code {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.post-content img {
    max-width: 100%;
    height: auto !important;
    border-radius: 10px;
    margin: .6em 0 1.4em;
}

.post-content figure {
    margin: 0 0 1.6em;
}

.post-content figcaption {
    font-size: 14px;
    color: #6b6b7b;
    text-align: center;
    margin-top: -.8em;
}

.post-content hr {
    border: 0;
    border-top: 1px solid #e3e7ea;
    margin: 2.4em 0;
}

.post-content table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 0 0 1.6em;
    font-size: 16px;
}

.post-content th,
.post-content td {
    border: 1px solid #e3e7ea;
    padding: 10px 14px;
    text-align: left;
}

.post-content th {
    background: #f3f7ff;
    font-weight: 600;
}

/* Rich-text editors sometimes leave fixed widths/inline fonts — keep the column readable */
.post-content iframe,
.post-content video {
    max-width: 100%;
    border-radius: 10px;
}

.post-content [style*="font-family"] {
    font-family: inherit !important;
}

/* ---------- Call to action ---------- */
.post-cta {
    margin-top: 56px;
    background: #190844;
    color: #fff;
    border-radius: 14px;
    padding: 34px 36px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.post-cta__title {
    font-family: Poppins, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.post-cta__text {
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 16px;
}

.post-cta__btn {
    display: inline-block;
    background: #cc3500;
    color: #fff;
    font-family: Poppins, sans-serif;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 28px;
    border-radius: 30px;
    white-space: nowrap;
    transition: background .2s;
}

.post-cta__btn:hover,
.post-cta__btn:focus {
    background: #fff;
    color: #190844;
}

/* ---------- Previous / next ---------- */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
}

.post-nav__link {
    display: block;
    background: #f3f7ff;
    border-radius: 10px;
    padding: 18px 20px;
    color: #282828;
    transition: background .2s;
}

.post-nav__link:hover {
    background: #fff0eb;
    color: #282828;
}

.post-nav__link--next {
    text-align: right;
    grid-column: 2;
}

.post-nav__label {
    display: block;
    font-size: 13px;
    color: #cc3500;
    font-weight: 600;
    margin-bottom: 6px;
}

.post-nav__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: Poppins, sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    color: #190844;
}

.post-back {
    display: inline-block;
    margin-top: 32px;
    color: #cc3500;
    font-weight: 600;
}

.post-back:hover {
    color: #190844;
}

/* ---------- Blog list cards ---------- */
.card-meta {
    font-size: 14px;
    color: #6b6b7b;
    margin-bottom: 8px;
}

/* ---------- Small screens ---------- */
@media (max-width: 767.98px) {
    .post-section {
        padding: 50px 0 70px;
    }

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

    .post-content {
        font-size: 17px;
        line-height: 1.75;
    }

    .post-content h2 { font-size: 24px; }
    .post-content h3 { font-size: 21px; }
    .post-content h4 { font-size: 19px; }

    .post-cta {
        padding: 26px 22px;
    }

    .post-nav {
        grid-template-columns: 1fr;
    }

    .post-nav__link--next {
        grid-column: auto;
    }
}
