/* ==========================================================================
   ثِقال — Ghost theme
   Every value below is taken from the thiqal.net source
   (app/globals.css + the Tailwind classes in app/components/*).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Colors */
    --color-accent: #12b2c1;              /* step numbers, glow, success text */
    --color-black: #000;                  /* page + odd sections */
    --color-surface: #101010;             /* even sections (فلك / حلول) */
    --color-card: #181717;                /* service cards */
    --color-panel: rgba(255, 255, 255, 0.06); /* راجح feature panel */
    --color-panel-media: #0f0f0f;         /* راجح image well */
    --color-muted: #9c9c9c;               /* card descriptions */
    --color-footer-text: #a3a6ad;         /* footer secondary text */
    --color-placeholder: #626262;         /* form placeholders, copyright */
    --color-rule: #292929;                /* footer bottom border */
    --color-divider: rgba(241, 241, 241, 0.15);
    --color-outline-card: rgba(206, 192, 192, 0.21);
    --color-tab-track: rgba(206, 196, 196, 0.1);
    --color-error: #f87171;

    /* Type */
    --font-heading: var(--gh-font-heading, "Kufam", sans-serif);
    --font-body: var(--gh-font-body, "IBM Plex Sans Arabic", sans-serif);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Layout */
    --container-max: 1400px;
    --container-pad: clamp(1.5rem, 8vw, 7.5rem);
    --content-width: 46rem;
    --wide-width: 1160px;

    /* Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. Reset (Tailwind preflight essentials)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
}

html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    scroll-behavior: smooth;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    background: var(--color-black);
    color: #fff;
}

.site-main { flex: 1 0 auto; }

h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
img, svg, video, canvas, iframe { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button, input, textarea, select {
    font: inherit;
    color: inherit;
    background: transparent;
    letter-spacing: inherit;
}
button { cursor: pointer; }
::placeholder { opacity: 1; }

::selection { background: rgba(18, 178, 193, 0.35); color: #fff; }

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.section-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.font-heading { font-family: var(--font-heading); }
.font-body { font-family: var(--font-body); }

.divider {
    height: 1px;
    background: var(--color-divider);
}

.section { padding-block: 3.5rem; }
.section--black { background: var(--color-black); }
.section--surface { background: var(--color-surface); padding-block: 5rem; }

/* Inner pages: the section sits right under the header */
.site-header + .site-main > .section:first-child { padding-top: 1.5rem; }

@media (min-width: 1024px) {
    .section,
    .section--surface { padding-block: 7rem; }
    .site-header + .site-main > .section:first-child { padding-top: 2.5rem; }
}

/* --------------------------------------------------------------------------
   4. Buttons (verbatim from globals.css)
   -------------------------------------------------------------------------- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    color: #000;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.12);
    filter: brightness(1.04);
}

.btn-primary:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.02);
}

.btn-outline:active { transform: scale(0.97); }

/* --------------------------------------------------------------------------
   5. Card hover — lift + shadow (verbatim)
   -------------------------------------------------------------------------- */
.hover-lift {
    transition: transform 0.28s var(--ease-out-expo),
                box-shadow 0.28s ease,
                border-color 0.28s ease,
                background 0.28s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

/* --------------------------------------------------------------------------
   6. Pill navigation (Navbar.tsx)
   -------------------------------------------------------------------------- */
.pill-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    min-width: 0;
    padding: 0.5rem;
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* The tag list is the part that scrolls sideways */
.pill-nav__list {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-radius: 41px;
}

.pill-nav__list::-webkit-scrollbar { display: none; }

/* Soft fade on whichever edge has more tags hidden behind it */
.pill-nav__list.has-more-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 36px);
    mask-image: linear-gradient(to right, transparent 0, #000 36px);
}

.pill-nav__list.has-more-start {
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 36px);
    mask-image: linear-gradient(to left, transparent 0, #000 36px);
}

.pill-nav__list.has-more-start.has-more-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

.pill-nav__item { flex-shrink: 0; }

.pill-nav__link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 41px;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    color: #fff;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.pill-nav__link:hover { background: rgba(255, 255, 255, 0.1); }

.pill-nav__link.is-active {
    background: #fff;
    color: #000;
}

.pill-nav__search {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    padding-inline: 0.75rem;
}

.pill-nav__search svg {
    width: 1.25em;
    height: 1.5em;
}

