/* ==========================================================================
   GreatLight blog detail layout
   Uses the homepage design tokens from /assets/base.css.
   ========================================================================== */

html.gl-blog-html {
    overflow-x: clip;
}

.gl-blog-page {
    background: #f6f3ff;
    overflow-x: clip;
}

.gl-blog-page .gl-blog-shell {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 36px 24px 80px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 32px;
    align-items: start;
}

.gl-blog-main {
    min-width: 0;
}

/* Breadcrumb */
.gl-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--mu);
}

.gl-breadcrumb a {
    color: var(--ink2);
    text-decoration: none;
}

.gl-breadcrumb a:hover {
    color: var(--p);
}

/* Article */
.gl-article {
    background: #fff;
    border: 1px solid var(--ln);
    border-radius: 24px;
    padding: clamp(24px, 3.1vw, 52px);
    box-shadow: 0 18px 50px rgba(23, 11, 51, .06);
}

.gl-article-head {
    margin-bottom: 26px;
}

.gl-kicker {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--p);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
}

.gl-article h1 {
    margin: 0 0 18px;
    font-family: var(--fh);
    font-size: clamp(30px, 3.2vw, 46px);
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -.015em;
    text-transform: none;
    color: var(--ink);
    text-wrap: balance;
}

.gl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--mu);
    font-size: 13.5px;
}

.gl-meta a {
    color: var(--ink2);
    text-decoration: none;
}

.gl-meta a:hover {
    color: var(--p);
}

.gl-dot {
    color: var(--bd);
}

.gl-featured {
    margin: 0 0 30px;
    border-radius: 18px;
    overflow: hidden;
    background: var(--pl2);
}

.gl-featured img {
    display: block;
    width: 100%;
    height: auto;
}

/* Article body */
.gl-content {
    color: var(--ink2);
    font-size: 16px;
    line-height: 1.8;
}

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

.gl-content h2,
.gl-content h3,
.gl-content h4 {
    color: var(--ink);
    text-transform: none;
    letter-spacing: -.01em;
}

.gl-content h2 {
    margin: 1.7em 0 .65em;
    font-size: clamp(24px, 2.1vw, 30px);
    line-height: 1.28;
}

.gl-content h3 {
    margin: 1.5em 0 .55em;
    font-size: 22px;
    line-height: 1.32;
}

.gl-content h4 {
    margin: 1.35em 0 .5em;
    font-size: 18px;
}

.gl-content p,
.gl-content li {
    font-size: 16px;
    line-height: 1.8;
}

.gl-content p {
    margin: 0 0 1.1em;
}

.gl-content ul,
.gl-content ol {
    margin: 0 0 1.2em;
    padding-left: 1.3em;
}

.gl-content li {
    margin-bottom: .45em;
}

.gl-content a {
    color: var(--p);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gl-content a:hover {
    color: var(--p6);
}

.gl-content img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
}

.gl-content figure {
    margin: 1.5em 0;
}

.gl-content blockquote {
    margin: 1.5em 0;
    padding: 18px 22px;
    border-left: 4px solid var(--p);
    border-radius: 0 12px 12px 0;
    background: var(--pl2);
    color: var(--ink2);
    font-size: 17px;
}

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

.gl-content th,
.gl-content td {
    padding: 10px 12px;
    border: 1px solid var(--ln);
    text-align: left;
}

.gl-content th {
    background: var(--pl2);
    color: var(--ink);
}

.gl-content code {
    padding: 2px 5px;
    border-radius: 5px;
    background: var(--pl2);
    font-size: .92em;
}

.gl-content pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 12px;
    background: #17112b;
    color: #f4f1ff;
}

.gl-article-foot {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--ln);
}

.gl-tags a {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--pl2);
    border: 1px solid var(--ln);
    color: var(--ink2);
    font-size: 12px;
    text-decoration: none;
}

.gl-tags a:hover {
    color: var(--p);
    border-color: var(--bd);
}

.gl-back {
    margin-top: 22px;
}

.gl-back a {
    color: var(--p);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.gl-comments {
    margin-top: 24px;
    padding: 24px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--ln);
}

/* Sidebar shell — exactly one viewport tall, bottom block pinned */
.gl-blog-sidebar {
    position: sticky;
    top: 108px;
    height: calc(100vh - 108px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
    align-self: start;
}

.gl-sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 3px;
    scrollbar-width: thin;
    scrollbar-color: var(--bd) transparent;
}

