@import url("https://fonts.googleapis.com/css2?family=Alegreya:wght@500;600;700;800&display=swap");

:root {
    --page: #fff;
    --text: #333;
    --muted: #7d7d7d;
    --line: #e5e1dc;
    --soft: #f1f1f1;
    --accent: var(--ghost-accent-color, #4237ff);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, white);
    --accent-soft-hover: color-mix(in srgb, var(--accent) 20%, white);
    --serif: "Alegreya", Georgia, "Times New Roman", serif;
    --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--page);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
}

body {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.site-shell {
    min-height: 100vh;
}

.topbar {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 108px;
    padding: 34px clamp(18px, 4vw, 42px) 24px;
}

.site-logo {
    grid-column: 2;
    justify-self: center;
    font-family: "Comic Sans MS", "Comic Sans", "Marker Felt", fantasy;
    font-size: clamp(3.3rem, 7vw, 5.6rem);
    font-weight: 900;
    line-height: .85;
    letter-spacing: 0;
    text-transform: uppercase;
}

.site-logo img {
    max-height: 70px;
    width: auto;
}

.site-actions {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    font-size: .95rem;
}

.login-link,
.subscribe-link,
.widget-subscribe,
.ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 16px;
    border-radius: 7px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease;
}

.login-link {
    color: #555;
}

.subscribe-link,
.widget-subscribe {
    background: var(--accent-soft);
    color: var(--accent);
}

.ui-button {
    border: 1px solid transparent;
    line-height: 1;
}

.ui-button--primary {
    background: var(--accent-soft);
    color: var(--accent);
}

.ui-button--primary:hover {
    background: var(--accent-soft-hover);
}

.ui-button--secondary {
    background: #f2f2f2;
    color: #3d3d3d;
}

.ui-button--secondary:hover {
    background: #e8e8e8;
}

.ui-button--tertiary {
    background: transparent;
    color: #5a5a5a;
    border-color: #dfdfdf;
}

.ui-button--tertiary:hover {
    background: #f7f7f7;
    border-color: #d2d2d2;
    color: #444;
}

.ui-button:active {
    transform: translateY(1px);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav a {
    display: block;
    min-height: 34px;
    padding: 8px 15px;
    border-radius: 999px;
    font-size: .92rem;
    font-weight: 600;
    color: #3d3d3d;
}

.nav a:hover,
.nav-current a {
    background: #f2f2f2;
}

.post-site-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    padding: 34px clamp(18px, 4vw, 42px) 24px;
}

.post-site-logo {
    grid-column: 1;
    display: flex;
    align-items: center;
    height: 35px;
    line-height: 1;
    justify-self: start;
}

.post-site-logo img {
    max-height: 35px;
}

.post-site-nav {
    grid-column: 2;
    display: flex;
    align-items: center;
    min-height: 35px;
    justify-content: flex-start;
    margin: 7px 0 0 18px;
}

.post-site-nav .nav {
    justify-content: flex-start;
}

.post-site-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.home-page,
.archive-page,
.post-page {
    width: min(100%, 1230px);
    margin: 0 auto;
    padding: 0 clamp(18px, 4vw, 44px);
}

.home-feed {
    max-width: 550px;
    margin: 28px auto 0;
}

.home-feed:has(.recent-card.is-featured) {
    max-width: 550px;
    margin-top: 58px;
}

.signup-box {
    position: relative;
    max-width: 800px;
    margin: 58px auto 0;
    padding: 42px 34px 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    text-align: center;
}

.signup-box-public {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
    padding: 0;
    overflow: hidden;
    text-align: left;
}

.signup-box-public-side {
    min-width: 0;
    padding: 42px 34px 44px;
}

.signup-box-public-side--intro {
    background: #f3f3f3;
}

.signup-box-public-side--form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    background: var(--page);
    border-left: 1px solid var(--line);
}

.signup-box-art {
    width: 120px;
    height: auto;
    margin: 0 auto 22px;
    border-radius: 14px;
    object-fit: cover;
}

.signup-box-public .signup-box-art {
    width: 72px;
    margin: 0 0 18px;
    border-radius: 50%;
}

.signup-box-public-copy {
    max-width: 320px;
}

.signup-box-public .signup-box-public-copy h1 {
    margin: 0;
    font-size: 1.75rem;
}