/* Laptops: slightly tighter so all tags fit more often */
@media (min-width: 1024px) {
    .pill-nav { gap: 0.75rem; }
    .pill-nav__list { gap: 0.75rem; }
    .pill-nav__link {
        padding: 10px 18px;
        font-size: 18px;
    }
}

/* Large screens: thiqal.net's full-size menu */
@media (min-width: 1440px) {
    .pill-nav__list { gap: 20px; }
    .pill-nav__link {
        padding: 12px 22px;
        font-size: 20px;
    }
}

/* Fixed to the top. Hidden at first; fades in while scrolling down,
   fades out while scrolling up (toggled by main.js). */
.floating-nav {
    position: fixed;
    top: 1rem;
    inset-inline: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding-inline: 1rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.floating-nav.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s linear 0s;
}

.floating-nav.is-visible .pill-nav { pointer-events: auto; }

/* Desktop: the menu can stretch across the page. Where it's always on
   (every page but the homepage), it stops short of the logo on the right. */
@media (min-width: 1024px) {
    .floating-nav { padding-inline: var(--container-pad); }
    .floating-nav:not([data-autohide]) { padding-inline-start: calc(var(--container-pad) + 174px); }
}

/* --------------------------------------------------------------------------
   7. Logo row
   -------------------------------------------------------------------------- */
.site-logo {
    display: block;
    flex-shrink: 0;
    width: 110px;
    height: 62px;
}

.site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: flex-start; /* RTL: logo on the right */
    padding-top: 1.75rem;
    padding-bottom: 1rem;
}

/* Pages where the menu is always on: leave room for it above the logo on phones */
.floating-nav.is-visible:not([data-autohide]) ~ .site-header { padding-top: 5.25rem; }

@media (min-width: 1024px) {
    /* Article and tag pages: logo sits below the menu, so the menu can centre across the page */
    .post-template .floating-nav.is-visible:not([data-autohide]) ~ .site-header,
    .tag-template .floating-nav.is-visible:not([data-autohide]) ~ .site-header { padding-top: 6.5rem; }
    .post-template .floating-nav:not([data-autohide]),
    .tag-template .floating-nav:not([data-autohide]) { padding-inline-start: var(--container-pad); }
}

@media (min-width: 1024px) {
    .site-logo { width: 150px; height: 84px; }
    .site-header,
    .floating-nav.is-visible:not([data-autohide]) ~ .site-header { padding-top: 1rem; } /* logo level with the menu */
}

/* --------------------------------------------------------------------------
   9. Section header (label + Kufam heading | description)
   -------------------------------------------------------------------------- */
.section-head {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.section-head__titles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
}

.section-head__desc {
    display: flex;
    align-items: center;
}

.section-label {
    font-family: var(--font-body);
    font-size: 1.5rem;
    line-height: 1.5;
    color: #fff;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.875rem;
    line-height: 1.3;
    color: #fff;
}

.section-desc {
    width: 100%;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.625;
    text-align: right;
    color: #fff;
}

@media (min-width: 1024px) {
    .section-head {
        flex-direction: row;
        gap: 4rem;
        margin-bottom: 3rem;
    }
    .section-head__titles { width: 48%; gap: 0.5rem; }
    .section-head__desc { width: 52%; }
    .section-label { font-size: 2.375rem; }
    .section-title { font-size: 54px; }
    .section-desc { font-size: 21px; line-height: 35.4px; }
}

/* --------------------------------------------------------------------------
   10. Post feed + cards (service-card language from HuloulSection.tsx)
   -------------------------------------------------------------------------- */
.post-feed {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .post-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .post-feed {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 40px;
    }
}

.post-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: var(--color-card);
}

.post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card__media {
    position: relative;
    min-width: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-panel-media);
}

/* Absolutely placed so the photo's own size never stretches the frame */
.post-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* No image → teal glow + line icon, positioned exactly like the service cards */
.post-card__glyph {
    position: relative;
    height: 71px;
    flex-shrink: 0;
}

.post-card__glow {
    position: absolute;
    top: 19px;
    right: 19px;
    width: 59px;
    height: 59px;
    pointer-events: none;
}

.post-card__icon {
    position: absolute;
    top: 37px;
    right: 36px;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.post-card__placeholder { display: none; }

.post-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 20px 19px 24px;
    text-align: right;
}

