/* JustSERP blog theme
   Loaded after built/screen.css. Overrides Casper so the blog matches the
   justserp.com homepage: Inter, brand purple (#6415FF / #3c0d99), rounded
   cards with soft shadows, a dark terminal look for code, dark footer.

   Colours: primary-400 #742cff, primary-500 #6415FF, primary-600 #5a13e6,
   primary-900 #3c0d99, gray-900 #111827. */

/* html:root beats the :root rule that Ghost injects in {{ghost_head}} (accent colour from Admin) */
html:root {
    --ghost-accent-color: #6415FF;
    --color-darkgrey: #111827;
    --color-secondary-text: #4b5563; /* 7.6:1 on white */
    --color-border: #e5e7eb;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

body {
    background: #fff;
    font-family: var(--gh-font-body, var(--font-sans));
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--gh-font-heading, var(--font-sans));
}

/* Focus states */
a:focus-visible,
button:focus-visible {
    outline: 3px solid #935bff;
    outline-offset: 2px;
    border-radius: 2px;
}

.jsp-skip-link {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 200;
    padding: 10px 16px;
    border-radius: 4px;
    background: #fff;
    color: #3c0d99;
    font-weight: 700;
    text-decoration: none;
}

.jsp-skip-link:focus {
    top: 16px;
}

/* ---------- Header ---------- */

.jsp-header {
    position: relative;
    z-index: 100;
    background: #3c0d99;
    color: #f3f4f6;
    font-size: 16px;
    line-height: 1.5;
}

.jsp-header a:focus-visible,
.jsp-header button:focus-visible {
    outline-color: #fff;
}

.jsp-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 1536px;
    margin: 0 auto;
    padding: 32px;
}

.jsp-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f3f4f6;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.33;
    letter-spacing: 0.025em;
    text-decoration: none;
}

.jsp-logo:hover {
    color: #d1d5db;
}

.jsp-logo-mark {
    width: 40px;
    height: auto;
    flex-shrink: 0;
}

.jsp-menu-toggle {
    display: inline-flex;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #f3f4f6;
    cursor: pointer;
}

.jsp-menu-toggle:hover {
    color: #d1d5db;
}

.jsp-icon-close,
.jsp-header.is-open .jsp-icon-open {
    display: none;
}

.jsp-header.is-open .jsp-icon-close {
    display: block;
}

/* Mobile: white card under the header, like the homepage menu */
.jsp-nav {
    display: none;
    position: absolute;
    top: calc(100% - 8px);
    left: 16px;
    right: 16px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    text-align: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.jsp-header.is-open .jsp-nav {
    display: block;
}

.jsp-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.jsp-nav li,
.jsp-footer-col li {
    padding: 0;
}

.jsp-nav li {
    margin: 0;
}

.jsp-nav-links a,
.jsp-nav-login {
    display: inline-block;
    margin: 8px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    color: #111827;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1.55;
    text-decoration: none;
    transition: color 0.3s, border-color 0.3s;
}

.jsp-nav-links a:hover,
.jsp-nav-login:hover {
    color: #6415FF;
    border-color: #6415FF;
}

.jsp-nav-links a.is-active {
    color: #6415FF;
    border-color: #6415FF;
}

.jsp-nav-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 16px;
}

.jsp-btn-primary {
    display: inline-block;
    padding: 12px 32px;
    border-radius: 4px;
    background: #6415FF;
    color: #f3f4f6;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-decoration: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s;
}

.jsp-btn-primary:hover {
    background: #5011cc;
    color: #fff;
}

@media (min-width: 1024px) {
    .jsp-menu-toggle {
        display: none;
    }

    .jsp-nav {
        display: flex;
        position: static;
        flex: 1;
        align-items: center;
        justify-content: flex-end;
        padding: 0;
        border: 0;
        background: transparent;
        color: #f3f4f6;
        box-shadow: none;
        text-align: left;
    }

    .jsp-nav-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        white-space: nowrap;
    }

    .jsp-nav-links a,
    .jsp-nav-login {
        margin: 0 18px;
        color: #f3f4f6;
        font-size: 14px;
        line-height: 1.43;
    }

    .jsp-nav-links a:hover,
    .jsp-nav-login:hover {
        color: #d1d5db;
        border-color: #f3f4f6;
    }

    .jsp-nav-links a.is-active {
        color: #fff;
        border-color: #fff;
    }

    .jsp-nav-actions {
        flex-direction: row;
        margin-top: 0;
    }

    .jsp-nav-login {
        margin-right: 24px;
    }

    .jsp-btn-primary {
        background: #742cff;
        font-size: 14px;
        line-height: 1.43;
    }

    .jsp-btn-primary:hover {
        background: #6415FF;
    }
}