.signup-box-public .signup-box-public-copy p {
    max-width: none;
    margin: 12px 0 0;
}

.signup-box-public .signup-box-signoff {
    margin-top: 28px;
    color: #555;
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.42;
    font-weight: 400;
}

.signup-box-public-form-copy h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.8rem;
    line-height: 1.05;
    text-align: center;
}

.signup-box-paid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding-top: 21px;
    padding-bottom: 22px;
    text-align: left;
}

.signup-box-art-paid {
    width: 80px;
    flex: 0 0 auto;
    margin: 0;
}

.signup-box-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: center;
}

.signup-box-paid .signup-box-copy p {
    margin: 6px 0 0;
}

.signup-box-paid .signup-box-copy h1 {
    margin: 0;
}

.signup-box + .home-feed {
    margin-top: 58px;
}

.signup-box h1 {
    margin: 0;
    overflow: visible;
    font-family: var(--serif);
    font-size: 1.45rem;
    line-height: 1.1;
    text-overflow: clip;
    white-space: normal;
    text-wrap: balance;
}

.signup-box p {
    max-width: 460px;
    margin: 10px auto 20px;
    color: #555;
    line-height: 1.42;
    text-wrap: balance;
}

.signup-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 460px;
    margin: 0 auto;
}

.signup-box-public .signup-form {
    max-width: 360px;
}

.signup-box-public .signup-form input,
.signup-box-public .signup-form button {
    width: 100%;
    min-height: 46px;
}

.signup-box-public .signup-form input {
    height: 46px;
}

.signup-box-public .signup-form button {
    height: 46px;
}

.signup-actions {
    display: flex;
    justify-content: center;
}

.signup-actions-stacked,
.content-cta-actions-stacked {
    flex-direction: column;
    gap: 14px;
}

.price-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -14px;
    right: 22px;
    min-height: 34px;
    padding: 0 14px;
    background: #fff2a8;
    color: #4d4221;
    font-size: .88rem;
    font-weight: 700;
    line-height: 1;
    transform: rotate(-2deg);
    clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 50%, calc(100% - 6px) 100%, 6px 100%, 0 50%);
}

.content-cta-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.content-cta-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-content .content-cta-box .signup-box-art {
    width: 120px;
}

.content-cta-actions a {
    text-decoration: none;
    text-decoration-line: none;
}

.post-content .content-cta-actions a {
    text-decoration: none;
    text-decoration-line: none;
}

.content-cta-actions .widget-subscribe:hover,
.content-cta-actions .login-link:hover {
    background: #f2f2f2;
}

.content-cta-actions .widget-subscribe:active,
.content-cta-actions .login-link:active {
    transform: translateY(1px);
}

.content-cta-actions .login-link {
    min-height: 38px;
    padding: 0 8px;
}

.box-preview-list {
    display: grid;
    gap: 34px;
    margin-top: 20px;
}

.box-preview-item {
    display: grid;
    gap: 14px;
}

.box-preview-item .signup-box {
    margin-top: 0;
}

.box-preview-item .post-inline-signup {
    margin-top: 0;
}

.box-preview-label {
    width: min(100%, 800px);
    margin: 0 auto;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.signup-form input {
    min-width: 0;
    flex: 1;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font: inherit;
}

.signup-form button {
    height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 7px;
    background: var(--accent-soft);
    color: var(--accent);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.signup-message {
    display: none;
}

.signup-form.success .signup-success,
.signup-form.error .signup-error {
    display: block;
    width: 100%;
    margin: 6px 0 0;
    font-size: .9rem;
    text-align: center;
}

.archive-cta-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
    min-height: 40px;
    margin: 56px auto 0;
    padding: 0 18px;
    border-radius: 999px;
    background: #f2f2f2;
    font-weight: 700;
    transition: background-color .15s ease, transform .15s ease;
}

.archive-cta-link:hover {
    background: #e9e9e9;
}

.archive-cta-link:active {
    transform: translateY(1px);
}

.archive-cta-link span,
.archive-count {
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 7px;
}

.post-meta time,
.post-header time {
    display: inline-flex;
    align-items: center;
    color: #9a9a9a;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.access-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #8c8c8c;
}

.access-lock svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
}

.recent-posts h2,
.archive-header h1,
.post-header h1 {
    margin: 0;
    font-family: var(--serif);
}