.post-card__tag {
    font-size: 14px;
    color: var(--color-accent);
}

.post-card__title {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.5;
    color: #fff;
}

.post-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 13px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
}

/* Lead post — the outlined راجِح card from AISection.tsx */
.post-feed:not(.post-feed--plain) > .post-card:first-child {
    grid-column: 1 / -1;
}

@media (min-width: 1024px) {
    .post-feed:not(.post-feed--plain) > .post-card:first-child {
        padding: 1.5rem;
        border-radius: 30px;
        border: 1px solid var(--color-outline-card);
        background: transparent;
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__link {
        flex-direction: row-reverse; /* RTL: text on the right, image on the left */
        gap: 1rem;
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__media {
        flex: 0 0 40%;
        align-self: center;
        aspect-ratio: 16 / 10;
        border-radius: 30px;
    }

    /* No feature image: keep an image area on the left with the Thiqal logo on a teal glow */
    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__glyph {
        flex: 0 0 40%;
        align-self: center;
        height: auto;
        aspect-ratio: 16 / 10;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border-radius: 30px;
        background:
            radial-gradient(circle at 50% 50%, rgba(18, 178, 193, 0.22) 0%, rgba(18, 178, 193, 0.06) 38%, transparent 70%),
            var(--color-panel-media);
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__glow,
    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__icon { display: none; }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__placeholder {
        display: block;
        width: 182px;
        opacity: 0.9;
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__placeholder img {
        width: 100%;
        height: auto;
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__body {
        justify-content: center;
        gap: 0.75rem;
        padding: 2rem;
        border-radius: 30px;
        background: var(--color-panel);
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__title {
        font-family: var(--font-heading);
        font-weight: 900;
        font-size: 28px;
        line-height: 1.3;
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__excerpt {
        font-size: 18px;
        line-height: 1.75;
        color: rgba(255, 255, 255, 0.8);
        -webkit-line-clamp: 4;
    }

    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__meta {
        margin-top: 0.75rem;
        font-size: 14.5px;
    }
}

.empty-state { padding-block: 3rem; }

@media (min-width: 1280px) {
    .post-feed:not(.post-feed--plain) > .post-card:first-child .post-card__title { font-size: 34px; }
}

/* Pagination */
.pagination { margin-top: 4rem; }

.pagination__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2.5rem;
}

.pagination__info {
    font-size: 14px;
    color: var(--color-muted);
}

/* --------------------------------------------------------------------------
   11. Article (post + page)
   -------------------------------------------------------------------------- */
.article-header {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    text-align: right;
}


.article-header__tag {
    display: inline-block;
    transition: opacity 0.2s;
}

.article-header__tag:hover { opacity: 0.7; }

.article-header__title {
    margin-top: 0.25rem;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.875rem;
    line-height: 1.3;
}

.article-header__excerpt {
    margin-top: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.75;
}

.article-meta {
    margin-top: 2rem;
    font-weight: 300;
    font-size: 14.5px;
    line-height: 1.5rem;
    color: var(--color-footer-text);
}

.article-image { margin-bottom: 3rem; }

.article-image__frame {
    padding: 0.75rem;
    border-radius: 24px;
    border: 1px solid var(--color-outline-card);
}

.article-image__frame img {
    width: 100%;
    border-radius: 20px;
}

.article-image figcaption,
.gh-content figcaption {
    margin-top: 0.75rem;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    color: var(--color-muted);
}

@media (min-width: 1024px) {
    .article-header { padding-top: 4rem; padding-bottom: 3.5rem; }
    .article-header__title { margin-top: 0.5rem; font-size: 54px; }
    .article-header__excerpt { font-size: 21px; line-height: 35.4px; }
    .article-image { margin-bottom: 4rem; }
    .article-image__frame { padding: 1.5rem; border-radius: 30px; }
    .article-image__frame img { border-radius: 24px; }
}

/* Article page: everything inside one outlined container (the image frame's style) */
.article-shell {
    width: min(var(--wide-width), 100% - 1.5rem);
    margin: 0.5rem auto 3rem;
    padding: 1rem;
    border-radius: 24px;
    border: 1px solid var(--color-outline-card);
}

/* Title, text and tags line up with the feature image's left and right edges */
.article-shell .article-narrow { width: 100%; }

.article-shell .article-header { padding: 1.75rem 0 2rem; }

.article-shell__image { margin-bottom: 2.5rem; }

.article-shell__image img {
    width: 100%;
    border-radius: 20px;
}

.article-shell__image figcaption {
    margin-top: 0.75rem;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    color: var(--color-muted);
}

.article-shell .gh-content {
    grid-template-columns: [full-start wide-start main-start] minmax(0, 1fr) [main-end wide-end full-end];
    padding-bottom: 2rem;
}
.article-shell .article-footer { padding-bottom: 1.25rem; }

@media (min-width: 1024px) {
    .article-shell {
        width: min(var(--wide-width), 100% - 3rem);
        margin: 1rem auto 4rem;
        padding: 1.5rem;
        border-radius: 30px;
    }
    .article-shell .article-header { padding: 3rem 0 3rem; }
    .article-shell__image { margin-bottom: 3.5rem; }
    .article-shell__image img { border-radius: 24px; }
    .article-shell .gh-content { padding-bottom: 3rem; }
    .article-shell .article-footer { padding-bottom: 1.5rem; }
}

.article-narrow {
    width: min(var(--content-width), 100% - 3rem);
    margin-inline: auto;
}

.article-wide {
    width: min(var(--wide-width), 100% - 3rem);
    margin-inline: auto;
}

.article-footer { padding-bottom: 3rem; }

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 2rem;
}

.tag-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 41px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tag-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.5);
}

.article-comments { padding-bottom: 4rem; }

.related { padding-top: 1rem; }
.related__label { margin-bottom: 2.5rem; }

.author-avatar {
    width: 72px;
    height: 72px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    border: 1px solid var(--color-divider);
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   12. Post content (Ghost editor output)
   -------------------------------------------------------------------------- */
.gh-content {
    --gap: 1.5rem;
    display: grid;
    grid-template-columns:
        [full-start] minmax(var(--gap), 1fr)
        [wide-start] minmax(0, calc((var(--wide-width) - var(--content-width)) / 2))
        [main-start] min(var(--content-width), calc(100% - var(--gap) * 2))
        [main-end] minmax(0, calc((var(--wide-width) - var(--content-width)) / 2))
        [wide-end] minmax(var(--gap), 1fr)
        [full-end];
    padding-bottom: 4rem;
    font-size: 18px;
    line-height: 1.85;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
    overflow-wrap: break-word;
}

@media (min-width: 1024px) {
    .gh-content { font-size: 20px; }
}

.gh-content > * { grid-column: main-start / main-end; }
.gh-content > * + * { margin-top: 1.4em; }

.gh-content > .kg-width-wide,
.gh-content .kg-width-wide { grid-column: wide-start / wide-end; }

.gh-content > .kg-width-full,
.gh-content .kg-width-full { grid-column: full-start / full-end; }

.gh-content .kg-width-full img { width: 100%; }

.gh-content > h2,
.gh-content > h3,
.gh-content > h4 { color: #fff; margin-top: 2em; }

.gh-content > h2 + *,
.gh-content > h3 + *,
.gh-content > h4 + * { margin-top: 0.75em; }

.gh-content h2 {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5em;
    line-height: 1.35;
}

.gh-content h3 {
    font-weight: 700;
    font-size: 1.3em;
    line-height: 1.5;
}

.gh-content h4,
.gh-content h5,
.gh-content h6 {
    font-weight: 700;
    font-size: 1.1em;
    line-height: 1.6;
}

.gh-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-decoration-color: rgba(18, 178, 193, 0.4);
    text-underline-offset: 4px;
    transition: text-decoration-color 0.2s;
}

.gh-content a:hover { text-decoration-color: var(--color-accent); }

.gh-content strong { font-weight: 700; color: #fff; }

.gh-content ul,
.gh-content ol { padding-inline-start: 1.5em; }
.gh-content ul { list-style: disc; }
.gh-content ol { list-style: decimal; }
.gh-content li + li { margin-top: 0.5em; }
.gh-content li::marker { color: var(--color-accent); }

.gh-content blockquote:not([class]) {
    padding: 1.5rem 2rem;
    border-radius: 20px;
    background: var(--color-panel);
    color: #fff;
}

.gh-content blockquote.kg-blockquote-alt {
    padding-inline: 1.5rem;
    font-size: 1.35em;
    line-height: 1.6;
    text-align: center;
    color: #fff;
}

.gh-content hr {
    height: 1px;
    margin-block: 2.5em;
    background: var(--color-divider);
}

.gh-content hr + * { margin-top: 0; }

.gh-content code:not(pre code) {
    padding: 0.1em 0.4em;
    border-radius: 6px;
    border: 1px solid var(--color-divider);
    background: var(--color-card);
    font-family: var(--font-mono);
    font-size: 0.85em;
    unicode-bidi: isolate;
}

.gh-content pre {
    direction: ltr;
    text-align: left;
    overflow-x: auto;
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--color-divider);
    background: var(--color-surface);
    font-family: var(--font-mono);
    font-size: 0.8em;
    line-height: 1.6;
}

.gh-content figure img { border-radius: 20px; }
.gh-content .kg-width-full img { border-radius: 0; }

.gh-content table {
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.9em;
}

.gh-content th,
.gh-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-divider);
    text-align: right;
    white-space: nowrap;
}

.gh-content th { font-weight: 700; color: #fff; }

/* Koenig cards on a black canvas */
.gh-content .kg-bookmark-container {
    border-radius: 20px;
    border: 1px solid var(--color-outline-card);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    text-decoration: none;
    overflow: hidden;
}

.gh-content .kg-bookmark-title { color: #fff; font-weight: 700; }
.gh-content .kg-bookmark-description { color: var(--color-muted); }
.gh-content .kg-bookmark-metadata { color: var(--color-footer-text); }

.gh-content .kg-callout-card { border-radius: 20px; }
.gh-content .kg-toggle-card { border-radius: 20px; border-color: var(--color-divider); }
.gh-content .kg-button-card a.kg-btn { border-radius: 10px; text-decoration: none; }
.gh-content .kg-file-card-container { border-radius: 20px; border-color: var(--color-divider); }

/* Paywall CTA */
.content-cta {
    grid-column: main-start / main-end;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
    padding: 2.5rem 2rem;
    border-radius: 30px;
    border: 1px solid var(--color-outline-card);
    text-align: center;
}

.content-cta__title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    line-height: 1.3;
    color: #fff;
}

.gh-content .content-cta .btn-primary { color: #000; text-decoration: none; }

.content-cta__signin { font-size: 14px; color: var(--color-muted); }

@media (min-width: 1024px) {
    .content-cta__title { font-size: 34px; }
}

/* --------------------------------------------------------------------------
   13. Subscribe (ContactModal form language)
   -------------------------------------------------------------------------- */
.subscribe {
    padding-block: 5rem;
    background: var(--color-surface);
}

.subscribe__inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.subscribe__text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: right;
}

.subscribe__title {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 22px;
    line-height: 1.25;
}

.subscribe__form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.field {
    border-bottom: 1px solid var(--color-placeholder);
    transition: border-color 0.2s;
}

.field:focus-within { border-color: #fff; }

.field__input {
    width: 100%;
    padding-block: 0.75rem;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: right;
    color: #fff;
    outline: none;
}

.field__input::placeholder { color: var(--color-placeholder); }

.subscribe__actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 2.5rem;
}

.form-msg {
    display: none;
    font-size: 0.875rem;
    text-align: right;
}

.form-msg--success { color: var(--color-accent); }
.form-msg--error { color: var(--color-error); }

.subscribe__form.success .form-msg--success,
.subscribe__form.error .form-msg--error { display: block; }

.btn-loading { display: none; }
.subscribe__form.loading .btn-label { display: none; }
.subscribe__form.loading .btn-loading { display: inline; }
.subscribe__form.loading .btn-primary,
.subscribe__form.success .btn-primary { opacity: 0.6; pointer-events: none; }

@media (min-width: 1024px) {
    .subscribe { padding-block: 7rem; }
    .subscribe__inner { flex-direction: row; gap: 5rem; }
    .subscribe__text { width: 42%; }
    .subscribe__form { width: 58%; gap: 1.5rem; }
    .subscribe__title { font-size: 34px; }
    .field__input { padding-block: 1rem; font-size: 21px; }
}

/* --------------------------------------------------------------------------
   15. Footer — logo only
   -------------------------------------------------------------------------- */
.site-footer {
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.18); /* the line that sat above the footer on thiqal.net */
}

.site-footer__logo {
    display: flex;
    justify-content: flex-start;
    padding-block: 2.5rem;
}

.site-footer__logo img {
    width: 91px;
    height: 56px;
    object-fit: contain;
}

@media (min-width: 1024px) {
    .site-footer__logo { padding-block: 3rem; }
}

/* --------------------------------------------------------------------------
   16. Error page
   -------------------------------------------------------------------------- */
.error-page { padding-block: 5rem 8rem; }
.error-page .section-title { margin-block: 0.5rem 1rem; }
.error-page__text { max-width: 40rem; margin-bottom: 2.5rem; }

/* --------------------------------------------------------------------------
   16b. Search window
   -------------------------------------------------------------------------- */
.search[hidden] { display: none; }

.search {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0.75rem;
}

.search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.search__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 760px;
    max-height: calc(100vh - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid var(--color-outline-card);
    background: var(--color-surface);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.35s var(--ease-out-expo);
}

.search.is-open .search__backdrop { opacity: 1; }
.search.is-open .search__panel { opacity: 1; transform: none; }

.search__bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--color-divider);
}