.gl-sidebar-scroll::-webkit-scrollbar {
    width: 5px;
}

.gl-sidebar-scroll::-webkit-scrollbar-thumb {
    background: var(--bd);
    border-radius: 99px;
}

.gl-sidebar-bottom {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gl-side-card {
    background: #fff;
    border: 1px solid var(--ln);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 10px 28px rgba(23, 11, 51, .045);
}

.gl-side-card h2 {
    margin: 0 0 10px;
    color: var(--mu);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* Categories */
.gl-cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gl-cat-list li {
    margin: 0;
}

.gl-cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--ln);
    color: var(--ink2);
    font-size: 13.5px;
    line-height: 1.4;
    text-decoration: none;
}

.gl-cat-list li:last-child a {
    border-bottom: 0;
}

.gl-cat-list a:hover,
.gl-cat-list a.is-current {
    color: var(--p);
}

.gl-cat-list em {
    color: var(--mu);
    font-style: normal;
    font-size: 11px;
}

.gl-all-link {
    font-weight: 700;
}

/* Author */
.gl-author-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gl-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    border: 1px solid var(--ln);
}

.gl-author-row img {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 50%;
    border: 1px solid var(--ln);
}

.gl-avatar-fallback {
    display: grid;
    place-items: center;
    background: var(--pl);
    color: var(--p);
    border: 1px solid var(--bd);
    font: 800 14px/1 Arial, Helvetica, sans-serif;
}

.gl-author-row strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
}

.gl-author-row strong a {
    color: inherit;
    text-decoration: none;
}

.gl-author-role {
    display: block;
    margin-top: 2px;
    color: var(--mu);
    font-size: 11.5px;
}

.gl-author p {
    margin: 0;
    color: var(--mu);
    font-size: 12.5px;
    line-height: 1.6;
}

/* Marketing line */
.gl-pitch {
    background: linear-gradient(135deg, var(--pl2), #fff);
}

.gl-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--p);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.gl-pitch p {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.gl-text-link {
    color: var(--p);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

/* Contact */
.gl-contact a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    color: var(--ink2);
    text-decoration: none;
}

.gl-contact a span {
    color: var(--mu);
    font-size: 11.5px;
}

.gl-contact a strong {
    font-size: 12.5px;
    font-weight: 600;
}

.gl-contact a:hover strong {
    color: var(--p);
}

.gl-contact-note {
    margin: 6px 0 0;
    color: var(--mu);
    font-size: 11.5px;
    line-height: 1.5;
}

/* Lead form */
.gl-lead-sub {
    margin: -4px 0 10px;
    color: var(--mu);
    font-size: 12px;
    line-height: 1.5;
}

.gl-lead-form label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink2);
    font-size: 11.5px;
    font-weight: 700;
}

.gl-lead-form label > span {
    display: block;
    margin-bottom: 3px;
}

.gl-lead-form label em {
    color: var(--mu);
    font-style: normal;
    font-weight: 400;
}

.gl-lead-form input,
.gl-lead-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--bd);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: 13px/1.45 Arial, Helvetica, sans-serif;
}

.gl-lead-form textarea {
    min-height: 62px;
    max-height: 120px;
    resize: vertical;
}

.gl-lead-form input:focus,
.gl-lead-form textarea:focus {
    outline: none;
    border-color: var(--p);
    box-shadow: 0 0 0 3px rgba(88, 4, 250, .1);
}

.gl-lead-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    margin-top: 9px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--p);
    color: #fff;
    font: 700 13.5px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.gl-lead-submit:hover {
    background: var(--p6);
    transform: translateY(-1px);
}

.gl-lead-form small {
    display: block;
    margin-top: 7px;
    color: var(--mu);
    font-size: 10.5px;
    line-height: 1.4;
}

.gl-form-status {
    margin: 0 0 9px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12px;
    line-height: 1.5;
}

.gl-form-status.is-success {
    background: #ecfdf3;
    border: 1px solid #b7ebc6;
    color: #116b35;
}

.gl-form-status.is-error {
    background: #fff1f1;
    border: 1px solid #ffc9c9;
    color: #9b1c1c;
}

.gl-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

#gl-sidebar-form {
    scroll-margin-top: 120px;
}

/* Comments */
.gl-comments .comments-title,
.gl-comments .comment-reply-title {
    font-size: 20px;
    text-transform: none;
}

