:root {
    --journal-ink: #171944;
    --journal-cyan: #00aeea;
    --journal-sky: #dff6ff;
    --journal-mist: #eef6f9;
    --journal-white: #ffffff;
    --journal-line: #d7e4e9;
}

.eyebrow {
    margin: 0 0 14px;
    color: #037da9;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.journal-hero {
    position: relative;
    overflow: hidden;
    padding: 92px 10% 102px;
    background: var(--journal-mist);
}

.journal-hero::after {
    content: '';
    position: absolute;
    width: 430px;
    height: 430px;
    right: -120px;
    top: -235px;
    border: 74px solid rgba(0, 174, 234, .13);
    border-radius: 50%;
}

.journal-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
    align-items: end;
    gap: 70px;
    position: relative;
    z-index: 1;
}

.journal-hero h1 {
    max-width: 820px;
    margin: 0;
    font-size: clamp(3.2rem, 7vw, 6.8rem);
    line-height: .91;
    letter-spacing: -.065em;
}

.journal-hero h1 span { color: var(--journal-cyan); }
.journal-intro { border-left: 2px solid var(--journal-cyan); padding-left: 28px; }
.journal-intro p { margin-bottom: 24px; font-size: 1.05rem; }

.articles-topbar {
    padding: 26px 10%;
    background: var(--journal-mist);
    border-bottom: 1px solid var(--journal-line);
}