@media (min-width: 1280px) {
    .jsp-nav-links a {
        margin: 0 24px;
    }
}

/* ---------- Index hero ---------- */

.jsp-hero {
    background: #3c0d99;
    color: #fff;
}

.jsp-hero-inner {
    max-width: 1536px;
    margin: 0 auto;
    padding: 24px 32px 64px;
    text-align: center;
}

.jsp-hero-title {
    margin: 0;
    color: #fff;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0;
}

.jsp-hero-description {
    margin: 16px auto 0;
    max-width: 640px;
    color: #c9b3ff; /* 6.65:1 on #3c0d99 */
    font-size: 18px;
    line-height: 1.55;
}

@media (min-width: 640px) {
    .jsp-hero-title {
        font-size: 36px;
    }
}

@media (min-width: 1024px) {
    .jsp-hero-inner {
        padding: 40px 32px 80px;
        text-align: left;
    }

    .jsp-hero-title {
        font-size: 48px;
    }

    .jsp-hero-description {
        margin-left: 0;
    }
}

/* ---------- Feed and cards ---------- */

.site-main {
    padding-bottom: 64px;
}

.post-card {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
    transition: box-shadow 0.3s, transform 0.3s;
}

.post-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.post-card-image-link {
    margin-bottom: 0;
}

.post-card-content {
    padding: 20px 24px 24px;
}

.post-card-header {
    margin-top: 0;
}

.post-card-title {
    color: #111827;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.25;
}

.post-card-content-link:hover .post-card-title {
    color: #6415FF;
    opacity: 1;
}

.post-card-primary-tag {
    color: #5011cc;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-card-featured {
    color: #5011cc;
}

.post-card-excerpt {
    color: #374151;
    font-size: 1.5rem;
}

.post-card-meta {
    margin-top: 16px;
}

@media (min-width: 1001px) {
    .post-card-large {
        grid-gap: 0;
    }

    .post-card-large .post-card-content {
        justify-content: center;
        padding: 32px;
    }

    .post-card-large .post-card-title {
        font-size: 3.2rem;
        line-height: 1.15;
    }

    .post-card-large + .post-card-large:nth-child(even) {
        margin: 0;
    }

    .post-card-large .post-card-image-link::after {
        padding-bottom: 40%;
    }

    .post-card.dynamic .post-card-title {
        font-size: 2.6rem;
    }
}

.pagination a {
    color: #6415FF;
}

.pagination a:hover {
    color: #5011cc;
}

/* ---------- Post and page ---------- */

.article-title {
    color: #111827;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.article-tag a {
    color: #5011cc;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 1.3rem;
}

.article-excerpt {
    color: #374151;
}

.article-image img {
    border-radius: 12px;
}

.gh-content > p,
.gh-content > ul,
.gh-content > ol,
.gh-content > dl,
.gh-content > blockquote:not([class]) {
    color: #1f2937;
    font-size: 1.8rem;
    line-height: 1.75em;
}

.gh-content > [id] {
    color: #111827;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.gh-content a {
    color: #6415FF;
    text-underline-offset: 2px;
}

.gh-content a:hover {
    color: #5011cc;
}

.gh-content > blockquote:not([class])::before {
    background: #6415FF;
}

.gh-content :not(pre) > code {
    border: 1px solid #e0d4ff;
    background: #f5f0ff;
    color: #3c0d99;
    font-family: var(--font-mono);
}