/* Previous / next article */
.gl-post-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--ln);
}

.gl-post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--ln);
    border-radius: 14px;
    background: var(--pl2);
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.gl-post-nav-item:hover {
    border-color: var(--bd);
    background: #fff;
    transform: translateY(-2px);
}

.gl-post-nav-item span {
    color: var(--mu);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gl-post-nav-item strong {
    color: var(--ink);
    font-size: 14px;
    line-height: 1.45;
}

.gl-post-nav-item.is-next {
    text-align: right;
}

.gl-post-nav-item:only-child {
    grid-column: 1 / -1;
}

/* Related articles */
.gl-related {
    margin-top: 36px;
    padding: 56px 24px 64px;
    background: #fff;
    border-top: 1px solid var(--ln);
}

.gl-related-inner {
    max-width: 1600px;
    margin: 0 auto;
}

.gl-related-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.gl-related-head h2 {
    margin: 0;
    font-size: clamp(26px, 2.6vw, 36px);
    text-transform: none;
    color: var(--ink);
}

.gl-related-head > a {
    color: var(--p);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.gl-related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.gl-related-card {
    border: 1px solid var(--ln);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.gl-related-card:hover {
    transform: translateY(-4px);
    border-color: var(--bd);
    box-shadow: 0 16px 34px rgba(23, 11, 51, .08);
}

.gl-related-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--pl2);
    line-height: 0;
}

.gl-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    transition: transform .4s ease;
}

.gl-related-card:hover .gl-related-thumb img {
    transform: scale(1.035);
}

.gl-related-noimg {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--pl2), #fff);
    color: var(--p);
    font-weight: 800;
    font-size: 14px;
}

.gl-related-body {
    padding: 14px 16px 17px;
}

.gl-related-meta {
    display: block;
    margin-bottom: 6px;
    color: var(--mu);
    font-size: 11px;
}

.gl-related-body h3 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
    text-transform: none;
}

.gl-related-body h3 a {
    color: var(--ink);
    text-decoration: none;
}

.gl-related-body h3 a:hover {
    color: var(--p);
}

/* Keep the static-site logo at its intrinsic aspect ratio */
.gl-blog-page .hr .lo {
    flex: 0 0 auto;
}

.gl-blog-page .hr .lo img {
    width: 175px;
    max-width: 100%;
    height: auto;
}

/* Footer text links: underline so they are distinguishable without color alone */
.gl-blog-page .ft .fb a,
.gl-blog-page .ft .ftc a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 991px) {
    .gl-blog-page .hr .lo img {
        width: 140px;
    }
}

@media (max-width: 600px) {
    .gl-blog-page .hr .lo img {
        width: 110px;
    }
}

/* Category archive */
.gl-category {
    padding: 36px 24px 76px;
    background: #f6f3ff;
}

.gl-category-inner {
    max-width: 1600px;
    margin: 0 auto;
}

.gl-category-hero {
    margin-bottom: 30px;
    padding: clamp(26px, 3.5vw, 46px);
    border: 1px solid var(--ln);
    border-radius: 24px;
    background: linear-gradient(135deg, #fff 0%, var(--pl2) 100%);
    box-shadow: 0 18px 50px rgba(23, 11, 51, .05);
}

.gl-category-hero h1 {
    margin: 6px 0 12px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.1;
    text-transform: none;
    color: var(--ink);
}

.gl-category-desc {
    max-width: 780px;
    margin: 0 0 16px;
    color: var(--mu);
    font-size: 16px;
    line-height: 1.75;
}

.gl-category-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    color: var(--mu);
    font-size: 13px;
}

.gl-category-meta a {
    color: var(--p);
    font-weight: 700;
    text-decoration: none;
}

.gl-category-meta .gl-rss {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding: 3px 9px;
    border: 1px solid var(--bd);
    border-radius: 999px;
    background: #fff;
    font-size: 11.5px;
}

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

.gl-cat-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: 0;
    padding: 0 !important;
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 0 0 1px var(--ln), 0 10px 28px rgba(23, 11, 51, .045);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.gl-cat-card > .gl-cat-thumb {
    margin: 0 !important;
}

.gl-cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 0 1px var(--bd), 0 18px 40px rgba(23, 11, 51, .1);
}

.gl-cat-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--pl2);
    line-height: 0;
}