.articles-topbar-inner {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.articles-topbar h1 {
    margin: 0;
    color: var(--journal-ink);
    font-size: clamp(2rem, 4vw, 3.35rem);
    line-height: 1;
    letter-spacing: -.045em;
}

.articles-topbar .btn-primary {
    flex: 0 0 auto;
}

.journal-feed { padding-top: clamp(44px, 6vw, 72px); }
.feed-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.feed-heading h2 { margin: 0; padding: 0; border: 0; font-size: clamp(2rem, 4vw, 3rem); }
.feed-heading > span { color: var(--text-muted); font-size: .9rem; }

.category-filter {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: -8px 0 32px;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.category-filter a {
    flex: 0 0 auto;
    padding: 9px 15px;
    color: #536176;
    background: #fff;
    border: 1px solid var(--journal-line);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
}

.category-filter a:hover,
.category-filter a.active {
    color: #fff;
    background: var(--journal-ink);
    border-color: var(--journal-ink);
}

.journal-list { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
.journal-list::before { content: ''; position: absolute; left: -31px; top: 18px; bottom: 18px; width: 2px; background: repeating-linear-gradient(to bottom, var(--journal-cyan) 0 10px, transparent 10px 20px); }
.journal-card { min-width: 0; overflow: hidden; background: white; border: 1px solid var(--journal-line); border-radius: 16px; transition: transform .25s ease, box-shadow .25s ease; }
.journal-card:hover { transform: translateY(-5px); box-shadow: 0 20px 50px rgba(29, 29, 75, .1); }
.journal-card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.05fr .95fr; }
.journal-image { display: block; position: relative; min-height: 260px; overflow: hidden; background: #dce8eb; }
.journal-image img { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .55s ease; }
.journal-card:hover .journal-image img { transform: scale(1.035); }
.journal-card-featured .journal-image img { aspect-ratio: auto; min-height: 100%; }
.route-marker { position: absolute; left: 20px; bottom: 20px; width: 18px; height: 18px; background: white; border: 5px solid var(--journal-cyan); border-radius: 50%; box-shadow: 0 0 0 6px rgba(255,255,255,.6); }
.journal-card-copy { padding: 30px; display: flex; flex-direction: column; }
.journal-card-featured .journal-card-copy { padding: clamp(32px, 5vw, 64px); justify-content: center; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 17px; color: var(--text-muted); font-size: .78rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.category-badge,
.article-category {
    display: inline-flex;
    align-self: flex-start;
    margin-bottom: 16px;
    padding: 6px 10px;
    color: #007da8;
    background: var(--journal-sky);
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.journal-card h3 { margin-bottom: 14px; color: var(--journal-ink); font-size: clamp(1.45rem, 3vw, 2.25rem); line-height: 1.12; letter-spacing: -.035em; }
.journal-card h3 a { color: inherit; text-decoration: none; }
.journal-card p { color: var(--text-muted); }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: auto; padding-top: 20px; border-top: 1px solid var(--journal-line); font-size: .85rem; }
.card-footer > span { color: var(--journal-ink); font-weight: 600; }
.card-footer a, .text-link { color: #007da8; font-weight: 800; text-decoration: none; }
.card-footer a span { display: inline-block; transition: transform .2s ease; }
.card-footer a:hover span { transform: translateX(4px); }

.rating-summary {
    margin: 2px 0 19px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6d7482;
    font-size: .88rem;
}

.rating-summary > span,
.article-rating-summary h2 > span { color: #f2a900; }
.rating-summary strong { color: var(--journal-ink); }
.rating-summary small { font-size: .8rem; }

.empty-journal { padding: 80px 30px; text-align: center; background: white; border: 1px dashed #a9c5cf; border-radius: 16px; }
.empty-journal .empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 18px; border: 2px solid var(--journal-cyan); border-radius: 50%; color: var(--journal-ink); font-weight: 800; }
.empty-journal h3 { color: var(--journal-ink); }

.article-header { margin-top: 42px; padding: 64px 10% 58px; background: white; border-top: 1px solid var(--journal-line); border-bottom: 1px solid var(--journal-line); }
.article-header-inner { max-width: 960px; margin: auto; text-align: center; }
.back-link { display: inline-block; margin-bottom: 58px; color: var(--journal-ink); font-size: .88rem; font-weight: 700; text-decoration: none; }
.article-header h1 { max-width: 920px; margin: 0 auto 26px; font-size: clamp(2.6rem, 5vw, 4.8rem); line-height: 1.02; letter-spacing: -.052em; text-wrap: balance; }
.article-header .eyebrow { margin-bottom: 20px; }
.article-byline { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 0; color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.article-byline span { display: inline-flex; align-items: center; }
.article-byline span + span::before { content: ''; width: 4px; height: 4px; margin: 0 14px; background: var(--journal-cyan); border-radius: 50%; }
.article-cover { width: 90%; max-width: 980px; margin-top: 42px; padding-left: 0; padding-right: 0; }
.article-cover img { display: block; width: 100%; aspect-ratio: 16 / 8.5; object-fit: cover; border-radius: 14px; box-shadow: 0 18px 50px rgba(29,29,75,.1); }
.article-layout { width: 92%; max-width: 900px; display: block; padding-top: 62px; padding-bottom: 54px; }
.article-body { min-width: 0; color: #29293d; font-family: Inter, Arial, sans-serif; font-size: 19px; line-height: 1.75; }
.article-body p, .article-body div { margin-bottom: 22px; color: inherit; }
.article-body h2, .article-body h3, .article-body h4 { border: 0; padding: 0; color: var(--journal-ink); font-family: Inter, Arial, sans-serif; }
.article-body h2 { margin: 48px 0 18px; font-size: clamp(1.85rem, 4vw, 2.35rem); line-height: 1.15; letter-spacing: -.025em; }
.article-body h3 { margin: 38px 0 15px; font-size: 1.65rem; line-height: 1.2; }
.article-body blockquote { margin: 30px 0; padding: 7px 0 7px 24px; border-left: 4px solid var(--journal-cyan); color: #323260; font-size: 1.25em; }
.article-body ul, .article-body ol { margin: 16px 0 20px 28px; }
.article-body a { color: #007da8; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 28px auto; border-radius: 10px; }
.article-end { max-width: 900px; margin-bottom: 80px; padding: 34px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--journal-sky); border-radius: 14px; }
.article-end p { margin: 0; color: var(--journal-ink); font-weight: 800; }
.not-found { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.not-found p { margin-bottom: 24px; }
.preview-toolbar { position:relative; z-index:2; max-width:1120px; margin:28px auto; padding:13px 18px; display:flex; align-items:center; justify-content:space-between; gap:20px; color:var(--journal-ink); background:white; border:1px solid var(--journal-line); border-radius:12px; box-shadow:0 10px 26px rgba(29,29,75,.08); }
.preview-toolbar > div:first-child { display:grid; grid-template-columns:auto auto; align-items:center; justify-content:start; gap:2px 10px; }
.preview-toolbar small { grid-column:2; color:var(--text-muted); }
.preview-status { grid-row:1 / 3; display:inline-flex; padding:6px 9px; border-radius:999px; font-size:.68rem; font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.preview-status.pending { color:#875d00; background:#fff3ce; }
.preview-status.draft { color:#53606d; background:#e9eef1; }
.preview-status.published { color:#126343; background:#dff5eb; }
.preview-actions { display:flex; align-items:center; gap:16px; }
.preview-actions > a:first-child { color:#007da8; font-size:.82rem; font-weight:800; text-decoration:none; }
.preview-actions .btn-primary { padding:9px 16px; font-size:.82rem; }
.preview-article .article-cover { margin-top:0; }
.preview-article .article-header { margin-top:42px; padding-top:64px; background:var(--journal-mist); }

.submission-section { padding-top: 70px; background: linear-gradient(110deg, var(--journal-mist) 0 36%, var(--bg-light) 36%); }
.submission-layout { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(0, 1.3fr); gap: clamp(45px, 8vw, 110px); align-items: start; }
.submission-intro { position: sticky; top: 140px; }
.submission-intro h1 { font-size: clamp(2.7rem, 5vw, 4.7rem); line-height: .96; letter-spacing: -.05em; }
.review-note { display: grid; grid-template-columns: 38px 1fr; gap: 20px 14px; margin-top: 42px; }
.review-note > span { display: grid; place-items: center; align-self: start; width: 34px; height: 34px; border: 1px solid var(--journal-cyan); border-radius: 50%; color: var(--journal-ink); font-size: .7rem; font-weight: 800; }
.review-note strong { color: var(--journal-ink); }
.review-note p { margin: 2px 0 0; color: var(--text-muted); font-size: .86rem; }
.submission-form-panel { padding: 42px; background: white; border: 1px solid var(--journal-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(29, 29, 75, .07); }
.blog-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.blog-form label { color: var(--journal-ink); }
.blog-form input[type="text"], .blog-form input[type="email"], .blog-form input:not([type]), .blog-form select { width: 100%; padding: 13px 14px; border: 1px solid #b9cbd2; border-radius: 7px; background:white; font: inherit; }
.blog-form input:focus, .editor-surface:focus { outline: 3px solid rgba(0, 174, 234, .19); border-color: var(--journal-cyan); }
.blog-form small, .field-help { display: block; margin-top: 6px; color: var(--text-muted); font-size: .76rem; }
.consent-row { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; margin: 24px 0; font-size: .86rem; }
.consent-row input { margin-top: 4px; }
.alert { margin-bottom: 24px; padding: 15px 18px; border-radius: 8px; font-size: .9rem; }
.alert ul { margin: 8px 0 0 20px; }
.alert-success { color: #145c45; background: #e5f7ef; border: 1px solid #a8dec8; }
.alert-error { color: #8d2634; background: #fff0f2; border: 1px solid #efbdc4; }

.rich-editor { overflow: hidden; border: 1px solid #b9cbd2; border-radius: 8px; background: white; }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 9px; background: #f3f7f9; border-bottom: 1px solid #cbd9de; }
.editor-toolbar button, .editor-toolbar select { min-height: 34px; padding: 6px 9px; color: var(--journal-ink); background: white; border: 1px solid #c2d0d5; border-radius: 5px; font: 600 .76rem Inter, sans-serif; cursor: pointer; }
.editor-toolbar button:hover, .editor-toolbar select:hover { border-color: var(--journal-cyan); }
.toolbar-divider { width: 1px; height: 24px; margin: 0 3px; background: #c2d0d5; }
.editor-surface { min-height: 360px; padding: 24px; color: #222; font: 16px/1.5 Inter, Arial, sans-serif; overflow-wrap: anywhere; }
.editor-surface p { margin-bottom: 16px; color: inherit; }
.editor-surface img { max-width: 100%; height: auto; }
.rich-editor .field-help { margin: 0; padding: 7px 12px; border-top: 1px solid #dbe4e8; background: #fafcfd; }
.footer-copy { font-size: .9rem; color: #64748b; margin-bottom: 5px; }
.footer-legal { font-size: .8rem; color: #94a3b8; margin-top: 20px; }

@media (max-width: 900px) {
    .journal-hero-grid, .submission-layout { grid-template-columns: 1fr; }
    .journal-intro { max-width: 620px; }
    .journal-card-featured { grid-template-columns: 1fr; }
    .submission-intro { position: static; }
    .submission-section { background: var(--bg-light); }
}

@media (max-width: 680px) {
    .articles-topbar { padding: 20px 5%; }
    .articles-topbar-inner { min-height: 58px; }
    .articles-topbar h1 { font-size: 2rem; }
    .articles-topbar .btn-primary { padding: 10px 16px; font-size: .86rem; }
    .journal-hero { padding-top: 60px; padding-bottom: 70px; }
    .journal-list { grid-template-columns: 1fr; }
    .journal-list::before { display: none; }
    .journal-card-featured { display: block; }
    .feed-heading { align-items: start; flex-direction: column; }
    .feed-heading { margin-bottom: 24px; }
    .category-filter { margin-top: 0; margin-bottom: 25px; }
    .article-header { padding-top: 54px; }
    .back-link { margin-bottom: 38px; }
    .article-header-inner { text-align:left; }
    .article-byline { justify-content:flex-start; }
    .article-cover { width:90%; margin-left:5%; margin-right:5%; }
    .article-layout { padding-top: 42px; }
    .article-end { margin-left: 5%; margin-right: 5%; flex-direction: column; align-items: flex-start; }
    .submission-form-panel { padding: 25px 18px; }
    .blog-form .form-row { grid-template-columns: 1fr; gap: 0; }
    .editor-toolbar { max-height: 175px; overflow-y: auto; }
    .editor-surface { min-height: 300px; padding: 17px; }
    .preview-toolbar { margin:16px 5%; align-items:flex-start; flex-direction:column; }
    .preview-actions { width:100%; justify-content:space-between; }
}

@media (max-width: 420px) {
    .articles-topbar-inner { align-items: stretch; flex-direction: column; gap: 14px; }
    .articles-topbar .btn-primary { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .journal-card, .journal-image img, .card-footer a span { transition: none; }
}

/* Editorial article layout inspired by Stripe's long-form blog pages. */
.editorial-article {
    padding: 34px 0 88px;
    background: #fff;
}

.editorial-shell {
    width: calc(100% - 40px);
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 38px 76px;
    display: grid;
    grid-template-columns: 220px minmax(0, 800px);
    grid-template-rows: auto auto;
    justify-content: center;
    column-gap: 42px;
    border-left: 1px solid #e8edf3;
    border-right: 1px solid #e8edf3;
}

.article-title-block {
    grid-column: 2;
    grid-row: 1;
    padding-top: 42px;
    padding-bottom: 50px;
}

.article-title-block h1 {
    max-width: 790px;
    margin: 0;
    color: var(--journal-ink);
    font-size: clamp(3rem, 5.3vw, 5rem);
    line-height: .98;
    letter-spacing: -.06em;
    text-wrap: balance;
}

.article-title-block .article-category {
    margin-bottom: 22px;
}

.article-date-row {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 30px;
    color: #596579;
    font-size: .95rem;
}

.article-date-row span {
    position: relative;
}

.article-date-row span::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--journal-cyan);
}

.article-author-card {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 4px 18px 0 0;
}

.author-avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--journal-cyan), var(--journal-ink));
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    box-shadow: 0 9px 22px rgba(23, 25, 68, .14);
}

.author-details {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-top: 3px;
}

.author-details strong {
    color: var(--journal-ink);
    font-size: .92rem;
    line-height: 1.35;
}

.author-details small {
    margin-top: 4px;
    color: #738095;
    font-size: .75rem;
    line-height: 1.45;
}

.article-main-column {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
}

.article-lead {
    color: #27344a;
    font-family: Inter, Arial, sans-serif;
    font-size: clamp(1.18rem, 1.7vw, 1.38rem);
    line-height: 1.58;
    letter-spacing: -.015em;
}

.article-lead p {
    margin: 0;
}

.editorial-article .article-cover {
    width: 100%;
    max-width: none;
    margin: 48px 0 54px;
    padding: 0;
}

.editorial-article .article-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: none;
}

.editorial-article .article-body {
    width: 100%;
    max-width: none;
    color: #283249;
    font-family: Inter, Arial, sans-serif;
    font-size: 1.18rem;
    line-height: 1.78;
}

.editorial-article .article-body > :first-child {
    margin-top: 0;
}

.article-rating {
    margin-top: 64px;
    padding: 32px;
    background: #f6faef;
    border: 1px solid #d7e7c1;
    border-radius: 14px;
}

.article-rating-summary h2 {
    margin: 0;
    padding: 0;
    color: var(--journal-ink);
    border: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.article-rating-summary h2 small {
    color: #667085;
    font-size: .9rem;
    font-weight: 600;
}

.article-rating-summary > p:last-child { margin: 8px 0 0; color: #596579; }
.rating-form { margin-top: 23px; display: flex; align-items: end; flex-wrap: wrap; gap: 20px; }
.rating-form fieldset { margin: 0; padding: 0; border: 0; }
.rating-form legend { margin-bottom: 8px; color: var(--journal-ink); font-size: .8rem; font-weight: 800; }

.star-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 2px;
}

.star-input input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-input label { padding: 0 2px; color: #b6bdc7; font-size: 2.1rem; line-height: 1; cursor: pointer; transition: color .15s ease, transform .15s ease; }
.star-input input:checked ~ label,
.star-input label:hover,
.star-input label:hover ~ label { color: #f2a900; }
.star-input label:hover { transform: translateY(-2px); }
.star-input input:focus-visible + label { outline: 3px solid rgba(0, 174, 234, .28); outline-offset: 2px; border-radius: 4px; }
.rating-form .btn-primary { border: 0; cursor: pointer; font: 700 .9rem Inter, sans-serif; }

.rating-message { margin-top: 18px; padding: 11px 13px; border-radius: 7px; font-size: .86rem; }
.rating-message.success { color: #145c45; background: #e5f7ef; border: 1px solid #a8dec8; }
.rating-message.error { color: #8d2634; background: #fff0f2; border: 1px solid #efbdc4; }
.preview-rating { margin-bottom: 0; }

.editorial-article .article-body h2 {
    margin-top: 2.2em;
    color: var(--journal-ink);
    font-size: clamp(2rem, 3.3vw, 2.9rem);
    line-height: 1.06;
    letter-spacing: -.035em;
}

.editorial-article .article-body h3 {
    margin-top: 2em;
    color: var(--journal-ink);
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    line-height: 1.15;
}

.editorial-article .article-body p,
.editorial-article .article-body ul,
.editorial-article .article-body ol,
.editorial-article .article-body blockquote {
    max-width: 760px;
}

.preview-article.editorial-article {
    padding-top: 34px;
    background: #fff;
}

@media (max-width: 820px) {
    .editorial-shell {
        width: calc(100% - 28px);
        padding: 0 22px 58px;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        border-left: 0;
        border-right: 0;
    }

    .article-title-block,
    .article-author-card,
    .article-main-column {
        grid-column: 1;
        grid-row: auto;
    }

    .article-title-block { padding-bottom: 30px; }
    .article-title-block h1 { font-size: clamp(2.6rem, 11.5vw, 4.2rem); }
    .article-author-card { padding: 0 0 34px; }
    .article-main-column { width: 100%; }
    .editorial-article .article-cover { margin: 34px 0 40px; }
}

@media (max-width: 520px) {
    .editorial-article { padding-top: 20px; }
    .editorial-shell { width: 100%; padding-inline: 20px; }
    .article-date-row { flex-wrap: wrap; margin-top: 22px; }
    .article-lead { font-size: 1.1rem; }
    .editorial-article .article-body { font-size: 1.08rem; line-height: 1.7; }
    .article-rating { margin-top: 46px; padding: 24px 18px; }
    .rating-form { align-items: stretch; flex-direction: column; }
    .rating-form .btn-primary { width: 100%; text-align: center; }
}