.recent-posts h2 {
    margin-bottom: 22px;
    font-size: 2.05rem;
}

.recent-card-link {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    min-height: 142px;
    margin: 0 -14px 12px;
    padding: 18px 14px;
    border-radius: 16px;
    transition: background-color .15s ease;
}

.recent-card-link:hover {
    background: #f5f5f5;
}

.recent-card.is-featured .recent-card-link {
    grid-template-columns: 1fr;
    gap: 22px;
    justify-items: center;
    align-items: start;
}

.recent-card.is-featured .recent-card-image {
    width: 100%;
    aspect-ratio: 1.45 / 1;
}

.recent-card.is-featured .recent-card-copy {
    max-width: 620px;
    text-align: center;
}

.recent-card.is-featured h3 {
    font-size: 1.8rem;
    line-height: 1.12;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.recent-card h3 {
    overflow: hidden;
    margin: 0 0 5px;
    font-family: var(--serif);
    font-size: 1.45rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-card-copy {
    min-width: 0;
}

.recent-card.is-featured .post-meta {
    justify-content: center;
}

.recent-card p {
    display: -webkit-box;
    margin: 0 0 9px;
    overflow: hidden;
    color: #6f6f6f;
    line-height: 1.42;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recent-card-image {
    overflow: hidden;
    aspect-ratio: 1.45 / 1;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
}

.recent-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #efefef, #e9e9e9);
}

.archive-page,
.post-page {
    padding-top: 104px;
}

.archive-header {
    max-width: 760px;
    margin: 0 auto 34px;
    text-align: center;
}

.archive-header h1,
.post-header h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1.05;
}

.archive-header h1,
.post-header h1 {
    font-size: clamp(1.9rem, 3vw, 2.55rem);
    font-weight: 500;
    line-height: 1.14;
}

.archive-header p,
.post-header p {
    color: #757575;
    font-size: 1.22rem;
    line-height: 1.45;
}

.post-header-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 0;
}

.post-header-meta span {
    color: #757575;
}

.archive-feed {
    max-width: 550px;
    margin: 0 auto;
}

.archive-count {
    margin: -20px 0 28px;
    text-align: center;
}

.archive-gate {
    max-width: 650px;
    margin: 0 auto;
    padding: 30px 28px;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: center;
}

.archive-gate h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 2rem;
    line-height: 1.1;
}

.archive-gate p {
    max-width: 480px;
    margin: 12px auto 22px;
    color: #6f6f6f;
    line-height: 1.42;
}

.archive-gate-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.post-article {
    max-width: 720px;
    margin: 0 auto;
}

.post-header {
    max-width: 540px;
    margin: 0 auto;
    text-align: center;
}

.post-image {
    overflow: hidden;
    width: 120px;
    height: 120px;
    margin: 0 auto 26px;
    border-radius: 50%;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-inline-signup {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    margin-top: 54px;
    padding: 22px 26px;
    border: 1px solid color-mix(in srgb, var(--accent) 16%, white);
    border-radius: 22px;
    background: var(--accent-soft);
}

.post-inline-signup-art {
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 50%;
    flex: 0 0 auto;
}

.post-inline-signup-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-inline-signup-copy {
    min-width: 0;
    width: 100%;
}

.post-inline-signup-copy h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.28rem;
    line-height: 1.12;
    text-wrap: balance;
}

.post-inline-signup-copy p {
    margin: 4px 0 0;
    color: #555;
    line-height: 1.45;
    text-wrap: balance;
}

.post-inline-signup-copy strong {
    color: #333;
    font-weight: 700;
}

.post-inline-signup-actions {
    display: flex;
    justify-content: flex-end;
}

.post-inline-signup-button {
    min-width: 148px;
    background: #fff;
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 20%, white);
}

.post-inline-signup-button:hover {
    background: color-mix(in srgb, var(--accent) 8%, white);
    border-color: color-mix(in srgb, var(--accent) 28%, white);
}

.post-inline-signup-button:active {
    background: color-mix(in srgb, var(--accent) 12%, white);
}

.post-end-signup {
    max-width: 720px;
    margin: 84px auto 0;
}

.post-end-signup .post-inline-signup {
    margin-top: 0;
}

.post-content {
    margin-top: 72px;
    font-size: 1.12rem;
    line-height: 1.65;
}