.search__icon {
    display: flex;
    flex-shrink: 0;
    color: var(--color-placeholder);
}

.search__icon svg { width: 22px; height: 22px; }

.search__input {
    flex: 1;
    min-width: 0;
    padding-block: 0.5rem;
    font-family: var(--font-body);
    font-size: 1.125rem;
    text-align: right;
    color: #fff;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.search__input::placeholder { color: var(--color-placeholder); }
.search__input::-webkit-search-cancel-button,
.search__input::-webkit-search-decoration { -webkit-appearance: none; display: none; }

.search__close {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--color-footer-text);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.search__close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.search__body {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem 0.75rem 1.25rem;
}

.search__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0 0.75rem 1rem;
}

.search__tags:empty { display: none; }
.search__tags .tag-pill { font-size: 14px; padding: 0.375rem 0.875rem; }

.search__label {
    padding: 0 0.75rem 0.5rem;
    font-size: 14px;
    color: var(--color-muted);
}

.search__label:empty { display: none; }

.search__results li + li { margin-top: 0.25rem; }

.search-result {
    display: block;
    padding: 0.875rem 0.75rem;
    border-radius: 20px;
    text-align: right;
    transition: background 0.2s ease;
}

.search-result:hover,
.search-result.is-active { background: var(--color-panel); }