.gl-cat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    transition: transform .4s ease;
}

.gl-cat-card:hover .gl-cat-thumb img {
    transform: scale(1.035);
}

.gl-cat-noimg {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--pl2), #fff);
    color: var(--p);
    font-weight: 800;
}

.gl-cat-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 18px 20px 20px;
}

.gl-cat-meta {
    display: block;
    margin-bottom: 7px;
    color: var(--mu);
    font-size: 11.5px;
}

.gl-cat-body h2 {
    margin: 0 0 9px;
    font-size: 20px;
    line-height: 1.35;
    text-transform: none;
}

.gl-cat-body h2 a {
    color: var(--ink);
    text-decoration: none;
}

.gl-cat-body h2 a:hover {
    color: var(--p);
}

.gl-cat-body p {
    margin: 0 0 14px;
    color: var(--mu);
    font-size: 13.5px;
    line-height: 1.65;
}

.gl-cat-more {
    margin-top: auto;
    color: var(--p);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
}

.gl-category-pagination {
    margin-top: 34px;
    text-align: center;
}

.gl-category-pagination .nav-links,
.gl-category-pagination .navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
}

.gl-category-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--ln);
    border-radius: 999px;
    background: #fff;
    color: var(--ink2);
    font-size: 13px;
    text-decoration: none;
}

.gl-category-pagination .page-numbers.current,
.gl-category-pagination .page-numbers:hover {
    border-color: var(--p);
    background: var(--p);
    color: #fff;
}

.gl-category-pagination .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.gl-category-empty {
    padding: 40px;
    border: 1px solid var(--ln);
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

/* One-screen sidebar: keep the three cards evenly spaced and the form at the bottom */
@media (min-width: 1181px) and (min-height: 851px) {
    .gl-blog-page .gl-blog-sidebar {
        justify-content: space-between;
    }

    .gl-blog-page .gl-sidebar-scroll,
    .gl-blog-page .gl-sidebar-bottom {
        display: contents;
    }
}

/* Reserve space for the homepage-style floating contact rail */
@media (min-width: 1181px) and (max-width: 1700px) {
    .gl-blog-page .gl-blog-shell {
        padding-right: 76px;
    }

    .gl-blog-page .gl-category-inner {
        padding-right: 76px;
    }
}

/* Tablet / mobile: stack the sidebar below the article */
@media (max-width: 1180px) {
    .gl-blog-page .gl-blog-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 980px;
        gap: 24px;
    }

    .gl-blog-page .gl-blog-sidebar {
        position: static;
        height: auto;
        overflow: visible;
    }

    .gl-blog-page .gl-sidebar-scroll {
        overflow: visible;
        padding-right: 0;
    }

    .gl-blog-page .gl-sidebar-bottom {
        margin-top: 0;
    }

    .gl-category-grid,
    .gl-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .gl-blog-page .gl-blog-shell {
        padding: 20px 14px 60px;
    }

    .gl-article {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .gl-article h1 {
        font-size: 28px;
    }

    .gl-content,
    .gl-content p,
    .gl-content li {
        font-size: 15px;
    }

    .gl-content h2 {
        font-size: 23px;
    }

    .gl-content h3 {
        font-size: 19px;
    }

    .gl-featured {
        margin-bottom: 22px;
        border-radius: 14px;
    }

    .gl-side-card {
        padding: 14px 15px;
        border-radius: 15px;
    }

    .gl-category {
        padding: 20px 14px 60px;
    }

    .gl-category-hero {
        padding: 24px 20px;
        border-radius: 18px;
    }

    .gl-category-grid,
    .gl-related-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .gl-related {
        padding: 40px 14px 44px;
    }

    .gl-related-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .gl-post-nav {
        grid-template-columns: minmax(0, 1fr);
    }

    .gl-post-nav-item.is-next {
        text-align: left;
    }
}

@media (max-height: 720px) and (min-width: 1181px) {
    .gl-blog-sidebar {
        position: static;
        height: auto;
        overflow: visible;
    }

    .gl-sidebar-scroll {
        overflow: visible;
    }
}

body.admin-bar .gl-blog-sidebar {
    top: 140px;
    height: calc(100vh - 156px);
}

body.admin-bar .hr {
    top: 32px;
}

@media (max-width: 1180px) {
    body.admin-bar .gl-blog-sidebar {
        top: auto;
        height: auto;
    }
}