.post-content > :not(.kg-image-card):not(.kg-width-wide):not(.kg-width-full) {
    max-width: 576px;
    margin-right: auto;
    margin-left: auto;
}

.post-content > * + * {
    margin-top: 28px;
}

.post-content :is(h2, h3, h4, h5, h6) {
    margin-bottom: 0;
    font-family: var(--serif);
    line-height: 1.2;
}

.post-content > * + :is(h2, h3, h4, h5, h6) {
    margin-top: 84px;
}

.post-content h2 {
    font-size: 2rem;
}

.post-content h3 {
    font-size: 1.7rem;
}

.post-content h4 {
    font-size: 1.45rem;
}

.post-content h5 {
    font-size: 1.22rem;
}

.post-content h6 {
    font-size: 1.05rem;
}

.post-content :is(h2, h3, h4, h5, h6) + * {
    margin-top: 18px;
}

.post-content :is(figure, .kg-card) + * {
    margin-top: 34px;
}

.post-content :is(ul, ol, blockquote) {
    padding-left: 1.2em;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.post-content img {
    width: 100%;
    height: auto;
}

.post-content hr {
    width: 120px;
    height: 2px;
    margin: 44px auto;
    background: #e7e7e7;
    border: 0;
}

.post-content .kg-image-card {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
}

.post-content .kg-image-card img {
    width: 100%;
}

.post-image-link {
    display: block;
}

.post-image-link img {
    cursor: zoom-in;
}

.post-content .kg-width-wide {
    width: min(100vw - 36px, 1080px);
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.post-content .kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: 50%;
    transform: translateX(-50%);
}

.post-content .kg-width-full img,
.post-content .kg-width-wide img {
    width: 100%;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 42px 0;
}

.site-footer {
    width: min(100%, 1230px);
    margin: 40px auto 0;
    padding: 56px clamp(18px, 4vw, 44px) 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: .88rem;
    text-align: center;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .topbar {
        grid-template-columns: auto 1fr;
        min-height: 84px;
        gap: 12px;
        padding-top: 24px;
        padding-bottom: 16px;
    }

    .site-logo {
        justify-self: start;
        grid-column: 1;
        font-size: 3.2rem;
    }

    .site-logo img {
        max-height: 40px;
    }

    .site-actions {
        grid-column: 2;
        justify-content: flex-end;
        justify-self: end;
        gap: 8px;
    }

    .post-site-header {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        padding: 24px 18px 0;
        grid-template-areas:
            "logo actions"
            "nav nav";
        row-gap: 16px;
    }

    .post-site-logo {
        display: inline-flex;
        grid-area: logo;
        margin: 0;
    }

    .post-site-nav {
        display: block;
        grid-area: nav;
        margin: 0;
    }

    .post-site-nav .nav {
        justify-content: center;
        margin-left: 0;
    }

    .post-site-actions {
        grid-area: actions;
        justify-content: flex-end;
        justify-self: end;
        padding: 0;
    }

    .nav a {
        padding-right: 12px;
        padding-left: 12px;
    }

    .signup-box {
        padding: 22px 18px;
    }

    .signup-box-public {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .signup-box-public-side {
        padding: 22px 18px;
    }

    .signup-box-public-side--intro,
    .signup-box-public-side--form {
        text-align: center;
    }

    .signup-box-public-side--form {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .signup-box-public .signup-box-art {
        margin-right: auto;
        margin-left: auto;
    }

    .signup-box-public-copy {
        max-width: none;
    }

    .signup-box-public .signup-box-signoff {
        margin-top: 22px;
    }

    .signup-form {
        flex-direction: column;
    }

    .signup-form button {
        width: 100%;
    }

    .post-inline-signup {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 22px 18px;
        text-align: center;
    }

    .post-inline-signup-copy {
        text-align: center;
    }

    .post-inline-signup-actions {
        width: 100%;
        justify-content: center;
    }

    .post-inline-signup-button {
        width: 100%;
    }

    .recent-card-link {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-right: 0;
        margin-left: 0;
        padding-right: 0;
        padding-left: 0;
        align-items: start;
    }

    .recent-card.is-featured .recent-card-link {
        grid-template-columns: 1fr;
    }

    .recent-card-image {
        width: 100%;
        max-width: none;
    }

    .recent-card.is-featured .recent-card-image {
        width: 100%;
    }

    .recent-card h3 {
        display: -webkit-box;
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
}