.search-result__tag {
    margin-bottom: 0.25rem;
    font-size: 13px;
    color: var(--color-accent);
}

.search-result__title {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.5;
    color: #fff;
}

.search-result__excerpt {
    margin-top: 0.25rem;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result__date {
    margin-top: 0.5rem;
    font-size: 13px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
}

.search__empty {
    padding: 2.5rem 0.75rem;
    font-size: 1rem;
    text-align: center;
    color: var(--color-muted);
}

html.search-open { overflow: hidden; }

@media (min-width: 1024px) {
    .search { padding: 12vh 1.5rem 1.5rem; }
    .search__panel {
        max-height: min(680px, 88vh - 1.5rem);
        border-radius: 30px;
    }
    .search__bar { padding: 1rem 1.75rem; }
    .search__input { font-size: 21px; }
    .search__body { padding: 1.25rem 1rem 1.5rem; }
    .search-result { padding: 1rem; }
    .search-result__title { font-size: 20px; }
}

/* --------------------------------------------------------------------------
   17. Motion — scroll reveal (verbatim)
   -------------------------------------------------------------------------- */
.js [data-reveal]:not([data-reveal="stagger"]) {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s var(--ease-out-expo);
}

.js [data-reveal]:not([data-reveal="stagger"]).is-revealed {
    opacity: 1;
    transform: none;
}

.js [data-reveal="stagger"] > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s ease, transform 0.5s var(--ease-out-expo);
}

.js [data-reveal="stagger"] > *.is-revealed {
    opacity: 1;
    transform: none;
}

/* Once a staggered card has landed, hand its transitions back to .hover-lift */
.js [data-reveal="stagger"] > .hover-lift.reveal-done {
    transition: transform 0.28s var(--ease-out-expo),
                box-shadow 0.28s ease,
                border-color 0.28s ease,
                background 0.28s ease;
}

.js [data-reveal="stagger"] > .hover-lift.reveal-done:hover {
    transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }

    .js [data-reveal]:not([data-reveal="stagger"]),
    .js [data-reveal="stagger"] > * {
        opacity: 1 !important;
        transform: none !important;
    }
}