/* Code blocks: the hero's dark terminal card */
.gh-content pre {
    position: relative;
    padding: 52px 24px 20px;
    border: 1px solid #2d2d44;
    border-radius: 12px;
    color: #e4e4e7;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    line-height: 1.6em;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background:
        radial-gradient(circle at 22px 18px, #ff5f57 5.5px, transparent 6px) top left / 100% 36px no-repeat,
        radial-gradient(circle at 42px 18px, #febc2e 5.5px, transparent 6px) top left / 100% 36px no-repeat,
        radial-gradient(circle at 62px 18px, #28c840 5.5px, transparent 6px) top left / 100% 36px no-repeat,
        linear-gradient(180deg, #2d2d44 0%, #252538 100%) top left / 100% 36px no-repeat,
        #1a1a2e;
}

.gh-content pre code {
    font-family: inherit;
    color: inherit;
    background: none;
}

.gh-content table:not(.gist table) {
    border-radius: 8px;
}

.read-more-wrap {
    margin-top: 0;
    padding-bottom: 64px;
}

/* ---------- Footer ---------- */

.jsp-footer {
    background: #111827;
    color: #f3f4f6;
    font-size: 16px;
    line-height: 1.5;
}

.jsp-footer a:focus-visible {
    outline-color: #fff;
}

.jsp-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 64px 32px 32px;
}

.jsp-footer-cols {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.jsp-footer-company {
    width: 100%;
    margin-bottom: 64px;
    text-align: center;
}

.jsp-footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
}

.jsp-footer-brand span {
    margin-left: 8px;
    font-size: 20px;
    font-weight: 900;
    line-height: 1.4;
}

.jsp-footer-brand svg {
    width: 32px;
    height: auto;
}

.jsp-footer-blurb {
    max-width: 512px;
    margin: 16px auto 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 2;
}

.jsp-footer-blurb a {
    color: inherit;
    text-decoration: underline;
}

.jsp-footer-social {
    margin-top: 16px;
}

.jsp-footer-social a {
    display: inline-block;
    margin-right: 16px;
    padding: 8px;
    border-radius: 9999px;
    background: #f3f4f6;
    color: #111827;
    line-height: 0;
    transition: background-color 0.3s;
}

.jsp-footer-social a:last-child {
    margin-right: 0;
}

.jsp-footer-social a:hover {
    background: #9ca3af;
}

.jsp-footer-social svg {
    width: 16px;
    height: 16px;
}

.jsp-footer-col {
    width: 50%;
    margin-bottom: 32px;
    text-align: center;
}

.jsp-footer-col h2 {
    margin: 0;
    color: #f3f4f6;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: uppercase;
}

.jsp-footer-col ul {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    font-weight: 500;
}

.jsp-footer-col li {
    margin-top: 12px;
}

.jsp-footer-col a {
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    color: #f3f4f6;
    text-decoration: none;
    transition: color 0.3s, border-color 0.3s;
}

.jsp-footer-col a:hover {
    color: #d1d5db;
    border-color: #f3f4f6;
}

.jsp-footer-divider {
    margin: 32px 0;
    border: 0;
    border-bottom: 2px solid #1f2937;
}

.jsp-footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

@media (min-width: 640px) {
    .jsp-footer-bottom {
        flex-direction: row;
    }

    .jsp-footer-col {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .jsp-footer-col {
        width: 25%;
        margin-bottom: 0;
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .jsp-footer-company {
        width: 50%;
        margin-bottom: 0;
        text-align: left;
    }

    .jsp-footer-brand {
        justify-content: flex-start;
    }

    .jsp-footer-blurb {
        margin: 16px 16px 0 0;
        text-align: left;
    }
}

@media (max-width: 1023px) {
    .jsp-footer-col:nth-of-type(n) {
        margin-bottom: 32px;
    }
}

/* ---------- Cookie consent banner (mirrors src/components/ConsentBanner.js) ---------- */

.jsp-consent {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    padding: 16px;
    border-top: 1px solid #374151;
    background: #111827;
    color: #f3f4f6;
    font-size: 14px;
    line-height: 1.43;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.jsp-consent[hidden] {
    display: none;
}

.jsp-consent-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 1280px;
    margin: 0 auto;
}

.jsp-consent p {
    margin: 0;
}

.jsp-consent a {
    color: inherit;
    text-decoration: underline;
}

.jsp-consent a:hover {
    color: #d1d5db;
}

.jsp-consent-actions {
    display: flex;
    flex-shrink: 0;
    gap: 12px;
}

.jsp-consent button {
    padding: 8px 16px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.43;
    cursor: pointer;
}

.jsp-consent button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.jsp-consent-decline {
    border: 1px solid #9ca3af;
    background: transparent;
    color: #f3f4f6;
}

.jsp-consent-decline:hover {
    background: #1f2937;
}

.jsp-consent-accept {
    border: 1px solid #6415FF;
    background: #6415FF;
    color: #fff;
}

.jsp-consent-accept:hover {
    background: #5a13e6;
}

@media (min-width: 640px) {
    .jsp-consent-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
