/* ==========================================================================
   Block-based content (admin-authored blog posts & portfolio projects)
   Rendered by resources/views/_partials/_blocks.blade.php
   ========================================================================== */

.post-body {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 15px;
    color: var(--color-body, #333);
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-body--wide {
    max-width: 1100px;
}

.pb-block {
    margin: 34px 0;
}

.pb-block:first-child {
    margin-top: 0;
}

/* ---- Headings ---- */
.pb-heading {
    margin-top: 52px;
}

.pb-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary, #45d0bd);
    margin-bottom: 10px;
}

.pb-heading__title {
    color: var(--color-heading, #111);
    line-height: 1.25;
    margin: 0;
}

h2.pb-heading__title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3.pb-heading__title { font-size: clamp(1.35rem, 2.4vw, 1.6rem); }
h4.pb-heading__title { font-size: 1.2rem; }

/* ---- Rich text ---- */
.pb-rich > :first-child { margin-top: 0; }
.pb-rich > :last-child { margin-bottom: 0; }
.pb-rich h2, .pb-rich h3, .pb-rich h4 {
    color: var(--color-heading, #111);
    margin: 1.6em 0 0.5em;
    line-height: 1.3;
}
.pb-rich p { margin: 0 0 1.1em; }
.pb-rich a {
    color: var(--color-primary, #1fa07f);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.pb-rich ul, .pb-rich ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.pb-rich li { margin: 0.35em 0; }
.pb-rich blockquote {
    margin: 1.4em 0;
    padding: 0.4em 0 0.4em 1.1em;
    border-left: 3px solid var(--color-primary, #45d0bd);
    font-style: italic;
    color: var(--color-heading, #111);
}
.pb-rich img { border-radius: 12px; margin: 1.2em 0; }

/* ---- Standalone image ---- */
.pb-image { margin-left: auto; margin-right: auto; }
.pb-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
}
.pb-image figcaption {
    margin-top: 10px;
    font-size: 0.88rem;
    color: #777;
    text-align: center;
}
.pb-image--normal { max-width: 620px; }
.pb-image--wide { max-width: 100%; }
.pb-image--full {
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.pb-image--full img { border-radius: 0; }

/* ---- Image + text ---- */
.pb-image-text {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin: 48px 0;
}
.pb-image-text--right .pb-image-text__media { order: 2; }
.pb-image-text__media img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
}
.pb-image-text__body h3 {
    color: var(--color-heading, #111);
    margin: 0 0 0.5em;
    font-size: 1.5rem;
}
.pb-image-text__body p { margin: 0 0 1em; }
.pb-image-text__body .ibt-btn { margin-top: 8px; }

/* ---- Gallery ---- */
.pb-gallery {
    display: grid;
    gap: 16px;
    margin: 40px 0;
}
.pb-gallery--2 { grid-template-columns: repeat(2, 1fr); }
.pb-gallery--3 { grid-template-columns: repeat(3, 1fr); }
.pb-gallery--4 { grid-template-columns: repeat(4, 1fr); }
.pb-gallery figure { margin: 0; }
.pb-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    display: block;
}

/* ---- Pull quote ---- */
.pb-quote {
    margin: 48px 0;
    padding: 0 0 0 28px;
    border-left: 4px solid var(--color-primary, #45d0bd);
}
.pb-quote p {
    font-size: 1.4rem;
    line-height: 1.5;
    font-weight: 500;
    color: var(--color-heading, #111);
    margin: 0 0 12px;
}
.pb-quote cite {
    font-style: normal;
    font-size: 0.95rem;
    color: #777;
}
.pb-quote cite span { color: #999; }

/* ---- Checklist ---- */
.pb-checklist { margin: 36px 0; }
.pb-checklist h4 { color: var(--color-heading, #111); margin: 0 0 14px; }
.pb-checklist__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pb-checklist__list li { position: relative; padding-left: 32px; line-height: 1.6; }
.pb-checklist__list--check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary, #45d0bd);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23fff' d='M8 13.2 4.8 10l-1.4 1.4L8 16 17 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 76% no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23fff' d='M8 13.2 4.8 10l-1.4 1.4L8 16 17 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 76% no-repeat;
}
.pb-checklist__list--bullet li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-primary, #45d0bd);
}

/* ---- FAQ (accordion) ---- */
.pb-faq { margin: 40px 0; }
.pb-faq__title { color: var(--color-heading, #111); margin: 0 0 20px; }
.pb-faq__list { display: grid; gap: 12px; }
.pb-faq__item {
    border: 1px solid var(--color-border, #e2e2e2);
    border-radius: 14px;
    padding: 2px 22px;
    background: #fff;
}
.pb-faq__q {
    cursor: pointer;
    list-style: none;
    padding: 18px 30px 18px 0;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--color-heading, #111);
    position: relative;
}
.pb-faq__q::-webkit-details-marker { display: none; }
.pb-faq__q::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--color-primary, #1fa07f);
}
.pb-faq__item[open] .pb-faq__q::after { content: "\2013"; }
.pb-faq__a { padding: 0 0 20px; }
.pb-faq__a > :first-child { margin-top: 0; }
.pb-faq__a > :last-child { margin-bottom: 0; }
.pb-faq__a p { margin: 0 0 0.9em; }

/* ---- Comparison table (via the HTML block: <div class="pb-table"><table>…) ---- */
.pb-table {
    margin: 34px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.pb-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.97rem;
    min-width: 520px;
}
.pb-table th,
.pb-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border, #e2e2e2);
    vertical-align: top;
    line-height: 1.55;
}
.pb-table thead th {
    background: var(--color-surface-light, #f0f2f4);
    color: var(--color-heading, #111);
    font-weight: 700;
}
.pb-table tbody th {
    font-weight: 600;
    color: var(--color-heading, #111);
}
.pb-table tbody tr:last-child td,
.pb-table tbody tr:last-child th { border-bottom: 0; }
.pb-table caption {
    caption-side: bottom;
    padding-top: 10px;
    font-size: 0.85rem;
    color: #777;
    text-align: left;
}

/* ---- Stats ---- */
.pb-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 24px;
    margin: 44px 0;
    padding: 32px;
    background: var(--color-surface-light, #f0f2f4);
    border-radius: 18px;
}
.pb-stat { text-align: center; }
.pb-stat__value {
    display: block;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--color-primary, #1fa07f);
    line-height: 1.1;
}
.pb-stat__label {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
    color: #666;
}

/* ---- CTA ---- */
.pb-cta {
    position: relative;
    margin: 52px 0;
    padding: 42px 44px;
    border-radius: 24px;
    overflow: hidden;
    background: var(--gradient-3, linear-gradient(113deg, #45d0bd 2.7%, #44b6e9 98.55%));
    color: #fff;
}
.pb-cta::before {
    content: "";
    position: absolute;
    top: -45%;
    right: -8%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.30), transparent 70%);
    pointer-events: none;
}
.pb-cta__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    flex-wrap: wrap;
}
.pb-cta__text { flex: 1 1 320px; }
.pb-cta h3 {
    color: #fff;
    margin: 0 0 8px;
    font-size: 1.5rem;
    line-height: 1.25;
}
.pb-cta p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    max-width: 48ch;
    font-size: 1rem;
    line-height: 1.6;
}
.pb-cta__btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 26px;
    border-radius: 999px;
    background: #fff;
    color: var(--color-surface-dark-2, #0c111d);
    font-weight: 600;
    font-size: 0.98rem;
    text-decoration: none;
    box-shadow: 0 12px 30px -10px rgba(12, 17, 29, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.pb-cta__btn svg { transition: transform 0.2s ease; }
.pb-cta__btn:hover {
    background: var(--color-surface-dark-2, #0c111d);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 18px 38px -10px rgba(12, 17, 29, 0.5);
}
.pb-cta__btn:hover svg { transform: translateX(3px); }

@media (max-width: 620px) {
    .pb-cta { padding: 30px 24px; }
    .pb-cta__inner { flex-direction: column; align-items: flex-start; }
    .pb-cta__btn { width: 100%; justify-content: center; }
}

/* ---- Video ---- */
.pb-video { margin: 44px 0; }
.pb-video__frame {
    position: relative;
    padding-top: 56.25%;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}
.pb-video__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.pb-video figcaption {
    margin-top: 10px;
    font-size: 0.88rem;
    color: #777;
    text-align: center;
}

/* ---- Raw HTML passthrough ---- */
.pb-html > :first-child { margin-top: 0; }
.pb-html > :last-child { margin-bottom: 0; }

/* ---- Divider ---- */
.pb-divider { margin: 0; }
.pb-divider--sm { height: 24px; }
.pb-divider--md { height: 48px; }
.pb-divider--lg { height: 80px; }
.pb-divider--line {
    border-bottom: 1px solid var(--color-border, #e2e2e2);
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .post-body { font-size: 1rem; }
    .pb-image-text { grid-template-columns: 1fr; gap: 24px; }
    .pb-image-text--right .pb-image-text__media { order: 0; }
    .pb-gallery--3, .pb-gallery--4 { grid-template-columns: repeat(2, 1fr); }
    .pb-quote p { font-size: 1.2rem; }
    .pb-stats { padding: 28px; }
}

/* ==========================================================================
   Listing pages (blog index, portfolio index) + article/project chrome
   ========================================================================== */

.cx-wrap { max-width: 1180px; margin: 0 auto; padding: 0 15px; }

/* ---- Category filter pills ---- */
.cx-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 40px;
}
.cx-filters a {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid var(--color-border, #d9d9d9);
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    color: var(--color-body, #333);
    transition: 0.2s;
}
.cx-filters a:hover { border-color: var(--color-heading, #111); }
.cx-filters a.is-active {
    background: var(--color-heading, #111);
    border-color: var(--color-heading, #111);
    color: #fff;
}

/* ---- Card grid ---- */
.cx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.cx-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cx-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}
.cx-card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-surface-light, #f0f2f4);
}
.cx-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.cx-card:hover .cx-card__media img { transform: scale(1.06); }
.cx-card__body {
    padding: 26px 26px 30px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cx-card__cat {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary, #1fa07f);
    margin-bottom: 10px;
}
.cx-card__title {
    font-size: 1.25rem;
    line-height: 1.35;
    margin: 0 0 10px;
}
.cx-card__title a { color: var(--color-heading, #111); text-decoration: none; }
.cx-card__title a:hover { color: var(--color-primary, #1fa07f); }
.cx-card__excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 18px;
}
.cx-card__meta {
    margin-top: auto;
    font-size: 0.82rem;
    color: #999;
    display: flex;
    gap: 14px;
}

.cx-empty {
    text-align: center;
    padding: 60px 20px;
    color: #777;
}

/* ---- Pagination (Bootstrap-5 paginator markup) ---- */
.cx-pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}
.cx-pagination .pagination { margin: 0; gap: 6px; flex-wrap: wrap; }
.cx-pagination .page-link {
    border-radius: 10px;
    border-color: var(--color-border, #d9d9d9);
    color: var(--color-body, #333);
}
.cx-pagination .active .page-link {
    background: var(--color-heading, #111);
    border-color: var(--color-heading, #111);
}

/* ---- Article / project hero ---- */
.cx-hero { padding: 60px 0 40px; }
.cx-hero__inner { max-width: 820px; margin: 0 auto; padding: 0 15px; }
.cx-hero__eyebrow {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-primary, #1fa07f);
}
.cx-hero__title {
    font-size: clamp(1.9rem, 4vw, 2.9rem);
    line-height: 1.2;
    color: var(--color-heading, #111);
    margin: 14px 0 16px;
}
.cx-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.9rem;
    color: #888;
}
.cx-hero__media {
    max-width: 1180px;
    margin: 30px auto 0;
    padding: 0 15px;
}
.cx-hero__media img {
    width: 100%;
    height: auto;
    border-radius: 22px;
    display: block;
}
.cx-lead {
    max-width: 820px;
    margin: 36px auto 0;
    padding: 0 15px;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--color-heading, #111);
}

/* ---- Project facts panel ---- */
.cx-facts {
    max-width: 820px;
    margin: 30px auto 0;
    padding: 24px 15px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    border-top: 1px solid var(--color-border, #e2e2e2);
}
.cx-fact__label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 4px;
}
.cx-fact__value { color: var(--color-heading, #111); font-weight: 600; }
.cx-fact__value a { color: var(--color-primary, #1fa07f); }
.cx-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-tags span {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--color-surface-light, #f0f2f4);
    color: var(--color-body, #333);
}

/* ---- Related strip ---- */
.cx-related { margin-top: 70px; }
.cx-related h2 {
    text-align: center;
    font-size: 1.7rem;
    color: var(--color-heading, #111);
    margin-bottom: 34px;
}

@media (max-width: 768px) {
    .cx-grid { grid-template-columns: 1fr; }
    .cx-lead { font-size: 1.08rem; }
}

/* ---- Portfolio / blog detail banner (page-banner4 + .cx-banner) ---- */
.cx-banner .page-content { max-width: 900px; }
.cx-banner .page-content .sub-title {
    display: inline-block;
    margin-bottom: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.7;
}
.cx-banner .page-content .title {
    font-size: clamp(2.1rem, 4.6vw, 3.6rem);
    line-height: 1.14;
}
.page-banner4 .page-content .subtitle {
    max-width: 640px;
    margin: 20px auto 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ---- Article layout: sticky "on this page" sidebar + scrolling body ---- */
/* `.wrapper { overflow: hidden }` (style.css) turns the wrapper into a scroll
   container, which kills `position: sticky` for the TOC. `clip` still hides the
   horizontal overflow from decorative shapes but does NOT create a scroll
   container, so the sidebar can stick to the viewport again. */
.wrapper {
    overflow: clip;
}
.cx-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 15px;
}
.cx-layout__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 56px;
    align-items: start;
    justify-content: center;
}
.cx-layout.has-toc .cx-layout__grid {
    grid-template-columns: 240px minmax(0, 800px);
}
.cx-layout__main {
    min-width: 0;
    max-width: 820px;
}
.cx-layout:not(.has-toc) .cx-layout__main { margin: 0 auto; }
.cx-layout__main .post-body,
.cx-layout__main .cx-lead {
    max-width: none;
    margin: 0;
    padding: 0;
}
.cx-layout__main .cx-lead--flush { margin-bottom: 10px; }

.pb-heading { scroll-margin-top: 110px; }

.cx-toc {
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding-right: 6px;
}
.cx-toc__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 14px;
}
.cx-toc__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--color-border, #e2e2e2);
}
.cx-toc__item a {
    display: block;
    padding: 7px 0 7px 18px;
    margin-left: -2px;
    border-left: 2px solid transparent;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--color-body, #555);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.cx-toc__item--h3 a { padding-left: 32px; font-size: 0.86rem; }
.cx-toc__item a:hover { color: var(--color-heading, #111); }
.cx-toc__item a.is-active {
    color: var(--color-primary, #1fa07f);
    border-left-color: var(--color-primary, #1fa07f);
    font-weight: 600;
}

@media (max-width: 992px) {
    .cx-layout.has-toc .cx-layout__grid { grid-template-columns: minmax(0, 1fr); }
    .cx-toc {
        position: static;
        max-height: none;
        overflow: visible;
        order: -1;
        margin-bottom: 10px;
    }
    .cx-toc__list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        border-left: 0;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .cx-toc__item a {
        white-space: nowrap;
        padding: 8px 14px;
        border: 1px solid var(--color-border, #e2e2e2);
        border-radius: 999px;
    }
    .cx-toc__item--h3 a { padding-left: 14px; font-size: 0.82rem; }
    .cx-toc__item a.is-active {
        background: var(--color-primary, #1fa07f);
        border-color: var(--color-primary, #1fa07f);
        color: #fff;
    }
}

